BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
BoxesSquareLatticeBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/StandardSamples/BoxesSquareLatticeBuilder.cpp
6 //! @brief Implements class BoxesSquareLattice2DBuilder.
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 
24 
26 {
27  const double length = 5;
28  const double height = 10;
29 
30  Layer vacuum_layer(refMat::Vacuum);
31  Layer substrate_layer(refMat::Substrate);
32 
34 
35  Profile2DCauchy pdf(100.0, 100.0, 0);
36  iff.setDecayFunction(pdf);
37 
38  // particles
39  ParticleLayout particle_layout;
40  Box ff_box(length, length, height);
41  Particle particle(refMat::Particle, ff_box);
42  particle_layout.addParticle(particle, 1.0);
43 
44  particle_layout.setInterference(iff);
45 
46  vacuum_layer.addLayout(particle_layout);
47 
48  auto* sample = new MultiLayer();
49  sample->addLayer(vacuum_layer);
50  sample->addLayer(substrate_layer);
51  return sample;
52 }
Defines class Box.
Defines class BoxesSquareLattice2DBuilder.
Defines class Interference2DLattice.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines interface class IProfile2D, and children thereof.
Defines materials in namespace refMat.
A rectangular prism (parallelepiped).
Definition: Box.h:23
Interference function of a 2D lattice.
void setDecayFunction(const IProfile2D &decay)
Sets two-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 addParticle(const IParticle &particle, double abundance=-1.0)
Adds particle to the layout with abundance, position and the rotation defined.
void setInterference(const IInterference &interparticle)
Adds interference functions.
A particle with a form factor and refractive index.
Definition: Particle.h:25
Two-dimensional Cauchy distribution in Fourier space; corresponds to a normalized exp(-r) in real spa...
Definition: Profiles2D.h:71
A two-dimensional Bravais lattice with square unit cell.
Definition: Lattice2D.h:76
MultiLayer * createBoxesSquareLattice2D()
static const Material Vacuum
static const Material Particle
static const Material Substrate