BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ILayerRTCoefficients.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file Sample/RT/ILayerRTCoefficients.h
6 //! @brief Defines and implements class ILayerRTCoefficients.
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_RT_ILAYERRTCOEFFICIENTS_H
21 #define BORNAGAIN_SAMPLE_RT_ILAYERRTCOEFFICIENTS_H
22 
23 #include "Base/Types/Complex.h"
24 #include "Base/Vector/EigenCore.h"
25 
26 //! Interface to access reflection/transmission coefficients.
27 //! @ingroup algorithms_internal
28 
30 public:
31  virtual ~ILayerRTCoefficients() {}
32 
33  virtual ILayerRTCoefficients* clone() const = 0;
34 
35 #ifndef SWIG
36  //! The following functions return the transmitted and reflected amplitudes
37  //! for different incoming beam polarizations and eigenmodes
38  virtual Eigen::Vector2cd T1plus() const = 0;
39  virtual Eigen::Vector2cd R1plus() const = 0;
40  virtual Eigen::Vector2cd T2plus() const = 0;
41  virtual Eigen::Vector2cd R2plus() const = 0;
42  virtual Eigen::Vector2cd T1min() const = 0;
43  virtual Eigen::Vector2cd R1min() const = 0;
44  virtual Eigen::Vector2cd T2min() const = 0;
45  virtual Eigen::Vector2cd R2min() const = 0;
46  //! Returns z-part of the two wavevector eigenmodes
47  virtual Eigen::Vector2cd getKz() const = 0;
48  //! Scalar value getters; these throw errors by default as they should only
49  //! be used when the derived object is really scalar
50 #endif
51  virtual complex_t getScalarT() const
52  {
53  throw std::runtime_error("ILayerRTCoefficients::"
54  "getScalarT(): coefficients are not scalar.");
55  }
56  virtual complex_t getScalarR() const
57  {
58  throw std::runtime_error("ILayerRTCoefficients::"
59  "getScalarR(): coefficients are not scalar.");
60  }
61  virtual complex_t getScalarKz() const
62  {
63  throw std::runtime_error("ILayerRTCoefficients::"
64  "getScalarKz(): coefficients are not scalar.");
65  }
66 
67  virtual Eigen::Matrix2cd getReflectionMatrix() const
68  {
69  throw std::runtime_error("Only defined for Matrix coefficeints");
70  }
71 };
72 
73 #endif // BORNAGAIN_SAMPLE_RT_ILAYERRTCOEFFICIENTS_H
74 #endif // USER_API
Defines complex_t, and a few elementary functions.
std::complex< double > complex_t
Definition: Complex.h:20
Include to deal with Eigen alignment centrally.
Interface to access reflection/transmission coefficients.
virtual Eigen::Matrix2cd getReflectionMatrix() const
virtual Eigen::Vector2cd T1plus() const =0
The following functions return the transmitted and reflected amplitudes for different incoming beam p...
virtual ILayerRTCoefficients * clone() const =0
virtual Eigen::Vector2cd R2plus() const =0
virtual Eigen::Vector2cd R1min() const =0
virtual complex_t getScalarT() const
Scalar value getters; these throw errors by default as they should only be used when the derived obje...
virtual Eigen::Vector2cd getKz() const =0
Returns z-part of the two wavevector eigenmodes.
virtual Eigen::Vector2cd R2min() const =0
virtual Eigen::Vector2cd R1plus() const =0
virtual Eigen::Vector2cd T1min() const =0
virtual Eigen::Vector2cd T2plus() const =0
virtual complex_t getScalarKz() const
virtual complex_t getScalarR() const
virtual Eigen::Vector2cd T2min() const =0