diff --git a/Core/Algorithms/inc/ILayerRTCoefficients.h b/Core/Algorithms/inc/ILayerRTCoefficients.h index 88617964fc9353d124bf875a30c8e9a7b73bc85a..33848b74848d2e8098ba691cb88f5740db305ee7 100644 --- a/Core/Algorithms/inc/ILayerRTCoefficients.h +++ b/Core/Algorithms/inc/ILayerRTCoefficients.h @@ -21,7 +21,6 @@ class ILayerRTCoefficients { public: - ILayerRTCoefficients(); virtual ~ILayerRTCoefficients() {} //! The following functions return the transmitted and reflected amplitudes @@ -34,8 +33,8 @@ public: virtual Eigen::Vector2cd R1min() const=0; virtual Eigen::Vector2cd T2min() const=0; virtual Eigen::Vector2cd R2min() const=0; - - Eigen::Vector2cd kz; //!< z-part of the two wavevector eigenmodes + //! Returns z-part of the two wavevector eigenmodes + virtual Eigen::Vector2cd getKz() const=0; }; diff --git a/Core/Algorithms/inc/OpticalFresnel.h b/Core/Algorithms/inc/OpticalFresnel.h index 8b2d379b292e8e56c3d1099fa348548dd6b05ddc..215961daaf678bae7019cfe37f890f4ae8725ecc 100644 --- a/Core/Algorithms/inc/OpticalFresnel.h +++ b/Core/Algorithms/inc/OpticalFresnel.h @@ -20,6 +20,7 @@ #include "Types.h" #include "ISimulation.h" #include "MultiLayer.h" +#include "ScalarRTCoefficients.h" //! Optical Fresnel coefficients. @@ -29,47 +30,54 @@ class OpticalFresnel : public ISimulation OpticalFresnel() : m_use_roughness(false) {} //! reflection/transmission Fresnel coefficients - class FresnelCoeff { - public: - FresnelCoeff() : kz(0), r(0), t(0), tb(0), X(0), R(0), T(0) {} - ~FresnelCoeff() {} - // A - amplitude of initial wave, R, T - amplitudes of reflected and transmitted waves - complex_t kz; //!< z-component of the wavevector in given layer - complex_t r; //!< r = R/A - Fresnel reflection coefficient - complex_t t; //!< t = T/A - Fresnel transmission coefficient - complex_t tb; //!< t = T/A - Fresnel transmission coefficient - complex_t X; //!< ratio of amplitudes R/T of the outgoing to the incoming waves in layer - complex_t R; //!< amplitude of the reflected wave in layer - complex_t T; //!< amplitude of the transmitted wave in layer - - //! operator is necessary to make pyplusplus/boost happy during exposing of FresnelCoeff to python using boost::vector_indexing_suite - bool operator==(FresnelCoeff const& other) const; - }; - +// class FresnelCoeff { +// public: +// FresnelCoeff() : kz(0), r(0), t(0), tb(0), X(0), R(0), T(0) {} +// ~FresnelCoeff() {} +// // A - amplitude of initial wave, R, T - amplitudes of reflected and +// // transmitted waves +// complex_t kz; //!< z-component of the wavevector in given layer +// complex_t r; //!< r = R/A - Fresnel reflection coefficient +// complex_t t; //!< t = T/A - Fresnel transmission coefficient +// complex_t tb; //!< t = T/A - Fresnel transmission coefficient +// complex_t X; //!< ratio of amplitudes R/T of the outgoing to the +// //!< incoming waves in layer +// complex_t R; //!< amplitude of the reflected wave in layer +// complex_t T; //!< amplitude of the transmitted wave in layer +// +// //! operator is necessary to make pyplusplus/boost happy during exposing +// //! of FresnelCoeff to python using boost::vector_indexing_suite +// bool operator==(FresnelCoeff const& other) const; +// }; +// //! collection of Fresnel coefficients for multi layer class MultiLayerCoeff { public: - inline FresnelCoeff& operator[](size_t i) { return m_data[i]; } - inline const FresnelCoeff& operator[](size_t i) const { return m_data[i]; } + inline ScalarRTCoefficients& operator[](size_t i) { return m_data[i]; } + inline const ScalarRTCoefficients& operator[](size_t i) const { + return m_data[i]; + } inline size_t size() const { return m_data.size(); } inline void clear() { m_data.clear(); } inline void resize(size_t size) { m_data.resize(size); } private: - std::vector<FresnelCoeff > m_data; + std::vector<ScalarRTCoefficients > m_data; }; - //typedef std::vector<FresnelCoeff > MultiLayerCoeff_t; // set of Fresnel coefficients for set of layers, [nlayer] - typedef MultiLayerCoeff MultiLayerCoeff_t; // set of Fresnel coefficients for set of layers, [nlayer] - + //! set of Fresnel coefficients for set of layers, [nlayer] + typedef MultiLayerCoeff MultiLayerCoeff_t; //! Returns Fresnel coefficients for given multi layer and kvector - void execute(const MultiLayer& sample, const kvector_t& k, MultiLayerCoeff_t& coeff); + void execute(const MultiLayer& sample, const kvector_t& k, + MultiLayerCoeff_t& coeff); private: bool m_use_roughness; - void calculateKZ(const MultiLayer& sample, const kvector_t& k, MultiLayerCoeff_t& coeff) const; - void calculateFresnelCoefficients(const MultiLayer& sample, MultiLayerCoeff_t& coeff) const; + void calculateKZ(const MultiLayer& sample, const kvector_t& k, + MultiLayerCoeff_t& coeff) const; + void calculateFresnelCoefficients(const MultiLayer& sample, + MultiLayerCoeff_t& coeff) const; void calculateX(const MultiLayer& sample, MultiLayerCoeff_t& coeff) const; void calculateRT(const MultiLayer& sample, MultiLayerCoeff_t& coeff) const; }; diff --git a/Core/Algorithms/inc/ScalarRTCoefficients.h b/Core/Algorithms/inc/ScalarRTCoefficients.h index 0694abb1a2787e456f861dead5a0eae19c36abc7..82bbda7dc1049cec41cfc67f1a6674ea4d66a1c5 100644 --- a/Core/Algorithms/inc/ScalarRTCoefficients.h +++ b/Core/Algorithms/inc/ScalarRTCoefficients.h @@ -35,6 +35,8 @@ public: virtual Eigen::Vector2cd R1min() const; virtual Eigen::Vector2cd T2min() const; virtual Eigen::Vector2cd R2min() const; + //! Returns z-part of the two wavevector eigenmodes + virtual Eigen::Vector2cd getKz() const; complex_t kz; //!< z-component of the wavevector in given layer complex_t r; //!< r = R/A - Fresnel reflection coefficient @@ -49,6 +51,7 @@ private: }; inline ScalarRTCoefficients::ScalarRTCoefficients() +: kz(0), r(0), t(0), tb(0), X(0), R(0), T(0) { m_ones_vector.setOnes(); } @@ -93,4 +96,9 @@ inline Eigen::Vector2cd ScalarRTCoefficients::R2min() const return m_ones_vector * R; } +inline Eigen::Vector2cd ScalarRTCoefficients::getKz() const +{ + return m_ones_vector * kz; +} + #endif /* SCALARRTCOEFFICIENTS_H_ */ diff --git a/Core/Core.pro b/Core/Core.pro index ea2c8210dbf7a6f25a06f8a3fd44c166736a8f98..be5bd7552005070dc3644489d03d3e716b8ae35d 100644 --- a/Core/Core.pro +++ b/Core/Core.pro @@ -230,6 +230,7 @@ HEADERS += \ Algorithms/inc/MultiLayerRoughnessDWBASimulation.h \ Algorithms/inc/OpticalFresnel.h \ Algorithms/inc/ResolutionFunction2DSimple.h \ + Algorithms/inc/ScalarRTCoefficients.h \ Algorithms/inc/Simulation.h \ Algorithms/inc/SimulationParameters.h \ Algorithms/inc/SizeSpacingCorrelationApproximationStrategy.h \