BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Gauss.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/SoftParticle/Gauss.h
6 //! @brief Defines class GaussSphere.
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 BORNAGAIN_SAMPLE_SOFTPARTICLE_GAUSS_H
16 #define BORNAGAIN_SAMPLE_SOFTPARTICLE_GAUSS_H
17 
19 
20 //! The form factor of a Gaussian sphere.
21 //! @ingroup softParticle
22 
23 class GaussSphere : public IFormFactor {
24 public:
25  GaussSphere(std::vector<double> P);
26  GaussSphere(double mean_radius);
27 
28  GaussSphere* clone() const override { return new GaussSphere(m_mean_radius); }
29  std::string className() const final { return "GaussSphere"; }
30  // const auto tooltip = "class_tooltip";
31  std::vector<ParaMeta> parDefs() const final
32  {
33  return {{"MeanRadius", "nm", "para_tooltip", 0, +INF, 0}};
34  }
35 
36  double meanRadius() const { return m_mean_radius; }
37 
38  double radialExtension() const override { return m_mean_radius; }
39 
40  complex_t formfactor_at_bottom(C3 q) const override;
41 
42 private:
43  const double& m_mean_radius;
44  void initialize();
45 };
46 
47 #endif // BORNAGAIN_SAMPLE_SOFTPARTICLE_GAUSS_H
Defines interface IDecoratableBorn.
const double INF
Definition: INode.h:26
The form factor of a Gaussian sphere.
Definition: Gauss.h:23
double meanRadius() const
Definition: Gauss.h:36
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Gauss.h:31
GaussSphere(std::vector< double > P)
Definition: Gauss.cpp:20
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Gauss.h:29
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
Definition: Gauss.h:38
const double & m_mean_radius
Definition: Gauss.h:43
complex_t formfactor_at_bottom(C3 q) const override
Definition: Gauss.cpp:32
void initialize()
GaussSphere * clone() const override
Returns a clone of this ISampleNode object.
Definition: Gauss.h:28
Abstract base class for Born form factors.
Definition: IFormFactor.h:36