BornAgain  1.18.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 scattering at grazing incidence
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)
19  {"Dot",
20  "dot, with scattering power of a sphere of given radius",
21  {{"Radius", "nm", "radius of sphere that defines scattering power", 0, +INF, 0}}},
22  P),
23  m_radius(m_P[0])
24 {
25  onChange();
26 }
27 
28 FormFactorDot::FormFactorDot(double radius) : FormFactorDot(std::vector<double>{radius}) {}
29 
31 {
32  return 4 * M_PI / 3 * pow(m_radius, 3);
33 }
Defines class FormFactorDot.
A dot, with scattering power as a sphere of radius rscat, but with F(q)=const.
Definition: FormFactorDot.h:24
complex_t evaluate_for_q(cvector_t q) const override final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
Pure virtual base class for Born form factors.
virtual void onChange()
Action to be taken in inherited class when a parameter has changed.