BornAgain  1.19.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 reflection and scattering
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_SAMPLE_HARDPARTICLE_FORMFACTORTRUNCATEDSPHEROID_H
16 #define BORNAGAIN_SAMPLE_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 public:
26  FormFactorTruncatedSpheroid(const std::vector<double> P);
27  FormFactorTruncatedSpheroid(double radius, double height, double height_flattening, double dh);
28 
30  {
32  }
33  void accept(INodeVisitor* visitor) const final { visitor->visit(this); }
34 
35  double getRadius() const { return m_radius; }
36  double getHeight() const { return m_height; }
37  double getHeightFlattening() const { return m_height_flattening; }
38  double getRemovedTop() const { return m_dh; }
39 
40  double radialExtension() const final { return m_radius; }
41 
42  complex_t evaluate_for_q(cvector_t q) const final;
43 
44 protected:
45  IFormFactor* sliceFormFactor(ZLimits limits, const IRotation& rot,
46  kvector_t translation) const final;
47 
48  void onChange() final;
49 
50 private:
51  bool check_initialization() const;
52  complex_t Integrand(double Z) const;
53 
54  const double& m_radius;
55  const double& m_height;
56  const double& m_height_flattening;
57  const double& m_dh;
58  mutable cvector_t m_q;
59 };
60 
61 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_FORMFACTORTRUNCATEDSPHEROID_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines interface IBornFF.
FormFactorTruncatedSpheroid * clone() const final
Returns a clone of this ISampleNode object.
complex_t Integrand(double Z) const
Integrand for complex form factor.
double radialExtension() const final
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
void accept(INodeVisitor *visitor) const final
Calls the INodeVisitor's visit method.
FormFactorTruncatedSpheroid(const std::vector< double > P)
IFormFactor * sliceFormFactor(ZLimits limits, const IRotation &rot, kvector_t translation) const final
Actually slices the form factor or throws an exception.
void onChange() final
Action to be taken in inherited class when a parameter has changed.
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
Abstract base class for all form factors.
Definition: IFormFactor.h:36
Visitor interface to visit ISampleNode objects.
Definition: INodeVisitor.h:146
Abstract base class for rotations.
Definition: Rotations.h:28
Class that contains upper and lower limits of the z-coordinate for the slicing of form factors.
Definition: ZLimits.h:45