mat_save.lsf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. clear;
  2. slash = "/";
  3. if (operatingsystem == "windows") {slash = "\\";}
  4. #########################################
  5. # Set constants
  6. mkm = 1e-6;
  7. groupscope("::model");
  8. select("FDTD");
  9. min_mesh_step=get("min mesh step");
  10. select("sub-Au");
  11. sub_Au_z_max = get("z max");
  12. #########################################
  13. # Get FDTD material data
  14. #groupscope("::model::mon");
  15. min_f = getglobalmonitor("minimum frequency");
  16. max_f = getglobalmonitor("maximum frequency");
  17. fpoints = getglobalmonitor("frequency points");
  18. fvec=linspace(min_f,max_f,fpoints);
  19. #Au_name = "Au (Gold) - Johnson and Christy Copy 2";
  20. Au_name = "Au-McPeak";
  21. n_fdtd=getfdtdindex(Au_name,fvec,min_f,max_f);
  22. #n_fdtd;
  23. #########################################
  24. format long;
  25. #z_arr = [5, 20];
  26. #########################################
  27. monitor_name = "monitor_1";
  28. mon1_E = getresult(monitor_name, "E");
  29. mon1_H = getresult(monitor_name, "H");
  30. monitor_name = "monitor_2";
  31. mon2_E = getresult(monitor_name, "E");
  32. mon2_H = getresult(monitor_name, "H");
  33. lambda = mon1_E.lambda;
  34. z = mon1_E.z;
  35. dippower = dipolepower(mon1_E.f);
  36. vacpower = sourcepower(mon1_E.f);
  37. name_base = filebasename(currentfilename)+"."+fileextension(currentfilename)+".1D.results";
  38. matlabsavelegacy(name_base);