#ifndef MATLVIS_H #define MATLVIS_H /* * METRIC --- Mode expansion modeling in integrated optics / photonics * http://metric.computational-photonics.eu/ */ /* * matlvis.h * Visualization, helper routines, output to MATLAB m-files */ /* some global settings */ #define YES 1 #define NO 0 /* output uses colour */ extern int Mlop_Colour; /* output files include print commands */ extern int Mlop_Print; /* add contour lines to image plots */ extern int Mlop_Contour; /* output window, x-z-plane */ void mlout_windowxz(FILE *dat, double xbeg, double xend, double zbeg, double zend); /* output window, generic */ void mlout_window(FILE *dat, char xchr, double xbeg, double xend, char zchr, double zbeg, double zend); /* output mesh, x-z-plane */ void mlout_meshxz(FILE *dat, double ybeg, double yend, int npy, double zbeg, double zend, int npz); /* output mesh, generic */ void mlout_mesh(FILE *dat, char xchr, double xbeg, double xend, int npx, char zchr, double zbeg, double zend, int npz); /* previously stored field is meant as real part of a field component */ void mlout_fldtore(FILE *dat, Fcomp cp); /* previously stored field is meant as imaginary part of a field component */ void mlout_fldtoim(FILE *dat, Fcomp cp); /* general structure: geometry for interference visualization */ void mlout_gengeoxz(FILE *dat, SegWgStruct st, double xbeg, double xend, double zbeg, double zend); void mlout_gengeoxz(FILE *dat, OvlStruct ovl, double xbeg, double xend, double zbeg, double zend); /* general structure: refractive index profile patches, data */ void mlout_gengeorefindpatches(FILE *dat, SegWgStruct s); /* interference plot, general structure */ void mlout_genimage(Fcomp cp, Afo foa, const char *name, const char *desc, FILE *dat); void mlout_genimage(char xchr, char zchr, Fcomp cp, Afo foa, const char *name, const char *desc, FILE *dat); /* add contour lines to an image plot */ void mlout_contours(Fcomp cp, FILE *dat); void mlout_contours(char xchr, char zchr, Fcomp cp, FILE *dat); /* interference animation, general structure */ void mlout_genmovie(Fcomp cp, const char *name, const char *desc, FILE *dat, int ntfr, double dt, double om, double famp); void mlout_genmovie(char xchr, char zchr, Fcomp cp, const char *name, const char *desc, FILE *dat, int ntfr, double dt, double om, double famp); /* add contour lines to an image movie */ void mlout_contours(FILE *dat); void mlout_contours(char xchr, char zchr, FILE *dat); /* fancy interference plot */ void mlout_fancy(const char *name, const char *desc, FILE *dat, Fcomp cp, int nc); /* interference animation, fancy style */ void mlout_genfmovie(Fcomp cp, const char *name, const char *desc, FILE *dat, int nc, int ntfr, double dt, double om, double famp); /* linear colormap */ void mlout_lincolormap(FILE *dat); /* colormap for positive values, shows low levels in more detail */ void mlout_lowlevcolormap(FILE *dat); /* colormap, magnified range around the center (only for Colour=YES) */ void mlout_magcolormap(FILE *dat); /* sketch of permittivity boundaries: colours, linewidth */ void mlout_sketchinit(FILE *dat); /* .m file title comment */ void mlout_title(FILE *dat, const char *name, const char *intro); /* waveguide geometry and field extrema */ void mlout_geo(FILE *dat, Waveguide wg, double minf, double maxf); /* mode section plot geometry */ void mlout_Lsecgeo(FILE *dat, double x0, double x1, int nbd, Dvector bd, Dvector ri); /* section of a 1D field, including position vector */ void mlout_sec(FILE *dat, Fcomp cp, char c2, char c3, char c4, char c5, int np, Dvector fld, Dvector pos); /* section of a 2D field, begin + end points */ void mlout_sec(FILE *dat, double x0, double z0, double x1, double z1, int np, Fcomp cp, int nc, Dvector fld); /* section of a complex 2D field, begin + end points */ void mlout_sec(FILE *dat, double x0, double z0, double x1, double z1, int np, Fcomp cp, int nc, Cvector fld); /* for the fancy plots: transfer data related to the geometry annotations */ void mlout_bddata(FILE *dat, Fcomp cp, int nc, Ivector si, Ivector np, Dvector f, Dvector x0, Dvector z0, Dvector x1, Dvector z1); void mlout_bddata(FILE *dat, Fcomp cp, int nc, Ivector si, Ivector np, Cvector f, Dvector x0, Dvector z0, Dvector x1, Dvector z1); /* mode section plot, plot commands */ void mlout_Lsecplot(const char *name, FILE *dat, Fcomp cp, Afo foa, int nbd, int nsec); void mlout_Vsecplot(FILE *dat, Fcomp cp, int nsec, char ext0, char ext1); /* 1D refractive index profile, plot commands */ void mlout_refindplot(const char *name, FILE *dat, Interval i); /* 1D complex refractive index profile, plot commands */ void mlout_crefindplot(const char *name, FILE *dat, Interval i); /* 2D refractive index profile, plot commands */ void mlout_refindoverview(const char *name, FILE *dat); /* matrix of field values */ void mlout_fld(FILE *dat, int npx, int npz, Fcomp cp, Dmatrix fld); /* print commands */ void mlout_print(FILE *dat, const char *name, char dev); /* ----------------------------------------------------------------------- */ /* field viewer .m-file: top, title and globals */ void mlout_viewertop(FILE *dat, const char *name, Polarization p, double wl); void mlout_viewertop(FILE *dat, const char *name, Polarization p, double wl, int vM); void mlout_viewertop(FILE *dat, const char *name, char xchr, char zchr, Polarization p, double wl, int vM); /* matrix of refractive index values */ void mlout_n(FILE *dat, int npx, int npz, Dmatrix n); /* matrix of field values, zero field */ void mlout_0fld(FILE *dat, Fcomp cp, char xchr, char zchr); void mlout_0fld(FILE *dat, Fcomp cp); void mlout_0fldxy(FILE *dat, Fcomp cp); /* field viewer .m-file: viewer commands */ void mlout_fldviewer(FILE *dat, const char *name); void mlout_fldviewer(FILE *dat, const char *name, char xchr, char zchr); /* ----------------------------------------------------------------------- */ /* long three segment coupler: geometry for interference visualization */ void mlout_l3scgeoxz_2(FILE *dat, Waveguide wg1, Waveguide wg2, Waveguide wg3, double l, double xbeg, double xend); /* interference intensity image, long three segment coupler */ void mlout_1Dl3scimage(const char *name, FILE *dat); /* --- 3D waveguides with 2D cross sections ------------------------------ */ /* structure, geometry */ void mlout_gengeoxy(FILE *dat, SegWgCrs st, Rect disp); void mlout_gengeoxy(FILE *dat, OvlStruct o, Rect disp); /* output window, x-y-plane */ void mlout_windowxy(FILE *dat, double xbeg, double xend, double ybeg, double yend); /* refractive index profile patches, data */ void mlout_gengeorefindpatches(FILE *dat, SegWgCrs s); /* plot commands */ void mlout_wgcrsoverview(const char *name, FILE *dat); /* waveguide geometry and field extrema */ void mlout_geo(FILE *dat, WgCrs wg, double minf, double maxf); /* waveguide geometry and field extrema for interference visualization */ void mlout_geoyz(FILE *dat, WgCrs wg, double minf, double maxf); /* three segment coupler geometry and field extrema for interference visualization, input and output waveguides included */ void mlout_iopropgeo(FILE *dat, WgCrs iwg, WgCrs pwg, WgCrs owg, double l, double minf, double maxf); /* output mesh, x-y-plane */ void mlout_meshxy(FILE *dat, Rect disp, int npx, int npy); /* output mesh, y-z-plane */ void mlout_meshyz(FILE *dat, double ybeg, double yend, int npy, double zbeg, double zend, int npz); /* field section */ void mlout_sec(FILE *dat, double x0, double y0, double x1, double y1, int np, Fcomp cp, char c2, char c3, Dvector fld); /* field section, 1D*/ void mlout_sec1D(FILE *dat, Fcomp cp, char c2, char c3, char c4, char c5, int np, Dvector fld, Dvector pos); /* contour plot */ void mlout_contour(char *name, FILE *dat, Fcomp cp, Afo foa); void mlout_contour(char *name, FILE *dat, Fcomp cp, Afo foa, const char* vlab, const char* hlab); /* surface plot */ void mlout_surface(char *name, FILE *dat, Fcomp cp, Afo foa); void mlout_surface(char *name, FILE *dat, Fcomp cp, Afo foa, const char *vlab, const char *hlab); /* intensity image */ void mlout_image(char *name, FILE *dat, Fcomp cp, Afo foa, double minf, double maxf); void mlout_image(char *name, FILE *dat, Fcomp cp, Afo foa, double minf, double maxf, const char *vlab, const char *hlab); /* six component surface plot */ void mlout_acmfile(char *name, FILE *dat, double minE, double maxE, double minH, double maxH); /* mode section plot geometry */ void mlout_Lsecgeo(FILE *dat, double x0, double y0, double x1, double y1, int nbd, Dvector bd, Dvector ri); /* mode section plot, plot commands */ void mlout_Lsecplot(char *name, FILE *dat, char ori, double minf, double maxf, Fcomp cp, int nbd, int nsec); /* fancy plot */ void mlout_fancy(char *name, FILE *dat, Fcomp cp, int numc); /* for interference data: show the z position */ void mlout_annotatezpos(FILE *dat, double rz); /* interference field animation */ void mlout_play(FILE *dat, char *name, int numz); /* print commands */ void mlout_print(FILE *dat, char *name, char dev); /* interference intensity image */ void mlout_propimage(char *name, FILE *dat); /* three segment coupler, interference intensity image */ void mlout_iopropimage(char *name, FILE *dat); /* field viewer .m-file, 3D mode profiles: top, title and globals */ void mlout_viewertopxy(FILE *dat, const char *name, Polarization p, double lambda); void mlout_viewertopxy(FILE *dat, const char *name, double lambda); /* mode profile viewer .m-file: viewer commands */ void mlout_fldviewerxy(FILE *dat, const char *name); #endif // MATLVIS_H