BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MultiLayerUtils.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Multilayer/MultiLayerUtils.h
6 //! @brief Defines helper functions for MultiLayer objects.
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 
15 #ifndef BORNAGAIN_CORE_MULTILAYER_MULTILAYERUTILS_H
16 #define BORNAGAIN_CORE_MULTILAYER_MULTILAYERUTILS_H
17 
18 #include <cstddef>
19 #include <vector>
20 
21 class Layer;
22 class LayerInterface;
23 class LayerRoughness;
24 class MultiLayer;
25 class ZLimits;
26 
27 namespace MultiLayerUtils
28 {
29 //! Returns thickness of layer
30 double LayerThickness(const MultiLayer& multilayer, size_t i);
31 
32 //! Returns top interface of layer
33 const LayerInterface* LayerTopInterface(const MultiLayer& multilayer, size_t i);
34 
35 //! Returns bottom interface of layer
36 const LayerInterface* LayerBottomInterface(const MultiLayer& multilayer, size_t i);
37 
38 //! Returns top roughness of layer
39 const LayerRoughness* LayerTopRoughness(const MultiLayer& multilayer, size_t i);
40 
41 //! Returns the index of the given layer
42 size_t IndexOfLayer(const MultiLayer& multilayer, const Layer* p_layer);
43 
44 //! Returns true if the multilayer contains non-default materials of one type only
45 bool ContainsCompatibleMaterials(const MultiLayer& multilayer);
46 
47 //! Calculate z-regions occupied by particles
48 std::vector<ZLimits> ParticleRegions(const MultiLayer& multilayer, bool use_slicing);
49 
50 bool hasRoughness(const MultiLayer& sample);
51 } // namespace MultiLayerUtils
52 
53 #endif // BORNAGAIN_CORE_MULTILAYER_MULTILAYERUTILS_H
Interface between two layers, possibly with roughness.
A roughness of interface between two layers.
A layer, with thickness (in nanometer) and material.
Definition: Layer.h:28
Our sample model: a stack of layers one below the other.
Definition: MultiLayer.h:42
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:41
const LayerRoughness * LayerTopRoughness(const MultiLayer &multilayer, size_t i)
Returns top roughness of layer.
std::vector< ZLimits > ParticleRegions(const MultiLayer &multilayer, bool use_slicing)
Calculate z-regions occupied by particles.
size_t IndexOfLayer(const MultiLayer &multilayer, const Layer *p_layer)
Returns the index of the given layer.
bool ContainsCompatibleMaterials(const MultiLayer &multilayer)
Returns true if the multilayer contains non-default materials of one type only.
double LayerThickness(const MultiLayer &multilayer, size_t i)
Returns thickness of layer.
const LayerInterface * LayerTopInterface(const MultiLayer &multilayer, size_t i)
Returns top interface of layer.
bool hasRoughness(const MultiLayer &sample)
const LayerInterface * LayerBottomInterface(const MultiLayer &multilayer, size_t i)
Returns bottom interface of layer.