We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
Photonics

Photonics

Topics related to Lumerical and more.

FEEM unstructured data processing

    • Finn Salhoff
      Subscriber

      Good Day,

      I am modelling a waveguide and simulate the modes with FEEM solver. I want to compare the results with the results obtained by MODE.

      I want to process the field data calculated by FEEM solver. The field data is a unstructured data set. Using the visualizer tool, spatial data in my case x and y is shown. How can i achieve the same by lumerical scripting language?

      My end goal is to find the maximum field in a specific area of the device. 

      Where can i find more information about the software?

      Kind regards, Finn

    • Amrita Pati
      Ansys Employee

      Hi Finn,

      If you just want to visualize the data using the script then you can use the getresult and visualize script commands. For example,

      field = getresult("FEEM","fields");
      visualize(field);

      However, if you want to compare the datasets from MODE and FEEM simulation (quantitative comparison), it would be much more starightforward to post-process/compare the data with MODE if we can interpolate it into rectillinear mesh. This can be acheived by the interptri script command. 

      I have a sample script where I interpolate the field result in CHARGE from a triangular mesh to a rectillinear mesh. You can use a similar approach for field results obtained from FEEM.

      x = linspace(-14.5e-6,0e-6,2000);
      y = 0;
      z = linspace(1e-06,3e-06,500);

      x_no = length(x);
      z_no = length(z);

      Ex= matrix(x_no,z_no);
      Ey= matrix(x_no,z_no);
      Ez = matrix(x_no,z_no);

      X = meshgrid3dx(x,y,z);
      Y = meshgrid3dy(x,y,z);
      Z = meshgrid3dz(x,y,z);

      run("CHARGE");
      electrostatics = getresult("CHARGE","electrostatics");
      E = pinch(electrostatics.E);
      Ex_tri = pinch(E,2,1);
      Ey_tri = pinch(E,2,2);
      Ez_tri = pinch(E,2,3);
      vtx_x = electrostatics.x;
      vtx_z = electrostatics.z;
      vtx = [vtx_x,vtx_z];

      tri = electrostatics.elements;

      Ex(:,:) = interptri(tri,vtx,Ex_tri,x,z);
      Ey(:,:) = interptri(tri,vtx,Ey_tri,x,z);
      Ez(:,:) = interptri(tri,vtx,Ez_tri,x,z);

      image(x*1e6,z*1e6,Ex(:,:),"x (um)","z (um)","E");
      image(x*1e6,z*1e6,Ey(:,:),"x (um)","z (um)","E");
      image(x*1e6,z*1e6,Ez(:,:),"x (um)","z (um)","E");

       

      Here I first define the 2D rectilinear grid (you can set this based on the MODE simulation which would make it easier to compare), where I want the fields to be interpolated to. Then I initialize the matrices where the final fields (Ex,Ey, and Ez) will be stored. Then I get the results from CHARGE and interpolate them using the interptri script command. 

      For general information, please visit the Ansys Optics Page: https://optics.ansys.com/hc/en-us

      From here you can access the 1.  Knowledge Base (KB): which consists of articles on various solvers and topics. 2. App Gallery (APP): here you find simulation example files, and detailed information for different application areas using different solvers (including FEEM). 3. Ansys Innovation Courses: You can find courses on different solvers and scripting. For a list of all script commands, please refer to: https://optics.ansys.com/hc/en-us/articles/360034923553-Lumerical-scripting-language-Alphabetical-list

      Please let me know if you have any questions.

       

      Regards,
      Amrita

       

       

       

    • Finn Salhoff
      Subscriber

      Hello Amrita,

      "interptri" was the function i needed. Thank your for the helpful answer.

      Regards, Finn

Viewing 2 reply threads
  • The topic ‘FEEM unstructured data processing’ is closed to new replies.