BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Dodecahedron.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Dodecahedron.cpp
6 //! @brief Implements class Dodecahedron.
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 
16 #include <ff/Platonic.h>
17 
18 Dodecahedron::Dodecahedron(const std::vector<double> P)
20  , m_edge(m_P[0])
21 {
22  checkNodeArgs();
23  setPolyhedron(ff::platonic::Dodecahedron::topology(), -1.113516364411607 * m_edge,
24  ff::platonic::Dodecahedron::vertices(m_edge));
26 }
27 
29  : Dodecahedron(std::vector<double>{edge})
30 {
31 }
Defines class Dodecahedron.
A regular dodecahedron.
Definition: Dodecahedron.h:23
Dodecahedron(double edge)
double edge() const
Definition: Dodecahedron.h:37
const double & m_edge
Definition: Dodecahedron.h:41
A polyhedron, for form factor computation.
void assert_platonic() const
Assertions for Platonic solid.
void setPolyhedron(const ff::PolyhedralTopology &topology, double z_bottom, const std::vector< R3 > &vertices)
Called by child classes to set faces and other internal variables.
void checkNodeArgs() const
Raises exception if a parameter value is invalid.
Definition: INode.cpp:27