# grid3D

Synopsys: grid3D(xg,yg,zg,[xC,yC,zC])

xg, yg, and zg, are the points of the discretized grid along the x,y,z axis. xC, yC and zC are optional,
and correspond to the x,y,z coordinates of the atoms to be included in the 3D domain.
In particular, when specified, xC, yC and zC, grid3D impose a grid point in correspondence of such coordinates.
Have a look at the tutorial on the grid3D to get a clear understanding.

grid3D is a NanoTCAD ViDES class devoted to the definition of the discretized tridimensional domain.
In particular, it deals with non-uniform rectangular grids, and with all the relevant quantities needed to discretized the 3D Poisson equation
within the box-integration method.

This is a generalization of the 2D discretization problems, explained in the grid2D command.

In particular, the surface of the Voronoi cell $\Omega$l, the length of the segment delimiting the Voronoi cell $\sigma$li, and the distance

between the point l and its first neighbour dli, in the 3D domain, translates to the volume of the Voronoi cell ($\Omega$l) the delimiting surface of the Voronoi cell ($\sigma$li),

and the distance of between point l and its first neighbour i (dli).

Since it is easier to work with vectors rather than with matrices, the discretized quantities (e.g. the electrostatic potential, x-y-z coordinates, free charge etc.) are ordered first along x, then along y and z. This means that in the 3D domain, if the generic point rl has index i, j and k along the three axis, its index l in the mapped vector is:

l=i+j*nx+k*nx*ny

with

i=0..nx-1

j=0..ny-1

k=0..nz-1

The attribute of grid3D instance are the following:

• nx : (int) number of grid points along the x axis
• ny : (int) number of grid points along the y axis
• nz : (int) number of grid points along the z axis
• Np : (int) total number of grid points: Np=nx*ny*nz
• x3D : (array of double, dimension Np) x coordinates of each grid point, ordered as above
• y3D : (array of double, dimension Np) y coordinates of each grid point, ordered as above
• z3D : (array of double, dimension Np) z coordinates of each grid point, ordered as above
• surf : (matrix of double, dimension [Np][6]) matrix of the $\sigma$li surfaces of the Voronoi cell. Since the grid is hexahedric, point l has 6 first neighbour. surf[l][0], and surf[l][1] (x coordinate of surf[l][0] < surf[l][1]) correspond to the surfaces normal to the x axis, surf[l][2] and surf[l][3] (y coordinate of surf[l][2] < surf[l][3]) correspond to the surfaces normal to the y axis, while surf[l][4] and surf[l][5] to the surfaces normal to the z axis  (z coordinate of surf[l][4] < surf[l][5]).
• dist : (matrix of double, dimension [Np][6]) matrix of the dli distances between point l and i. Since the grid is hexahedric, point l has 6 first neighbour. dist[l][0], and dist[l][1] correspond to the distances along the x axis where x[i-1]=x[i]-dist[i][0] and x[i+1]=x[i]+dist[i][1], dist[l][2] and dist[l][3] correspond to the distances normal to the y axis, where y[i-ny]=y[i]-dist[i][2] and y[i+ny]=y[i]+dist[i][3], while dist[l][4] and dist[l][5] to the distances along to the z axis, where z[i+nx*ny]=z[i]+dist[i][5] and z[i-nx*ny]=z[i]-dist[i][4].
• gridx : (array of double, dimension nx)  points discretized along the x axis. If xC, yC and zC are not specifies, gridx=xg
• gridy : (array of double, dimension ny)  points discretized along the y axis. If xC, yC and zC are not specifies, gridy=yg
• gridz : (array of double, dimension nz)  points discretized along the z axis. If xC, yC and zC are not specifies, gridy=zg
• dVe : (array of double, dimension Np) dVe[i] represents the volume of the Voronoi cell around the i-th point of the grid
• swap : (array of double; dimension Np) the array needed to map the points belonging to the 3D grid to points belonging to the material where the NEGF equation is solved. Look at Tutorial 04 for an example.
• xmin : (double) minimum of the x-coordinate
• xmax : (double) maximum of the x-coordinate
• ymin : (double) minimum of the y-coordinate
• ymax : (double) maximum of the y-coordinate
• zmin : (double) minimum of the z-coordinate
• zmax : (double) maximum of the z-coordinate