BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
Polyhedron.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/Polyhedron.h
6 //! @brief Defines class Polyhedron.
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 
15 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRON_H
21 #define BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRON_H
22 
24 #include <memory>
25 
26 class PolyhedralTopology;
27 
28 //! A polyhedron, implementation class for use in IFormFactorPolyhedron
29 
30 class Polyhedron {
31 public:
32  Polyhedron() = delete;
33  Polyhedron(const Polyhedron&) = delete;
34  Polyhedron(const PolyhedralTopology& topology, double z_bottom,
35  const std::vector<kvector_t>& vertices);
37  void assert_platonic() const;
38  double volume() const;
39  double radius() const;
40  const std::vector<kvector_t>& vertices(); //! needed for topZ, bottomZ computation
41  complex_t evaluate_for_q(const cvector_t& q) const;
42  complex_t evaluate_centered(const cvector_t& q) const;
43 
44 private:
45  double m_z_bottom;
46  bool m_sym_Ci; //!< if true, then faces obtainable by inversion are not provided
47 
48  std::vector<PolyhedralFace> m_faces;
49  double m_radius;
50  double m_volume;
51  std::vector<kvector_t> m_vertices; //! for topZ, bottomZ computation only
52 };
53 
54 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_POLYHEDRON_H
55 #endif // USER_API
std::complex< double > complex_t
Definition: Complex.h:20
Defines classes PolyhedralEdge, PolyhedralFace.
For internal use in IFormFactorPolyhedron.
A polyhedron, implementation class for use in IFormFactorPolyhedron.
Definition: Polyhedron.h:30
void assert_platonic() const
Definition: Polyhedron.cpp:92
double volume() const
Definition: Polyhedron.cpp:108
double m_z_bottom
Definition: Polyhedron.h:45
double m_volume
Definition: Polyhedron.h:50
Polyhedron()=delete
bool m_sym_Ci
if true, then faces obtainable by inversion are not provided
Definition: Polyhedron.h:46
std::vector< PolyhedralFace > m_faces
Definition: Polyhedron.h:48
complex_t evaluate_centered(const cvector_t &q) const
Returns the form factor F(q) of this polyhedron, with origin at z=0.
Definition: Polyhedron.cpp:142
complex_t evaluate_for_q(const cvector_t &q) const
needed for topZ, bottomZ computation
Definition: Polyhedron.cpp:124
const std::vector< kvector_t > & vertices()
Definition: Polyhedron.cpp:117
std::vector< kvector_t > m_vertices
Definition: Polyhedron.h:51
Polyhedron(const Polyhedron &)=delete
double m_radius
Definition: Polyhedron.h:49
double radius() const
Definition: Polyhedron.cpp:112