BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
FormFactorBAPol.cpp
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Scattering/FormFactorBAPol.cpp
6 //! @brief Defines class FormFactorBAPol.
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 #include <stdexcept>
18 
20  : mP_form_factor(form_factor.clone())
21 {
22  setName("FormFactorBAPol");
23 }
24 
26 
28 {
29  return new FormFactorBAPol(*mP_form_factor);
30 }
31 
33 {
34  throw std::runtime_error("FormFactorBAPol::evaluate: "
35  "should never be called for matrix interactions");
36 }
37 
38 Eigen::Matrix2cd FormFactorBAPol::evaluatePol(const WavevectorInfo& wavevectors) const
39 {
40  Eigen::Matrix2cd ff_BA = mP_form_factor->evaluatePol(wavevectors);
41  Eigen::Matrix2cd result;
42  result(0, 0) = -ff_BA(1, 0);
43  result(0, 1) = ff_BA(0, 0);
44  result(1, 0) = -ff_BA(1, 1);
45  result(1, 1) = ff_BA(0, 1);
46  return result;
47 }
48 
49 double FormFactorBAPol::bottomZ(const IRotation& rotation) const
50 {
51  return mP_form_factor->bottomZ(rotation);
52 }
53 
54 double FormFactorBAPol::topZ(const IRotation& rotation) const
55 {
56  return mP_form_factor->topZ(rotation);
57 }
std::complex< double > complex_t
Definition: Complex.h:20
Defines class FormFactorBAPol.
Defines WavevectorInfo.
Evaluates the matrix BA term in a polarized IFormFactor.
double topZ(const IRotation &rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
FormFactorBAPol * clone() const override
Returns a clone of this ISample object.
double bottomZ(const IRotation &rotation) const override
Returns the z-coordinate of the lowest point in this shape after a given rotation.
~FormFactorBAPol() override
complex_t evaluate(const WavevectorInfo &wavevectors) const override
Throws not-implemented exception.
Eigen::Matrix2cd evaluatePol(const WavevectorInfo &wavevectors) const override
Calculates and returns a polarized form factor calculation in BA.
std::unique_ptr< IFormFactor > mP_form_factor
The form factor for BA.
FormFactorBAPol(const IFormFactor &form_factor)
Pure virtual base class for all form factors.
Definition: IFormFactor.h:40
void setName(const std::string &name)
Pure virtual interface for rotations.
Definition: Rotations.h:27
Holds all wavevector information relevant for calculating form factors.