BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
RotatedPyramidsBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/StandardSamples/RotatedPyramidsBuilder.cpp
6 //! @brief Implements classe RotatedPyramidsBuilder
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 
25 using Units::deg;
26 
28 {
29  const double m_length(10);
30  const double m_height(5);
31  const double m_alpha(Units::deg2rad(54.73));
32  const double m_zangle(45. * deg);
33 
34  Layer vacuum_layer(refMat::Vacuum);
35  Layer substrate_layer(refMat::Substrate);
36 
37  Pyramid4 ff_pyramid(m_length, m_height, m_alpha);
38 
39  Particle pyramid(refMat::Particle, ff_pyramid);
40 
41  RotationZ z_rotation(m_zangle);
42  pyramid.rotate(z_rotation);
43 
44  ParticleLayout particle_layout;
45  particle_layout.addParticle(pyramid);
46 
47  vacuum_layer.addLayout(particle_layout);
48 
49  auto* sample = new MultiLayer();
50  sample->addLayer(vacuum_layer);
51  sample->addLayer(substrate_layer);
52  return sample;
53 }
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines class Pyramid4.
Defines materials in namespace refMat.
Defines class RotatedPyramidsBuilder.
Defines IRotation classes.
Defines some unit conversion factors and other constants in namespace Units.
IParticle * rotate(const IRotation &rotation)
Rotates the particle, and returns this.
Definition: IParticle.cpp:41
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.
A particle with a form factor and refractive index.
Definition: Particle.h:25
A frustum with a quadratic base.
Definition: Pyramid4.h:23
A rotation about the z axis.
Definition: Rotations.h:122
MultiLayer * createRotatedPyramids()
double deg2rad(double angle)
Definition: Units.h:58
static constexpr double deg
Definition: Units.h:46
static const Material Vacuum
static const Material Particle
static const Material Substrate