Waveguide
definition

The mode solver assumes a cartesian coordinate system with axes denoted by x, y, and z. The longitudinal zaxis indicates the direction of light propagation, the transverse x, and yaxes are oriented such that all permittivity discontinuities are parallel to one of these axes. In the usual case of a guiding dielectric film on a flat substrate, the ydirection shall be parallel to the substrate surface, the xaxis is normal to the substrate. The following figure shows the proper coordinate system for a rib waveguide:As suggested by the figure, the directions y and x will be called horizontal and vertical, respectively. While this orientation conflicts e.g. with the usual axis orientaion in plot tools, it fits to the description of planar (1D, slab) waveguides in terms of x and z, where x is the relevant transverse coordinate, with the fields and the permittivity being constant along the yaxis.
The choice of the coordinate orientation induces the naming convention for the mode polarization according to the magnitude of the transverse electric (E) and magnetic (H) components of the mode profile:
 A mode with dominant E_{y} and H_{x} components and minor E_{x} and H_{y} fields is called TE polarized,
 one with dominant E_{x} and H_{y} fields and minor E_{y} and H_{x} components will be classified a TM mode.
To encode the waveguide geometry for processing with the mode solver, the cross section plane, the xyplane, is to be decomposed into a matrix of rectangles with constant refractive index. The first and last rectangles in each row/column are unbounded. For the rib waveguide example, the decomposition looks like this:The information on the numbers of rows/columns, the layer boundaries, the refractive index values, and the vacuum wavelength constitute a Waveguide object as defined in waveg.h, waveg.c. See matrix.h and matrix.c for the definition of vectors and matrices used for the boundary locations and refractive indices. Note the following points:
Among the members of a Waveguideobject are:
 All length parameters are given in micrometers, if not otherwise stated.
 The Waveguide members nx and ny denote the number of inner rows/columns of the rectangular decomposition. Accordingly, for a nx x ny waveguide one has to specify the locations hx(0), ..., hx(nx) of the horizontal boundaries, and hy(0), ..., hy(ny) for the vertical boundaries, and refractive index values n(0,0), ..., n(nx+1,ny+1). The rib is a Waveguide(2, 1).
 Frequently, a waveguide is mirror symmetric with respect to a plane spanned by the zaxis and by the normal vector to the substrate (parallel to the xaxis). To enable the mode solver to exploit this symmetry, the origin of the coordinate system must be placed in the symmetry plane of the waveguide.
 The boundary locations must be in ascending order, without any equal entries: hx(l) < hx(l+1), hy(m) < hy(m+1). Disregarding this constraint is likely to end in a core dump. In this framework, a raised strip (Waveguide(1, 1)) is not a rib (Waveguide(2, 1)) with vanishing lateral film thickness.
Additionally, objects of class Waveguide know how to write and read themselves to/from FILEs, they know how to translate themselves to new coordinates, they can deal with the rectangular decomposition in terms of indices and coordinate values (rectidx, rectbounds, testconnect, bdmatch), and they have some knowledge about the bounds defaultneffmin, defaultneffmax on prospective effective indices. Further details can be found in the source files waveg.h, waveg.c directly.
nx, ny The number of inner layers / slices in the rectangular decomposition of the cross section plane. hx, hy The positions of horizontal / vertical boundaries. lambda The vacuum wavelength of the light propagating in this waveguide. n The matrix of refractive index values. eps Functions which return permittivity values, for positions specified by rectangle indices or by (x, y)pairs. xyplane For integral evaluations: A rectangle which is large when compared to the specified core dimensions. The Waveguide constructors take one of the sets {}, {nx, ny}, or {nx, hx, ny, hy, lambda, n}, where the remaining information must be directly assigned. See one of the example files for an actual waveguide definition.