Grating2D Class Reference

#include <Grating2D.h>

Collaboration diagram for Grating2D:

Collaboration graph
[legend]

List of all members.

Public Member Functions

most important functions
 Grating2D (int)
 initialise the grating:
 ~Grating2D ()
const Grating2Doperator= (Grating2D &)
 assign a grating (includes all layers)
void setParameters (int, double, double, Vector< double >, double, double, double, complex< double >, complex< double >)
 set required parameters needed for the calculations
void setTransPt (Vector< double >, Vector< double >)
 set the transition points of the rows and columns
void setTransPt (void)
 set the transition points to a regular grid
void setRefInd (vector< Matrix< complex< double > > >)
 set the refractive index of all layers
void setIncid (Matrix< complex< double > >, Matrix< complex< double > >)
 set the Fourier coefficients of the incident light
Matrix< complex< double > > getIncid (string)
 get the Fourier coefficients of the incident light
void solve (void)
 solve all layers and calculate S matrix
void setSMatrix (void)
 set the S-matrices (only R_ud, and T_dd) ([2]: equation 13a,b)
complex< double > getReflection (string, int, int)
complex< double > getTransmission (string, int, int)
complex< double > getIncid (string, int, int)
complex< double > calcTransField (double, double, double, string)
 calculate the transmitted field
void calcEfficiencyR (void)
void calcEfficiencyT (void)
void writeField (string, string, string, double, int, int)
 write the field to a file
void writeParameters (string)
 write a file with the Transmission coefficients and one with all parameters (lambda, phi, etc.)
bool getMemsave (void)
 returns TRUE if the memory save mode is on
void setMemsave (bool)
 set the memory save mode
void minimiseMemory (void)
 reduce the memory
get and set parameters
double getSizeX (void)
void setSizeX (double)
double getSizeY (void)
void setSizeY (double)
int getnLayers (void)
 get the number of layers
void setnLayers (int)
 change the number of layers
double getLambda (void)
 incident wavelength in vacuum [my m]
void setLambda (double)
double getTheta (void)
 angle to z-axis (incident angle) [degree]
void setTheta (double)
double getPhi (void)
 angle to x-axis [degree]
void setPhi (double)
complex< double > getN1 (void)
 refractive index of region 1 (incident region)
void setN1 (complex< double >)
complex< double > getN3 (void)
 refractive index of region 3 (transmission region)
void setN3 (complex< double >)
int getnOrds (void)
 number of Fourier orders (for x and y)
void setnOrds (int)
 set number of Fourier orders (for x and y)
complex< double > getR (int, int)
 the (i,j) coefficient of the reflection matrix
complex< double > getT (int, int)
 the (i,j) coefficient of the transmission matrix
complex< double > getAlphaT (int)
 the spatial frequency in x for the halfspace of the transmitted field
complex< double > getBetaT (int)
 the spatial frequency in y for the halfspace of the transmitted field
complex< double > getAlphaR (int)
 the spatial frequency in x for the halfspace of the incident and reflected field
complex< double > getBetaR (int)
 the spatial frequency in y for the halfspace of the incident and reflected field
usually not used externally
void calcAlphaBetaGamma (void)
void calcBoundaryW (void)
 calculate the W_1, W_2 matrices of the halfspaces before and after the element
double delta (int, int)
 returns 1 if i==j and 0 else

Public Attributes

vector< GratingLayer2Dlayer

Protected Attributes

Vector< complex< double > > incid
Vector< complex< double > > trans
Vector< complex< double > > ref
Matrix< complex< double > > efficiencyR
Matrix< complex< double > > efficiencyT

Private Attributes

bool memorysave
 unneeded arrays are deleted if memsave = true
Matrix< complex< double > > R
Matrix< complex< double > > T
Matrix< complex< double > > Q12
Matrix< complex< double > > Q2
Matrix< complex< double > > tau
Matrix< complex< double > > T_tilde
Matrix< complex< double > > R_tilde
Matrix< complex< double > > G
Matrix< complex< double > > W21
Matrix< complex< double > > W23
int nOrds
int nOrdsSq
int nLayers
 number of layers, number of pixels in x and y direction
double periodX
double periodY
double lambda
 the wavelength in vacuum [my m]
double theta
 theta is the angle of the incidentin respective to the z-axis [rad]
double phi
 the angle of the incidentin respective to the x-axis [rad]
double k1
 the wave number in the halfspace of the incident light (=2pi n1/lambda)
double k3
 the wave number in the halfspace behind the element (=2pi n1/lambda)
complex< double > n1
complex< double > n3
Vector< complex< double > > alpha_1
Vector< complex< double > > alpha_3
Vector< complex< double > > beta_1
Vector< complex< double > > beta_3
Vector< complex< double > > gamma_1
Vector< complex< double > > gamma_3
complex< double > mu


Detailed Description

The main class for 2 dimensional gratings Solves the Bloch modes for the layers

References:
===========
[1] Li, JOSA A, Vol.13, No.5, 1996 - Formulation and comparison of two recursive matrix algorithms for modeling diffraction gratings
[2] Li, JOSA A, Vol.20, No.4, 2003 - Note on the S-matrix algorithm
[3] Li, JOSA A, Vol.14, No.10, 1997 - New formulation of the Fourier modal method for crossed surface-relief gratings

Definition at line 36 of file Grating2D.h.


Member Function Documentation

void Grating2D::calcAlphaBetaGamma ( void   ) 

Calculate the spatial frequencies of the halfspaces befor and behind the structure according to [3] equations 11, 14

Definition at line 403 of file Grating2D.cpp.

References alpha_1, alpha_3, beta_1, beta_3, gamma_1, gamma_3, imag(), lambda, n1, n3, nOrds, nOrdsSq, periodX, periodY, phi, real(), and theta.

Referenced by setParameters().

void Grating2D::calcBoundaryW ( void   ) 

calculate the W_1, W_2 matrices of the halfspaces before and after the element

use the same equations which reduce to a very easy form when applying to a homogeneous layer where only the (0,0) Fourier coefficient is != 0

Definition at line 430 of file Grating2D.cpp.

References alpha_3, beta_3, gamma_3, invert(), k1, mu, n3, nOrds, nOrdsSq, and W23.

Referenced by setSMatrix().

double Grating2D::delta ( int  i,
int  j 
)

returns 1 if i==j and 0 else

Definition at line 692 of file Grating2D.cpp.


Member Data Documentation

bool Grating2D::memorysave [private]

unneeded arrays are deleted if memsave = true

for iterative algorithm this might decrease the performance as memory has to be allocated and delocated in each iteration step

Definition at line 43 of file Grating2D.h.

Referenced by getMemsave(), setMemsave(), and setSMatrix().

Matrix< complex<double> > Grating2D::R [private]

Definition at line 49 of file Grating2D.h.

Referenced by getR(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::T [private]

Definition at line 49 of file Grating2D.h.

Referenced by getT(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::Q12 [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::Q2 [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::tau [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::T_tilde [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::R_tilde [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::G [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), operator=(), and setSMatrix().

Matrix< complex<double> > Grating2D::W21 [private]

Definition at line 49 of file Grating2D.h.

Referenced by minimiseMemory(), and operator=().

Matrix< complex<double> > Grating2D::W23 [private]

Definition at line 49 of file Grating2D.h.

Referenced by calcBoundaryW(), minimiseMemory(), operator=(), and setSMatrix().

int Grating2D::nOrds [private]

int Grating2D::nOrdsSq [private]

int Grating2D::nLayers [private]

number of layers, number of pixels in x and y direction

Definition at line 54 of file Grating2D.h.

Referenced by getnLayers(), Grating2D(), minimiseMemory(), setMemsave(), setnLayers(), setParameters(), setRefInd(), setSizeX(), setSizeY(), setSMatrix(), setTransPt(), and solve().

double Grating2D::periodX [private]

double Grating2D::periodY [private]

double Grating2D::lambda [private]

the wavelength in vacuum [my m]

Definition at line 59 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), getLambda(), setLambda(), setN1(), setN3(), setParameters(), setSMatrix(), and writeParameters().

double Grating2D::theta [private]

theta is the angle of the incidentin respective to the z-axis [rad]

Definition at line 61 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), getTheta(), setParameters(), setSMatrix(), setTheta(), and writeParameters().

double Grating2D::phi [private]

the angle of the incidentin respective to the x-axis [rad]

Definition at line 63 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), getPhi(), setParameters(), setPhi(), setSMatrix(), and writeParameters().

double Grating2D::k1 [private]

the wave number in the halfspace of the incident light (=2pi n1/lambda)

Definition at line 65 of file Grating2D.h.

Referenced by calcBoundaryW(), calcEfficiencyR(), operator=(), setIncid(), setLambda(), and setN1().

double Grating2D::k3 [private]

the wave number in the halfspace behind the element (=2pi n1/lambda)

Definition at line 67 of file Grating2D.h.

Referenced by calcEfficiencyT(), operator=(), setLambda(), and setN3().

complex<double> Grating2D::n1 [private]

complex<double> Grating2D::n3 [private]

Definition at line 71 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), calcBoundaryW(), getN3(), setLambda(), setN3(), and writeParameters().

Vector< complex<double> > Grating2D::alpha_1 [private]

Definition at line 74 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), calcEfficiencyR(), getAlphaR(), operator=(), and setIncid().

Vector< complex<double> > Grating2D::alpha_3 [private]

Vector< complex<double> > Grating2D::beta_1 [private]

Definition at line 74 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), calcEfficiencyR(), getBetaR(), operator=(), and setIncid().

Vector< complex<double> > Grating2D::beta_3 [private]

Vector< complex<double> > Grating2D::gamma_1 [private]

Definition at line 74 of file Grating2D.h.

Referenced by calcAlphaBetaGamma(), calcEfficiencyR(), operator=(), and setIncid().

Vector< complex<double> > Grating2D::gamma_3 [private]

complex<double> Grating2D::mu [private]

Definition at line 77 of file Grating2D.h.

Referenced by calcBoundaryW(), and Grating2D().

Vector< complex<double> > Grating2D::incid [protected]

Definition at line 83 of file Grating2D.h.

Referenced by getIncid(), operator=(), setIncid(), and setSMatrix().

Vector< complex<double> > Grating2D::trans [protected]

Definition at line 84 of file Grating2D.h.

Referenced by calcTransField(), getTransmission(), operator=(), setSMatrix(), and writeParameters().

Vector< complex<double> > Grating2D::ref [protected]

Definition at line 85 of file Grating2D.h.

Referenced by getReflection(), operator=(), setSMatrix(), and writeParameters().

Matrix< complex<double> > Grating2D::efficiencyR [protected]

Definition at line 86 of file Grating2D.h.

Referenced by calcEfficiencyR(), and operator=().

Matrix< complex<double> > Grating2D::efficiencyT [protected]

Definition at line 86 of file Grating2D.h.

Referenced by calcEfficiencyT(), and operator=().


The documentation for this class was generated from the following files:

Generated on Thu May 7 16:28:04 2009 for FMM by  doxygen 1.5.5