BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
IFormFactorPrism.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/HardParticle/IFormFactorPrism.cpp
6 //! @brief Implements class IFormFactorPrism.
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 
17 
18 IFormFactorPrism::IFormFactorPrism(const NodeMeta& meta, const std::vector<double>& PValues)
19  : IFormFactorBorn(meta, PValues)
20 {
21 }
22 
24 
25 void IFormFactorPrism::setPrism(bool symmetry_Ci, const std::vector<kvector_t>& vertices)
26 {
27  pimpl = std::make_unique<Prism>(symmetry_Ci, height(), vertices);
28 }
29 
30 double IFormFactorPrism::bottomZ(const IRotation& rotation) const
31 {
32  return BottomZ(pimpl->vertices(), rotation);
33 }
34 
35 double IFormFactorPrism::topZ(const IRotation& rotation) const
36 {
37  return TopZ(pimpl->vertices(), rotation);
38 }
39 
40 //! Returns the volume of this prism.
42 {
43  return height() * pimpl->area();
44 }
45 
47 {
48  return height();
49 }
51 {
52  return std::sqrt(pimpl->area());
53 }
54 
55 //! Returns the form factor F(q) of this polyhedron, respecting the offset height/2.
56 
58 {
59  return pimpl->evaluate_for_q(q);
60 }
std::complex< double > complex_t
Definition: Complex.h:20
Defines class IFormFactorPrism.
Defines class Prism.
Pure virtual base class for Born form factors.
static double TopZ(const std::vector< kvector_t > &vertices, const IRotation &rotation)
Calculates the z-coordinate of the highest vertex after rotation.
static double BottomZ(const std::vector< kvector_t > &vertices, const IRotation &rotation)
Calculates the z-coordinate of the lowest vertex after rotation.
double topZ(const IRotation &rotation) const override final
Returns the z-coordinate of the lowest point in this shape after a given rotation.
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
virtual double height() const =0
double bottomZ(const IRotation &rotation) const override final
Returns the z-coordinate of the lowest point in this shape after a given rotation.
double getHeight() const
IFormFactorPrism(const NodeMeta &meta, const std::vector< double > &PValues)
double volume() const override
Returns the volume of this prism.
std::unique_ptr< Prism > pimpl
void setPrism(bool symmetry_Ci, const std::vector< kvector_t > &vertices)
complex_t evaluate_for_q(cvector_t q) const override
Returns the form factor F(q) of this polyhedron, respecting the offset height/2.
Pure virtual interface for rotations.
Definition: Rotations.h:27
Metadata of one model node.
Definition: INode.h:37