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