BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PercusYevickBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/StandardSamples/PercusYevickBuilder.cpp
6 //! @brief Implements class PercusYevickBuilder.
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
23 
25 {
26  const double m_cylinder_height(5);
27  const double m_cylinder_radius(5);
28  const double m_disk_radius(5);
29  const double m_density(0.006);
30 
31  Layer vacuum_layer(refMat::Vacuum);
32  Layer substrate_layer(refMat::Substrate);
33 
34  Cylinder ff_cylinder(m_cylinder_radius, m_cylinder_height);
35  Particle particle(refMat::Particle, ff_cylinder);
36  ParticleLayout particle_layout(particle);
37 
38  InterferenceHardDisk interparticle(m_disk_radius, m_density);
39  particle_layout.setInterference(interparticle);
40 
41  vacuum_layer.addLayout(particle_layout);
42 
43  auto* sample = new MultiLayer();
44  sample->addLayer(vacuum_layer);
45  sample->addLayer(substrate_layer);
46  return sample;
47 }
Defines class Cylinder.
Defines class InterferenceHardDisk.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines classes of PercusYevickBuilder family.
Defines materials in namespace refMat.
A circular cylinder.
Definition: Cylinder.h:23
Percus-Yevick hard disk interference function.
A layer in a MultiLayer sample.
Definition: Layer.h:26
void addLayout(const ParticleLayout &layout)
Definition: Layer.cpp:49
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:43
Decorator class that adds particles to ISampleNode objects.
void setInterference(const IInterference &interparticle)
Adds interference functions.
A particle with a form factor and refractive index.
Definition: Particle.h:25
MultiLayer * createHardDisk()
static const Material Vacuum
static const Material Particle
static const Material Substrate