BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IProfileRipple.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/IProfileRipple.h
6 //! @brief Defines interface classes IProfileRipple, ICosineRipple, ISawtoothRipple.
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 USER_API
16 #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_IPROFILERIPPLE_H
17 #define BORNAGAIN_SAMPLE_HARDPARTICLE_IPROFILERIPPLE_H
18 
20 
21 //! Base class for form factors with a cosine ripple profile in the yz plane.
22 
23 class IProfileRipple : public IBornFF {
24 public:
25  IProfileRipple(const NodeMeta& meta, const std::vector<double>& PValues);
26 
27  double getLength() const { return m_length; }
28  double getHeight() const { return m_height; }
29  double getWidth() const { return m_width; }
30 
31  double radialExtension() const final;
32 
33  complex_t evaluate_for_q(cvector_t q) const final;
34 
35 protected:
36  const double& m_length;
37  const double& m_width;
38  const double& m_height;
39 
40  virtual void onChange() override = 0;
41  virtual complex_t factor_x(complex_t qx) const = 0;
42  virtual complex_t factor_yz(complex_t qy, complex_t qz) const = 0;
43 };
44 
45 //! Base class for form factors with a rectangular ripple (bar) profile in the yz plane.
46 
48 public:
49  IProfileRectangularRipple(const NodeMeta& meta, const std::vector<double>& PValues);
50 
51 private:
52  virtual void onChange() final;
53  complex_t factor_yz(complex_t qy, complex_t qz) const final;
54 };
55 
56 //! Base class for form factors with a cosine ripple profile in the yz plane.
57 
58 class ICosineRipple : public IProfileRipple {
59 public:
60  ICosineRipple(const NodeMeta& meta, const std::vector<double>& PValues);
61 
62 private:
63  virtual void onChange() final;
64  complex_t factor_yz(complex_t qy, complex_t qz) const final;
65 };
66 
67 //! Base class for form factors with a triangular ripple profile in the yz plane.
68 
70 public:
71  ISawtoothRipple(const NodeMeta& meta, const std::vector<double>& PValues);
72 
73  double getAsymmetry() const { return m_asymmetry; }
74 
75 protected:
76  const double& m_asymmetry;
77 
78 private:
79  virtual void onChange() final;
80  complex_t factor_yz(complex_t qy, complex_t qz) const final;
81 };
82 
83 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_IPROFILERIPPLE_H
84 #endif // USER_API
std::complex< double > complex_t
Definition: Complex.h:20
Defines interface IBornFF.
Abstract base class for Born form factors.
Definition: IBornFF.h:41
Base class for form factors with a cosine ripple profile in the yz plane.
Base class for form factors with a rectangular ripple (bar) profile in the yz plane.
Base class for form factors with a cosine ripple profile in the yz plane.
double getHeight() const
virtual complex_t factor_yz(complex_t qy, complex_t qz) const =0
double radialExtension() const final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
double getLength() const
double getWidth() const
const double & m_length
const double & m_width
virtual complex_t factor_x(complex_t qx) const =0
complex_t evaluate_for_q(cvector_t q) const final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
IProfileRipple(const NodeMeta &meta, const std::vector< double > &PValues)
virtual void onChange() override=0
Action to be taken in inherited class when a parameter has changed.
const double & m_height
Base class for form factors with a triangular ripple profile in the yz plane.
double getAsymmetry() const
const double & m_asymmetry
Metadata of one model node.
Definition: INode.h:38