( ) (

If you choose the "Interpolate" option from the main menu and click the
"Ok" button, you enter the interpolation GUI.
Given a "from" grid and a "from" solution and given a "to" grid, then
a solution for the "to" grid can be obtained by interpolation from the
"from" grid and solution.
There are programs for both 2D and 3D.
The interpolation programs allow any number of dependent variables to be
interpolated.
If the number of variables is different from four for 2D or five for 3D,
then the PLOT3D and NPARC files are read and written as usual except for
a different number of variables.
Common File *.cfl* files are also read and written the same way
except the variables are named "`VARbbbb1`" (the `b`'s
are blanks) for the first variable and the integer is incremented for
successive variables.
The grids and solution can be read from PLOT3D, NPARC and Common File
files and the interpolated solution can be written as a PLOT3D, NPARC or
Common File.
The GUI leads you through this process.

The interpolated solution is obtained by taking each node in the "to" grid and finding a hexahedron in the "from" grid which contains the node, then performing a trilinear interpolation. The tricky part of the process is finding the containing hexahedron which will be called a stencil.

Let a stencil with indices (`I,J,K`) be a hexahedron determined
by the eight nodes in the "from" grid, (`X,Y,Z`), with indices

(I , J , K ) (I+1, J , K ) (I , J+1, K ) (I+1, J+1, K ) (I , J , K+1) (I+1, J , K+1) (I , J+1, K+1) (I+1, J+1, K+1)where

1 ≤ I < IMAX 1 ≤ J < JMAX 1 ≤ K < KMAX

Given the first node in the "to" grid, to start things off,
an exhaustive search is made in the "from" grid to find the
(`I,J,K`) of the node closest to the given first node.
Then the three parameters, A, B and G, of the
trilinear interpolation of the stencil
(`I,J,K`) are computed.
If the given first node is inside the stencil, then all three parameters
will be between plus and minus one.
If one or more of the parameters are not within range, then the next
prospective stencil is determined by the following `IF`'s:

IF (A .LT. -1.0) I = MAX( 1, I-1) IF (A .GT. 1.0) I = MIN(IMAX-1, I+1) IF (B .LT. -1.0) J = MAX( 1, J-1) IF (B .GT. 1.0) J = MIN(JMAX-1, J+1) IF (G .LT. -1.0) K = MAX( 1, K-1) IF (G .GT. 1.0) K = MIN(KMAX-1, K+1)

Usually this process will walk to the containing stencil. If after a number of steps the next prospective stencil is one that has already been tried, then the method would be caught in a loop. Checks are made to be sure this does not happen.

After the containing stencil for the first node has been found, no more
exhaustive searches are performed.
These are too time consuming to be practical for many grids.
The stencil just found is used as the first guess for the next "to" node
and the walking process described above is used to find the correct
stencil.
Experience has shown that this works very well if the next point is
close to the first point.
This closeness is achieved by snaking through the "to" grid according to
the following nested `DO`'s.

IBEGIN = IMAX IEND = 1 ISTEP = -1 JBEGIN = JMAX JEND = 1 JSTEP = -1 DO K = 1, KMAX JBEGIN = JMAX + 1 - JBEGIN JEND = JMAX + 1 - JEND JSTEP = -JSTEP DO J = JBEGIN, JEND, JSTEP IBEGIN = IMAX + 1 - IBEGIN IEND = IMAX + 1 - IEND ISTEP = -ISTEP DO I = IBEGIN, IEND, ISTEPFind the interpolating stencil for thenode(I,J,K)in the "to" grid.END DO END DO END DO

If no containing stencil can be found, then a check is made to see if the stencil is close enough for an extrapolation. An extrapolation is made if the absolute values of the parameters are less than prescribed values. The GUI provides for specification of the extrapolation tolerances for each index and for each zone. This flexibility is provided so a user can allow a larger extrapolation across a boundary layer than in the other directions. A value of 1.0 means no extrapolation. A value of 2.0 would mean an extrapolation would be made in that direction of one cell width.

If the stencil is not close enough for extrapolation, then the "to" node
is said to be an orphan node.
The program provides two options for orphan nodes.
The user can specify a default value for each solution or the value of
each solution can be set to the value of the solution of the "from" grid
at the "best" node, where best is defined as the node with the same
(`I,J,K`) indices as that of the stencil found by the method.

Each zone of the "to" grid is interpolated one at a time.
All of the nodes in a "to" zone are processed with the first "from"
zone.
Then all of the nodes of the "to" zone are processed with the second
"from" zone and so on until all of the "from" zones have been gone
through.
Iblanking of the "from" grid is considered and the `IBLANK` array
for the "to" grid is determined.
An array, `JSTAT`, keeps track of the progress for each "to" node.

JSTAT = 0 => in a hole JSTAT = 1 => orphan JSTAT = 2 => extrapolated boundary JSTAT = 3 => interpolated boundary JSTAT = 4 => extrapolated interior JSTAT = 5 => interpolated interior

A node in the "to" grid is assigned `JSTAT` = 2 or 3 if at least
one of the points of its stencil has an `IBLANK` of zero (no flow
region).
A node in the "to" grid is assigned `JSTAT` = 4 or 5 if all of
the points of its stencil have nonzero `IBLANK`.
`IBLANK` for the "to" grid is assigned zero for nodes with
`JSTAT` = 0 and one otherwise.

When a stencil is found it is used only if it would raise the
`JSTAT` value of the node.
All of the nodes begin with a `JSTAT` value of zero.
Note that the walking process for finding a stencil proceeds as usual
through a hole.
Therefore, it is assumed that the grid inside a hole is reasonable.
A degenerate volume inside a hole can abort the program.

Last updated 2 May 2003