The mode analysis procedures receive an object of class
WMM_ModeArray
as the last (reference) argument. On completion of the searching process,
the data structure is filled with the found number of
WMM_Mode
s. This array, or its entries,
respectively, constitute the output of the mode solver.
An object of class WMM_Mode
implements what is meant by a guided mode.
The more general concepts are defined in
mode.h and
mode.cpp, while the procedures in
wmmfld.h and
wmmfld.cpp fill the methods which are left 'virtual' in
the former files, i.e. specify the functions which need direct access to
the WMM field representation. WMM_Mode
s can be copied and assigned.
Among the members of a mode object are:
wg 
The waveguide , for which the mode was calculated. See waveg.h and waveg.cpp for the definition. 
pol 
The
polarization
which was specified for the mode analysis, one of
QTE ,
QTM , or
VEC .

sym 
The enforced
symmetry of the mode with respect to
the xzplane. One of
SYM ,
ASY , or
NOS .

beta 
The propagation constant, in µm^{1}. 
k0 
The vacuum wavenumber belonging to the vacuum wavelength of the modes waveguide, in µm^{1}. 
neff 
The effective mode index,
beta/k0 .

npcB 
A normalized propagation constant, or normalized effective permittivity:

field 
The mode profile, evaluated at position
(x,y) on the cross section plane.
Accepts an identifier for the field component, one of
EX ,
EY ,
EZ ,
HX ,
HY ,
HZ , or
SZ , for the three electric and magnetic components, and for the
longitudinal component of the time averaged Poynting vector (declared in
maxweq.h).
The return values are meant in units of
V/µm,
A/µm, or
W/µm^{2}, respectively. Note that the
electric and magnetic fields associated with the guided modes are
EX ,
EY ,
HX , and
HY specify the real part of the corresponding mode component, while
EZ and
HZ mean an imaginary part.
With this ansatz, the transverse components of the time averaged
Poynting vector vanish.

ampfac 
Normalization factor of the mode profile. Initially, this value is set such
that the total guided power of the mode
ampfac enters the results of all methods, which access the mode
profile.

minE, maxE
minH, maxH
minS, maxS 
For visualization purposes: minimum / maximum electric and magnetic field amplitudes (with respect to the x, y, and zcomponents), and the extremal values of the Poynting vector (zcomponent). Roughly estimated for the normalized mode profile. 
totpower
tepower
tmpower 
The total guided power assigned to the mode, and the powers assigned
to the TE and the TM part of the hybrid mode profile, in W:
totpower = .

polcharacter 
Polarization character of a hybrid mode, between 0 and 1.
A value close to 1 indicates
a TElike mode. Depending on the charargument, the function returns
one of the following ratios:
'S' : tepower()/totpower() .

normalize 
Normalize the mode, such that
totpower() evaluates to the supplied argument.

recint 
Integrate a product of two mode components
(EX , ... , HZ ) over a rectangular area in the xyplane.
Confer the
code
for the guided power evaluations as an example.
May be useful for evaluating perturbation theory integrals.

horlineint
verlineint

Integrate a product of two mode components
(EX , ... , HZ ) along horizontal or vertical lines
in the xyplane. Integrals along
dielectric boundary segments may be of interest
in the framework of perturbation theory; therefore the functions
require the indices of the rectangle, where the field is to
be evaluated, as an explicit argument.
Lines involving more than one rectangle of the permittivity decomposition
must be treated piecewise.

maxintensity 
Determines the mode shape: The function returns the maximum intensity on a specified rectangular area, and sets the reference arguments to the xyposition of the intensity maximum, and to the average 1/e^{2} extent in the x and ydirections. Only a coarse approximation! 
translate 
Shifts the position of the entire mode by a vector (dx, dy) . The shift affects
the waveguide (boundary locations) and the mode profile. In general, the
mode symmetry is destroyed, and the mode symmetry argument becomes
NOS .

read_def
read
write_def
write 
Save the entire mode information to a file, or retrieve it.
read and
write read or write information from/to an open FILE
handle.
The default versions access files with extension '.mod', where the filename
is composed from the two supplied character arguments, and from some of the
modes properties, as explaned in the
introduction (consequently this information
must be supplied to read_def explicitely).
The files are in ASCII format and commented; at least the first lines
can be useful e.g. for inspecting the propagation constant or the underlying
waveguide structure.
To prevent the inclusion of comments for a reduction of the file size,
comment the print command in the comment function in
inout.cpp.

Other members of mode objects are described in the sections concerned with visualization and perturbation theory. For some methods dealing with field products and special integrals see the code directly.
Bilinear products combining an input field and guided modes, two modes of the same waveguide, or two modes belonging to two different waveguides are required in several frameworks, e.g. to compute initial amplitudes, for modeling waveguide junctions, or along with coupled mode theory. The WMM provides the following functions for these purposes:
ovlp 
Member function of a
WMM_Mode ,
declared in mode.h,
source in mode.cpp.
Computes the overlap

twomrecint 
Defined in wmmfld.h, wmmfld.cpp. The function integrates a product of two field components belonging to two different modes over a rectangular area in the xyplane. 
scalprod 
Defined in
wmmfld.h, wmmfld.cpp.
The 'scalar' product

lscalprod 
Defined in
wmmfld.h, wmmfld.cpp.
The symmetric form of the former product:

Note that all integrals are evaluated analytically, as long as only
WMM_Mode
s are concerned. Due to the ansatz of real mode field
components, the products yield real results.
In general, a mode analysis yields a set of guided modes, numerically
represented by the
WMM_ModeArray
class, as defined in
wmmarr.h and wmmarr.cpp.
The parantheses operator ()
accesses the WMM_Mode
entries.
WMM_ModeArray
objects may be subject to
copying and assignment.
Among the members are:
num 
The number of modes
contained in the array.
The WMM_Mode s in a
WMM_ModeArray marr are
marr(0), ..., marr(n) , where n==marr.num1 .

clear 
Free the allocated memory. Note that the mode arrays may be quite large objects. This function is invoked at the beginning of each call to a mode analysis procedure. 
add 
Enlarge the mode array by another WMM_Mode .

remove 
Delete a specified WMM_Mode entry.

merge 
Merge the entries of another WMM_ModeArray .
The added array becomes cleared.

sort 
Sort the entries with respect to propagation constants, highest first. 
read_def
read
write_def
write 
Save the entire information to a file, or retrieve it.
read and
write read or write information from/to an open FILE
handle.
The default versions access files 'wmm??.mar', where the questionmarks are
replaced by the two character arguments.
The files are in ASCII format and commented.
To prevent the inclusion of comments for a reduction of the file size,
comment the print command in the comment function in
inout.cpp.

Paragraphs on further member functions can be found below, or in the section on interference visualization.
Several interesting optical devices rely on the interference of
modes inside a longitudinally homogeneous waveguide segment;
consequently the WMM_ModeArray
s include functions
to simulate the guided wave propagation. While isolated modes can be treated
on a completely real basis, the evaluation of mode superpositions
naturally involves complex amplitudes, the harmonically zdependent phases,
thus complex numbers, as defined in
complex.h and
complex.cpp. The files
matrix.h and
matrix.cpp supply complex vectors and matrices.
Single waveguide segment
Assuming that all modes belong to
the same waveguide, the following procedures evaluate the superposition
of the array's modes, at a certain propagation distance z,
for given initial amplitudes at z=0. The functions are members of
the WMM_ModeArray
class, defined in
wmmarr.h and wmmarr.cpp:
field 
One of the components
EX ,
EY ,
EZ ,
HX ,
HY ,
HZ , or
SZ
of the interference field at a position (x, y, z). In contrast to
WMM_Mode.field , here the return values
obviously have to be complex numbers.

fieldmat 
A matrix of values of the interference field on a rectangular mesh of
(x, y) positions at a specified distance z. Intended for visualization
purposes, therefore the function returns a Dmatrix rather than
complex values; the component identifier and an attribute for the desired
information
(one of
MOD ,
SQR ,
REP , or
IMP for the absolute value, the square of it, the real, or the imaginary part) are to be supplied as arguments.

fieldvec 
As above, but for a series of equidistant points along a line in the (x, y) plane at a fixed z distance. 
The above functions
compute evolutions of the individual mode amplitudes of
~exp( i (beta + pert) z) ,
where beta is the actual propagation constant of the mode. The
complex quantities pert (supplied as arguments to the procedures)
provide an interface to
first order perturbation theory, enabling to evaluate
the propagation of the unperturbed mode profiles with shifted propagation
constants. If no perturbation is present, the elements of the
Cvector
pert must be initialized by CC0
.
Three segment couplers
Frequently, one encounters an arrangement, where one or more well separated input waveguides are joined to a longitudinally homogeneous coupling segment of finite length, followed by one or more well separated output guides. One is interested in the power transfer characteristics. The MMI coupler considered in mmi.cpp is an example. A (basic) simulation of such a device starts with calculating overlap integrals at the first junction between the incoming field(s) and the modes of the coupling segment. These values are used as initial amplitudes to compute the interference fields at the end of the coupling segment. Calculating overlaps at the junction between the coupling segment and the outgoing waveguides yields the amplitudes for the modes of the output channels, or the output powers, respectively. See the section on 'waveguide junctions' in the survey for details.
The following functions (members of the WMM_ModeArray
class,
sources in
wmmarr.h, wmmarr.cpp)
take the WMM_Mode
s of the incoming and outgoing waveguides as
arguments:
pweight 
Amplitude factors for the power evaluation. pweight computes the
double overlap
(M_{in}  M_{m})(M_{m}  M_{out}) involving the input mode M_{in}, the output field M_{out}, and the specified entry M_{m} of the mode array. (..) denotes the lscalprod .

iopower
writeiopower

Relative output power for a multimode coupler based on the array's modes.
The two versions of iopower return either a double value for
the power transmission through a device of specified length, or a
Dvector for a series of devices. The evaluation of the overlap
integrals may be time consuming, therefore
using iopower for a sequence of device lengths is
recommended, if applicable.
writeiopower saves a curve of power transmission values versus
device lengths to a file. Filename is
'??pow??.xyf', where the first two questionmarks indicate the polarization,
and the latter are supplied as arguments.

All involved modes are understood to be normalized with respect to this
product (as put out from the mode analysis procedures).
Applying iopower
subsequently to different input/output configurations
suffices, as long as only one input port is excited at a time.
The code for ioprop
exemplifies modeling the coherent illumination of more than one input guide.