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