28 : m_crossCorrLength(0)
29 , m_sample_name(std::move(name))
44 if (i > 0 && interface->roughness())
47 result->
addLayer(std::as_const(*m_layers[i]));
67 if (roughness.
sigma() != 0.0)
76 throw std::runtime_error(
77 "Invalid call to MultiLayer::addLayer(): the semi-infinite top layer "
78 "must have a pro forma thickness of 0");
83 throw std::runtime_error(
84 "Invalid call to MultiLayer::addLayer(): the semi-infinite top layer "
85 "cannot have roughness.");
104 throw std::runtime_error(
"Attempt to set crossCorrLength to negative value");
120 std::vector<const INode*> result;
124 for (
size_t i = 0; i <
N; ++i) {
125 result.push_back(
layer(i));
Defines the macro ASSERT.
Defines class LayerInterface.
Defines class LayerRoughness.
Declares functions in namespace MaterialUtils.
Defines class MultiLayer.
Defines namespace SampleUtils::Multilayer.
Defines class ParticleLayout.
Defines class RealLimits.
Interface between two layers, possibly with roughness.
static LayerInterface * createRoughInterface(const Layer *top_layer, const Layer *bottom_layer, const LayerRoughness &roughness)
Creates rough interface between two layers.
const LayerRoughness * roughness() const
Returns roughness of the interface.
static LayerInterface * createSmoothInterface(const Layer *top_layer, const Layer *bottom_layer)
Creates smooth interface between two layers.
A roughness of interface between two layers.
double sigma() const
Returns rms of roughness.
A layer in a MultiLayer sample.
Layer * clone() const override
Returns a clone of this ISampleNode object.
Our sample model: a stack of layers one below the other.
MultiLayer(std::string name="Unnamed")
double m_crossCorrLength
cross correlation length (in z direction) between different layers
R3 m_ext_field
external magnetic field (in A/m)
void setRoughnessModel(RoughnessModel roughnessModel)
const LayerInterface * layerInterface(size_t i_interface) const
Returns interface with given index.
const Layer * layer(size_t i_layer) const
Returns layer with given index.
OwningVector< LayerInterface > m_interfaces
stack of layer interfaces [nlayers-1]
MultiLayer * clone() const override
Returns a clone of this ISampleNode object.
R3 externalField() const
Returns the external field applied to the sample (units: A/m)
RoughnessModel roughnessModel() const
void setCrossCorrLength(double crossCorrLength)
Sets cross correlation length of roughnesses between interfaces.
RoughnessModel m_roughness_model
size_t numberOfLayers() const
void addLayer(const Layer &layer)
Adds layer with default (zero) roughness.
void setExternalField(R3 ext_field)
Sets the external field applied to the sample (units: A/m)
void addInterface(LayerInterface *child)
Adds the interface with simultaneous registration in parent class.
void addLayerWithTopRoughness(const Layer &layer, const LayerRoughness &roughness)
Adds layer with top roughness.
double crossCorrLength() const
Returns cross correlation length of roughnesses between interfaces.
OwningVector< Layer > m_layers
stack of layers [nlayers]
std::vector< const INode * > nodeChildren() const override
Returns all children.
T *const & at(int i) const
void check(const std::string &name, double value) const
Throws if value is outside limits. Parameter 'name' is for exception message.
static RealLimits nonnegative()
Creates an object which can have only positive values with 0. included.