BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
LatticeBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/StandardSamples/LatticeBuilder.cpp
6 //! @brief Implements class Lattice1DBuilder.
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"
26 
27 MultiLayer* Lattice1DBuilder::buildSample() const
28 {
29  const double length(20.0 * Units::nanometer);
30  const double xi(10.0 * Units::deg);
31  const double corr_length(1000.0 * Units::nanometer);
32  const double cylinder_height(5 * Units::nanometer);
33  const double cylinder_radius(5 * Units::nanometer);
34 
35  Layer vacuum_layer(refMat::Vacuum);
36  Layer substrate_layer(refMat::Substrate);
37 
38  InterferenceFunction1DLattice interference_function(length, xi);
39  FTDecayFunction1DCauchy pdf(corr_length);
40  interference_function.setDecayFunction(pdf);
41 
42  FormFactorCylinder ff_cylinder(cylinder_radius, cylinder_height);
43  Particle cylinder(refMat::Particle, ff_cylinder);
44 
45  ParticleLayout particle_layout(cylinder);
46  particle_layout.setInterferenceFunction(interference_function);
47 
48  vacuum_layer.addLayout(particle_layout);
49 
50  MultiLayer* multi_layer = new MultiLayer();
51  multi_layer->addLayer(vacuum_layer);
52  multi_layer->addLayer(substrate_layer);
53  return multi_layer;
54 }
Defines classes IFTDecayFunction1D, IFTDecayFunction2D,.
Defines classes IFTDecayFunction1D, IFTDecayFunction2D,.
Defines class FormFactorCylinder.
Defines class InterferenceFunction1DLattice.
Defines class Lattice1DBuilder.
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.
One-dimensional Cauchy decay function in reciprocal space; corresponds to exp(-|x|/decay_length) in r...
Definition: FTDecay1D.h:44
A circular cylinder.
Interference function of a 1D lattice.
A layer, with thickness (in nanometer) and material.
Definition: Layer.h:28
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.
A particle with a form factor and refractive index.
Definition: Particle.h:26