BornAgain  1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
IFormFactorPolyhedron.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/HardParticle/IFormFactorPolyhedron.h
6 //! @brief Defines interface IFormFactorPolyhedron.
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 USER_API
16 #ifndef BORNAGAIN_SAMPLE_HARDPARTICLE_IFORMFACTORPOLYHEDRON_H
17 #define BORNAGAIN_SAMPLE_HARDPARTICLE_IFORMFACTORPOLYHEDRON_H
18 
20 #include <ff/PolyhedralTopology.h>
21 #include <memory>
22 
23 namespace ff {
24 
25 class Polyhedron;
26 }
27 
28 //! A polyhedron, for form factor computation.
29 
31 public:
32  // #ifdef ALGORITHM_DIAGNOSTIC
33  // static void setLimits(double _q, int _n);
34  // #endif
35 
36  IFormFactorPolyhedron(const std::vector<double>& PValues);
38 
39  double bottomZ(const IRotation* rotation) const override;
40  double topZ(const IRotation* rotation) const override;
41 
42  complex_t formfactor_at_bottom(C3 q) const override;
43 
44  double volume() const override;
45  double radialExtension() const override;
46  void assert_platonic() const;
47 
48 protected:
49  void setPolyhedron(const ff::PolyhedralTopology& topology, double z_bottom,
50  const std::vector<R3>& vertices);
51 
52 private:
53  std::unique_ptr<ff::Polyhedron> pimpl;
54  std::vector<R3> m_vertices; //! for topZ, bottomZ computation only
55  double m_z_bottom;
56 };
57 
58 #endif // BORNAGAIN_SAMPLE_HARDPARTICLE_IFORMFACTORPOLYHEDRON_H
59 #endif // USER_API
Defines interface IDecoratableBorn.
A polyhedron, for form factor computation.
double bottomZ(const IRotation *rotation) const override
std::unique_ptr< ff::Polyhedron > pimpl
double m_z_bottom
for topZ, bottomZ computation only
void assert_platonic() const
Assertions for Platonic solid.
complex_t formfactor_at_bottom(C3 q) const override
void setPolyhedron(const ff::PolyhedralTopology &topology, double z_bottom, const std::vector< R3 > &vertices)
Called by child classes to set faces and other internal variables.
double volume() const override
std::vector< R3 > m_vertices
IFormFactorPolyhedron(const std::vector< double > &PValues)
The mathematics implemented here is described in full detail in a paper by Joachim Wuttke,...
~IFormFactorPolyhedron() override
double topZ(const IRotation *rotation) const override
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape....
Abstract base class for Born form factors.
Definition: IFormFactor.h:36
Abstract base class for rotations.
Definition: Rotations.h:29