BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorCosineRipple.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/FormFactorCosineRipple.cpp
6 //! @brief Implements classes FormFactorCosineRipple*.
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 FormFactorCosineRippleBox
20 // ************************************************************************** //
21 
22 FormFactorCosineRippleBox::FormFactorCosineRippleBox(const std::vector<double> P)
23  : ICosineRipple({"CosineRippleBox", "class_tooltip", {}}, P)
24 {
25 }
26 
27 FormFactorCosineRippleBox::FormFactorCosineRippleBox(double length, double width, double height)
28  : FormFactorCosineRippleBox(std::vector<double>{length, width, height})
29 {
30 }
31 
33 {
34  return new FormFactorCosineRippleBox(m_length, m_width, m_height);
35 }
36 
38 {
39  visitor->visit(this);
40 }
41 
42 complex_t FormFactorCosineRippleBox::factor_x(complex_t qx) const
43 {
44  return ripples::factor_x_box(qx, m_length);
45 }
46 
47 // ************************************************************************** //
48 // class FormFactorCosineRippleGauss
49 // ************************************************************************** //
50 
51 FormFactorCosineRippleGauss::FormFactorCosineRippleGauss(const std::vector<double> P)
52  : ICosineRipple({"CosineRippleGauss", "class_tooltip", {}}, P)
53 {
54 }
55 
56 FormFactorCosineRippleGauss::FormFactorCosineRippleGauss(double length, double width, double height)
57  : FormFactorCosineRippleGauss(std::vector<double>{length, width, height})
58 {
59 }
60 
62 {
63  return new FormFactorCosineRippleGauss(m_length, m_width, m_height);
64 }
65 
67 {
68  visitor->visit(this);
69 }
70 
71 complex_t FormFactorCosineRippleGauss::factor_x(complex_t qx) const
72 {
73  return ripples::factor_x_Gauss(qx, m_length);
74 }
75 
76 // ************************************************************************** //
77 // class FormFactorCosineRippleLorentz
78 // ************************************************************************** //
79 
80 FormFactorCosineRippleLorentz::FormFactorCosineRippleLorentz(const std::vector<double> P)
81  : ICosineRipple({"CosineRippleLorentz", "class_tooltip", {}}, P)
82 {
83 }
84 
85 FormFactorCosineRippleLorentz::FormFactorCosineRippleLorentz(double length, double width,
86  double height)
87  : FormFactorCosineRippleLorentz(std::vector<double>{length, width, height})
88 {
89 }
90 
92 {
93  return new FormFactorCosineRippleLorentz(m_length, m_width, m_height);
94 }
95 
97 {
98  visitor->visit(this);
99 }
100 
101 complex_t FormFactorCosineRippleLorentz::factor_x(complex_t qx) const
102 {
103  return ripples::factor_x_Lorentz(qx, m_length);
104 }
Defines classes FormFactorCosineRipple*.
Declares computations in namespace ripples.
The form factor for a cosine ripple, with box profile in elongation direction.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
FormFactorCosineRippleBox * clone() const override final
Returns a clone of this ISample object.
The form factor for a cosine ripple, with Gaussian profile in elongation direction.
FormFactorCosineRippleGauss * clone() const override final
Returns a clone of this ISample object.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
The form factor for a cosine ripple, with Lorentz form factor in elongation direction.
FormFactorCosineRippleLorentz * clone() const override final
Returns a clone of this ISample object.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
Base class for form factors with a cosine ripple profile in the yz plane.
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149