BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorIcosahedron.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/FormFactorIcosahedron.cpp
6 //! @brief Implements class FormFactorIcosahedron.
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, 2, 1}, false},
19  // 1st row:
20  {{0, 5, 2}, false},
21  {{2, 3, 1}, false},
22  {{1, 4, 0}, false},
23  // 2nd row:
24  {{0, 6, 5}, false},
25  {{2, 5, 8}, false},
26  {{2, 8, 3}, false},
27  {{1, 3, 7}, false},
28  {{1, 7, 4}, false},
29  {{0, 4, 6}, false},
30  // 3rd row:
31  {{3, 8, 9}, false},
32  {{5, 11, 8}, false},
33  {{5, 6, 11}, false},
34  {{4, 10, 6}, false},
35  {{4, 7, 10}, false},
36  {{3, 9, 7}, false},
37  // 4th row:
38  {{8, 11, 9}, false},
39  {{6, 10, 11}, false},
40  {{7, 9, 10}, false},
41  // top:
42  {{9, 11, 10}, false}},
43  true};
44 
47  {"Icosahedron", "regular icosahedron", {{"Edge", "nm", "edge length", 0, +INF, 0}}}, P),
48  m_edge(m_P[0])
49 {
50  onChange();
51 }
52 
54  : FormFactorIcosahedron(std::vector<double>{edge})
55 {
56 }
57 
59 {
60  double a = m_edge;
61  setPolyhedron(topology, -0.7557613140761708 * a,
62  {{0.5773502691896258 * a, 0 * a, -0.7557613140761708 * a},
63  {-0.288675134594813 * a, 0.5 * a, -0.7557613140761708 * a},
64  {-0.288675134594813 * a, -0.5 * a, -0.7557613140761708 * a},
65  {-0.9341723589627158 * a, 0 * a, -0.1784110448865449 * a},
66  {0.467086179481358 * a, 0.8090169943749475 * a, -0.1784110448865449 * a},
67  {0.467086179481358 * a, -0.8090169943749475 * a, -0.1784110448865449 * a},
68  {0.9341723589627158 * a, 0 * a, 0.1784110448865449 * a},
69  {-0.467086179481358 * a, 0.8090169943749475 * a, 0.1784110448865449 * a},
70  {-0.467086179481358 * a, -0.8090169943749475 * a, 0.1784110448865449 * a},
71  {-0.5773502691896258 * a, 0 * a, 0.7557613140761708 * a},
72  {0.288675134594813 * a, 0.5 * a, 0.7557613140761708 * a},
73  {0.288675134594813 * a, -0.5 * a, 0.7557613140761708 * a}});
75 }
Defines class FormFactorIcosahedron.
const double INF
Definition: INode.h:24
A regular icosahedron.
static const PolyhedralTopology topology
void onChange() override final
Action to be taken in inherited class when a parameter has changed.
FormFactorIcosahedron(const std::vector< double > P)
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.