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
15
#include "
Sample/HardParticle/IFormFactorPrism.h
"
16
#include "
Sample/HardParticle/Prism.h
"
17
18
IFormFactorPrism::IFormFactorPrism
(
const
NodeMeta
& meta,
const
std::vector<double>& PValues)
19
:
IFormFactorBorn
(meta, PValues)
20
{
21
}
22
23
IFormFactorPrism::~IFormFactorPrism
() =
default
;
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.
41
double
IFormFactorPrism::volume
()
const
42
{
43
return
height
() *
pimpl
->area();
44
}
45
46
double
IFormFactorPrism::getHeight
()
const
47
{
48
return
height
();
49
}
50
double
IFormFactorPrism::radialExtension
()
const
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
57
complex_t
IFormFactorPrism::evaluate_for_q
(
cvector_t
q)
const
58
{
59
return
pimpl
->evaluate_for_q(q);
60
}
complex_t
std::complex< double > complex_t
Definition:
Complex.h:20
IFormFactorPrism.h
Defines class IFormFactorPrism.
Prism.h
Defines class Prism.
BasicVector3D< std::complex< double > >
IFormFactorBorn
Pure virtual base class for Born form factors.
Definition:
IFormFactorBorn.h:32
IFormFactorBorn::TopZ
static double TopZ(const std::vector< kvector_t > &vertices, const IRotation &rotation)
Calculates the z-coordinate of the highest vertex after rotation.
Definition:
IFormFactorBorn.cpp:111
IFormFactorBorn::BottomZ
static double BottomZ(const std::vector< kvector_t > &vertices, const IRotation &rotation)
Calculates the z-coordinate of the lowest vertex after rotation.
Definition:
IFormFactorBorn.cpp:103
IFormFactorPrism::topZ
double topZ(const IRotation &rotation) const override final
Returns the z-coordinate of the lowest point in this shape after a given rotation.
Definition:
IFormFactorPrism.cpp:35
IFormFactorPrism::radialExtension
double radialExtension() const override
Returns the (approximate in some cases) radial size of the particle of this form factor's shape.
Definition:
IFormFactorPrism.cpp:50
IFormFactorPrism::height
virtual double height() const =0
IFormFactorPrism::bottomZ
double bottomZ(const IRotation &rotation) const override final
Returns the z-coordinate of the lowest point in this shape after a given rotation.
Definition:
IFormFactorPrism.cpp:30
IFormFactorPrism::getHeight
double getHeight() const
Definition:
IFormFactorPrism.cpp:46
IFormFactorPrism::IFormFactorPrism
IFormFactorPrism(const NodeMeta &meta, const std::vector< double > &PValues)
Definition:
IFormFactorPrism.cpp:18
IFormFactorPrism::volume
double volume() const override
Returns the volume of this prism.
Definition:
IFormFactorPrism.cpp:41
IFormFactorPrism::pimpl
std::unique_ptr< Prism > pimpl
Definition:
IFormFactorPrism.h:44
IFormFactorPrism::~IFormFactorPrism
~IFormFactorPrism()
IFormFactorPrism::setPrism
void setPrism(bool symmetry_Ci, const std::vector< kvector_t > &vertices)
Definition:
IFormFactorPrism.cpp:25
IFormFactorPrism::evaluate_for_q
complex_t evaluate_for_q(cvector_t q) const override
Returns the form factor F(q) of this polyhedron, respecting the offset height/2.
Definition:
IFormFactorPrism.cpp:57
IRotation
Pure virtual interface for rotations.
Definition:
Rotations.h:27
NodeMeta
Metadata of one model node.
Definition:
INode.h:37
Sample
HardParticle
IFormFactorPrism.cpp
Generated by
1.9.1