BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorDot.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/FormFactorDot.cpp
6 //! @brief Implements class FormFactorDot.
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 
16 
17 FormFactorDot::FormFactorDot(const std::vector<double> P)
18  : IBornFF({"Dot",
19  "dot, with scattering power of a sphere of given radius",
20  {{"Radius", "nm", "radius of sphere that defines scattering power", 0, +INF, 0}}},
21  P)
22  , m_radius(m_P[0])
23 {
24  onChange();
25 }
26 
27 FormFactorDot::FormFactorDot(double radius) : FormFactorDot(std::vector<double>{radius}) {}
28 
30 {
31  return 4 * M_PI / 3 * pow(m_radius, 3);
32 }
std::complex< double > complex_t
Definition: Complex.h:20
#define M_PI
Definition: Constants.h:44
Defines class FormFactorDot.
const double INF
Definition: INode.h:25
A dot, with scattering power as a sphere of radius rscat, but with F(q)=const.
Definition: FormFactorDot.h:23
const double & m_radius
Definition: FormFactorDot.h:44
complex_t evaluate_for_q(cvector_t q) const final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
FormFactorDot(const std::vector< double > P)
Abstract base class for Born form factors.
Definition: IBornFF.h:41
virtual void onChange()
Action to be taken in inherited class when a parameter has changed.
Definition: filesystem.h:81