BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Icosahedron.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Icosahedron.cpp
6 //! @brief Implements class Icosahedron.
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 Icosahedron::Icosahedron(const std::vector<double> P)
20  , m_edge(m_P[0])
21 {
22  checkNodeArgs();
23  setPolyhedron(ff::platonic::Icosahedron::topology(), -0.7557613140761708 * m_edge,
24  ff::platonic::Icosahedron::vertices(m_edge));
26 }
27 
29  : Icosahedron(std::vector<double>{edge})
30 {
31 }
Defines class Icosahedron.
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
A regular icosahedron.
Definition: Icosahedron.h:23
double edge() const
Definition: Icosahedron.h:37
Icosahedron(double edge)
Definition: Icosahedron.cpp:28
const double & m_edge
Definition: Icosahedron.h:41