BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
TruncatedSpheroid.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/TruncatedSpheroid.h
6 //! @brief Defines class TruncatedSpheroid.
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_TRUNCATEDSPHEROID_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_TRUNCATEDSPHEROID_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  TruncatedSpheroid(double radius, double height, double height_flattening, double dh);
27 #ifndef USER_API
28  TruncatedSpheroid(std::vector<double> P);
29 
30  TruncatedSpheroid* clone() const override
31  {
33  }
34  std::string className() const final { return "TruncatedSpheroid"; }
35  // const auto tooltip = "class_tooltip";
36  std::vector<ParaMeta> parDefs() const final
37  {
38  return {{"Radius", "nm", "horizontal radius", 0, +INF, 0},
39  {"Height", "nm", "height before removal of cap", 0, +INF, 0},
40  {"HeightFlattening", "", "ratio of vertical to horizontal radius", 0, +INF, 0},
41  {"DeltaHeight", "nm", "height of removed cap", 0, +INF, 0}};
42  }
43 
44  double radius() const { return m_radius; }
45  double height() const { return m_height; }
46  double heightFlattening() const { return m_height_flattening; }
47  double removedTop() const { return m_dh; }
48 
49  double radialExtension() const override { return m_radius; }
50 
51  complex_t formfactor_at_bottom(C3 q) const override;
52 
53 private:
54  const double& m_radius;
55  const double& m_height;
56  const double& m_height_flattening;
57  const double& m_dh;
58 #endif // USER_API
59 };
60 
61 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_TRUNCATEDSPHEROID_H
Defines interface IDecoratableBorn.
const double INF
Definition: INode.h:26
Abstract base class for Born form factors.
Definition: IFormFactor.h:36
A truncated spheroid. An ellipsoid with two equal axis, truncated by a plane perpendicular to the thi...
const double & m_dh
double height() const
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
const double & m_height_flattening
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
const double & m_radius
TruncatedSpheroid * clone() const override
Returns a clone of this ISampleNode object.
double radius() const
const double & m_height
complex_t formfactor_at_bottom(C3 q) const override
double removedTop() const
double heightFlattening() const
TruncatedSpheroid(double radius, double height, double height_flattening, double dh)