2D photonic crystal ω-formulation (TE and TM mode) - sampling over quasi-momenta k

Filename waveprop/PCEVSolve.cc

  • Computation of the band structure of 2D photonic crystal (TE or TM mode) and the respective Bloch modes
  • ω-formulation, sampling over quasi-momenta k

Call PCEVSolve.cc -f <FILE>

Requirements

The external libraries SuperLU (sparse direct solver) and Arpack (sparse eigenvalue solver) have to be installed.

Usage

The files for the mesh are expected to have the following specified relation to the input file <FILE> e.g. for the input file example.cig it is searched for:
example_Coord.dat File with coordinates of the mesh vertices.
example_Elms.dat File with information of the mesh cells.
example_Attr.dat File with cell, edge and vertex attributes.
example_EdgRadia.dat File with radia of circular edges.
example_EdgCorr.dat File with information about periodic edges.

Furthermore, semi-infinite rectangles can be defined via the file for the input parameter.

Type Name (default value) Stands for Compulsory
string array InfiniteQuad (empty) Array of semi-infinite rectangles, e.g.
string array InfiniteQuad {
  1 "2 1 4",
  2 "104 103 4"
}
No

The lattice constant a results from the coordinates, i.e. the coordinates will not be scaled inside the programme. However, as the non-absorbing Maxwell's equations scale with the size can interprete the results in a scaling independent of the lattice constant a.

Input Parameter

Type Name (default value) Stands for Compulsory
double array epsilon (1) Map from attribute to relative permittivity Yes
double array k0 (empty) Array of quasi-momenta in e1 direction, in [-π/a, π/a] No
double array k1 (empty) Array of quasi-momenta in e2 direction, in [-π/a, π/a] No
string samplemode ( "simple") Sample modes in the reciprocal lattice. No
  "simple" Arrays of k0, k1 build one common array (k0, k1)  
  "tensor" Tensor product of arrays of k0, k1, beginning to sample in k0.  
  "angle = <ANGLE> " Array of k0 is abs(k) and angle is read from string.  
double k0 (0) Single quasi-momentum in e1 direction (taken if array k0 is empty) No
double k1 (0) Single quasi-momentum in e2 direction (taken if array k1 is empty) No
int neig (4) Number of eigenvalues ω No
string mode ( "TM") TE or TM mode. No

string dirichl_bdAttrib ( "") List of attributes of edges with Dirichlet boundary condition, the attributes are separated by spaces, e.g. "1 3 8 7" No
int p (1) Starting polynomial degree, will be set at least to 1. No
string refinement ( "") Further refinement, e.g. ="p2 in 1, h2 in 2, p2|0 in 3". No
    h -refinement "h" - once  
      "h2" - twice  
      "h2|1" - twice in local x1-direction and once in x2-direction.  
    p -refinement "p" - increase polynomial degrees by 1  
      "p2" - increase polynomial degrees by 2  
      "p2|0" - increase in local x1-direction by 2  
    only in some cells "p2|0 in 3" - refinement as above, but only in cells with attribute 3  
    h - or hp -refinement towards vertices or edges "hp -> v101" - one step of hp -refinement towards the vertex/vertices with attribute 101  
      h2 in 3 -> e20" - twofold h -refinement towards the edge(s) with attribute 20, only in cells with attribute 3  
bool trunk ( true) Use of linear trunk space. No
double epsArpack (EPS) Accuracy of the eigensolver, by default machine precision is taken. No
double omega (0) Shift for the eigensolver. No

string outputdirectory (".") Directory of the output files, by default the current working directory (where the executable is called from), and related to current the working directory. No
string outputprefix (<FILEPRE>) Prefix of the output files, for input file example.cig the prefix is by default example. No
bool verbose (false) Let print more information out. No

Example

Output

Mesh

Filename <OUTPUTDIRECTORY>/<OUTPUTPREFIX> _Mesh.m
  e.g. for example.cig by default ./example_Mesh.m
Type Matlab
Call plot(x(edgemsh), y(edgemsh), 'k-');

Band structure

Filename <OUTPUTDIRECTORY>/<OUTPUTPREFIX> _Omega.m
  e.g. for example.cig by default ./example_Omega.m
Type Matlab
Variables ndof Number of degrees of freedom.
  ks_TE or ks_TM 4 x nk-matrix with quasi-momenta and eigen frequencies.

Structure of ks_TE and ks_TM

Row Values
1 k0-values, not scaled, i.e. as given for example in [-π/a, π/a] with lattice constant of mesh.
2 k1-values, also not scaled.
3 ω^2-values, scaled by square of the vacuum speed of light c
4 ω-values, scaled by the vacuum speed of light c
To get quasi-momenta in the usual scaling independent of the lattice constant a, divide the values by a/(2π). To get the eigenfrequencies ω in the usual scaling independent of a and the vacuum speed of light c, multiply the values by a/(2π).

Eigenmodes

The eigenmodes are written with their coefficient vectors in the FE space into the following files, where <INDEX> goes from 00000 to the number of eigenmodes minus 1.

Filename <OUTPUTDIRECTORY>=/eigenfuns/=<OUTPUTPREFIX> EF <INDEX>.dat=
  e.g. for example.cig by default ./eigenfuns/example_TE_00000.dat and so on.
Type Binary
The sub-directory eigenfuns will be created if not existing. Files for graphical output in Matlab can be generated with showSol2D.cc. See here.
Topic revision: r1 - 11 Sep 2023, KerstenSchmidt
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Concepts? Send feedback