BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
MultiLayerWithRoughnessBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/StandardSamples/MultiLayerWithRoughnessBuilder.cpp
6 //! @brief Implement class MultiLayerWithRoughnessBuilder.
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 
20 
22 {
23  const double thicknessA(2.5);
24  const double thicknessB(5.0);
25  const double sigma(1.0);
26  const double hurst(0.3);
27  const double lateralCorrLength(5.0);
28  const double crossCorrLength(10.0);
29 
30  Material vacuum_material = RefractiveMaterial("Vacuum", 0., 0.);
31  Material substrate_material = RefractiveMaterial("Substrate", 15e-6, 0.0);
32  Material part_a_material = RefractiveMaterial("PartA", 5e-6, 0.0);
33  Material part_b_material = RefractiveMaterial("PartB", 10e-6, 0.0);
34 
35  Layer vacuum_layer(vacuum_material, 0);
36  Layer partA_layer(part_a_material, thicknessA);
37  Layer partB_layer(part_b_material, thicknessB);
38  Layer substrate_layer(substrate_material, 0);
39 
40  LayerRoughness roughness(sigma, hurst, lateralCorrLength);
41 
42  auto* sample = new MultiLayer();
43  sample->addLayer(vacuum_layer);
44  for (int i = 0; i < 5; ++i) {
45  sample->addLayerWithTopRoughness(partA_layer, roughness);
46  sample->addLayerWithTopRoughness(partB_layer, roughness);
47  }
48  sample->addLayerWithTopRoughness(substrate_layer, roughness);
49  sample->setCrossCorrLength(crossCorrLength);
50  return sample;
51 }
Defines class LayerRoughness.
Defines class Layer.
Factory functions used to create material instances.
Defines class MultiLayerWithRoughnessBuilder.
Defines class MultiLayer.
A roughness of interface between two layers.
A layer in a MultiLayer sample.
Definition: Layer.h:26
A wrapper for underlying material implementation.
Definition: Material.h:35
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:43
Material RefractiveMaterial(const std::string &name, complex_t refractive_index, R3 magnetization)
MultiLayer * createMultiLayerWithRoughness()