BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ComputeBAPol.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/FFCompute/ComputeBAPol.cpp
6 //! @brief Defines class ComputeBAPol.
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 
21 ComputeBAPol::~ComputeBAPol() = default;
22 
24 {
25  return new ComputeBAPol(*m_ff);
26 }
27 
29 {
30  throw std::runtime_error("ComputeBAPol::evaluate: "
31  "should never be called for matrix interactions");
32 }
33 
34 Eigen::Matrix2cd ComputeBAPol::evaluatePol(const WavevectorInfo& wavevectors) const
35 {
36  Eigen::Matrix2cd ff_BA = m_ff->evaluatePol(wavevectors);
37  Eigen::Matrix2cd result;
38  result(0, 0) = -ff_BA(1, 0);
39  result(0, 1) = ff_BA(0, 0);
40  result(1, 0) = -ff_BA(1, 1);
41  result(1, 1) = ff_BA(0, 1);
42  return result;
43 }
std::complex< double > complex_t
Definition: Complex.h:20
Defines class ComputeBAPol.
Defines WavevectorInfo.
Provides polarized form factor evaluation in Born Approximation for given IFormFactor.
Definition: ComputeBAPol.h:31
complex_t evaluate(const WavevectorInfo &wavevectors) const override
Throws not-implemented exception.
~ComputeBAPol() override
Eigen::Matrix2cd evaluatePol(const WavevectorInfo &wavevectors) const override
Calculates and returns a polarized form factor calculation in BA.
ComputeBAPol * clone() const override
ComputeBAPol(const IFormFactor &ff)
Abstract base class for form factor evaluations.
Definition: IComputeFF.h:39
std::unique_ptr< IFormFactor > m_ff
Definition: IComputeFF.h:64
Abstract base class for all form factors.
Definition: IFormFactor.h:36
Holds all wavevector information relevant for calculating form factors.