BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularMagneticStrategy.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Sample/Specular/SpecularMagneticStrategy.h
6 //! @brief Defines class SpecularMagneticStrategy.
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 BORNAGAIN_CORE_MULTILAYER_SPECULARMAGNETICSTRATEGY_H
16 #define BORNAGAIN_CORE_MULTILAYER_SPECULARMAGNETICSTRATEGY_H
17 
20 #include <memory>
21 #include <vector>
22 
23 class Slice;
24 
25 //! Implements the magnetic Fresnel computation without roughness
26 //!
27 //! Implements the matrix formalism for the calculation of wave amplitudes of
28 //! the coherent wave solution in a multilayer with magnetization.
29 //! For a detailed description see internal document "Polarized Specular Reflectometry"
30 //!
31 //! @ingroup algorithms_internal
33 {
34 public:
35  //! Computes refraction angle reflection/transmission coefficients
36  //! for given sliced multilayer and wavevector k
37  ISpecularStrategy::coeffs_t Execute(const std::vector<Slice>& slices, const kvector_t& k) const;
38 
39  //! Computes refraction angle reflection/transmission coefficients
40  //! for given sliced multilayer and a set of kz projections corresponding to each slice
41  ISpecularStrategy::coeffs_t Execute(const std::vector<Slice>& slices,
42  const std::vector<complex_t>& kz) const;
43 
44 private:
45  static std::vector<MatrixRTCoefficients_v2> computeTR(const std::vector<Slice>& slices,
46  const std::vector<complex_t>& kzs);
47 
48  //! Computes frobenius matrices for multilayer solution
49  static void calculateTR(MatrixRTCoefficients_v2& coeff);
51 
52  static void setNoTransmission(MatrixRTCoefficients_v2& coeff);
53 
54  //! initializes reflectionless bottom boundary condition.
56 
57  //! Propagates boundary conditions from the bottom to the top of the layer stack.
58  //! Used to compute boundary conditions from the bottom one (with nullified reflection)
59  //! simultaneously propagates amplitudes forward again
60  //! Due to the use of temporary objects this is combined into one function now
61  static void propagateBackwardsForwards(std::vector<MatrixRTCoefficients_v2>& coeff,
62  const std::vector<Slice>& slices);
63 
64  //! finds linear coefficients for normalizing transmitted wave to unity.
65  //! The left column of the returned matrix corresponds to the coefficients for pure spin-up
66  //! wave, while the right column - to the coefficients for the spin-down one.
67  static std::pair<Eigen::Matrix2cd, complex_t>
69 };
70 
71 #endif // BORNAGAIN_CORE_MULTILAYER_SPECULARMAGNETICSTRATEGY_H
Defines and implements class ISpecularStrategy.
Defines class MatrixRTCoefficients_v2.
Interface for the Fresnel computations, both in the scalar and magnetic case.
std::vector< std::unique_ptr< const ILayerRTCoefficients > > coeffs_t
Specular reflection and transmission coefficients in a layer in case of magnetic interactions between...
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:28
Implements the magnetic Fresnel computation without roughness.
static void calculateZeroFieldTR(MatrixRTCoefficients_v2 &coeff)
static std::vector< MatrixRTCoefficients_v2 > computeTR(const std::vector< Slice > &slices, const std::vector< complex_t > &kzs)
static void nullifyBottomReflection(MatrixRTCoefficients_v2 &coeff)
initializes reflectionless bottom boundary condition.
static void setNoTransmission(MatrixRTCoefficients_v2 &coeff)
ISpecularStrategy::coeffs_t Execute(const std::vector< Slice > &slices, const kvector_t &k) const
Computes refraction angle reflection/transmission coefficients for given sliced multilayer and waveve...
static void calculateTR(MatrixRTCoefficients_v2 &coeff)
Computes frobenius matrices for multilayer solution.
static void propagateBackwardsForwards(std::vector< MatrixRTCoefficients_v2 > &coeff, const std::vector< Slice > &slices)
Propagates boundary conditions from the bottom to the top of the layer stack.
static std::pair< Eigen::Matrix2cd, complex_t > findNormalizationCoefficients(const MatrixRTCoefficients_v2 &coeff)
finds linear coefficients for normalizing transmitted wave to unity.