BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
TransformationsBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/StandardSamples/TransformationsBuilder.cpp
6 //! @brief Implements classes to build samples with different transformations.
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"
23 
24 MultiLayer* TransformBoxBuilder::buildSample() const
25 {
26  const double layer_thickness(100);
27  const double length(50);
28  const double width(20);
29  const double height(10);
30 
31  Particle box(refMat::Ag, FormFactorBox(length, width, height));
32  box.setRotation(RotationZ(90. * Units::degree));
33  box.rotate(RotationY(90. * Units::degree));
34  box.setPosition(kvector_t(0, 0, -layer_thickness / 2.));
35 
36  ParticleLayout layout;
37  layout.addParticle(box);
38 
39  Layer vacuum_layer(refMat::Vacuum);
40  Layer middle_layer(refMat::Teflon, layer_thickness);
41  middle_layer.addLayout(layout);
42  Layer substrate(refMat::Substrate2);
43 
44  MultiLayer* multi_layer = new MultiLayer();
45  multi_layer->addLayer(vacuum_layer);
46  multi_layer->addLayer(middle_layer);
47  multi_layer->addLayer(substrate);
48  return multi_layer;
49 }
Defines class FormFactorBox.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines materials in namespace refMat.
Defines classes to build samples with different transformations.
Defines some unit conversion factors and other constants in namespace Units.
A rectangular prism (parallelepiped).
Definition: FormFactorBox.h:24
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.
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
A rotation about the y axis.
Definition: Rotations.h:93
A rotation about the z axis.
Definition: Rotations.h:114