Most important functions | |
Grating1D::Grating (int truncation, int layers, int nSegments) | |
constructor | |
Grating1D::~Grating () | |
destructor | |
void | Grating1D::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 | Grating1D::initLayers (string, string, string) |
initialise the grating layers from a file | |
void | Grating1D::initLayers (F_Matrix< int >, Vector< double >, string) |
initialise the layers with an array of material numbers | |
void | Grating1D::initLayers (F_Matrix< complex< double > >, Vector< double >) |
initialise the layers with an array of complex indices | |
void | Grating1D::solve (string) |
solve the grating after having solved the eigenvalue equations of each layer | |
void | Grating1D::calcIntField (int, int) |
if solved by T-Matrix approach: calculate the internal field | |
void | Grating1D::calcExtField (int, int, double, double, double) |
calculate the external field | |
void | Grating1D::calcEmbField (int, int, double, double, double) |
calculate the external field after using the field stitching technique (absorbing padding) | |
complex< double > | Grating1D::getIntField (double, double) |
calculate the field at a certain point | |
complex< double > | Grating1D::getExtField (double, double) |
calculate the external transmitted field at a certain point | |
complex< double > | Grating1D::getEmbExtField (double, double) |
calculate the external field form the Fourier coefficients obtained with the field stitching method | |
void | Grating1D::writeField (string) |
write the Field amplitudes to a file | |
void | Grating1D::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 | Grating1D::getEfficiencyR (int) |
efficiencies of the reflected modes | |
double | Grating1D::getEfficiencyT (int) |
efficiencies of the transmitted modes | |
complex< double > | Grating1D::getTrans (int) |
transmision modes | |
complex< double > | Grating1D::getRef (int) |
reflected modes | |
void | Grating1D::calcIncid (Vector< complex< double > >, int) |
calculate the Fourier orders of a field distribution (currently not working) | |
void | Grating1D::changeRefInd (int, int, complex< double >) |
set the refractive index of one pixel of the grating | |
void | Grating1D::changeMaterial (int slab, int segment, int mat) |
set the material of one pixel of the grating | |
void | Grating1D::addFrame (complex< double >, double) |
add an additional frame to the grating | |
void | Grating1D::writeParameters (string) |
write most parameters to a file |
void Grating1D::addFrame | ( | complex< double > | ind, | |
double | frame | |||
) | [inherited] |
add an additional frame to the grating
This function adds an additional frame to the grating with a certain refractive index. This can be used to test the effect of the periodic bouindary conditions. The grating size remains the same, the period increases by a specified size.
ind | the refractive index of the frame | |
frame | the size of the frame added to both sides of the grating [LU] |
Definition at line 399 of file Grating1D.cpp.
References Grating1D::gratingSize, Grating1D::indices, Grating1D::lambda, Grating1D::layer, Grating1D::material, Grating1D::n0, Grating1D::nLayers, Grating1D::nPad, Grating1D::nPermSegs, Grating1D::padding, Grating1D::period, Grating1D::polMode, Grating1D::setnPermSegs(), Grating1D::setParameters(), Grating1D::setPeriod(), Grating1D::slabThick, Grating1D::theta, and Grating1D::transpt.
void Grating1D::calcEmbField | ( | int | X, | |
int | Y, | |||
double | propBehind, | |||
double | start = 0. , |
|||
double | stop = 1. | |||
) | [inherited] |
calculate the external field after using the field stitching technique (absorbing padding)
X | # pixels in X | |
Y | # pixels in Y | |
propBehind | propagation depth | |
start | starting point on the left side (0-> most left point of the grating (including padding and embedding), 1-> most right point of the grating (including padding and embedding) ) | |
stop | stop point on the right side (as start) |
Definition at line 1012 of file Grating1D.cpp.
References Grating1D::dimX, Grating1D::dimY, Grating1D::fieldAmplitude, Grating1D::getEmbExtField(), and norm().
void Grating1D::calcExtField | ( | int | X, | |
int | Y, | |||
double | propBehind, | |||
double | start = 0. , |
|||
double | stop = 1. | |||
) | [inherited] |
calculate the external field
X | # pixels in X | |
Y | # pixels in Y | |
propBehind | propagation depth | |
start | starting point on the left side (0-> most left point of the grating (including padding and embedding), 1-> most right point of the grating (including padding and embedding) ) | |
stop | stop point on the right side (as number 4) |
Definition at line 987 of file Grating1D.cpp.
References Grating1D::dimX, Grating1D::dimY, Grating1D::fieldAmplitude, Grating1D::getExtField(), norm(), Grating1D::period, Grating1D::plotSize, and Grating1D::propAfter.
void Grating1D::calcIncid | ( | Vector< complex< double > > | field, | |
int | dim | |||
) | [inherited] |
calculate the Fourier orders of a field distribution (currently not working)
Definition at line 235 of file Grating1D.cpp.
References abs(), Grating1D::I, Grating1D::incid, and Grating1D::period.
void Grating1D::calcIntField | ( | int | X, | |
int | Y | |||
) | [inherited] |
if solved by T-Matrix approach: calculate the internal field
X | position X in fraction of the grating size | |
Y | position Y in length units |
Definition at line 958 of file Grating1D.cpp.
References abs(), Grating1D::calcGamma(), Grating1D::dimX, Grating1D::dimY, Grating1D::fieldAmplitude, Grating1D::getIntField(), Grating1D::layer, and Grating1D::nLayers.
void Grating1D::calcTransEmb | ( | double | embSize, | |
int | embOrd | |||
) | [inherited] |
calculate the transmission coefficients from the original ones in an absorbing embedding (0 transmission) using the field stitching technique
embSize | embedding size | |
embOrd | number of Fourier orders |
Definition at line 1103 of file Grating1D.cpp.
References Grating1D::embedding, Grating1D::embPeriod, Grating1D::gamma, Grating1D::gammaEmb, Grating1D::gratingSize, Grating1D::I, imag(), Grating1D::lambda, Grating1D::n0, Grating1D::n3, Grating1D::nOrdsEmb, Grating1D::period, real(), Grating1D::tEmb, Grating1D::theta, Grating1D::tran, Grating1D::TransEmb, and Grating1D::zb.
void Grating1D::changeMaterial | ( | int | slab, | |
int | segment, | |||
int | mat | |||
) | [inherited] |
set the material of one pixel of the grating
This function changes the material in the grating as well as in the layers. Only the cahnged layer needs to be recalculated before solving the new boundary conditions
slab | the layer of the changed pixel | |
segment | the segment in the layer | |
mat | the new material |
Definition at line 388 of file Grating1D.cpp.
References Grating1D::indices, Grating1D::layer, Grating1D::material, Grating1D::nPadSegs, and Grating1D::refIndMat.
void Grating1D::changeRefInd | ( | int | slab, | |
int | segment, | |||
complex< double > | ind | |||
) | [inherited] |
set the refractive index of one pixel of the grating
This function changes the refractive index in the grating as well as in the layers. Only the cahnged layer needs to be recalculated before solving the new boundary conditions
slab | the layer of the changed pixel | |
segment | the segment in the layer | |
ind | the new refractive index |
Definition at line 377 of file Grating1D.cpp.
References Grating1D::indices, Grating1D::layer, and Grating1D::nPadSegs.
double Grating1D::getEfficiencyR | ( | int | i | ) | [inherited] |
efficiencies of the reflected modes
Definition at line 182 of file Grating1D.cpp.
References Grating1D::rEFF.
Referenced by Grating1D::writeParameters().
double Grating1D::getEfficiencyT | ( | int | i | ) | [inherited] |
efficiencies of the transmitted modes
Definition at line 183 of file Grating1D.cpp.
References Grating1D::tEFF.
Referenced by Grating1D::writeParameters().
complex< double > Grating1D::getEmbExtField | ( | double | x, | |
double | y | |||
) | [inherited] |
calculate the external field form the Fourier coefficients obtained with the field stitching method
x | x position as fraction of grating size | |
y | y position in my |
Definition at line 1152 of file Grating1D.cpp.
References Grating1D::embPeriod, Grating1D::gammaEmb, Grating1D::I, Grating1D::nOrdsEmb, Grating1D::tEmb, and Grating1D::TransEmb.
Referenced by Grating1D::calcEmbField().
complex< double > Grating1D::getExtField | ( | double | x, | |
double | y | |||
) | [inherited] |
calculate the external transmitted field at a certain point
x | x position as fraction of grating size | |
y | y position in my |
Definition at line 1089 of file Grating1D.cpp.
References Grating1D::gamma, Grating1D::I, Grating1D::period, Grating1D::t, and Grating1D::tran.
Referenced by Grating1D::calcExtField().
complex< double > Grating1D::getIntField | ( | double | x, | |
double | y | |||
) | [inherited] |
calculate the field at a certain point
x | x position as fraction of grating size | |
y | y position as fraction of grating thickness |
Definition at line 1050 of file Grating1D.cpp.
References Grating1D::getA(), Grating1D::getAdash(), Grating1D::getGamma(), Grating1D::I, Grating1D::layer, Grating1D::maxOrd, Grating1D::nLayers, and Grating1D::period.
Referenced by Grating1D::calcIntField().
complex< double > Grating1D::getRef | ( | int | i | ) | [inherited] |
complex< double > Grating1D::getTrans | ( | int | i | ) | [inherited] |
Grating1D::Grating | ( | int | truncation, | |
int | layers, | |||
int | nSegments | |||
) | [inherited] |
constructor
void Grating1D::initLayers | ( | F_Matrix< complex< double > > | element, | |
Vector< double > | thickness | |||
) | [inherited] |
initialise the layers with an array of complex indices
Initialise the layers from a matrix conatining the refractive index distribution of the grating
element | the refractive index structure of the grating (all layers) | |
thickness | the thickness of the layers |
Definition at line 353 of file Grating1D.cpp.
References Grating1D::gratingSegs, Grating1D::gratingSize, Grating1D::indices, Grating1D::lambda, Grating1D::layer, Grating1D::n0, Grating1D::nLayers, Grating1D::nPad, Grating1D::nPermSegs, Grating1D::padding, Grating1D::period, Grating1D::polMode, Grating1D::setParameters(), Grating1D::slabThick, Grating1D::theta, and Grating1D::transpt.
void Grating1D::initLayers | ( | F_Matrix< int > | element, | |
Vector< double > | thickness, | |||
string | matFile | |||
) | [inherited] |
initialise the layers with an array of material numbers
Initialise the layers from a Matrix containing the material numbers
element | the material structure of the grating | |
thickness | the thickness of the layers | |
matFile | the path to the file containing the material parameters |
Definition at line 332 of file Grating1D.cpp.
References Grating1D::importMaterials(), Grating1D::indices, Grating1D::lambda, Grating1D::layer, Grating1D::n0, Grating1D::nLayers, Grating1D::nPad, Grating1D::nPadSegs, Grating1D::nPermSegs, Grating1D::period, Grating1D::polMode, Grating1D::refIndMat, Grating1D::setParameters(), Grating1D::slabThick, Grating1D::theta, and Grating1D::transpt.
void Grating1D::initLayers | ( | string | initfile, | |
string | initStyle, | |||
string | matFile | |||
) | [inherited] |
initialise the grating layers from a file
Initialise the layers from a file containing the material numbers or refractive indices: read the structure and material file, calculate the refractive indices (if working with materials) and set all necessary parameters for each layer
initfile | file containing the grating structure | |
initStyle | "material" or "index": information about the initfile | |
matFile | if initStyle = material: path to the file containing all material parameters |
Definition at line 287 of file Grating1D.cpp.
References find_next, Grating1D::gratingSegs, Grating1D::gratingSize, Grating1D::importMaterials(), Grating1D::indices, Grating1D::lambda, Grating1D::layer, Grating1D::material, Grating1D::n0, Grating1D::nLayers, Grating1D::nPad, Grating1D::nPermSegs, Grating1D::padding, Grating1D::period, Grating1D::polMode, Grating1D::refIndMat, Grating1D::setParameters(), Grating1D::slabThick, Grating1D::theta, and Grating1D::transpt.
void Grating1D::setParameters | ( | double | theta, | |
double | lambda, | |||
double | size, | |||
complex< double > | n0, | |||
complex< double > | n3, | |||
complex< double > | np, | |||
double | pad, | |||
Vector< complex< double > > | incident, | |||
string | pol = "TE" | |||
) | [inherited] |
set various parameters in grating needed for the calculations
Set various parameters that are needed for the calculations in bulk. This function only changes the parameters for the grating and not for each layer.
theta | the incident angle in degrees | |
lambda | the incident wavelength in vacuum | |
size | the grating size | |
n0 | the refractive index of region 1, the halfspace of the incident and reflected light | |
n3 | the refractive index of region 3, the halfspace of the transmitted light | |
np | the refractive index of the padding | |
pad | the size of the padding | |
incident | Vector containing the spatial Fourier orders of the incident light | |
pol | the polarisation ("TE" or "TM") |
Definition at line 220 of file Grating1D.cpp.
References Grating1D::calcGamma(), Grating1D::gratingSize, Grating1D::setIncid(), Grating1D::setLambda(), Grating1D::setN0(), Grating1D::setN3(), Grating1D::setNPad(), Grating1D::setPadding(), Grating1D::setPeriod(), Grating1D::setPolMode(), and Grating1D::setTheta().
Referenced by Grating1D::addFrame(), Grating1D::initLayers(), Grating1D::setnPermSegs(), and Grating1D::setPadding().
void Grating1D::solve | ( | string | method | ) | [inherited] |
solve the grating after having solved the eigenvalue equations of each layer
Calls the necessary functions to solve the boundary conditions of the system. Before using it each layer must be solved.
method | "S" or "T": solve with the S- or T-Matrix algorithm |
Definition at line 448 of file Grating1D.cpp.
References Grating1D::F, Grating1D::findEfficiencyS(), Grating1D::findEfficiencyT(), Grating1D::G, Grating1D::lhsMatBand, Grating1D::nLayers, Grating1D::nUnknowns, Grating1D::Q1, Grating1D::Q2, Grating1D::R, Grating1D::R_tilde, Grating1D::rhsVec, Grating1D::setEquations(), Grating1D::setSMatrix(), Grating1D::solVec, Grating1D::solveEquations(), Grating1D::T, Grating1D::T_tilde, and Grating1D::tau.
void Grating1D::writeField | ( | string | file | ) | [inherited] |
write the Field amplitudes to a file
file | path to filename to which is written |
Definition at line 1030 of file Grating1D.cpp.
References Grating1D::dimX, Grating1D::dimY, and Grating1D::fieldAmplitude.
void Grating1D::writeParameters | ( | string | filename | ) | [inherited] |
write most parameters to a file
filename | path to file in which is written |
Definition at line 1165 of file Grating1D.cpp.
References Grating1D::embPeriod, Grating1D::getEfficiencyR(), Grating1D::getEfficiencyT(), Grating1D::getGratingSize(), Grating1D::getnLayers(), Grating1D::getPadding(), Grating1D::getTheta(), Grating1D::lambda, Grating1D::layer, Grating1D::n0, Grating1D::n3, Grating1D::nLayers, Grating1D::nOrdsEmb, Grating1D::nPad, Grating1D::nPadSegs, Grating1D::nPermSegs, Grating1D::period, Grating1D::polMode, and real().
Grating1D::~Grating | ( | ) | [inherited] |
destructor