BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
ResonatorBuilder.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/StandardSamples/ResonatorBuilder.cpp
6 //! @brief Implements ResonatorBuilder class.
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"
21 #include <memory>
22 
24 {
25  auto* result = new MultiLayer;
26 
27  Material m_Si = RefractiveMaterial("Si", 8.25218379931e-06, 0.0);
28  Material m_Ti = RefractiveMaterial("Ti", -7.6593316363e-06, 3.81961616312e-09);
29  Material m_TiO2 = RefractiveMaterial("TiO2", 1.04803530026e-05, 2.03233519385e-09);
30  Material m_Pt = RefractiveMaterial("Pt", 2.52936993309e-05, 7.54553992473e-09);
31  Material m_D2O = RefractiveMaterial("D2O", 2.52897204573e-05, 4.5224432814e-13);
32 
33  Layer l_TiO2(m_TiO2, 3.0);
34  Layer l_Ti_top(m_Ti, 10.0);
35  Layer l_Ti(m_Ti, ti_thickness);
36  Layer l_Si(m_Si);
37  Layer l_Pt(m_Pt, 32.0);
38  Layer l_D2O(m_D2O);
39 
40  LayerRoughness roughness(2.0, 0.8, 1e4);
41 
42  result->addLayer(l_Si);
43 
44  const int nlayers = 3;
45  for (size_t i = 0; i < nlayers; ++i) {
46  result->addLayerWithTopRoughness(l_Ti, roughness);
47  result->addLayerWithTopRoughness(l_Pt, roughness);
48  }
49 
50  result->addLayerWithTopRoughness(l_Ti_top, roughness);
51  result->addLayerWithTopRoughness(l_TiO2, roughness);
52  result->addLayerWithTopRoughness(l_D2O, roughness);
53 
54  result->setCrossCorrLength(400);
55 
56  return result;
57 }
Defines class LayerRoughness.
Defines class Layer.
Factory functions used to create material instances.
Defines class MultiLayer.
Defines class RealLimits.
Defines ResonatorBuilder class.
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 * createResonator(double ti_thickness=13.0)