Overture  Version 25
Macros | Functions
findNearestGridPoint.C File Reference
#include "Overture.h"
#include "display.h"
#include "MappingProjectionParameters.h"
#include "ParallelUtility.h"
#include "CanInterpolate.h"
#include "SparseArray.h"
Include dependency graph for findNearestGridPoint.C:

Macros

#define R(i0, i1)   rp[i0+rDim0*(i1)]
 
#define X(i0, i1)   xp[i0+xDim0*(i1)]
 
#define XA(i0, i1)   xap[i0+xaDim0*(i1)]
 
#define DISTA(i0)   pdista[i0]
 
#define GRID(i1, i2, i3, axis)   gridp[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
 
#define gid(side, axis)   pgid[(side)+2*(axis)]
 
#define X(i0, i1)   px[i0+xDim0*(i1)]
 
#define IL(i0, i1)   ilp[i0+ilDim0*(i1)]
 
#define CI(i0, i1)   cip[i0+ciDim0*(i1)]
 
#define IA(i0)   iap[i0]
 
#define DISTA(i0)   pdista[i0]
 
#define bb(side, axis)   pbb[(side)+2*(axis)]
 
#define XA(i0, i1)   pxa[i0+xaDim0*(i1)]
 
#define RA(i0, i1)   pra[i0+raDim0*(i1)]
 
#define XC(i0, i1)   pxc[i0+xcDim0*(i1)]
 
#define IB(i0)   ibp[i0]
 

Functions

int findNearestValidGridPoint (CompositeGrid &cg, const RealArray &x, IntegerArray &il, RealArray &ci)
 Find the nearest valid grid point on a CompositeGrid to given points in space, x(i,.). A valid point is one with mask(i1,i2,i3)!=0 . NOTE: This function currently assumes that the points x(i,.) could NOT interpolate and so we are finding the best guess for points that are outside the grid.
 

Macro Definition Documentation

#define bb (   side,
  axis 
)    pbb[(side)+2*(axis)]
#define CI (   i0,
  i1 
)    cip[i0+ciDim0*(i1)]
#define DISTA (   i0)    pdista[i0]
#define DISTA (   i0)    pdista[i0]
#define gid (   side,
  axis 
)    pgid[(side)+2*(axis)]
#define GRID (   i1,
  i2,
  i3,
  axis 
)    gridp[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
#define IA (   i0)    iap[i0]
#define IB (   i0)    ibp[i0]
#define IL (   i0,
  i1 
)    ilp[i0+ilDim0*(i1)]
#define R (   i0,
  i1 
)    rp[i0+rDim0*(i1)]
#define RA (   i0,
  i1 
)    pra[i0+raDim0*(i1)]
#define X (   i0,
  i1 
)    xp[i0+xDim0*(i1)]
#define X (   i0,
  i1 
)    px[i0+xDim0*(i1)]
#define XA (   i0,
  i1 
)    xap[i0+xaDim0*(i1)]
#define XA (   i0,
  i1 
)    pxa[i0+xaDim0*(i1)]
#define XC (   i0,
  i1 
)    pxc[i0+xcDim0*(i1)]

Function Documentation

int findNearestValidGridPoint ( CompositeGrid cg,
const RealArray x,
IntegerArray il,
RealArray ci 
)

Find the nearest valid grid point on a CompositeGrid to given points in space, x(i,.). A valid point is one with mask(i1,i2,i3)!=0 . NOTE: This function currently assumes that the points x(i,.) could NOT interpolate and so we are finding the best guess for points that are outside the grid.

Parameters
cg(input) : CompositeGrid to check for closest valid point.
x(input) : x(i,0:r-1) (r=rangeDimension) list of points to check (in parallel each processor provides its own set of points).
il(output) : ip(i,0:r) = (i1,i2,i3,donor) index location and grid number of the closest valid point.
ci(output) : ci(i,0:r-1) are the r-coordinates of the closest pt in the donor grid.
Returns
0 for success.

x.....

References Mapping::approximateGlobalInverse, Mapping::basicInverseS(), bb, Mapping::bogus, MappedGrid::boundingBox(), boundingBox, CanInterpolate::canInterpolate(), Mapping::canInvert, CI, debug, DISTA, ApproximateGlobalInverse::findNearestGridPoint(), Mapping::getBasicInverseOption(), getCPU(), MappingRC::getMapping(), ia, IA, IB, IL, CompositeGrid::interpolationOverlap, CompositeGrid::interpolationWidth, MappedGrid::mapping(), Mapping::mapS(), max(), min(), NULL, GenericGridCollection::numberOfComponentGrids(), GridCollection::numberOfDimensions(), OV_ABORT, px, R, RA, ra, REAL_MAX, Mapping::setParameter(), sPrintF(), SQR, MappingParameters::THEfindBestGuess, Mapping::usesDistributedInverse(), X, XA, and XC.