BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
PlatonicTetrahedron.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/PlatonicTetrahedron.cpp
6 //! @brief Implements 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 
16 #include "Base/Math/Constants.h"
17 #include "Base/Math/Functions.h"
18 #include <ff/Platonic.h>
19 
20 PlatonicTetrahedron::PlatonicTetrahedron(const std::vector<double> P)
22  , m_edge(m_P[0])
23 {
24  checkNodeArgs();
25  setPolyhedron(ff::platonic::Tetrahedron::topology(), -height() / 4,
26  ff::platonic::Tetrahedron::vertices(m_edge));
28 }
29 
31  : PlatonicTetrahedron(std::vector<double>{edge})
32 {
33 }
Defines M_PI and some more mathematical constants.
Defines namespace Math.
Defines class PlatonicTetrahedron.
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 frustum with equilateral trigonal base.
PlatonicTetrahedron(double edge)