BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ISpecularStrategy.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/Specular/ISpecularStrategy.h
6 //! @brief Defines and implements class ISpecularStrategy.
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 #ifdef SWIG
16 #error no need to expose this header to Swig
17 #endif
18 
19 #ifndef USER_API
20 #ifndef BORNAGAIN_SAMPLE_SPECULAR_ISPECULARSTRATEGY_H
21 #define BORNAGAIN_SAMPLE_SPECULAR_ISPECULARSTRATEGY_H
22 
23 #include "Base/Vector/EigenCore.h"
24 #include "Base/Vector/Vectors3D.h"
25 #include <memory>
26 #include <variant>
27 #include <vector>
28 
30 class Slice;
31 
32 //! Interface for the Fresnel computations, both in the scalar and magnetic case
33 //!
34 //! Inherited by SpecularScalarStrategy, SpecularMagneticOldStrategy,
35 //! SpecularMagneticStrategy, SpecularMagneticNewStrategy
36 
37 //! @ingroup algorithms_internal
38 
40 public:
41  ISpecularStrategy() = default;
42  virtual ~ISpecularStrategy() = default;
43  ISpecularStrategy(const ISpecularStrategy& other) = delete;
44 
45  using coeffs_t = std::vector<std::unique_ptr<const ILayerRTCoefficients>>;
46 
47  virtual coeffs_t Execute(const std::vector<Slice>& slices, const kvector_t& k) const = 0;
48 
49  virtual coeffs_t Execute(const std::vector<Slice>& slices,
50  const std::vector<complex_t>& kz) const = 0;
51 
52  virtual std::variant<complex_t, Eigen::Matrix2cd>
53  computeTopLayerR(const std::vector<Slice>& slices, const std::vector<complex_t>& kz) const = 0;
54 };
55 
56 #endif // BORNAGAIN_SAMPLE_SPECULAR_ISPECULARSTRATEGY_H
57 #endif // USER_API
Include to deal with Eigen alignment centrally.
Defines basic vectors in Z^3, R^3, C^3.
Interface to access reflection/transmission coefficients.
Interface for the Fresnel computations, both in the scalar and magnetic case.
virtual std::variant< complex_t, Eigen::Matrix2cd > computeTopLayerR(const std::vector< Slice > &slices, const std::vector< complex_t > &kz) const =0
virtual ~ISpecularStrategy()=default
virtual coeffs_t Execute(const std::vector< Slice > &slices, const kvector_t &k) const =0
virtual coeffs_t Execute(const std::vector< Slice > &slices, const std::vector< complex_t > &kz) const =0
ISpecularStrategy(const ISpecularStrategy &other)=delete
ISpecularStrategy()=default
std::vector< std::unique_ptr< const ILayerRTCoefficients > > coeffs_t
Data structure containing the data of a single slice, for calculating the Fresnel coefficients.
Definition: Slice.h:32