BornAgain  1.18.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 scattering at grazing incidence
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 #ifndef BORNAGAIN_CORE_HARDPARTICLE_POLYHEDRON_H
16 #define BORNAGAIN_CORE_HARDPARTICLE_POLYHEDRON_H
17 
20 #include <memory>
21 
22 //! A polyhedron, implementation class for use in IFormFactorPolyhedron
23 
25 {
26 public:
27  Polyhedron() = delete;
28  Polyhedron(const Polyhedron&) = delete;
29  Polyhedron(const PolyhedralTopology& topology, double z_bottom,
30  const std::vector<kvector_t>& vertices);
32  void assert_platonic() const;
33  double volume() const;
34  double radius() const;
35  const std::vector<kvector_t>& vertices(); //! needed for topZ, bottomZ computation
36  complex_t evaluate_for_q(const cvector_t& q) const;
37  complex_t evaluate_centered(const cvector_t& q) const;
38 
39 private:
40  double m_z_bottom;
41  bool m_sym_Ci; //!< if true, then faces obtainable by inversion are not provided
42 
43  std::vector<PolyhedralFace> m_faces;
44  double m_radius;
45  double m_volume;
46  std::vector<kvector_t> m_vertices; //! for topZ, bottomZ computation only
47 };
48 
49 #endif // BORNAGAIN_CORE_HARDPARTICLE_POLYHEDRON_H
std::complex< double > complex_t
Definition: Complex.h:20
Defines classes PolyhedralEdge, PolyhedralFace.
Defines classes PolygonalTopology, PolyhedralTopology.
For internal use in IFormFactorPolyhedron.
A polyhedron, implementation class for use in IFormFactorPolyhedron.
Definition: Polyhedron.h:25
void assert_platonic() const
Definition: Polyhedron.cpp:91
double volume() const
Definition: Polyhedron.cpp:107
double m_z_bottom
Definition: Polyhedron.h:40
double m_volume
Definition: Polyhedron.h:45
Polyhedron()=delete
bool m_sym_Ci
if true, then faces obtainable by inversion are not provided
Definition: Polyhedron.h:41
std::vector< PolyhedralFace > m_faces
Definition: Polyhedron.h:43
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:141
complex_t evaluate_for_q(const cvector_t &q) const
needed for topZ, bottomZ computation
Definition: Polyhedron.cpp:123
const std::vector< kvector_t > & vertices()
Definition: Polyhedron.cpp:116
std::vector< kvector_t > m_vertices
Definition: Polyhedron.h:46
Polyhedron(const Polyhedron &)=delete
double m_radius
Definition: Polyhedron.h:44
double radius() const
Definition: Polyhedron.cpp:111