BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
LayerRoughness.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Interface/LayerRoughness.h
6 //! @brief Defines class LayerRoughness.
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_SAMPLE_INTERFACE_LAYERROUGHNESS_H
16 #define BORNAGAIN_SAMPLE_INTERFACE_LAYERROUGHNESS_H
17 
19 #include <heinz/Vectors3D.h>
20 
21 //! A roughness of interface between two layers.
22 //!
23 //! Based on the article "X-ray reflection and transmission by rough surfaces"
24 //! by D. K. G. de Boer, Physical Review B 51, 5297 (1995)
25 //!
26 //!
27 //! @ingroup samples
28 
29 class LayerRoughness : public ISampleNode {
30 public:
31  LayerRoughness(double sigma, double hurstParameter = 0, double lateralCorrLength = 0);
33 
34  LayerRoughness* clone() const override
35  {
37  }
38  std::string className() const final { return "LayerRoughness"; }
39  std::vector<ParaMeta> parDefs() const final
40  {
41  return {{"Sigma", "", "roughness amplitude", 0, +INF, 0},
42  {"Hurst", "", "Power law exponent??", 0, +INF, 0},
43  {"CorrLength", "nm", "lateral correlation length", 0, +INF, 0}};
44  }
45 
46  //! Returns power spectral density of the surface roughness
47  double spectralFunction(R3 kvec) const;
48 
49  double corrFunction(R3 k) const;
50 
51  //! Sets rms of roughness
52  void setSigma(double sigma) { m_sigma = sigma; }
53  //! Returns rms of roughness
54  double sigma() const { return m_sigma; }
55 
56  //! Sets hurst parameter. It describes how jagged the surface is.
57  void setHurstParameter(double hurstParameter) { m_hurstParameter = hurstParameter; }
58  //! Returns hurst parameter
59  double hurst() const { return m_hurstParameter; }
60 
61  //! Sets lateral correlation length
63  {
65  }
66  //! Returns lateral correlation length
67  double lateralCorrLength() const { return m_lateralCorrLength; }
68 
69 #ifndef SWIG
70  //! Creates the Python constructor of this class
71  std::string pythonConstructor() const;
72 #endif
73 
74 private:
75  double m_sigma; //!< rms of roughness
76  double m_hurstParameter; //!< Hurst parameter which describes how jagged the interface, 0<H<=1
77  double m_lateralCorrLength; //!< lateral correlation length of the roughness
78 };
79 
80 #endif // BORNAGAIN_SAMPLE_INTERFACE_LAYERROUGHNESS_H
const double INF
Definition: INode.h:26
Defines interface class ISampleNode.
Abstract base class for sample components and properties related to scattering.
Definition: ISampleNode.h:27
A roughness of interface between two layers.
double spectralFunction(R3 kvec) const
Returns power spectral density of the surface roughness.
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
double m_hurstParameter
Hurst parameter which describes how jagged the interface, 0<H<=1.
LayerRoughness * clone() const override
Returns a clone of this ISampleNode object.
void setSigma(double sigma)
Sets rms of roughness.
double sigma() const
Returns rms of roughness.
double hurst() const
Returns hurst parameter.
double m_lateralCorrLength
lateral correlation length of the roughness
double lateralCorrLength() const
Returns lateral correlation length.
double m_sigma
rms of roughness
void setLatteralCorrLength(double lateralCorrLength)
Sets lateral correlation length.
std::string pythonConstructor() const
Creates the Python constructor of this class.
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
void setHurstParameter(double hurstParameter)
Sets hurst parameter. It describes how jagged the surface is.
double corrFunction(R3 k) const
Correlation function of the roughness profile.