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

Added ScalarRTCoefficients; moved some coefficient members to private; added doxygen comments

parent 69997205
No related branches found
No related tags found
No related merge requests found
......@@ -26,33 +26,16 @@ public:
//! The following functions return the transmitted and reflected amplitudes
//! for different incoming beam polarizations and eigenmodes
Eigen::Vector2cd T1plus() const;
Eigen::Vector2cd R1plus() const;
Eigen::Vector2cd T2plus() const;
Eigen::Vector2cd R2plus() const;
Eigen::Vector2cd T1min() const;
Eigen::Vector2cd R1min() const;
Eigen::Vector2cd T2min() const;
Eigen::Vector2cd R2min() const;
virtual Eigen::Vector2cd T1plus() const=0;
virtual Eigen::Vector2cd R1plus() const=0;
virtual Eigen::Vector2cd T2plus() const=0;
virtual Eigen::Vector2cd R2plus() const=0;
virtual Eigen::Vector2cd T1min() const=0;
virtual Eigen::Vector2cd R1min() const=0;
virtual Eigen::Vector2cd T2min() const=0;
virtual Eigen::Vector2cd R2min() const=0;
Eigen::Vector2cd lambda; // positive eigenvalues of transfer matrix
Eigen::Vector2cd kz; //!< z-part of the two wavevector eigenmodes
Eigen::Vector4cd phi_psi_plus; //!< boundary values for up-polarization
Eigen::Vector4cd phi_psi_min; //!< boundary values for up-polarization
Eigen::Matrix4cd T1m; //!< matrix selecting the transmitted part of
//!< the first eigenmode
Eigen::Matrix4cd R1m; //!< matrix selecting the reflected part of
//!< the first eigenmode
Eigen::Matrix4cd T2m; //!< matrix selecting the transmitted part of
//!< the second eigenmode
Eigen::Matrix4cd R2m; //!< matrix selecting the reflected part of
//!< the second eigenmode
Eigen::Matrix2cd m_scatt_matrix; //!< scattering matrix
complex_t m_a; //!< polarization independent part of scattering matrix
complex_t m_b_mag; //!< magnitude of magnetic interaction term
complex_t m_bz; //!< z-part of magnetic interaction term
double m_kt; //!< wavevector length times thickness of layer for use when
//!< lambda=0
};
......
......@@ -31,17 +31,16 @@ class OpticalFresnel : public ISimulation
//! reflection/transmission Fresnel coefficients
class FresnelCoeff {
public:
FresnelCoeff() : kz(0), r(0), t(0), rb(0), tb(0), X(0), R(0), T(0) {}
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 rb; // r = R/A - Fresnel reflection 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
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;
......
// ************************************************************************** //
//
// BornAgain: simulate and fit scattering at grazing incidence
//
//! @file Algorithms/inc/ScalarRTCoefficients.h
//! @brief Defines class ScalarRTCoefficients.
//!
//! @homepage http://apps.jcns.fz-juelich.de/BornAgain
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2013
//! @authors Scientific Computing Group at MLZ Garching
//! @authors C. Durniak, G. Pospelov, W. Van Herck, J. Wuttke
//
// ************************************************************************** //
#ifndef SCALARRTCOEFFICIENTS_H_
#define SCALARRTCOEFFICIENTS_H_
#include "ILayerRTCoefficients.h"
#include "Types.h"
class ScalarRTCoefficients : public ILayerRTCoefficients
{
public:
ScalarRTCoefficients();
virtual ~ScalarRTCoefficients() {}
//! The following functions return the transmitted and reflected amplitudes
//! for different incoming beam polarizations and eigenmodes
virtual Eigen::Vector2cd T1plus() const;
virtual Eigen::Vector2cd R1plus() const;
virtual Eigen::Vector2cd T2plus() const;
virtual Eigen::Vector2cd R2plus() const;
virtual Eigen::Vector2cd T1min() const;
virtual Eigen::Vector2cd R1min() const;
virtual Eigen::Vector2cd T2min() const;
virtual Eigen::Vector2cd R2min() const;
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
private:
Eigen::Vector2cd m_ones_vector;
};
inline ScalarRTCoefficients::ScalarRTCoefficients()
{
m_ones_vector.setOnes();
}
inline Eigen::Vector2cd ScalarRTCoefficients::T1plus() const
{
return m_ones_vector * T;
}
inline Eigen::Vector2cd ScalarRTCoefficients::R1plus() const
{
return m_ones_vector * R;
}
inline Eigen::Vector2cd ScalarRTCoefficients::T2plus() const
{
return m_ones_vector * T;
}
inline Eigen::Vector2cd ScalarRTCoefficients::R2plus() const
{
return m_ones_vector * R;
}
inline Eigen::Vector2cd ScalarRTCoefficients::T1min() const
{
return m_ones_vector * T;
}
inline Eigen::Vector2cd ScalarRTCoefficients::R1min() const
{
return m_ones_vector * R;
}
inline Eigen::Vector2cd ScalarRTCoefficients::T2min() const
{
return m_ones_vector * T;
}
inline Eigen::Vector2cd ScalarRTCoefficients::R2min() const
{
return m_ones_vector * R;
}
#endif /* SCALARRTCOEFFICIENTS_H_ */
......@@ -43,9 +43,14 @@ public:
Eigen::Vector2cd R1min() const;
Eigen::Vector2cd T2min() const;
Eigen::Vector2cd R2min() const;
// R, T - amplitudes of reflected and transmitted waves
Eigen::Vector2cd lambda; // positive eigenvalues of transfer matrix
Eigen::Vector2cd kz; //!< z-part of the two wavevector eigenmodes
friend class SpecularMagnetic;
private:
void calculateTRMatrices();
void initializeBottomLayerPhiPsi();
void calculateTRWithoutMagnetization();
Eigen::Vector2cd lambda; // positive eigenvalues of transfer matrix
Eigen::Vector4cd phi_psi_plus; //!< boundary values for up-polarization
Eigen::Vector4cd phi_psi_min; //!< boundary values for up-polarization
Eigen::Matrix4cd T1m; //!< matrix selecting the transmitted part of
......@@ -62,11 +67,6 @@ public:
complex_t m_bz; //!< z-part of magnetic interaction term
double m_kt; //!< wavevector length times thickness of layer for use when
//!< lambda=0
friend class SpecularMagnetic;
private:
void calculateTRMatrices();
void initializeBottomLayerPhiPsi();
void calculateTRWithoutMagnetization();
};
//! multi layer coefficients for matrix formalism
......
......@@ -87,7 +87,6 @@ void OpticalFresnel::calculateFresnelCoefficients(const MultiLayer& sample, Mult
if (kzi == complex_t(0, 0) && kziplus1 == complex_t(0, 0)) {
coeff[i].r = complex_t(0, 0);
coeff[i].t = complex_t(1, 0);
coeff[i].rb = complex_t(0, 0);
coeff[i].tb = complex_t(1, 0);
} else {
double sigma = 0.0;
......@@ -105,7 +104,6 @@ void OpticalFresnel::calculateFresnelCoefficients(const MultiLayer& sample, Mult
coeff[i].t = std::sqrt(a*std::sinh(2.*a)*std::sinh(2.*b)/b)
/ std::sinh(a+b);
}
coeff[i].rb = -coeff[i].r;
if (coeff[i].t==complex_t(0.0, 0.0)) {
coeff[i].tb = 2.0;
}
......
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