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