BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
LatticeBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
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 using Units::deg;
28 
30 {
31  const double length(20.0);
32  const double xi(10.0 * deg);
33  const double corr_length(1000.0);
34  const double cylinder_height(5);
35  const double cylinder_radius(5);
36 
37  Layer vacuum_layer(refMat::Vacuum);
38  Layer substrate_layer(refMat::Substrate);
39 
40  Interference1DLattice interparticle(length, xi);
41  Profile1DCauchy pdf(corr_length);
42  interparticle.setDecayFunction(pdf);
43 
44  Cylinder ff_cylinder(cylinder_radius, cylinder_height);
45  Particle cylinder(refMat::Particle, ff_cylinder);
46 
47  ParticleLayout particle_layout(cylinder);
48  particle_layout.setInterference(interparticle);
49 
50  vacuum_layer.addLayout(particle_layout);
51 
52  auto* sample = new MultiLayer();
53  sample->addLayer(vacuum_layer);
54  sample->addLayer(substrate_layer);
55  return sample;
56 }
Defines class Cylinder.
Defines class Interference1DLattice.
Defines class Lattice1DBuilder.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines interface class IProfile1D, and children thereof.
Defines interface class IProfile2D, and children thereof.
Defines materials in namespace refMat.
Defines some unit conversion factors and other constants in namespace Units.
A circular cylinder.
Definition: Cylinder.h:23
Interference function of a 1D lattice.
void setDecayFunction(const IProfile1D &decay)
Sets one-dimensional decay 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
Exponential IProfile1D exp(-|omega*x|); its Fourier transform standardizedFT(q) is a Cauchy-Lorentzia...
Definition: Profiles1D.h:63
MultiLayer * createLattice1D()
static constexpr double deg
Definition: Units.h:46
static const Material Vacuum
static const Material Particle
static const Material Substrate