  # Interpolate finite element data onto a rectilinear grid

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 (2D) and interptet (3D). The KB page for interptri 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. You can use this pn_diode_3d.ldev (1.5 MB) file to test the script.

[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);

n = n(1:Ne,Nv);
p = p(1:Ne,Nv);

# Interpolate

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’);
legend(‘n’,‘p’);[/code]

The script generates the following plot: 8 Likes

Dr.Alam

could you please describe the physical meaning of this figure or advice me with a reference describe it

Hi. The plot above shows the distribution of the electrons and holes in the pn diode along a line in z-direction. You can see the p-doped and the n-doped regions and can identify the depletion region. I have marked the picture below so it is easier to read. You can find similar plots in most solid-state electronics book that talks about pn junctions. 1 Like

I have a design of a nanowire has p type and n type when I run the script above it give me that attached figure so I can’t understand it’s physical meaning and I’m sure that the doping is correct
would you help me in that  You are plotting the carrier density along z axis here. However, from the 3D plot, I can see z axis is the direction along the nanowire so you would expect to see a constant doping profile along z. You will need to plot the carrier concentration along x or y to see the pn junction.

may I ask you to adjust the script so I plot the carrier concentration along x or y to see the pn junction please

I would prefer to explain the script to you instead of modifying it for you since this way you can later edit the script again or create your own script if needed. The modification is very simple. After the interpolation the n_rect and p_rect arrays contain the n and p densities on a rectiliner grid. The second last line of the script simply plots them along z by picking the mid points in x and y direction and keeping all the points inside Si in z direction [hence the form n_rect(3,3,11:91)].

In your case, since you would want more points in x or y direction, you will also need to have more points in those directions when you create x_rect or y_rect. Please have a go at the script and let me know if you have any problem understanding any of the commands.

1 Like

A post was split to a new topic: Value of interpolated data using the “interptri” command is much larger than the source data