Overture  Version 25
Macros | Functions
stencilWalk.C File Reference
#include "Inverse.h"
#include "BoundingBox.h"
#include "TriangleClass.h"
#include "display.h"
#include <list>
Include dependency graph for stencilWalk.C:

Macros

#define STENCIL_DEBUG(x)
 
#define STENCIL_DEBUG2(x)
 
#define numberOfStencilDirections2D(dir1, dir2)   numberOfStencilDir2D[(dir1)+1+3*((dir2)+1)]
 
#define stencilDirection2D1(dir, dir1, dir2)   stencilDir2D1[(dir)+8*((dir1)+1+3*((dir2)+1))]
 
#define stencilDirection2D2(dir, dir1, dir2)   stencilDir2D2[(dir)+8*((dir1)+1+3*((dir2)+1))]
 
#define numberOfStencilDirections3D(dir1, dir2, dir3)   numberOfStencilDir3D[(dir1)+1+3*((dir2)+1+3*((dir3)+1))]
 
#define stencilDirection3D1(dir, dir1, dir2, dir3)   stencilDir3D1[(dir)+27*((dir1)+1+3*((dir2)+1+3*((dir3)+1)))]
 
#define stencilDirection3D2(dir, dir1, dir2, dir3)   stencilDir3D2[(dir)+27*((dir1)+1+3*((dir2)+1+3*((dir3)+1)))]
 
#define stencilDirection3D3(dir, dir1, dir2, dir3)   stencilDir3D3[(dir)+27*((dir1)+1+3*((dir2)+1+3*((dir3)+1)))]
 
#define DISTANCE_L2_1(xv, i1, i2, i3)   fabs(xv[0]-GRID1(i1,0))
 
#define DISTANCE_L2_2(xv, i1, i2, i3)   SQR(xv[0]-GRID2(i1,i2,0))+SQR(xv[1]-GRID2(i1,i2,1))
 
#define DISTANCE_L2_3(xv, i1, i2, i3)   SQR(xv[0]-GRID3(i1,i2,i3,0))+SQR(xv[1]-GRID3(i1,i2,i3,1))+SQR(xv[2]-GRID3(i1,i2,i3,2))
 
#define GET_DISTANCE1(d, i1)
 
#define indexRange(side, axis)   index[(side)+2*(axis)]
 
#define gid(side, axis)   pgid[(side)+2*(axis)]
 
#define GRID1(i1, axis)   gridp1[i1+gDim0*(axis)]
 
#define GRID2(i1, i2, axis)   gridp2[i1+gDim0*(i2+gDim1*(axis))]
 
#define GRID3(i1, i2, i3, axis)   gridp3[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
 
#define indexRange(side, axis)   index[(side)+2*(axis)]
 
#define GRID1(i1, axis)   gridp1[i1+gDim0*(axis)]
 
#define GRID2(i1, i2, axis)   gridp2[i1+gDim0*(i2+gDim1*(axis))]
 
#define GRID3(i1, i2, i3, axis)   gridp3[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
 
#define GET_NDIST(ia, ib, ic, distance)
 
#define GET_TRIANGLE_COORDS(r, s)
 
#define GRID(i1, i2, i3, axis)   gridp2[i1+gDim0*(i2+gDim1*(axis))]
 
#define GRID(i1, i2, i3, axis)   gridp3[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
 

Functions

 OV_USINGNAMESPACE (std)
 
real distancel2 (real xv[3], RealArray &grid, const int i1, const int i2, const int i3, const int rangeDimension)
 

Macro Definition Documentation

#define DISTANCE_L2_1 (   xv,
  i1,
  i2,
  i3 
)    fabs(xv[0]-GRID1(i1,0))
#define DISTANCE_L2_2 (   xv,
  i1,
  i2,
  i3 
)    SQR(xv[0]-GRID2(i1,i2,0))+SQR(xv[1]-GRID2(i1,i2,1))
#define DISTANCE_L2_3 (   xv,
  i1,
  i2,
  i3 
)    SQR(xv[0]-GRID3(i1,i2,i3,0))+SQR(xv[1]-GRID3(i1,i2,i3,1))+SQR(xv[2]-GRID3(i1,i2,i3,2))
#define GET_DISTANCE1 (   d,
  i1 
)
Value:
switch( rangeDimension ) \
{ \
case 1: \
d=SQR(xv[0]-GRID1(i1,0)); \
break; \
case 2: \
d=SQR(xv[0]-GRID1(i1,0))+SQR(xv[1]-GRID1(i1,1)); \
break; \
case 3: \
d=SQR(xv[0]-GRID1(i1,0))+SQR(xv[1]-GRID1(i1,1))+SQR(xv[2]-GRID1(i1,2)); \
break; \
}

Referenced by ApproximateGlobalInverse::findNearestGridPoint().

#define GET_NDIST (   ia,
  ib,
  ic,
  distance 
)
Value:
j1=iv[0]+ia[axis][side][0]; \
j2=iv[1]+ia[axis][side][1]; \
j3=iv[2]+ia[axis][side][2]; \
\
k1=iv[0]+ib[axis][side][0]; \
k2=iv[1]+ib[axis][side][1]; \
k3=iv[2]+ib[axis][side][2]; \
\
l1=iv[0]+ic[axis][side][0]; \
l2=iv[1]+ic[axis][side][1]; \
l3=iv[2]+ic[axis][side][2]; \
\
\
xx[0]=x[0]-GRID(j1,j2,j3,0); \
xx[1]=x[1]-GRID(j1,j2,j3,1); \
xx[2]=x[2]-GRID(j1,j2,j3,2); \
\
a[0]=GRID(k1,k2,k3,0)-GRID(j1,j2,j3,0); \
a[1]=GRID(k1,k2,k3,1)-GRID(j1,j2,j3,1); \
a[2]=GRID(k1,k2,k3,2)-GRID(j1,j2,j3,2); \
\
b[0]=GRID(l1,l2,l3,0)-GRID(j1,j2,j3,0); \
b[1]=GRID(l1,l2,l3,1)-GRID(j1,j2,j3,1); \
b[2]=GRID(l1,l2,l3,2)-GRID(j1,j2,j3,2); \
\
n[0]=a[1]*b[2]-a[2]*b[1]; \
n[1]=a[2]*b[0]-a[0]*b[2]; \
n[2]=a[0]*b[1]-a[1]*b[0]; \
distance =-signForJacobian*(xx[0]*n[0]+xx[1]*n[1]+xx[2]*n[2]);

Referenced by ApproximateGlobalInverse::distanceToCell().

#define GET_TRIANGLE_COORDS (   r,
  s 
)
Value:
aDotA = a[0]*a[0]+ a[1]*a[1]+ a[2]*a[2]; \
aDotB = a[0]*b[0]+ a[1]*b[1]+ a[2]*b[2]; \
bDotB = b[0]*b[0]+ b[1]*b[1]+ b[2]*b[2]; \
xxDotA = xx[0]*a[0]+xx[1]*a[1]+xx[2]*a[2]; \
xxDotB = xx[0]*b[0]+xx[1]*b[1]+xx[2]*b[2]; \
\
detInverse = 1./max( REAL_MIN, aDotA*bDotB-aDotB*aDotB); \
r = (xxDotA*bDotB-xxDotB*aDotB)*detInverse; \
s = (xxDotB*aDotA-xxDotA*aDotB)*detInverse;

Referenced by ApproximateGlobalInverse::distanceToCell().

#define gid (   side,
  axis 
)    pgid[(side)+2*(axis)]
#define GRID (   i1,
  i2,
  i3,
  axis 
)    gridp2[i1+gDim0*(i2+gDim1*(axis))]
#define GRID (   i1,
  i2,
  i3,
  axis 
)    gridp3[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
#define GRID1 (   i1,
  axis 
)    gridp1[i1+gDim0*(axis)]
#define GRID1 (   i1,
  axis 
)    gridp1[i1+gDim0*(axis)]
#define GRID2 (   i1,
  i2,
  axis 
)    gridp2[i1+gDim0*(i2+gDim1*(axis))]
#define GRID2 (   i1,
  i2,
  axis 
)    gridp2[i1+gDim0*(i2+gDim1*(axis))]
#define GRID3 (   i1,
  i2,
  i3,
  axis 
)    gridp3[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
#define GRID3 (   i1,
  i2,
  i3,
  axis 
)    gridp3[i1+gDim0*(i2+gDim1*(i3+gDim2*(axis)))]
#define indexRange (   side,
  axis 
)    index[(side)+2*(axis)]
#define indexRange (   side,
  axis 
)    index[(side)+2*(axis)]
#define numberOfStencilDirections2D (   dir1,
  dir2 
)    numberOfStencilDir2D[(dir1)+1+3*((dir2)+1)]
#define numberOfStencilDirections3D (   dir1,
  dir2,
  dir3 
)    numberOfStencilDir3D[(dir1)+1+3*((dir2)+1+3*((dir3)+1))]
#define STENCIL_DEBUG (   x)
#define STENCIL_DEBUG2 (   x)
#define stencilDirection2D1 (   dir,
  dir1,
  dir2 
)    stencilDir2D1[(dir)+8*((dir1)+1+3*((dir2)+1))]
#define stencilDirection2D2 (   dir,
  dir1,
  dir2 
)    stencilDir2D2[(dir)+8*((dir1)+1+3*((dir2)+1))]
#define stencilDirection3D1 (   dir,
  dir1,
  dir2,
  dir3 
)    stencilDir3D1[(dir)+27*((dir1)+1+3*((dir2)+1+3*((dir3)+1)))]
#define stencilDirection3D2 (   dir,
  dir1,
  dir2,
  dir3 
)    stencilDir3D2[(dir)+27*((dir1)+1+3*((dir2)+1+3*((dir3)+1)))]
#define stencilDirection3D3 (   dir,
  dir1,
  dir2,
  dir3 
)    stencilDir3D3[(dir)+27*((dir1)+1+3*((dir2)+1+3*((dir3)+1)))]

Function Documentation

real distancel2 ( real  xv[3],
RealArray grid,
const int  i1,
const int  i2,
const int  i3,
const int  rangeDimension 
)
inline
OV_USINGNAMESPACE ( std  )