Date: March, 2004.
This program splines, redistributes and projects points from grids supplied in a PLOT3D single/multiple grid file. Curve, surface and volume grids are assumed to be dimensioned (jmax,1,1), (jmax,kmax,1) and (jmax,kmax,lmax), respectively. Spline knots are supplied by the original grid. An option allows the redistributed points to be projected back on to the piece-wise linear representation of the curve/surface defined by the original points.
Redistribution is performed on J-varying curves, K-varying curves, or L-varying curves independently of each other.
Each curve in J, K or L can be divided into one or more segments on which redistribution is performed. Each segment is defined by its start and end indices IS,IE. The new number of points NP and grid spacings at the end points of the segment DELS,DELE can be specified. Grid points not on any defined segments are untouched.
For surface grids, a more complex situation may arise as follows. Suppose redistribution is to be performed in the J direction. Typically, the same end point spacings DELS and DELE are applied for all K=constant curves. In this case, the parameter NNODE (number of nodes) should be set to 1. If different end point spacings are desired at different K stations, NNODE > 1 should be used. At each node index (NODEI), a different set of DELS and DELE can be specified. Linear interpolation is used for values of DELS and DELE between nodes. For curve grids, NNODE should always be set to 1. Multiple nodes are currently NOT supported for redistribution in L.
This program is modified from the spline.f program obtained from Bob Meakin and can be used as
Sample input file 1
-----------------------------------------------
input_grid_filename
output_grid_filename
1 NBI, [MULTIG]
1, 3 IG, IROPT
1, 1, 1 IDIR, IMODE, [ISPEC]
2, 2 NSEG, NNODE
1, 10, 20 IS, IE, PAR (segment 1)
1, 0.1, 0.1 NODEI, DELS, DELE (node 1)
-1, 0.2, 0.2 (node 2)
29, -1, 17 IS, IE, PAR (segment 2)
1, 0.0, 0.0 NODEI, DELS, DELE (node 1)
-1, 0.0, 0.0 (node 2)
2, 1, 2 IDIR, IMODE, [ISPEC]
2, 1 NSEG, NNODE
1, 20, 1.2 IS, IE, PAR (segment 1)
1, 0.1, 0.1 NODEI, DELS, DELE (node 1)
20, -1, 1.2 IS, IE, PAR (segment 3)
1, 0.1, 0.0 NODEI, DELS, DELE (node 1)
-----------------------------------------------
Sample input file 2
-----------------------------------------------
input_grid_filename
output_grid_filename
1, 1 NBI, [MULTIG]
1, 1 IG, IROPT
1, 1, 6 IDIR, IMODE, [ISPEC]
1, 1 NSEG, NNODE
1, -1, 3 IS, IE, PAR (segment 1)
2,11,2,2,1,1 JS,JS,KS,KE,LS,LE
-----------------------------------------------
NBI = number of blocks of input ( <= number of grids + 1 ).
Each block of input contains SRAP parameters for one
grid (IG > 0) or for all grids (IG = 0) - see IG input
below. Parameters specified under IG > 0 overrides
parameters specified under IG = 0. Redistribution is
not performed on grids in the grid file that are not
specified in the input parameters file.
MULTIG >0 for ISPEC=2,3,4,5, use multi-griddable number of points
N where (N-1) is a multiple of 2^MULTIG
=0 for ISPEC=2,3,4,5, do not check for multi-griddable
number of points
For N=1,NBI, enter the following block
{
IG >0 grid number of grid on which this block of parameters
is applied
=0 apply this set of parameters to all grids other than
the ones specified by IG>0. Parameters for IG=0 must
appear in the first block of input.
IROPT = redistribution direction
(0 = no redistribution,
1 = redistribute in J direction,
2 = redistribute in K direction,
3 = 1 followed by 2,
4 = 2 followed by 1,
5 = redistribute in L direction
1/2/3/4/5 => projection is performed afterwards
-1/-2/-3/-4/-5 => no projection is performed)
Enter the following sub-block once for IROPT = 1 or 2 or 5.
Enter the following sub-block twice for IROPT = 3 or 4.
Do not enter the following sub-block if IROPT = 0.
[
IDIR = redistribution direction for this sub-block of parameters
(1 = J direction parameters,
2 = K direction parameters,
3 = L direction parameters)
IMODE = input grid spacing option
(1 = absolute,
2 = relative to arc length of segment)
ISPEC = input specification option (if ISPEC is omitted in input
line, ISPEC=1 is assumed)
(1 = specify number of points NP and end spacings for each segment;
NP specified in PAR must be in range NP > 0 - see below,
2 = specify max stretching ratio RMAX and end spacings for each
segment, number of points is automatically determined;
RMAX specified in PAR must be in range RMAX > 1 - see below,
3 = specify uniform grid spacing in DELS, number of points
is automatically determined, DELS must be > 0.
4 = specify uniform grid spacing in DELS and max distance deviation
between new and original curve in PAR, sharp turns and number
of points are automatically determined, grid spacings are
automatically reduced at high curvature turns, DELS must be >0,
implemented in J direction and for curves only,
5 = specify max stretching ratio RMAX, end spacings for each
segment, as well as max interior spacing allowed DELU, number of
points is automatically determined;
RMAX specified in PAR must be in range RMAX > 1 - see below,
DELU specified after DELE,
6 = copy point distribution from a curve subset of another grid
in the input grid file.
NSEG = number of segments.
Each grid line in J, K, or L can be divided into one or more
segments on which redistribution is performed. Each segment
is defined by its start and end indices IS,IE. The new number
of points NP and grid spacings at the end points of the
segment DELS,DELE can be specified. Grid points not on any
defined segments are untouched.
NNODE = number of nodes.
This is used to indicate variations in grid spacings in the
cross direction for surface grids. For curve grids, NNODE
should always be 1. For surface grids, suppose redistribution
is in J. One node in K would imply that the current sub-block
of parameters is used for all K. Multiple nodes in K would
allow a different DELS and DELE at different K stations K=NODEI.
Linear interpolation is used for values of DELS, DELE between
nodes. For IROPT=5, NNODE should be 1.
IS, IE = start and end segment indices
PAR = new number of points for segment with end spacings given by
DELS and DELE (ISPEC = 1) - must be > 0, or
= max stretching ratio for segment with end spacings given by
DELS and DELE (ISPEC = 2) - must be > 1
= max distance deviation between original and new curve (ISPEC=4)
if IMODE=1, PAR>0 gives absolute distance
PAR<0 gives distance relative to DELS
if IMODE=2, 0 < PAR < 1 gives relative distance to segment arc length
= grid number of grid in input grid file to copy distribution
from (ISPEC=6)
For ISPEC<6, repeat the following line for each node
(
NODEI = grid point index of node
DELS >0 prescribed grid spacing at start of segment
=0 float grid spacing at start of segment
DELE >0 prescribed grid spacing at end of segment
=0 float grid spacing at end of segment
(setting both DELS and DELE to zero with PAR>0 will given
uniform spacing for segment)
DELU >0 max spacing allowed (needed for ISPEC=5 only)
)
For ISPEC=6, enter
JS,JE,KS,KE,LS,LE = j,k,l curve subset in specified grid (PAR) from which
to copy distribution
]
}