BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorTruncatedSpheroid.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/FormFactorTruncatedSpheroid.h
6 //! @brief Defines class FormFactorTruncatedSpheroid.
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_HARDPARTICLE_FORMFACTORTRUNCATEDSPHEROID_H
16 #define BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORTRUNCATEDSPHEROID_H
17 
19 
20 //! A truncated spheroid.
21 //! An ellipsoid with two equal axis, truncated by a plane perpendicular to the third axis.
22 //! @ingroup hardParticle
23 
25 {
26 public:
27  FormFactorTruncatedSpheroid(const std::vector<double> P);
28  FormFactorTruncatedSpheroid(double radius, double height, double height_flattening, double dh);
29 
30  FormFactorTruncatedSpheroid* clone() const override final
31  {
33  }
34  void accept(INodeVisitor* visitor) const override final { visitor->visit(this); }
35 
36  double getRadius() const { return m_radius; }
37  double getHeight() const { return m_height; }
38  double getHeightFlattening() const { return m_height_flattening; }
39  double getRemovedTop() const { return m_dh; }
40 
41  double radialExtension() const override final { return m_radius; }
42 
43  complex_t evaluate_for_q(cvector_t q) const override final;
44 
45 protected:
46  IFormFactor* sliceFormFactor(ZLimits limits, const IRotation& rot,
47  kvector_t translation) const override final;
48 
49  void onChange() override final;
50 
51 private:
52  bool check_initialization() const;
53  complex_t Integrand(double Z) const;
54 
55  const double& m_radius;
56  const double& m_height;
57  const double& m_height_flattening;
58  const double& m_dh;
59  mutable cvector_t m_q;
60 };
61 
62 #endif // BORNAGAIN_CORE_HARDPARTICLE_FORMFACTORTRUNCATEDSPHEROID_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines pure virtual interface class IFormFactorBorn.
IFormFactor * sliceFormFactor(ZLimits limits, const IRotation &rot, kvector_t translation) const override final
Actually slices the form factor or throws an exception.
void accept(INodeVisitor *visitor) const override final
Calls the INodeVisitor's visit method.
complex_t Integrand(double Z) const
Integrand for complex form factor.
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.
complex_t evaluate_for_q(cvector_t q) const override final
Returns scattering amplitude for complex scattering wavevector q=k_i-k_f.
FormFactorTruncatedSpheroid(const std::vector< double > P)
FormFactorTruncatedSpheroid * clone() const override final
Returns a clone of this ISample object.
Pure virtual base class for Born form factors.
Pure virtual base class for all form factors.
Definition: IFormFactor.h:40
Visitor interface to visit ISample objects.
Definition: INodeVisitor.h:149
Pure virtual interface for rotations.
Definition: Rotations.h:27
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:41
const double radius(5 *Units::nanometer)