BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorDodecahedron.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/FormFactorDodecahedron.cpp
6 //! @brief Implements class FormFactorDodecahedron.
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 
18  {{0, 4, 3, 2, 1}, false},
19  // lower ring:
20  {{0, 5, 12, 9, 4}, false},
21  {{4, 9, 11, 8, 3}, false},
22  {{3, 8, 10, 7, 2}, false},
23  {{2, 7, 14, 6, 1}, false},
24  {{1, 6, 13, 5, 0}, false},
25  // upper ring:
26  {{8, 11, 16, 15, 10}, false},
27  {{9, 12, 17, 16, 11}, false},
28  {{5, 13, 18, 17, 12}, false},
29  {{6, 14, 19, 18, 13}, false},
30  {{7, 10, 15, 19, 14}, false},
31  // top:
32  {{15, 16, 17, 18, 19}, false}},
33  true};
34 
37  {"Dodecahedron", "regular dodecahedron", {{"Edge", "nm", "edge length", 0, +INF, 0}}}, P),
38  m_edge(m_P[0])
39 {
40  onChange();
41 }
42 
44  : FormFactorDodecahedron(std::vector<double>{edge})
45 {
46 }
47 
49 {
50  double a = m_edge;
51  setPolyhedron(topology, -1.113516364411607 * a,
52  {{0.8506508083520399 * a, 0 * a, -1.113516364411607 * a},
53  {0.2628655560595668 * a, 0.8090169943749473 * a, -1.113516364411607 * a},
54  {-0.6881909602355868 * a, 0.5 * a, -1.113516364411607 * a},
55  {-0.6881909602355868 * a, -0.5 * a, -1.113516364411607 * a},
56  {0.2628655560595668 * a, -0.8090169943749473 * a, -1.113516364411607 * a},
57  {1.376381920471174 * a, 0 * a, -0.2628655560595667 * a},
58  {0.42532540417602 * a, 1.309016994374947 * a, -0.2628655560595667 * a},
59  {-1.113516364411607 * a, 0.8090169943749475 * a, -0.2628655560595667 * a},
60  {-1.113516364411607 * a, -0.8090169943749475 * a, -0.2628655560595667 * a},
61  {0.42532540417602 * a, -1.309016994374947 * a, -0.2628655560595667 * a},
62  {-1.376381920471174 * a, 0 * a, 0.2628655560595667 * a},
63  {-0.42532540417602 * a, -1.309016994374947 * a, 0.2628655560595667 * a},
64  {1.113516364411607 * a, -0.8090169943749475 * a, 0.2628655560595667 * a},
65  {1.113516364411607 * a, 0.8090169943749475 * a, 0.2628655560595667 * a},
66  {-0.42532540417602 * a, 1.309016994374947 * a, 0.2628655560595667 * a},
67  {-0.8506508083520399 * a, 0 * a, 1.113516364411607 * a},
68  {-0.2628655560595668 * a, -0.8090169943749473 * a, 1.113516364411607 * a},
69  {0.6881909602355868 * a, -0.5 * a, 1.113516364411607 * a},
70  {0.6881909602355868 * a, 0.5 * a, 1.113516364411607 * a},
71  {-0.2628655560595668 * a, 0.8090169943749473 * a, 1.113516364411607 * a}});
73 }
Defines class FormFactorDodecahedron.
const double INF
Definition: INode.h:24
A regular dodecahedron.
static const PolyhedralTopology topology
FormFactorDodecahedron(const std::vector< double > P)
void onChange() override final
Action to be taken in inherited class when a parameter has changed.
A polyhedron, for form factor computation.
void assert_platonic() const
Assertions for Platonic solid.
void setPolyhedron(const PolyhedralTopology &topology, double z_bottom, const std::vector< kvector_t > &vertices)
Called by child classes to set faces and other internal variables.
For internal use in IFormFactorPolyhedron.