BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
Prism6.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Prism6.cpp
6 //! @brief Implements class Prism6.
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 
17 Prism6::Prism6(const std::vector<double> P)
18  : IFormFactorPrism(P)
19  , m_base_edge(m_P[0])
20  , m_height(m_P[1])
21 {
22  checkNodeArgs();
23  double a = m_base_edge;
24  double as = a * sqrt(3) / 2;
25  double ac = a / 2;
26  std::vector<R3> V{{a, 0., 0.}, {ac, as, 0.}, {-ac, as, 0.},
27  {-a, 0., 0.}, {-ac, -as, 0.}, {ac, -as, 0.}};
28  setPrism(true, V);
29 }
30 
31 Prism6::Prism6(double base_edge, double height)
32  : Prism6(std::vector<double>{base_edge, height})
33 {
34 }
Defines class Prism6.
A prism with a polygonal base, for form factor computation.
void setPrism(bool symmetry_Ci, const std::vector< R3 > &vertices)
void checkNodeArgs() const
Raises exception if a parameter value is invalid.
Definition: INode.cpp:27
A prism based on a regular hexagonal.
Definition: Prism6.h:23
Prism6(double base_edge, double height)
Definition: Prism6.cpp:31
const double & m_base_edge
Definition: Prism6.h:42
double height() const override
Definition: Prism6.h:39