25 IProfileRipple::IProfileRipple(
const NodeMeta& meta,
const std::vector<double>& PValues)
26 :
IFormFactorBorn(nodeMetaUnion({{
"Length",
"nm",
"Characteristic length", 0, INF, 1.},
27 {
"Width",
"nm",
"Width", 0, INF, 1.},
28 {
"Height",
"nm",
"Height", 0, INF, 1.}},
31 m_length(m_P[0]), m_width(m_P[1]), m_height(m_P[2])
37 return (m_width + m_length) / 4.0;
42 return factor_x(q.
x()) * factor_yz(q.
y(), q.
z());
49 IProfileRectangularRipple::IProfileRectangularRipple(
const NodeMeta& meta,
50 const std::vector<double>& PValues)
57 complex_t IProfileRectangularRipple::factor_yz(complex_t qy, complex_t qz)
const
62 void IProfileRectangularRipple::onChange()
64 mP_shape = std::make_unique<Box>(m_length, m_width, m_height);
71 ICosineRipple::ICosineRipple(
const NodeMeta& meta,
const std::vector<double>& PValues)
78 complex_t ICosineRipple::factor_yz(complex_t qy, complex_t qz)
const
83 void ICosineRipple::onChange()
85 mP_shape = std::make_unique<RippleCosine>(m_length, m_width, m_height);
92 ISawtoothRipple::ISawtoothRipple(
const NodeMeta& meta,
const std::vector<double>& PValues)
94 nodeMetaUnion({{
"AsymmetryLength",
"nm",
"Asymmetry of width", -INF, INF, 0.}}, meta),
102 complex_t ISawtoothRipple::factor_yz(complex_t qy, complex_t qz)
const
107 void ISawtoothRipple::onChange()
109 mP_shape = std::make_unique<RippleSawtooth>(m_length, m_width, m_height, m_asymmetry);
Defines interface classes IProfileRipple, ICosineRipple, ISawtoothRipple.
Defines class RippleCosine.
Defines class RippleSawtooth.
Declares computations in namespace ripples.
T z() const
Returns z-component in cartesian coordinate system.
T y() const
Returns y-component in cartesian coordinate system.
T x() const
Returns x-component in cartesian coordinate system.
Base class for form factors with a cosine ripple profile in the yz plane.
virtual void onChange() override=0
Action to be taken in inherited class when a parameter has changed.
double radialExtension() const override final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
complex_t evaluate_for_q(cvector_t q) const override final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
complex_t profile_yz_cosine(complex_t qy, complex_t qz, double width, double height)
Complex form factor of triangular ripple.
complex_t profile_yz_bar(complex_t qy, complex_t qz, double width, double height)
Complex form factor of rectangular ripple (bar).
complex_t profile_yz_triangular(complex_t qy, complex_t qz, double width, double height, double asymmetry)
Complex form factor of triangular ripple.