BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Pyramid3.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Pyramid3.h
6 //! @brief Defines class Pyramid3
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_PYRAMID3_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID3_H
17 
19 
20 //! A frustum with equilateral trigonal base.
21 //! @ingroup hardParticle
22 
24 public:
25  Pyramid3(double base_edge, double height, double alpha);
26 #ifndef USER_API
27  Pyramid3(std::vector<double> P);
28 
29  Pyramid3* clone() const override { return new Pyramid3(m_base_edge, m_height, m_alpha); }
30  std::string className() const final { return "Pyramid3"; }
31  // const auto tooltip = "actually, not a tetrahedron, but a trigonal frustum";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {
35  {"BaseEdge", "nm", "edge of base triangle", 0, +INF, 0},
36  {"Height", "nm", "height of frustum", 0, +INF, 0},
37  {"Alpha", "rad", "angle between base and a side face", 0., M_PI_2 + 0.0000000001, 0}};
38  }
39 
40  double baseEdge() const { return m_base_edge; }
41  double height() const { return m_height; }
42  double alpha() const { return m_alpha; }
43 
44 private:
45  static const ff::PolyhedralTopology topology;
46  const double& m_base_edge;
47  const double& m_height;
48  const double& m_alpha;
49 #endif // USER_API
50 };
51 
52 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID3_H
#define M_PI_2
Definition: Constants.h:45
Defines interface IFormFactorPolyhedron.
const double INF
Definition: INode.h:26
A polyhedron, for form factor computation.
A frustum with equilateral trigonal base.
Definition: Pyramid3.h:23
const double & m_alpha
Definition: Pyramid3.h:48
const double & m_base_edge
Definition: Pyramid3.h:46
double baseEdge() const
Definition: Pyramid3.h:40
Pyramid3 * clone() const override
Returns a clone of this ISampleNode object.
Definition: Pyramid3.h:29
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Pyramid3.h:30
static const ff::PolyhedralTopology topology
Definition: Pyramid3.h:45
Pyramid3(double base_edge, double height, double alpha)
Definition: Pyramid3.cpp:68
double alpha() const
Definition: Pyramid3.h:42
const double & m_height
Definition: Pyramid3.h:47
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Pyramid3.h:32
double height() const
Definition: Pyramid3.h:41