#include <Grating1D.h>
Public Member Functions | |
Most important functions | |
Grating (int truncation, int layers, int nSegments) | |
constructor | |
~Grating () | |
destructor | |
void | setParameters (double, double, double, complex< double >, complex< double >, complex< double >, double, Vector< complex< double > >, string) |
set various parameters in grating needed for the calculations | |
void | initLayers (string, string, string) |
initialise the grating layers from a file | |
void | initLayers (F_Matrix< int >, Vector< double >, string) |
initialise the layers with an array of material numbers | |
void | initLayers (F_Matrix< complex< double > >, Vector< double >) |
initialise the layers with an array of complex indices | |
void | solve (string) |
solve the grating after having solved the eigenvalue equations of each layer | |
void | calcIntField (int, int) |
if solved by T-Matrix approach: calculate the internal field | |
void | calcExtField (int, int, double, double, double) |
calculate the external field | |
void | calcEmbField (int, int, double, double, double) |
calculate the external field after using the field stitching technique (absorbing padding) | |
complex< double > | getIntField (double, double) |
calculate the field at a certain point | |
complex< double > | getExtField (double, double) |
calculate the external transmitted field at a certain point | |
complex< double > | getEmbExtField (double, double) |
calculate the external field form the Fourier coefficients obtained with the field stitching method | |
void | writeField (string) |
write the Field amplitudes to a file | |
void | calcTransEmb (double embSize, int embOrd) |
calculate the transmission coefficients from the original ones in an absorbing embedding (0 transmission) using the field stitching technique | |
double | getEfficiencyR (int) |
efficiencies of the reflected modes | |
double | getEfficiencyT (int) |
efficiencies of the transmitted modes | |
complex< double > | getTrans (int) |
transmision modes | |
complex< double > | getRef (int) |
reflected modes | |
void | calcIncid (Vector< complex< double > >, int) |
calculate the Fourier orders of a field distribution (currently not working) | |
void | changeRefInd (int, int, complex< double >) |
set the refractive index of one pixel of the grating | |
void | changeMaterial (int slab, int segment, int mat) |
set the material of one pixel of the grating | |
void | addFrame (complex< double >, double) |
add an additional frame to the grating | |
void | writeParameters (string) |
write most parameters to a file | |
Get and set parameters | |
void | setTheta (double) |
set angle of incidence | |
double | getTheta () |
get angle of incidence | |
void | setLambda (double) |
set incident wavelength in vacuum | |
double | getLambda () |
get the incident wavelength in vacuum | |
void | setPeriod (double) |
size of the grating including padding | |
double | getPeriod (void) |
get the size of the grating including padding | |
double | getGratingSize (void) |
get the size of the grating excluding padding | |
void | setnPermSegs (int) |
set the number of pixels per layer | |
int | getnPermSegs (void) |
get the number of pixels per layer | |
void | setPolMode (string) |
set polarization mode of the incident field (TE or TM) | |
string | getPolMode () |
get the polarization mode | |
void | setN0 (complex< double >) |
set the refractive index of region one (halfspace of incident field) | |
complex< double > | getN0 () |
get the refractive index of region one (halfspace of incident field) | |
void | setN3 (complex< double >) |
set the refractive index of region 3 (halfspace of transmitted field) | |
complex< double > | getN3 () |
get the refractive index of region 3 (halfspace of transmitted field) | |
void | setNPad (complex< double >) |
set refractive index of the material in which the element is embedded | |
complex< double > | getNPad () |
get refractive index of the material in which the element is embedded | |
void | setIncid (Vector< complex< double > >) |
set fourier orders of the incident field | |
complex< double > | getIncid (int) |
get fourier order (nOrds-1)/2+n | |
void | setMatPad (int) |
set material of the padding | |
void | setPadding (double) |
set the size of the padding | |
double | getPadding (void) |
get the size of the padding | |
int | getnOrds () |
number of Fourier orders used for the calculations | |
int | getnLayers (void) |
number of layers | |
double | getEmbSize () |
size of the embedding | |
complex< double > | getLhsMat (int, int) |
get one element of the lhsMatBand | |
complex< double > | getRhsVec (int) |
get element of the rhsVec | |
complex< double > | getA (int, int) |
Matrix to calculate the transmitted modes (S-Matrix algorithm). | |
complex< double > | getAdash (int, int) |
Matrix to calculate the reflected modes (S-Matrix algorithm). | |
complex< double > | getGamma (int) |
n_th order of gamma | |
usually not used externally | |
void | setEquations (void) |
set equations to calculate boundary equations | |
void | setLhsMatTE (void) |
set the equations for the boundary equations if polarisation is TE | |
void | setLhsMatTM (void) |
set the equations for the boundary equations if polarisation is TM | |
void | solveEquations (void) |
only T-Matrix: solve the equation system obtained by setEquations(); | |
void | setSMatrix (void) |
calculate the S-Matrix (only S-Matrix approach) | |
void | findEfficiency (string) |
calculate the efficiencies from the transmission orders | |
void | findEfficiencyT (void) |
void | findEfficiencyS (void) |
void | calcSTR (void) |
calculate the reflection and transmission orders and efficiencies with the S-Matrix approach | |
void | importMaterials (string) |
import Neumann coeffeicients to calculate the reefractive index of a material | |
void | calcGamma (void) |
calculate the gamma values gamma[n] = n0*k*sin(theta)+2*Pi*n/d (Ben Layet, eq 2.18) | |
void | setLhsMatBand (int, int, complex< double >) |
set the value of one element of the T-Matrix in a banded storage system | |
int | nLines (string) |
double | delta (int, int) |
F_Matrix< complex< double > > | unit (int i) |
Public Attributes | |
vector< GratingLayer > | layer |
the layers of the grating | |
Private Attributes | |
double | theta |
the incident angle in radians | |
double | lambda |
wavelength of incident light | |
double | period |
computational period = size of the element in including the padding | |
double | gratingSize |
size of the grating | |
double | padding |
size of the padding (e.g. absorbing padding to reduce periodicity) | |
Vector< complex< double > > | r |
the spatial frequencies of the reflected field | |
Vector< complex< double > > | t |
the spatial frequencies of the transmitted field | |
Vector< complex< double > > | refl |
Fourier orders of the reflected field. | |
Vector< complex< double > > | tran |
Fourier orders of the transmitted field. | |
Vector< complex< double > > | transS |
Vector< double > | rEFF |
Reflected efficiencies. | |
Vector< double > | tEFF |
Transmitted efficiencies. | |
complex< double > | n0 |
refractive index of region 1 (incident region) | |
complex< double > | n3 |
refractive index of region 3 (transmitted region) | |
complex< double > | nPad |
refractive index of the padding | |
F_BandMatrix< complex< double > > | precond |
F_Matrix< complex< double > > | invA |
F_BandMatrix< complex< double > > | lhsMatBand |
Matrix for the boundary conditions LhsMatBand*solVec=rhsVec. | |
Vector< complex< double > > | rhsVec |
right hand side vector in the boundary condition equation LhsMatBand*solVec=rhsVec | |
Vector< complex< double > > | solVec |
solving vector in the boundary condition equation LhsMatBand*solVec=rhsVec, contains the transmitted and reflected Fourier coefficients | |
Vector< complex< double > > | incid |
Fourier coefficients of the incident field. | |
Vector< complex< double > > | gamma |
complex< double > | I |
the complex number (0,1) | |
complex< double > | za |
complex< double > | zb |
int | nLayers |
the number of layers of the grating | |
int nOrds int minOrd int | maxOrd |
the number of Fourier orders used in the Fourier decomposition of the permittivity and the Field; the orders go from -(nOrds-1)/2 to (nOrds-1)/2 | |
int | nUnknowns |
number of unknowns in the boundary condition equation = dim(LhsMatBand) | |
int | nPermSegs |
number of transition points in each layer (= number of pixels per layer) | |
int | nPadSegs |
int | gratingSegs |
string | polMode |
polarization of the incident field | |
string | initMode |
F_Matrix< int > | material |
Materials of the grating (all layers and pixels): each element contains the number of its material as listed in the file containing the Neumann coefficients of the materials. | |
F_Matrix< int > | MCoeffs |
int | nMat |
number of materials used in the structure | |
int | matPad |
material of the padding | |
F_Matrix< complex< double > > | indices |
if working with constant refractive indices: contains the refractive index structure of the grating (all layers and pixels) | |
Vector< complex< double > > | refIndMat |
contains the refractive indices of the materials at wavelength lambda | |
F_Matrix< double > | transpt |
contains the transition points of each layer as fraction of the grating size | |
Vector< double > | slabThick |
the thickness of the layers | |
F_Matrix< double > | fieldAmplitude |
the intensity distribution of the field as calculated with one of the functions to calculate field | |
int | dimX |
number of pixels in x-directions for the field calculation | |
int | dimY |
number of pixels in y-directions for the field calculation | |
double | embedding |
double | embPeriod |
double | propAfter |
int | nOrdsEmb |
Vector< complex< double > > | TransEmb |
Vector< complex< double > > | tEmb |
Vector< complex< double > > | gammaEmb |
double | plotSize |
F_Matrix< complex< double > > | Q1 |
F_Matrix< complex< double > > | Q2 |
F_Matrix< complex< double > > | G |
F_Matrix< complex< double > > | tau |
F_Matrix< complex< double > > | R |
F_Matrix< complex< double > > | T |
F_Matrix< complex< double > > | R_tilde |
F_Matrix< complex< double > > | T_tilde |
F_Matrix< complex< double > > | F |
Vector< complex< double > > | expTerm |
double | incidPowFactor |
Definition at line 23 of file Grating1D.h.
double Grating1D::theta [private] |
the incident angle in radians
Definition at line 27 of file Grating1D.h.
Referenced by addFrame(), calcGamma(), calcTransEmb(), getTheta(), initLayers(), setnPermSegs(), setPadding(), and setTheta().
double Grating1D::lambda [private] |
wavelength of incident light
Definition at line 29 of file Grating1D.h.
Referenced by addFrame(), calcGamma(), calcTransEmb(), findEfficiencyS(), getLambda(), importMaterials(), initLayers(), setLambda(), setLhsMatTE(), setLhsMatTM(), setnPermSegs(), setPadding(), setSMatrix(), and writeParameters().
double Grating1D::period [private] |
computational period = size of the element in including the padding
Definition at line 31 of file Grating1D.h.
Referenced by addFrame(), calcExtField(), calcGamma(), calcIncid(), calcTransEmb(), getExtField(), getIntField(), getPeriod(), initLayers(), setnPermSegs(), setPadding(), setPeriod(), setSMatrix(), and writeParameters().
double Grating1D::gratingSize [private] |
size of the grating
Definition at line 33 of file Grating1D.h.
Referenced by addFrame(), calcTransEmb(), getGratingSize(), initLayers(), setPadding(), and setParameters().
double Grating1D::padding [private] |
size of the padding (e.g. absorbing padding to reduce periodicity)
Definition at line 35 of file Grating1D.h.
Referenced by addFrame(), getPadding(), initLayers(), and setPadding().
Vector< complex<double> > Grating1D::r [private] |
the spatial frequencies of the reflected field
Definition at line 37 of file Grating1D.h.
Referenced by findEfficiencyS(), findEfficiencyT(), setLhsMatTE(), setLhsMatTM(), and solveEquations().
Vector< complex<double> > Grating1D::t [private] |
the spatial frequencies of the transmitted field
Definition at line 39 of file Grating1D.h.
Referenced by findEfficiencyS(), findEfficiencyT(), getExtField(), setLhsMatTE(), and setLhsMatTM().
Vector< complex<double> > Grating1D::refl [private] |
Fourier orders of the reflected field.
Definition at line 41 of file Grating1D.h.
Referenced by findEfficiencyS(), findEfficiencyT(), and getRef().
Vector< complex<double> > Grating1D::tran [private] |
Fourier orders of the transmitted field.
Definition at line 43 of file Grating1D.h.
Referenced by calcTransEmb(), findEfficiencyS(), findEfficiencyT(), getExtField(), and getTrans().
Vector< complex<double> > Grating1D::transS [private] |
Definition at line 43 of file Grating1D.h.
Vector<double> Grating1D::rEFF [private] |
Reflected efficiencies.
Definition at line 45 of file Grating1D.h.
Referenced by findEfficiencyS(), findEfficiencyT(), and getEfficiencyR().
Vector<double> Grating1D::tEFF [private] |
Transmitted efficiencies.
Definition at line 47 of file Grating1D.h.
Referenced by findEfficiencyS(), findEfficiencyT(), and getEfficiencyT().
complex<double> Grating1D::n0 [private] |
refractive index of region 1 (incident region)
Definition at line 49 of file Grating1D.h.
Referenced by addFrame(), calcGamma(), calcTransEmb(), findEfficiencyS(), findEfficiencyT(), getN0(), initLayers(), setLhsMatTE(), setLhsMatTM(), setN0(), setnPermSegs(), setPadding(), setSMatrix(), and writeParameters().
complex<double> Grating1D::n3 [private] |
refractive index of region 3 (transmitted region)
Definition at line 51 of file Grating1D.h.
Referenced by calcTransEmb(), findEfficiencyS(), findEfficiencyT(), getN3(), setLhsMatTE(), setLhsMatTM(), setN3(), setSMatrix(), and writeParameters().
complex<double> Grating1D::nPad [private] |
refractive index of the padding
Definition at line 53 of file Grating1D.h.
Referenced by addFrame(), getNPad(), initLayers(), setNPad(), and writeParameters().
F_BandMatrix< complex<double> > Grating1D::precond [private] |
Definition at line 55 of file Grating1D.h.
F_Matrix< complex<double> > Grating1D::invA [private] |
Definition at line 56 of file Grating1D.h.
F_BandMatrix< complex<double> > Grating1D::lhsMatBand [private] |
Matrix for the boundary conditions LhsMatBand*solVec=rhsVec.
Definition at line 58 of file Grating1D.h.
Referenced by getLhsMat(), setLhsMatTE(), setLhsMatTM(), solve(), and solveEquations().
Vector< complex<double> > Grating1D::rhsVec [private] |
right hand side vector in the boundary condition equation LhsMatBand*solVec=rhsVec
Definition at line 60 of file Grating1D.h.
Referenced by getRhsVec(), solve(), and solveEquations().
Vector< complex<double> > Grating1D::solVec [private] |
solving vector in the boundary condition equation LhsMatBand*solVec=rhsVec, contains the transmitted and reflected Fourier coefficients
Definition at line 62 of file Grating1D.h.
Referenced by findEfficiencyT(), getA(), getAdash(), solve(), and solveEquations().
Vector< complex<double> > Grating1D::incid [private] |
Fourier coefficients of the incident field.
Definition at line 64 of file Grating1D.h.
Referenced by calcIncid(), findEfficiencyS(), findEfficiencyT(), getIncid(), setIncid(), and solveEquations().
Vector< complex<double> > Grating1D::gamma [private] |
Definition at line 65 of file Grating1D.h.
Referenced by calcGamma(), calcTransEmb(), getExtField(), and getGamma().
complex<double> Grating1D::I [private] |
the complex number (0,1)
Definition at line 67 of file Grating1D.h.
Referenced by calcIncid(), calcTransEmb(), findEfficiencyT(), getEmbExtField(), getExtField(), getIntField(), setLhsMatTE(), setLhsMatTM(), and setSMatrix().
complex<double> Grating1D::za [private] |
Definition at line 68 of file Grating1D.h.
Referenced by findEfficiencyS(), setLhsMatTE(), and setLhsMatTM().
complex<double> Grating1D::zb [private] |
Definition at line 68 of file Grating1D.h.
Referenced by calcTransEmb(), findEfficiencyS(), setLhsMatTE(), and setLhsMatTM().
int Grating1D::nLayers [private] |
the number of layers of the grating
Definition at line 70 of file Grating1D.h.
Referenced by addFrame(), calcIntField(), findEfficiencyT(), getIntField(), getnLayers(), initLayers(), setLambda(), setLhsMatTE(), setLhsMatTM(), setN0(), setnPermSegs(), setPadding(), setPeriod(), setPolMode(), setSMatrix(), setTheta(), solve(), and writeParameters().
int nOrds int minOrd int Grating1D::maxOrd [private] |
the number of Fourier orders used in the Fourier decomposition of the permittivity and the Field; the orders go from -(nOrds-1)/2 to (nOrds-1)/2
lowest Fourier order = -(nOrds-1)/2 highest Fourier order = (nOrds-1)/2
Definition at line 76 of file Grating1D.h.
Referenced by getA(), getAdash(), and getIntField().
int Grating1D::nUnknowns [private] |
number of unknowns in the boundary condition equation = dim(LhsMatBand)
Definition at line 78 of file Grating1D.h.
Referenced by findEfficiencyT(), solve(), and solveEquations().
int Grating1D::nPermSegs [private] |
number of transition points in each layer (= number of pixels per layer)
Definition at line 80 of file Grating1D.h.
Referenced by addFrame(), getnPermSegs(), initLayers(), setnPermSegs(), setPadding(), and writeParameters().
int Grating1D::nPadSegs [private] |
Definition at line 80 of file Grating1D.h.
Referenced by changeMaterial(), changeRefInd(), initLayers(), and writeParameters().
int Grating1D::gratingSegs [private] |
string Grating1D::polMode [private] |
polarization of the incident field
Definition at line 82 of file Grating1D.h.
Referenced by addFrame(), findEfficiencyT(), getPolMode(), initLayers(), setEquations(), setnPermSegs(), setPadding(), setPolMode(), setSMatrix(), solveEquations(), and writeParameters().
string Grating1D::initMode [private] |
Definition at line 83 of file Grating1D.h.
F_Matrix<int> Grating1D::material [private] |
Materials of the grating (all layers and pixels): each element contains the number of its material as listed in the file containing the Neumann coefficients of the materials.
Definition at line 85 of file Grating1D.h.
Referenced by addFrame(), changeMaterial(), and initLayers().
F_Matrix<int> Grating1D::MCoeffs [private] |
Definition at line 85 of file Grating1D.h.
int Grating1D::nMat [private] |
number of materials used in the structure
Definition at line 87 of file Grating1D.h.
Referenced by importMaterials().
int Grating1D::matPad [private] |
F_Matrix< complex<double> > Grating1D::indices [private] |
if working with constant refractive indices: contains the refractive index structure of the grating (all layers and pixels)
Definition at line 91 of file Grating1D.h.
Referenced by addFrame(), changeMaterial(), changeRefInd(), initLayers(), setnPermSegs(), and setPadding().
Vector< complex<double> > Grating1D::refIndMat [private] |
contains the refractive indices of the materials at wavelength lambda
Definition at line 93 of file Grating1D.h.
Referenced by changeMaterial(), importMaterials(), and initLayers().
F_Matrix<double> Grating1D::transpt [private] |
contains the transition points of each layer as fraction of the grating size
Definition at line 95 of file Grating1D.h.
Referenced by addFrame(), initLayers(), setnPermSegs(), and setPadding().
Vector<double> Grating1D::slabThick [private] |
the thickness of the layers
Definition at line 97 of file Grating1D.h.
Referenced by addFrame(), initLayers(), setnPermSegs(), and setPadding().
F_Matrix<double> Grating1D::fieldAmplitude [private] |
the intensity distribution of the field as calculated with one of the functions to calculate field
Definition at line 99 of file Grating1D.h.
Referenced by calcEmbField(), calcExtField(), calcIntField(), and writeField().
int Grating1D::dimX [private] |
number of pixels in x-directions for the field calculation
Definition at line 101 of file Grating1D.h.
Referenced by calcEmbField(), calcExtField(), calcIntField(), and writeField().
int Grating1D::dimY [private] |
number of pixels in y-directions for the field calculation
Definition at line 103 of file Grating1D.h.
Referenced by calcEmbField(), calcExtField(), calcIntField(), and writeField().
double Grating1D::embedding [private] |
double Grating1D::embPeriod [private] |
Definition at line 105 of file Grating1D.h.
Referenced by calcTransEmb(), getEmbExtField(), getEmbSize(), and writeParameters().
double Grating1D::propAfter [private] |
int Grating1D::nOrdsEmb [private] |
Definition at line 106 of file Grating1D.h.
Referenced by calcTransEmb(), getEmbExtField(), and writeParameters().
Vector< complex<double> > Grating1D::TransEmb [private] |
Vector< complex<double> > Grating1D::tEmb [private] |
Vector< complex<double> > Grating1D::gammaEmb [private] |
double Grating1D::plotSize [private] |
F_Matrix< complex<double> > Grating1D::Q1 [private] |
F_Matrix< complex<double> > Grating1D::Q2 [private] |
F_Matrix< complex<double> > Grating1D::G [private] |
F_Matrix< complex<double> > Grating1D::tau [private] |
F_Matrix< complex<double> > Grating1D::R [private] |
Definition at line 110 of file Grating1D.h.
Referenced by findEfficiencyS(), setSMatrix(), and solve().
F_Matrix< complex<double> > Grating1D::T [private] |
Definition at line 110 of file Grating1D.h.
Referenced by findEfficiencyS(), setSMatrix(), and solve().
F_Matrix< complex<double> > Grating1D::R_tilde [private] |
F_Matrix< complex<double> > Grating1D::T_tilde [private] |
F_Matrix< complex<double> > Grating1D::F [private] |
Vector< complex<double> > Grating1D::expTerm [private] |
double Grating1D::incidPowFactor [private] |
vector<GratingLayer> Grating1D::layer |
the layers of the grating
Definition at line 116 of file Grating1D.h.
Referenced by addFrame(), calcIntField(), changeMaterial(), changeRefInd(), findEfficiencyS(), findEfficiencyT(), getIntField(), initLayers(), setLambda(), setLhsMatTE(), setLhsMatTM(), setN0(), setnPermSegs(), setPadding(), setPeriod(), setPolMode(), setSMatrix(), setTheta(), solveEquations(), and writeParameters().