BornAgain  1.18.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 scattering at grazing incidence
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_CORE_SOFTPARTICLE_FORMFACTORSPHEREGAUSSIANRADIUS_H
16 #define BORNAGAIN_CORE_SOFTPARTICLE_FORMFACTORSPHEREGAUSSIANRADIUS_H
17 
19 #include <memory>
20 
21 //! A sphere with gaussian radius distribution.
22 //! @ingroup softParticle
23 
25 {
26 public:
27  FormFactorSphereGaussianRadius(const std::vector<double> P);
28  FormFactorSphereGaussianRadius(double mean, double sigma);
29 
30  FormFactorSphereGaussianRadius* clone() const override final
31  {
33  }
34 
35  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
36 
37  double radialExtension() const override final { return m_mean; }
38 
39  complex_t evaluate_for_q(cvector_t q) const override final;
40 
41 protected:
42  void onChange() override final;
43 
44 private:
45  double calculateMeanR3() const;
46 
47  const double& m_mean; //!< This is the mean radius
48  const double& m_sigma;
49  double m_mean_r3; //!< This is the radius that gives the mean volume
50 };
51 
52 #endif // BORNAGAIN_CORE_SOFTPARTICLE_FORMFACTORSPHEREGAUSSIANRADIUS_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines pure virtual interface class IFormFactorBorn.
A sphere with gaussian radius distribution.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
const double & m_mean
This is the mean radius.
double m_mean_r3
This is the radius that gives the mean volume.
double radialExtension() const override final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
void onChange() override final
Action to be taken in inherited class when a parameter has changed.
FormFactorSphereGaussianRadius(const std::vector< double > P)
complex_t evaluate_for_q(cvector_t q) const override final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
FormFactorSphereGaussianRadius * clone() const override final
Returns a clone of this ISample object.
Pure virtual base class for Born form factors.
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149