BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Bipyramid4.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Bipyramid4.h
6 //! @brief Defines class Bipyramid4
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_BIPYRAMID4_H
16 #define BORNAGAIN_SAMPLE_HARDPARTICLE_BIPYRAMID4_H
17 
19 
20 //! A truncated bifrustum with quadratic base.
21 //! @ingroup hardParticle
22 
24 public:
25  Bipyramid4(double length, double height, double height_ratio, double alpha);
26 #ifndef USER_API
27  Bipyramid4(std::vector<double> P);
28  Bipyramid4* clone() const override
29  {
31  }
32  std::string className() const final { return "Bipyramid4"; }
33  // const auto tooltip = "truncated quadratic bipyramid";
34  std::vector<ParaMeta> parDefs() const final
35  {
36  return {{"Length", "nm", "edge length of base square (common face of both pyramids)", 0,
37  +INF, 0},
38  {"Height", "nm", "height of the lower pyramid", 0, +INF, 0},
39  {"HeightRatio", "", "height ratio of upper to lower pyramid", 0, +INF, 0},
40  {"Alpha", "rad", "angle between the base and a side face", 0., M_PI_2, 0}};
41  }
42  double length() const { return m_length; }
43  double height() const { return m_height; }
44  double heightRatio() const { return m_height_ratio; }
45  double alpha() const { return m_alpha; }
46 #endif // USER_API
47 
48 private:
49  static const ff::PolyhedralTopology topology;
50 
51  const double& m_length;
52  const double& m_height;
53  const double& m_height_ratio;
54  const double& m_alpha;
55 };
56 
57 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_BIPYRAMID4_H
#define M_PI_2
Definition: Constants.h:45
Defines interface IFormFactorPolyhedron.
const double INF
Definition: INode.h:26
A truncated bifrustum with quadratic base.
Definition: Bipyramid4.h:23
double heightRatio() const
Definition: Bipyramid4.h:44
Bipyramid4(double length, double height, double height_ratio, double alpha)
Definition: Bipyramid4.cpp:85
double alpha() const
Definition: Bipyramid4.h:45
double length() const
Definition: Bipyramid4.h:42
const double & m_height
Definition: Bipyramid4.h:52
std::vector< ParaMeta > parDefs() const final
Returns the parameter definitions, to be hard-coded in each leaf class.
Definition: Bipyramid4.h:34
double height() const
Definition: Bipyramid4.h:43
static const ff::PolyhedralTopology topology
Definition: Bipyramid4.h:49
const double & m_height_ratio
Definition: Bipyramid4.h:53
Bipyramid4 * clone() const override
Returns a clone of this ISampleNode object.
Definition: Bipyramid4.h:28
const double & m_length
Definition: Bipyramid4.h:51
std::string className() const final
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Definition: Bipyramid4.h:32
const double & m_alpha
Definition: Bipyramid4.h:54
A polyhedron, for form factor computation.