/* * METRIC-Application: * Coupled guided wave propagation along two parallel cores */ #include #include #include #include"metric.h" #define Pol TE // light polarization #define CPnb 1.0 // background refractive index #define CPng 2.0 // core refractive index #define CPw 0.3 // core width /mum #define CPg 0.3 // gap width /mum #define Wavel 1.55 // vacuum wavelength /mum #define DWx 2.0 // half widths of the display window, symmetric #define DWz 6.0 // /* ------------------------------------------------------------------------ */ /* two parallel waveguide cores */ Waveguide wgdef() { Waveguide wg(3); wg.hx(0) = -CPg/2.0-CPw; wg.hx(1) = -CPg/2.0; wg.hx(2) = CPg/2.0; wg.hx(3) = CPg/2.0+CPw; wg.n(0) = CPnb; wg.n(1) = CPng; wg.n(2) = CPnb; wg.n(3) = CPng; wg.n(4) = CPnb; wg.lambda = Wavel; return wg; } /* ------------------------------------------------------------------------ */ /* guided wave simulation */ int main() { fprintf(stderr, "\nParallel cores:\n"); fprintf(stderr, "---------------\n"); fprintf(stderr, "lambda = %g mum\n", Wavel); fprintf(stderr, "n_b = %g\n", CPnb); fprintf(stderr, "n_g = %g\n", CPng); fprintf(stderr, "w = %g mum\n", CPw); fprintf(stderr, "g = %g mum\n\n", CPg); // the structure under investigation Waveguide wg = wgdef(); // find the guided modes ModeArray ma; modeanalysis(wg, Pol, ma); // illustrate the interference pattern Cvector af(ma.num); Cvector ab(ma.num); af.init(CC0); ab.init(CC0); af(0) = CC1; af(1) = -CC1; Mlop_Print = NO; Mlop_Colour = YES; char pc = polchr(Pol); Fcomp fc = principalcomp(Pol); ma.viewer(af, ab, -DWx, DWx, -DWz, DWz, 50, 200, 't', pc); ma.plot(af, ab, fc, REP, -DWx, DWx, -DWz, DWz, 50, 200, 't', pc); ma.plot(af, ab, fc, IMP, -DWx, DWx, -DWz, DWz, 50, 200, 't', pc); ma.plot(af, ab, fc, MOD, -DWx, DWx, -DWz, DWz, 50, 200, 't', pc); ma.phasemap(af, ab, fc, -DWx, DWx, -DWz, DWz, 50, 200, 't', pc); ma.movie(af, ab, -DWx, DWx, -DWz, DWz, 50, 200, 30, 't', pc); ma.fplot(af, ab, fc, -DWx, DWx, -DWz, DWz, 50, 200, 't', pc); ma.fmovie(af, ab, -DWx, DWx, -DWz, DWz, 50, 200, 30, 't', pc); fprintf(stderr, "\nOk.\n"); return 0; }