mat_save.lsf 1.2 KB

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