BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
CylindersAndPrismsBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/StandardSamples/CylindersAndPrismsBuilder.cpp
6 //! @brief Implements class CylindersAndPrismsBuilder.
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 
16 #include "Base/Const/Units.h"
24 
26 {
27  MultiLayer* multi_layer = new MultiLayer();
28 
29  Layer vacuum_layer(refMat::Vacuum);
30  Layer substrate_layer(refMat::Substrate);
31 
32  ParticleLayout particle_layout;
33 
34  FormFactorCylinder ff_cylinder(5.0, 5.0);
35  Particle cylinder(refMat::Particle, ff_cylinder);
36 
37  FormFactorPrism3 ff_prism3(10.0, 5.0);
38  Particle prism3(refMat::Particle, ff_prism3);
39 
40  particle_layout.addParticle(cylinder, 0.5);
41  particle_layout.addParticle(prism3, 0.5);
42 
43  vacuum_layer.addLayout(particle_layout);
44 
45  multi_layer->addLayer(vacuum_layer);
46  multi_layer->addLayer(substrate_layer);
47  return multi_layer;
48 }
Defines class CylindersAndPrismsBuilder.
Defines class FormFactorCylinder.
Defines class FormFactorPrism3.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines materials in namespace refMat.
Defines some unit conversion factors and other constants in namespace Units.
A circular cylinder.
A prism based on an equilateral triangle.
A layer, with thickness (in nanometer) and material.
Definition: Layer.h:28
void addLayout(const ILayout &decoration)
Definition: Layer.cpp:57
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
void addLayer(const Layer &layer)
Adds object to multilayer.
Definition: MultiLayer.cpp:54
Decorator class that adds particles to ISample objects.
void addParticle(const IAbstractParticle &particle, double abundance=-1.0, const kvector_t position={}, const IRotation &rotation=IdentityRotation())
Adds particle to the layout with abundance, position and the rotation defined.
A particle with a form factor and refractive index.
Definition: Particle.h:26
static const Material Vacuum
static const Material Particle
static const Material Substrate