Ansys Learning Forum Forums Discuss Simulation Photonics FEEM unstructured data processing Reply To: FEEM unstructured data processing

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

 

 

Â