BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Our sample model: a stack of layers one below the other.
Example of system of 4 layers (3 interfaces):
vacuum layer 0 --------- interface 0 z=0.0 Fe, 20A layer 1 --------- interface 1 z=-20.0 Cr, 40A layer 2 --------- interface 2 z=-60.0 substrate layer 3
Definition at line 43 of file MultiLayer.h.
Public Member Functions | |
MultiLayer (std::string name="Unnamed") | |
~MultiLayer () override | |
void | addLayer (const Layer &layer) |
Adds layer with default (zero) roughness. More... | |
void | addLayerWithTopRoughness (const Layer &layer, const LayerRoughness &roughness) |
Adds layer with top roughness. More... | |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
std::string | className () const final |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
MultiLayer * | clone () const override |
Returns a clone of this ISampleNode object. More... | |
std::vector< const Material * > | containedMaterials () const |
Returns set of unique materials contained in this ISampleNode. More... | |
double | crossCorrLength () const |
Returns cross correlation length of roughnesses between interfaces. More... | |
R3 | externalField () const |
Returns the external field applied to the sample (units: A/m) More... | |
bool | isMagnetic () const |
Returns true if there is any magnetic material in this ISampleNode. More... | |
const Layer * | layer (size_t i_layer) const |
Returns layer with given index. More... | |
const LayerInterface * | layerInterface (size_t i_interface) const |
Returns interface with given index. More... | |
virtual const Material * | material () const |
Returns nullptr, unless overwritten to return a specific material. More... | |
std::vector< const INode * > | nodeChildren () const override |
Returns all children. More... | |
std::vector< const INode * > | nodeOffspring () const |
Returns all descendants. More... | |
size_t | numberOfLayers () const |
virtual std::vector< ParaMeta > | parDefs () const |
Returns the parameter definitions, to be hard-coded in each leaf class. More... | |
RoughnessModel | roughnessModel () const |
const std::string & | sampleName () const |
void | setCrossCorrLength (double crossCorrLength) |
Sets cross correlation length of roughnesses between interfaces. More... | |
void | setExternalField (R3 ext_field) |
Sets the external field applied to the sample (units: A/m) More... | |
void | setRoughnessModel (RoughnessModel roughnessModel) |
void | setSampleName (const std::string &name) |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
Protected Attributes | |
std::vector< double > | m_P |
Private Member Functions | |
void | addInterface (LayerInterface *child) |
Adds the interface with simultaneous registration in parent class. More... | |
void | addLayer (Layer *child) |
Adds the layer with simultaneous registration in parent class. More... | |
Private Attributes | |
double | m_crossCorrLength |
cross correlation length (in z direction) between different layers More... | |
R3 | m_ext_field |
external magnetic field (in A/m) More... | |
OwningVector< LayerInterface > | m_interfaces |
stack of layer interfaces [nlayers-1] More... | |
OwningVector< Layer > | m_layers |
stack of layers [nlayers] More... | |
RoughnessModel | m_roughness_model {RoughnessModel::DEFAULT} |
std::string | m_sample_name {"Unnamed"} |
MultiLayer::MultiLayer | ( | std::string | name = "Unnamed" | ) |
Definition at line 27 of file MultiLayer.cpp.
References RealLimits::check(), m_crossCorrLength, and RealLimits::nonnegative().
Referenced by clone().
|
overridedefault |
|
private |
Adds the interface with simultaneous registration in parent class.
Definition at line 138 of file MultiLayer.cpp.
References OwningVector< T >::emplace_back(), and m_interfaces.
Referenced by addLayerWithTopRoughness().
void MultiLayer::addLayer | ( | const Layer & | layer | ) |
Adds layer with default (zero) roughness.
Definition at line 53 of file MultiLayer.cpp.
References addLayerWithTopRoughness(), and layer().
Referenced by addLayerWithTopRoughness(), and clone().
|
private |
Adds the layer with simultaneous registration in parent class.
Definition at line 133 of file MultiLayer.cpp.
References OwningVector< T >::emplace_back(), and m_layers.
void MultiLayer::addLayerWithTopRoughness | ( | const Layer & | layer, |
const LayerRoughness & | roughness | ||
) |
Adds layer with top roughness.
Definition at line 60 of file MultiLayer.cpp.
References addInterface(), addLayer(), OwningVector< T >::back(), Layer::clone(), LayerInterface::createRoughInterface(), LayerInterface::createSmoothInterface(), layer(), m_layers, numberOfLayers(), LayerInterface::roughness(), LayerRoughness::sigma(), and Layer::thickness().
Referenced by addLayer(), and clone().
|
inherited |
Raises exception if a parameter value is invalid.
Definition at line 27 of file INode.cpp.
References ASSERT, RealLimits::check(), INode::className(), INF, RealLimits::limited(), RealLimits::limitless(), INode::m_P, ParaMeta::name, RealLimits::nonnegative(), INode::parDefs(), ParaMeta::vMax, and ParaMeta::vMin.
Referenced by BarGauss::BarGauss(), BarLorentz::BarLorentz(), Bipyramid4::Bipyramid4(), Box::Box(), CantellatedCube::CantellatedCube(), Cone::Cone(), ConstantBackground::ConstantBackground(), CosineRippleBox::CosineRippleBox(), CosineRippleGauss::CosineRippleGauss(), CosineRippleLorentz::CosineRippleLorentz(), Cylinder::Cylinder(), DistributionCosine::DistributionCosine(), DistributionGate::DistributionGate(), DistributionGaussian::DistributionGaussian(), DistributionLogNormal::DistributionLogNormal(), DistributionLorentz::DistributionLorentz(), DistributionTrapezoid::DistributionTrapezoid(), Dodecahedron::Dodecahedron(), EllipsoidalCylinder::EllipsoidalCylinder(), FootprintGauss::FootprintGauss(), FootprintSquare::FootprintSquare(), FuzzySphere::FuzzySphere(), GaussSphere::GaussSphere(), HemiEllipsoid::HemiEllipsoid(), HollowSphere::HollowSphere(), HorizontalCylinder::HorizontalCylinder(), Icosahedron::Icosahedron(), LongBoxGauss::LongBoxGauss(), LongBoxLorentz::LongBoxLorentz(), PlatonicOctahedron::PlatonicOctahedron(), PlatonicTetrahedron::PlatonicTetrahedron(), Prism3::Prism3(), Prism6::Prism6(), Profile1DCauchy::Profile1DCauchy(), Profile1DCosine::Profile1DCosine(), Profile1DGate::Profile1DGate(), Profile1DGauss::Profile1DGauss(), Profile1DTriangle::Profile1DTriangle(), Profile1DVoigt::Profile1DVoigt(), Profile2DCauchy::Profile2DCauchy(), Profile2DCone::Profile2DCone(), Profile2DGate::Profile2DGate(), Profile2DGauss::Profile2DGauss(), Profile2DVoigt::Profile2DVoigt(), Pyramid2::Pyramid2(), Pyramid3::Pyramid3(), Pyramid4::Pyramid4(), Pyramid6::Pyramid6(), RotationEuler::RotationEuler(), RotationX::RotationX(), RotationY::RotationY(), RotationZ::RotationZ(), SawtoothRippleBox::SawtoothRippleBox(), SawtoothRippleGauss::SawtoothRippleGauss(), SawtoothRippleLorentz::SawtoothRippleLorentz(), Sphere::Sphere(), Spheroid::Spheroid(), TruncatedCube::TruncatedCube(), TruncatedSphere::TruncatedSphere(), and TruncatedSpheroid::TruncatedSpheroid().
|
inlinefinalvirtual |
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Implements INode.
Definition at line 49 of file MultiLayer.h.
|
overridevirtual |
Returns a clone of this ISampleNode object.
Implements ISampleNode.
Definition at line 36 of file MultiLayer.cpp.
References MultiLayer(), addLayer(), addLayerWithTopRoughness(), crossCorrLength(), externalField(), m_interfaces, numberOfLayers(), and roughnessModel().
Referenced by Py::Import::createFromPython().
|
inherited |
Returns set of unique materials contained in this ISampleNode.
Definition at line 25 of file ISampleNode.cpp.
References ISampleNode::material(), and INode::nodeChildren().
Referenced by SampleUtils::Multilayer::ContainsCompatibleMaterials(), SampleToPython::initLabels(), and ISampleNode::isMagnetic().
|
inline |
Returns cross correlation length of roughnesses between interfaces.
Definition at line 69 of file MultiLayer.h.
References m_crossCorrLength.
Referenced by clone(), RoughMultiLayerContribution::compute(), reSample::crossCorrSpectralFun(), and setCrossCorrLength().
|
inline |
Returns the external field applied to the sample (units: A/m)
Definition at line 71 of file MultiLayer.h.
References m_ext_field.
Referenced by clone(), reSample::make(), and reSample::polarizing().
|
inherited |
Returns true if there is any magnetic material in this ISampleNode.
Definition at line 39 of file ISampleNode.cpp.
References ISampleNode::containedMaterials().
Referenced by reSample::make().
const Layer * MultiLayer::layer | ( | size_t | i_layer | ) | const |
Returns layer with given index.
Definition at line 91 of file MultiLayer.cpp.
References OwningVector< T >::at(), and m_layers.
Referenced by addLayer(), addLayerWithTopRoughness(), SampleUtils::Multilayer::IndexOfLayer(), nodeChildren(), and Compute::Slicing::particleRegions().
const LayerInterface * MultiLayer::layerInterface | ( | size_t | i_interface | ) | const |
Returns interface with given index.
Definition at line 96 of file MultiLayer.cpp.
References OwningVector< T >::at(), and m_interfaces.
Referenced by SampleUtils::Multilayer::hasRoughness(), SampleUtils::Multilayer::LayerTopRoughness(), and nodeChildren().
|
inlinevirtualinherited |
Returns nullptr, unless overwritten to return a specific material.
Reimplemented in Particle, and Layer.
Definition at line 36 of file ISampleNode.h.
Referenced by ISampleNode::containedMaterials().
|
overridevirtual |
Returns all children.
Reimplemented from INode.
Definition at line 118 of file MultiLayer.cpp.
References layer(), layerInterface(), m_interfaces, m_layers, N, and OwningVector< T >::size().
|
inherited |
Returns all descendants.
Definition at line 61 of file INode.cpp.
References INode::nodeChildren().
|
inline |
Definition at line 51 of file MultiLayer.h.
References m_layers, and OwningVector< T >::size().
Referenced by addLayerWithTopRoughness(), clone(), SampleUtils::Multilayer::hasRoughness(), SampleUtils::Multilayer::IndexOfLayer(), and Compute::Slicing::particleRegions().
|
inlinevirtualinherited |
Returns the parameter definitions, to be hard-coded in each leaf class.
Reimplemented in ConstantBackground, GaussSphere, FuzzySphere, RotationEuler, RotationZ, RotationY, RotationX, Crystal, Layer, HexagonalLattice2D, SquareLattice2D, BasicLattice2D, LayerRoughness, TruncatedSpheroid, TruncatedSphere, TruncatedCube, Spheroid, Sphere, SawtoothRippleLorentz, SawtoothRippleGauss, SawtoothRippleBox, Pyramid6, Pyramid4, Pyramid3, Pyramid2, Prism6, Prism3, PlatonicTetrahedron, PlatonicOctahedron, LongBoxLorentz, LongBoxGauss, Icosahedron, HorizontalCylinder, HollowSphere, HemiEllipsoid, EllipsoidalCylinder, Dodecahedron, Cylinder, CosineRippleLorentz, CosineRippleGauss, CosineRippleBox, Cone, CantellatedCube, Box, Bipyramid4, BarLorentz, BarGauss, Profile2DVoigt, Profile2DCone, Profile2DGate, Profile2DGauss, Profile2DCauchy, Profile1DVoigt, Profile1DCosine, Profile1DTriangle, Profile1DGate, Profile1DGauss, Profile1DCauchy, MisesGaussPeakShape, MisesFisherGaussPeakShape, LorentzFisherPeakShape, GaussFisherPeakShape, IsotropicLorentzPeakShape, IsotropicGaussPeakShape, ParticleLayout, InterferenceTwin, InterferenceRadialParaCrystal, InterferenceHardDisk, Interference2DSuperLattice, Interference2DParaCrystal, Interference1DLattice, DistributionTrapezoid, DistributionCosine, DistributionLogNormal, DistributionGaussian, DistributionLorentz, DistributionGate, ResolutionFunction2DGaussian, PolFilter, FootprintSquare, and FootprintGauss.
Definition at line 51 of file INode.h.
Referenced by INode::checkNodeArgs(), and IFormFactor::pythonConstructor().
|
inline |
Definition at line 67 of file MultiLayer.h.
References m_roughness_model.
Referenced by clone(), ExemplarySamples::createFeNiBilayerNC(), ExemplarySamples::createFeNiBilayerSpinFlipNC(), ExemplarySamples::createFeNiBilayerSpinFlipTanh(), ExemplarySamples::createFeNiBilayerTanh(), and setRoughnessModel().
|
inline |
void MultiLayer::setCrossCorrLength | ( | double | crossCorrLength | ) |
Sets cross correlation length of roughnesses between interfaces.
Definition at line 101 of file MultiLayer.cpp.
References crossCorrLength(), and m_crossCorrLength.
void MultiLayer::setExternalField | ( | R3 | ext_field | ) |
Sets the external field applied to the sample (units: A/m)
Definition at line 108 of file MultiLayer.cpp.
References m_ext_field.
void MultiLayer::setRoughnessModel | ( | RoughnessModel | roughnessModel | ) |
Definition at line 113 of file MultiLayer.cpp.
References m_roughness_model, and roughnessModel().
|
inline |
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
|
private |
cross correlation length (in z direction) between different layers
Definition at line 90 of file MultiLayer.h.
Referenced by MultiLayer(), crossCorrLength(), and setCrossCorrLength().
|
private |
external magnetic field (in A/m)
Definition at line 92 of file MultiLayer.h.
Referenced by externalField(), and setExternalField().
|
private |
stack of layer interfaces [nlayers-1]
Definition at line 88 of file MultiLayer.h.
Referenced by addInterface(), clone(), layerInterface(), and nodeChildren().
|
private |
stack of layers [nlayers]
Definition at line 86 of file MultiLayer.h.
Referenced by addLayer(), addLayerWithTopRoughness(), layer(), nodeChildren(), and numberOfLayers().
|
protectedinherited |
Definition at line 63 of file INode.h.
Referenced by IFootprintFactor::IFootprintFactor(), INode::checkNodeArgs(), IProfile1D::pythonConstructor(), IProfile2D::pythonConstructor(), IFormFactor::pythonConstructor(), Profile1DVoigt::pythonConstructor(), and Profile2DVoigt::pythonConstructor().
|
private |
Definition at line 95 of file MultiLayer.h.
Referenced by roughnessModel(), and setRoughnessModel().
|
private |
Definition at line 94 of file MultiLayer.h.
Referenced by sampleName(), and setSampleName().