edu.jhu.cs.cisst.algorithms.optimize.fmg.interpolator
Class InterpolatorByStencil

java.lang.Object
  extended by edu.jhu.cs.cisst.algorithms.optimize.fmg.interpolator.InterpolatorByStencil
All Implemented Interfaces:
Interpolator

public class InterpolatorByStencil
extends java.lang.Object
implements Interpolator

An interpolator that operates according to an interpolation stencil.

A stencil is a means of defining the relationship of a grid element and its 26 nearest neighbors. In this case the interpolation stencil defines how to distribute the values of a coarse grid to the values of a fine grid during the process of interpolation.

Author:
Gerald Loeffler (Gerald.Loeffler@univie.ac.at)
See Also:
Stencil

Field Summary
static Stencil BILINEAR
           
protected  int[] coarseSize
          The coarse size.
protected  int[] fineSize
          The fine size.
protected  Stencil s
          The stencil.
protected  IntRange1D totalRange
          The total range.
static Stencil TRILINEAR
          the stencil that characterises trilinear interpolation where every element of the fine grid that does not coincide with an element of the coarse grid is calculated by linear interpolation between its nearest neighbors.
 
Constructor Summary
InterpolatorByStencil(Stencil stencil)
          construct from interpolation stencil.
 
Method Summary
 BoundaryGrid interpolate(ConstBoundaryGrid grid, SolverResolutionLevels levels)
          implements method from Interpolator.
 void interpolateProper(BoundaryGrid fine, ConstBoundaryGrid coarse, int myNum, int totalNum)
          implements the parallel part of interpolate().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRILINEAR

public static final Stencil TRILINEAR
the stencil that characterises trilinear interpolation where every element of the fine grid that does not coincide with an element of the coarse grid is calculated by linear interpolation between its nearest neighbors.


BILINEAR

public static final Stencil BILINEAR

s

protected Stencil s
The stencil.


coarseSize

protected int[] coarseSize
The coarse size.


fineSize

protected int[] fineSize
The fine size.


totalRange

protected IntRange1D totalRange
The total range.

Constructor Detail

InterpolatorByStencil

public InterpolatorByStencil(Stencil stencil)
construct from interpolation stencil.

Parameters:
stencil - the stencil that defines interpolation
Method Detail

interpolate

public BoundaryGrid interpolate(ConstBoundaryGrid grid,
                                SolverResolutionLevels levels)
implements method from Interpolator.

Specified by:
interpolate in interface Interpolator
Parameters:
grid - the grid
levels - the levels
Returns:
the boundary grid
See Also:
Interpolator.interpolate(edu.jhu.cs.cisst.algorithms.optimize.fmg.grid.ConstBoundaryGrid, edu.jhu.cs.cisst.algorithms.optimize.fmg.SolverResolutionLevels)

interpolateProper

public void interpolateProper(BoundaryGrid fine,
                              ConstBoundaryGrid coarse,
                              int myNum,
                              int totalNum)
implements the parallel part of interpolate().

Parameters:
fine - the fine
coarse - the coarse
myNum - the current index
totalNum - the number of parallel jobs