Remarks about the Metric mode solver
This concerns lossless and isotropic multilayer slab waveguides with 1D cross sections and piecewise constant refractive index profiles. Modal solutions are sought on infinite, halfinfinite, or finite computational intervals that are enclosed by Dirichlet or Neumann boundary conditions. Standard transfermatrix techniques allow to identify the eigenmodes in a quite efficient and reasonably robust way. The solutions of the symmetric eigenvalue problems consist of real eigenvalues (the squared propagation constants) and of the corresponding eigenfunctions (the mode profiles, with real transverse field components).
The mode solver engine relies on a search algorithm along the real axis of squared propagation constants, driven by the nodal properties of the basis modes. Where applicable, symmetry properties are exploited to resolve mode degeneracies. In view of the rather nonstandard refractive index profiles that occur along with the spectral discretization for the Helmholtz solvers, a few additional comments seem to be appropriate:
Waveguide
objects. Perhaps inspect the log output of the
mode solver, or try a plot of the refractive index profile.
nx
,
nz
>= 1).
SLAMS_BQTOL 
Tolerance for fixing the propagation constants; relative or absolute, depending on the absolute value of the squared propagation constants that are involved. 
SLAMS_BQSEP 
Minimum distance at which propagation constants are considered different; relative or absolute, depending on the absolute value of the squared propagation constants that are involved. 
SLAMS_DISCERRTOL 
Tolerance for the maximum relative error in the continuity of the basic field component for accepting a field as a valid mode. 
SLAMS_MODEANGLELIM 
The mode solver issues a warning message, if the absolute value of
a mode propagation constant happens to be smaller than k0 times
the level of this option times the maximum refractive index of the respective
Waveguide (see the comment above).

DECOUPLED 
A normalized parameter that specifies whether localized fields related to pieces of a waveguide are used to establish approximate modal basis sets (cf. the comment above). 
DECOUPLED
: structure.h and
structure.cpp).
Assigning new values to these variables in a driver file affects the
operation of the mode solver in subsequent calls to the
procedures below.
Nevertheless, in most cases the mode analysis procedures should operate completely autonomously, without any necessity to change the internal options.
Relevant source files: slams.h, slams.cpp.
Nevertheless, in most cases the mode analysis procedures should operate completely autonomously, without any necessity to change the internal options.
Relevant source files: slams.h, slams.cpp.
General mode analysis procedures
A mode analysis problem is specified in terms of the refractive index distribution, the polarization and vacuum wavelength, and possibly accompanied by a computational interval and types of boundary conditions. The Metric collection provides two more generic analysis procedures, defined in slams.h, slams.cpp:
findmodes 
Determine all modes with squared propagation constants within a specified range, for a general problem given by an arbitrary refractive index profile, with possibly different types of boundary conditions at the upper and lower end of a (possibly infinite or halfinfinite) computational window. 
freespacemodes 
For a constant refractive index profile that represents a homogeneous medium: Determine all modes up to a certain order, for a problem with either Dirichlet or Neumann boundary conditions on a finite interval. 
Simpler "wrapper"procedures exist for two typical situations, the identification of guided modes, and the computation of full spectral discretizations. These are described in two sections below.
The procedures operate on the following arguments (naming according to the declaration in slams.h):
wg 
The multilayer structure that is to be
analyzed, including the wavelength, a Waveguide object.
 
pol 
The polarization of the 2D optical waves, either TE or TM ,
a parameter of type Polarization as defined in
gengwed.h.
 
bdtb , bdtt or bdt 
The type of boundary conditions at the lower and upper end of the computational
interval (bdtb , bdtt for findmodes , or
bdt for freespacemodes ), parameters of type
Boundary_type as defined in gengwed.h.
The allowed values are
 
bpb , bpt 
The xpositions of the bottom and top endpoints of the computational
interval. In case of an OPEN boundary condition, the position
parameter of the respective end becomes irrelevant.
 
ma 
(output) A ModeArray
object that contains the found modes upon completion of the procedure.
 
verb 
An integer value that controls the level of log output (stderr):
2 : full log information,
1 : progress only,
0 : suppress all log output.

Besides these explicit arguments, the mode solver procedure can be
influenced by a few internal options.
The ModeArray
parameter ma
is passed as a reference
argument, and filled with the found modes. See the section on
modes and mode arrays for a description of the
corresponding objects and for possibilities for their further evaluation.
Procedures:
findmodes
,
freespacemodes
.
Relevant source files:
slams.h,
slams.cpp.
Guided mode analysis
Given a refractive index profile, a vacuum wavelength, and a polarization
state, the procedure modeanalysis
as defined in
slams.h and
slams.cpp tries to find all guided modes
that are supported by the structure. The open problem is considered,
with the constraint of square integrable mode profiles.
Internally, the modeanalysis
procedure is based on a call to the
generic findmodes
routine; cf. also the
general remarks on the Metric mode solvers.
Here only a few most intuitive arguments are required:
(naming according to the
declaration in slams.h):
wg 
The Waveguide under consideration,
including the wavelength.

pol 
The Polarization of the 2D light waves, either
TE or TM as defined in
gengwed.h.

ma 
(output) A ModeArray object that
is cleared first, then filled with the found modes. These are ordered by their squared propagation
constants, highest values first. Hence, with the exception of cases with
numerical degeneracies, the array index corresponds to the mode order;
index 0 identifies the fundamental mode.

quiet 
(optional) An integer parameter that suppresses the log output (stderr),
if quiet == 1 .

The function returns the number of found modes as an integer value.
For further details on how to access and process the mode objects
stored in the ModeArray
argument see the section on
modes and mode arrays.
The driver file tlwg.cpp provides
an example for the usage of the mode analysis routine and for
the handling of the mode objects. Modal dispersion curves, here the
dependence of effective indices on a core layer thickness,
can be calculated according to the example in
disp.cpp.
Procedure:
modeanalysis
.
Relevant source files:
slams.h,
slams.cpp.
Spectral discretization
Enclosing an internal refractive index profile by suitable boundary conditions leads to a discretization of the mode spectrum on the respective computational interval. Within the Metric collection, finite discrete sets of these modes are employed as an expansion basis for the BEP and QUEP Helmholtz solvers.
Given the refractive index profile, a vacuum wavelength, polarization state,
the computational interval, and the type of boundary conditions, the
procedure
modespectrum
as defined in slams.h,
slams.cpp computes all eigenmodes of the problem
with orders up to a specified number.
Internally, the modespectrum
procedure is based on a call to the
generic findmodes
routine; cf. also the
general remarks on the Metric mode solvers.
The following arguments are required (names according to the declaration in
slams.h):
wg 
The Waveguide under consideration,
including the wavelength.
 
pol 
The Polarization of the 2D light waves, either
TE or TM as defined in
gengwed.h.
 
cw 
The computational window, an Interval as declared in
structure.h. The endpoints are meant as
xpositions on the cross section axis of wg .
 
bdt 
(optional) The type of boundary conditions at the ends of the computational
interval, parameters of type
Boundary_type as defined in gengwed.h.
Here the allowed values are
bdt parameter is missing, the procedure selects
Dirichlet boundary conditions (LIMD ).
 
mnm 
Modes from order 0 up to order mnm1 are sought.
Hence the integer value mnm specifies the number of modes to be
identified.
 
ma 
(output) A ModeArray object that
is cleared first, then filled with the found modes. These are ordered by their squared propagation
constants, highest values first. Hence, with the exception of cases with
numerical degeneracies, the array index corresponds to the mode order.
 
quiet 
(optional) An integer parameter that suppresses the log output (stderr),
if quiet == 1 .

The function returns the number of found modes as an integer value
(i.e. the value mnm
upon successful completion). For further details
on how to access and process the mode objects stored in the ModeArray
argument see the section on modes and mode arrays.
An example for the usage of the routine can be found in the driver file
spec.cpp. Note that the spectral discretization
procedure is invoked automatically by some of the constructors of the
field containers
BepField
and
QuepField
of the Helmholtz solvers.
Procedure:
modespectrum
.
Relevant source files:
slams.h,
slams.cpp.