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