BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorSphereGaussianRadius.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/SoftParticle/FormFactorSphereGaussianRadius.h
6 //! @brief Defines and implements class FormFactorSphereGaussianRadius.
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_FORMFACTORSPHEREGAUSSIANRADIUS_H
16 #define BORNAGAIN_SAMPLE_SOFTPARTICLE_FORMFACTORSPHEREGAUSSIANRADIUS_H
17 
19 #include <memory>
20 
21 //! A sphere with gaussian radius distribution.
22 //! @ingroup softParticle
23 
25 public:
26  FormFactorSphereGaussianRadius(const std::vector<double> P);
27  FormFactorSphereGaussianRadius(double mean, double sigma);
28 
30  {
32  }
33 
34  void accept(INodeVisitor* visitor) const final { visitor->visit(this); }
35 
36  double radialExtension() const final { return m_mean; }
37 
38  complex_t evaluate_for_q(cvector_t q) const final;
39 
40 protected:
41  void onChange() final;
42 
43 private:
44  double calculateMeanR3() const;
45 
46  const double& m_mean; //!< This is the mean radius
47  const double& m_sigma;
48  double m_mean_r3; //!< This is the radius that gives the mean volume
49 };
50 
51 #endif // BORNAGAIN_SAMPLE_SOFTPARTICLE_FORMFACTORSPHEREGAUSSIANRADIUS_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines interface IBornFF.
A sphere with gaussian radius distribution.
void onChange() final
Action to be taken in inherited class when a parameter has changed.
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
const double & m_mean
This is the mean radius.
FormFactorSphereGaussianRadius * clone() const final
Returns a clone of this ISampleNode object.
double m_mean_r3
This is the radius that gives the mean volume.
double radialExtension() const final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
FormFactorSphereGaussianRadius(const std::vector< double > P)
complex_t evaluate_for_q(cvector_t q) const final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
Abstract base class for Born form factors.
Definition: IBornFF.h:41
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146