Skip to content
Snippets Groups Projects
Commit 18531a98 authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Replaced nested FresnelCoeff in OpticalFresnel by ScalarRTCoefficients

parent 89a860af
No related branches found
No related tags found
No related merge requests found
......@@ -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;
};
......
......@@ -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;
};
......
......@@ -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_ */
......@@ -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 \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment