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