BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
CylindersBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/StandardSamples/CylindersBuilder.cpp
6 //! @brief Implements classes of CylindersBuilder family.
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 "Fit/Param/RealLimits.h"
24 
26 {
27  double height(5);
28  double radius(5);
29 
30  Layer vacuum_layer(refMat::Vacuum);
31  Layer substrate_layer(refMat::Substrate);
32 
33  Cylinder ff_cylinder(radius, height);
34 
35  Particle particle(refMat::Particle, ff_cylinder);
36  ParticleLayout particle_layout(particle);
37 
38  vacuum_layer.addLayout(particle_layout);
39 
40  auto* sample = new MultiLayer();
41  sample->addLayer(vacuum_layer);
42  sample->addLayer(substrate_layer);
43  return sample;
44 }
45 
46 MultiLayer* ExemplarySamples::createCylindersInBA(double height, double radius)
47 {
48  Layer vacuum_layer(refMat::Vacuum);
49 
50  Cylinder ff_cylinder(radius, height);
51  Particle cylinder(refMat::Particle, ff_cylinder);
52 
53  ParticleLayout particle_layout(cylinder);
54 
55  vacuum_layer.addLayout(particle_layout);
56 
57  auto* sample = new MultiLayer();
58  sample->addLayer(vacuum_layer);
59  return sample;
60 }
61 
63 {
64  Layer vacuum_layer(refMat::Vacuum);
65  Layer substrate_layer(refMat::Substrate);
66 
67  Cylinder ff_cylinder(radius, height);
68 
69  Particle particle(refMat::Particle, ff_cylinder);
70  ParticleLayout particle_layout(particle);
71 
72  vacuum_layer.addLayout(particle_layout);
73 
74  auto* sample = new MultiLayer();
75  sample->addLayer(vacuum_layer);
76  sample->addLayer(substrate_layer);
77  return sample;
78 }
Defines class Cylinder.
Defines classes of CylindersBuilder family.
Defines class LayerInterface.
Defines class Layer.
Defines class MultiLayer.
Defines class ParticleLayout.
Defines class Particle.
Defines class RealLimits.
Defines materials in namespace refMat.
A circular cylinder.
Definition: Cylinder.h:23
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.
A particle with a form factor and refractive index.
Definition: Particle.h:25
MultiLayer * createLargeCylindersInDWBA(double height=1000, double radius=500)
Builds sample with large cylinders for MC integration tests.
MultiLayer * createCylindersInDWBA()
Builds sample: cylinder form factor in DWBA (IsGISAXS example #3, part I).
MultiLayer * createCylindersInBA(double height=5, double radius=5)
Builds sample: cylinder form factor in BA (IsGISAXS example #3, part II).
static const Material Vacuum
static const Material Particle
static const Material Substrate