BornAgain  1.18.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 scattering at grazing incidence
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 #ifndef BORNAGAIN_CORE_RT_ILAYERRTCOEFFICIENTS_H
16 #define BORNAGAIN_CORE_RT_ILAYERRTCOEFFICIENTS_H
17 
18 #include "Base/Types/Complex.h"
19 #include "Base/Types/Exceptions.h"
20 #include "Base/Vector/EigenCore.h"
21 
22 //! Interface to access reflection/transmission coefficients.
23 //! @ingroup algorithms_internal
24 
26 {
27 public:
28  virtual ~ILayerRTCoefficients() {}
29 
30  virtual ILayerRTCoefficients* clone() const = 0;
31 
32 #ifndef SWIG
33  //! The following functions return the transmitted and reflected amplitudes
34  //! for different incoming beam polarizations and eigenmodes
35  virtual Eigen::Vector2cd T1plus() const = 0;
36  virtual Eigen::Vector2cd R1plus() const = 0;
37  virtual Eigen::Vector2cd T2plus() const = 0;
38  virtual Eigen::Vector2cd R2plus() const = 0;
39  virtual Eigen::Vector2cd T1min() const = 0;
40  virtual Eigen::Vector2cd R1min() const = 0;
41  virtual Eigen::Vector2cd T2min() const = 0;
42  virtual Eigen::Vector2cd R2min() const = 0;
43  //! Returns z-part of the two wavevector eigenmodes
44  virtual Eigen::Vector2cd getKz() const = 0;
45  //! Scalar value getters; these throw errors by default as they should only
46  //! be used when the derived object is really scalar
47 #endif
48  virtual complex_t getScalarT() const
49  {
50  throw Exceptions::NotImplementedException("ILayerRTCoefficients::"
51  "getScalarT(): coefficients are not scalar.");
52  }
53  virtual complex_t getScalarR() const
54  {
55  throw Exceptions::NotImplementedException("ILayerRTCoefficients::"
56  "getScalarR(): coefficients are not scalar.");
57  }
58  virtual complex_t getScalarKz() const
59  {
60  throw Exceptions::NotImplementedException("ILayerRTCoefficients::"
61  "getScalarKz(): coefficients are not scalar.");
62  }
63 
64  virtual Eigen::Matrix2cd getReflectionMatrix() const
65  {
66  throw Exceptions::NotImplementedException("Only defined for Matrix coefficeints");
67  }
68 };
69 
70 #endif // BORNAGAIN_CORE_RT_ILAYERRTCOEFFICIENTS_H
Defines complex_t, and a few elementary functions.
std::complex< double > complex_t
Definition: Complex.h:20
Include to deal with Eigen alignment centrally.
Defines many exception classes in namespace Exceptionss.
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