#ifndef EIM_H #define EIM_H /* * METRIC --- Mode expansion modeling in integrated optics / photonics * http://metric.computational-photonics.eu/ */ /* * eim.h * Procedures related to an effective-index-like dimensionality reduction * 2D -> 1D for integrated optical scattering problems */ /* ------------------------------------------------------------------------ */ /* field container, including the solver procedure */ class EimField { public: // the structure in question SegWgStruct str; // polarization: TE, TM Polarization pol; // vacuum wavelength and derived quantities double lambda; double k0; double invommu0; double invomep0; // initialize; EimField(SegWgStruct s, Polarization p, double wl); // the vEIM solver // v = 0: standard version, // v = 1: modified 'vectorial' approach void solve(int v); void solve() { solve(0); } // the resulting field Complex field(Fcomp cp, double x, double z) const; // values on a rectangular mesh Cmatrix field(Fcomp cp, Interval wx, int npx, Interval wz, int npz) const; // ----------------------------------------------------------- // internal representation of the principal field component, // adjusted / calculated by the solver // vertical mode shape Mode vp; // effective permittivity profile Waveguide epseff; Waveguide epseff_b; // horizontal field shape ModeArray hp; Cvector amp; // reflection, transmission double ref; double trans; // ----------------------------------------------------------- // preparation of physical field plots: // selection of the global phase / snapshot time 0 within one period // multiply the entire field by a phase factor exp(i phi), // the internal representation is modified accordingly void adjustphase(double phi); // adjust the global phase, such that a plot(cp, ORG) of the physical // basic field component (cp = EY for TE, cp = HY for TM) exhibits the // maximum field at position (x, z) void adjustphase(double x, double z); // adjust the global phase, such that a plot(cp, ORG) of the physical // basic field component (cp = EY for TE, cp = HY for TM) exhibits an // overall field maximum (-> time snapshot of an extremal state // in case of a configuration with partially standing waves) // ... determine the maximum on a regular mesh of numx * mumz points // on the window given by xbeg, xend, zbeg, zend void adjustphase(double xbeg, double xend, double zbeg, double zend, int numx, int numz); // ----------------------------------------------------------- // visualization: output to MATLAB .m files // evaluation of the mode interference pattern in the display window // xbeg <= x <= xend, zbeg <= z <=zend // npx, npz: number of points in output mesh // ext0, ext1: filename id characters for the .m file // image plot corresponding to field component cp // cp: EX, EY, EZ, HX, HY, HZ, SX, SY, SZ // foa: MOD, SQR, REP, IMP void plot(Fcomp cp, Afo foa, double xbeg, double xend, double zbeg, double zend, int npx, int npz, char ext0, char ext1) const; // export full field data ("everything") into a viewer MATLAB file void viewer(double xbeg, double xend, double zbeg, double zend, int npx, int npz, char ext0, char ext1) const; private: }; #endif // EIM_H