March 13, 2021 at 1:12 amGuanhui WangAnsys Employee
The spatial data available from a DEVICE simulation such as charge, electric field, or temperature profile are all saved on a finite element grid. These data can be easily visualized from the visualizer but not easy to manipulate, i.e., adding/subtracting different data or getting partial data on a plane or along a line. It is therefore often desirable to interpolate these finite element data onto a rectilinear grid for post processing. The interpolated data can also be exported to other software such as Matlab for further processing.
The two script commands that can be used to perform this interpolation is interptri 59 (2D) and interptet 21 (3D). The KB page for interptri 59 has a detailed example on how to interpolate 2D finite element data onto a rectilinear grid. Similar approach can be used to interpolate 3D finite element data using the interptet command.
The following is an example of a combination of script commands that can be used to interpolate 3D charge data onto a rectilinear grid and then plot the data along a line.
[code]# get charge data
charge = getresult(‘CHARGE’,‘charge’);
n = pinch(charge.n);
p = pinch(charge.p);
get information about the finite elemetn data
x = charge.x; # x coordinates
y = charge.y; # y coordinates
z = charge.z; # z coordinates
vtx = [x,y,z];
elements = charge.elements; # connectivity matrix
kern = size(n);
Ne = kern(1); # Number of elements
Nv = kern(2); # Number of bias points
Define rectilinear grid
delta = 1e-9;
x_rect = linspace(min(x),max(x),5);
y_rect = linspace(min(y),max(y),5);
z_rect = linspace(min(z),max(z),101);
pick one bias point (last one)
n = n(1:Ne,Nv);
p = p(1:Ne,Nv);
n_rect = interptet(elements,vtx,n,x_rect,y_rect,z_rect); # interpolating n
p_rect = interptet(elements,vtx,p,x_rect,y_rect,z_rect); # interpolating p
plot n and p along Z
plot(z_rect(11:91)*1e6,n_rect(3,3,11:91),p_rect(3,3,11:91),‘z (um)’,‘carrier density (/cm^3)’,’’,‘log10y’);
The script generates the following plot:Viewing 0 reply threads
Ansys Innovation Space
- You must be logged in to reply to this topic.
Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.Trending discussions
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Error on Lumerical device
- Using a license file on a new license server
- Error: addfdtd is not a valid function or a variable name
- Ansys Insight: Diverging Simulations
- Ansys Insight: Transmission results greater than one
- Ansys Insight: About override mesh in FDTD: its use and settings
- Ansys Insight: Convergence issues in CHARGE
- Is there a Lumerical script command to output the Simulation and Memory requirements?
Top Rated Tags
© 2023 Copyright ANSYS, Inc. All rights reserved.Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.