BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Spheroid.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Spheroid.h
6 //! @brief Defines class Spheroid.
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_SPHEROID_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_SPHEROID_H
17 
19 
20 //! A full spheroid (an ellipsoid with two equal axes, hence with circular cross section)
21 //! @ingroup hardParticle
22 
23 class Spheroid : public IFormFactor {
24 public:
25  Spheroid(double radius, double height);
26 #ifndef USER_API
27  Spheroid(std::vector<double> P);
28 
29  Spheroid* clone() const override { return new Spheroid(m_radius, m_height); }
30  std::string className() const final { return "Spheroid"; }
31  // const auto tooltip = "ellipsoid of revolution";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {
35  {"Radius", "nm", "revolution radius", 0, +INF, 0},
36  {"Height", "nm", "height = twice the radius in non-revolution direction", 0, +INF, 0}};
37  }
38 
39  double height() const { return m_height; }
40  double radius() const { return m_radius; }
41 
42  double radialExtension() const override { return m_radius; }
43 
44  complex_t formfactor_at_bottom(C3 q) const override;
45 
46 private:
47  const double& m_radius;
48  const double& m_height;
49 #endif // USER_API
50 };
51 
52 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_SPHEROID_H
Defines interface IDecoratableBorn.
const double INF
Definition: INode.h:26
Abstract base class for Born form factors.
Definition: IFormFactor.h:36
A full spheroid (an ellipsoid with two equal axes, hence with circular cross section)
Definition: Spheroid.h:23
const double & m_height
Definition: Spheroid.h:48
double radius() const
Definition: Spheroid.h:40
Spheroid(double radius, double height)
Definition: Spheroid.cpp:32
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Spheroid.h:32
const double & m_radius
Definition: Spheroid.h:47
double height() const
Definition: Spheroid.h:39
Spheroid * clone() const override
Returns a clone of this ISampleNode object.
Definition: Spheroid.h:29
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Spheroid.h:30
complex_t formfactor_at_bottom(C3 q) const override
Definition: Spheroid.cpp:37
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
Definition: Spheroid.h:42