BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Pyramid6.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Pyramid6.h
6 //! @brief Defines class Pyramid6
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_PYRAMID6_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_PYRAMID6_H
17 
19 
20 //! A frustum (truncated pyramid) with regular hexagonal base.
21 //! @ingroup hardParticle
22 
24 public:
25  Pyramid6(double base_edge, double height, double alpha);
26 #ifndef USER_API
27  Pyramid6(std::vector<double> P);
28 
29  Pyramid6* clone() const override { return new Pyramid6(m_base_edge, m_height, m_alpha); }
30  std::string className() const final { return "Pyramid6"; }
31  // const auto tooltip = "frustum with regular hexagonal base";
32  std::vector<ParaMeta> parDefs() const final
33  {
34  return {
35  {"BaseEdge", "nm", "base edge length", 0, +INF, 0},
36  {"Height", "nm", "height", 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_PYRAMID6_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 (truncated pyramid) with regular hexagonal base.
Definition: Pyramid6.h:23
const double & m_height
Definition: Pyramid6.h:47
const double & m_alpha
Definition: Pyramid6.h:48
const double & m_base_edge
Definition: Pyramid6.h:46
Pyramid6 * clone() const override
Returns a clone of this ISampleNode object.
Definition: Pyramid6.h:29
Pyramid6(double base_edge, double height, double alpha)
Definition: Pyramid6.cpp:75
static const ff::PolyhedralTopology topology
Definition: Pyramid6.h:45
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Pyramid6.h:30
double alpha() const
Definition: Pyramid6.h:42
double height() const
Definition: Pyramid6.h:41
double baseEdge() const
Definition: Pyramid6.h:40
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Pyramid6.h:32