BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
MultipleLayoutBuilder.cpp
Go to the documentation of this file.
1
// ************************************************************************************************
2
//
3
// BornAgain: simulate and fit reflection and scattering
4
//
5
//! @file Sample/StandardSamples/MultipleLayoutBuilder.cpp
6
//! @brief Implements class MultipleLayoutBuilder.
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
15
#include "
Sample/StandardSamples/MultipleLayoutBuilder.h
"
16
#include "
Sample/Aggregate/ParticleLayout.h
"
17
#include "
Sample/HardParticle/Cylinder.h
"
18
#include "
Sample/HardParticle/Prism3.h
"
19
#include "
Sample/Multilayer/Layer.h
"
20
#include "
Sample/Multilayer/MultiLayer.h
"
21
#include "
Sample/Particle/Particle.h
"
22
#include "
Sample/StandardSamples/ReferenceMaterials.h
"
23
24
MultiLayer
*
ExemplarySamples::createMultipleLayout
()
25
{
26
const
double
cylinder_height(5);
27
const
double
cylinder_radius(5);
28
const
double
prisheight(5);
29
const
double
prislength(10);
30
const
double
cylinder_weight(0.5);
31
32
Layer
vacuum_layer(
refMat::Vacuum
);
33
Layer
substrate_layer(
refMat::Substrate
);
34
35
ParticleLayout
particle_layout_1;
36
ParticleLayout
particle_layout_2;
37
38
Cylinder
ff_cylinder(cylinder_radius, cylinder_height);
39
Particle
cylinder(
refMat::Particle
, ff_cylinder);
40
41
Prism3
ff_prism3(prislength, prisheight);
42
Particle
prism3(
refMat::Particle
, ff_prism3);
43
44
particle_layout_1.
addParticle
(cylinder, cylinder_weight);
45
particle_layout_2.
addParticle
(prism3, 1.0 - cylinder_weight);
46
47
vacuum_layer.
addLayout
(particle_layout_1);
48
vacuum_layer.
addLayout
(particle_layout_2);
49
50
auto
* sample =
new
MultiLayer
();
51
sample->addLayer(vacuum_layer);
52
sample->addLayer(substrate_layer);
53
return
sample;
54
}
Cylinder.h
Defines class Cylinder.
Layer.h
Defines class Layer.
MultiLayer.h
Defines class MultiLayer.
MultipleLayoutBuilder.h
Defines class MultipleLayoutBuilder.
ParticleLayout.h
Defines class ParticleLayout.
Particle.h
Defines class Particle.
Prism3.h
Defines class Prism3.
ReferenceMaterials.h
Defines materials in namespace refMat.
Cylinder
A circular cylinder.
Definition:
Cylinder.h:23
Layer
A layer in a MultiLayer sample.
Definition:
Layer.h:26
Layer::addLayout
void addLayout(const ParticleLayout &layout)
Definition:
Layer.cpp:49
MultiLayer
Our sample model: a stack of layers one below the other.
Definition:
MultiLayer.h:43
ParticleLayout
Decorator class that adds particles to ISampleNode objects.
Definition:
ParticleLayout.h:28
ParticleLayout::addParticle
void addParticle(const IParticle &particle, double abundance=-1.0)
Adds particle to the layout with abundance, position and the rotation defined.
Definition:
ParticleLayout.cpp:56
Particle
A particle with a form factor and refractive index.
Definition:
Particle.h:25
Prism3
A prism based on an equilateral triangle.
Definition:
Prism3.h:23
ExemplarySamples::createMultipleLayout
MultiLayer * createMultipleLayout()
Definition:
MultipleLayoutBuilder.cpp:24
refMat::Vacuum
static const Material Vacuum
Definition:
ReferenceMaterials.h:31
refMat::Particle
static const Material Particle
Definition:
ReferenceMaterials.h:33
refMat::Substrate
static const Material Substrate
Definition:
ReferenceMaterials.h:32
Sample
StandardSamples
MultipleLayoutBuilder.cpp
Generated by
1.9.1