BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
CosineRipple.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/CosineRipple.cpp
6 //! @brief Implements classes CosineRipple*.
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 
17 
18 // ************************************************************************************************
19 // class CosineRippleBox
20 // ************************************************************************************************
21 
22 CosineRippleBox::CosineRippleBox(const std::vector<double> P)
23  : ICosineRipple(P)
24 {
25  checkNodeArgs();
26 }
27 
28 CosineRippleBox::CosineRippleBox(double length, double width, double height)
29  : CosineRippleBox(std::vector<double>{length, width, height})
30 {
31 }
32 
34 {
36 }
37 
38 complex_t CosineRippleBox::factor_x(complex_t qx) const
39 {
40  return ripples::factor_x_box(qx, m_length);
41 }
42 
43 // ************************************************************************************************
44 // class CosineRippleGauss
45 // ************************************************************************************************
46 
47 CosineRippleGauss::CosineRippleGauss(const std::vector<double> P)
48  : ICosineRipple(P)
49 {
50  checkNodeArgs();
51 }
52 
53 CosineRippleGauss::CosineRippleGauss(double length, double width, double height)
54  : CosineRippleGauss(std::vector<double>{length, width, height})
55 {
56 }
57 
59 {
61 }
62 
63 complex_t CosineRippleGauss::factor_x(complex_t qx) const
64 {
66 }
67 
68 // ************************************************************************************************
69 // class CosineRippleLorentz
70 // ************************************************************************************************
71 
72 CosineRippleLorentz::CosineRippleLorentz(const std::vector<double> P)
73  : ICosineRipple(P)
74 {
75  checkNodeArgs();
76 }
77 
78 CosineRippleLorentz::CosineRippleLorentz(double length, double width, double height)
79  : CosineRippleLorentz(std::vector<double>{length, width, height})
80 {
81 }
82 
84 {
86 }
87 
88 complex_t CosineRippleLorentz::factor_x(complex_t qx) const
89 {
91 }
Defines classes CosineRipple*.
Declares computations in namespace ripples.
The form factor for a cosine ripple, with box profile in elongation direction.
Definition: CosineRipple.h:22
CosineRippleBox(double length, double width, double height)
complex_t factor_x(complex_t qx) const override
CosineRippleBox * clone() const override
Returns a clone of this ISampleNode object.
The form factor for a cosine ripple, with Gaussian profile in elongation direction.
Definition: CosineRipple.h:44
CosineRippleGauss * clone() const override
Returns a clone of this ISampleNode object.
CosineRippleGauss(double length, double width, double height)
complex_t factor_x(complex_t qx) const override
The form factor for a cosine ripple, with Lorentz form factor in elongation direction.
Definition: CosineRipple.h:66
complex_t factor_x(complex_t qx) const override
CosineRippleLorentz * clone() const override
Returns a clone of this ISampleNode object.
CosineRippleLorentz(double length, double width, double height)
Base class for form factors with a cosine ripple profile in the yz plane.
void checkNodeArgs() const
Raises exception if a parameter value is invalid.
Definition: INode.cpp:27
double width() const
const double & m_length
const double & m_width
double height() const
double length() const
const double & m_height
complex_t factor_x_box(complex_t q, double l)
Definition: Ripples.cpp:20
complex_t factor_x_Lorentz(complex_t q, double l)
Definition: Ripples.cpp:30
complex_t factor_x_Gauss(complex_t q, double l)
Definition: Ripples.cpp:25