File: MultiLayerWithRoughnessBuilder.cpp

package info (click to toggle)
bornagain 23.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 103,936 kB
  • sloc: cpp: 423,131; python: 40,997; javascript: 11,167; awk: 630; sh: 318; ruby: 173; xml: 130; makefile: 51; ansic: 24
file content (68 lines) | stat: -rw-r--r-- 2,524 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//  ************************************************************************************************
//
//  BornAgain: simulate and fit reflection and scattering
//
//! @file      Sample/StandardSample/MultiLayerWithRoughnessBuilder.cpp
//! @brief     Implement class MultiLayerWithRoughnessBuilder.
//!
//! @homepage  http://www.bornagainproject.org
//! @license   GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors   Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
//  ************************************************************************************************

#include "Sample/StandardSample/MultiLayerWithRoughnessBuilder.h"
#include "Sample/Interface/Roughness.h"
#include "Sample/Material/MaterialFactoryFuncs.h"
#include "Sample/Multilayer/Layer.h"
#include "Sample/Multilayer/LayerStack.h"
#include "Sample/Multilayer/Sample.h"

namespace {
Sample* createMultiLayerWithTransientModel(const TransientModel* transient)
{
    const double thicknessA(2.5);
    const double thicknessB(5.0);
    const double sigma(1.0);
    const double hurst(0.3);
    const double lateralCorrLength(5.0);
    const double crossCorrDepth(10.0);

    Material vacuum_material = RefractiveMaterial("Vacuum", 0., 0.);
    Material substrate_material = RefractiveMaterial("Substrate", 15e-6, 0.0);
    Material part_a_material = RefractiveMaterial("PartA", 5e-6, 0.0);
    Material part_b_material = RefractiveMaterial("PartB", 10e-6, 0.0);

    SelfAffineFractalModel autocorrelation(sigma, hurst, lateralCorrLength);
    CommonDepthCrosscorrelation crosscorrelation(crossCorrDepth);
    Roughness roughness(&autocorrelation, transient, &crosscorrelation);

    Layer vacuum_layer(vacuum_material);
    Layer partA_layer(part_a_material, thicknessA, &roughness);
    Layer partB_layer(part_b_material, thicknessB, &roughness);
    Layer substrate_layer(substrate_material, &roughness);

    LayerStack stack(5);
    stack.addLayer(partA_layer);
    stack.addLayer(partB_layer);

    auto* sample = new Sample;
    sample->addLayer(vacuum_layer);
    sample->addStack(stack);
    sample->addLayer(substrate_layer);
    return sample;
}
} // namespace

Sample* ExemplarySamples::createMultiLayerWithRoughness()
{
    TanhTransient transient;
    return createMultiLayerWithTransientModel(&transient);
}

Sample* ExemplarySamples::createMultiLayerWithNCRoughness()
{
    ErfTransient transient;
    return createMultiLayerWithTransientModel(&transient);
}