Overture  Version 25
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Interpolate Class Reference

#include <Interpolate.h>

Public Types

enum  InterpolateOptionEnum {
  injection =0, fullWeighting100, fullWeighting010, fullWeighting001,
  fullWeighting110, fullWeighting101, fullWeighting011, fullWeighting111
}
 
enum  GeneralNamesEnum { useDefaultTransferWidth =-12345 }
 
enum  MaskOptionEnum { doNotUseMask =0, maskGreaterThanZero =1, maskEqualZero =2 }
 

Public Member Functions

 Interpolate ()
 
 Interpolate (const InterpolateParameters &interpParams_, const bool timing=LogicalFalse)
 
 ~Interpolate ()
 
int initialize (const InterpolateParameters &interpParams_, const bool timing=LogicalFalse)
 
int interpolateCoarseToFine (realArray &fineGridArray, const Index Iv[3], const realArray &coarseGridArray, const IntegerArray &amrRefinementRatio_=Overture::nullIntArray())
 
int interpolateFineToCoarse (realArray &coarseGridArray, const Index Iv[3], const realArray &fineGridArray, const IntegerArray &amrRefinementRatio_=Overture::nullIntArray())
 
int interpolateFineFromCoarse (realArray &fineGridArray, const Index Iv[3], const realArray &coarseGridArray, const IntegerArray &amrRefinementRatio_=Overture::nullIntArray(), const int update=0, const int transferWidth=useDefaultTransferWidth)
 Interpolate fine from coarse.
 
int interpolateFineFromCoarse (realArray &fineGridArray, const intSerialArray &mask, const Index Iv[3], const realArray &coarseGridArray, const IntegerArray &amrRefinementRatio_=Overture::nullIntArray(), const int update=0, const int transferWidth=useDefaultTransferWidth, const MaskOptionEnum maskOption=maskGreaterThanZero)
 Interpolate coarse to fine with a mask.
 
int interpolateCoarseFromFine (realArray &coarseGridArray, const Index Iv[3], const realArray &fineGridArray, const IntegerArray &amrRefinementRatio_=Overture::nullIntArray(), const InterpolateOptionEnum interpOption=injection, const int update=0, const int transferWidth=useDefaultTransferWidth)
 Interpolate coarse from fine.
 
int interpolateCoarseFromFine (realArray &coarseGridArray, const intSerialArray &mask, const Index Iv[3], const realArray &fineGridArray, const IntegerArray &amrRefinementRatio_=Overture::nullIntArray(), const InterpolateOptionEnum interpOption=injection, const int update=0, const int transferWidth=useDefaultTransferWidth, const MaskOptionEnum maskOption=maskGreaterThanZero)
 Interpolate coarse to fine with a mask.
 

Public Attributes

bool debug
 
bool timing
 

Protected Member Functions

int initializeCoefficients (const int maxRefinementRatio_, const int interpolateOrder_, const int numberOfDimensions_, const int *interpolateOffset_)
 
int computeIndexes (const realArray &uc, int *lm, Index *Jf, Index *Jc, const Index *If, const int *lmr, const int R, const int *A, const int *r, const int *stride, const int *extra, const int *offset, InterpolateParameters::InterpolateOffsetDirection *iod)
 
int displayEverything (const int *r, const int *extra, const int *offset, const int *lm, const int *lmr, const Index *Iv, const Index *If, const Index *Jf, const Index *Jc)
 

Protected Attributes

RealArray coeff
 
int interpolateOrder
 
int numberOfDimensions
 
bool preComputeAllCoefficients
 
bool useGeneralInterpolationFormula
 
IntegerArray amrRefinementRatio
 
GridFunctionParameters::GridFunctionType gridCentering
 
InterpolateParameters::InterpolateType interpolateType
 

Member Enumeration Documentation

Enumerator
useDefaultTransferWidth 
Enumerator
injection 
fullWeighting100 
fullWeighting010 
fullWeighting001 
fullWeighting110 
fullWeighting101 
fullWeighting011 
fullWeighting111 
Enumerator
doNotUseMask 
maskGreaterThanZero 
maskEqualZero 

Constructor & Destructor Documentation

Interpolate::Interpolate ( )
Interpolate::Interpolate ( const InterpolateParameters interpParams_,
const bool  timing = LogicalFalse 
)

References initialize().

Interpolate::~Interpolate ( )

Member Function Documentation

int Interpolate::computeIndexes ( const realArray uc,
int *  lm,
Index *  Jf,
Index *  Jc,
const Index *  If,
const int *  lmr,
const int  R,
const int *  A,
const int *  r,
const int *  stride,
const int *  extra,
const int *  offset,
InterpolateParameters::InterpolateOffsetDirection iod 
)
protected
int Interpolate::displayEverything ( const int *  r,
const int *  extra,
const int *  offset,
const int *  lm,
const int *  lmr,
const Index *  Iv,
const Index *  If,
const Index *  Jf,
const Index *  Jc 
)
protected

References interpolateOrder, M, and max().

Referenced by interpolateCoarseToFine().

int Interpolate::initialize ( const InterpolateParameters interpParams_,
const bool  timing = LogicalFalse 
)
int Interpolate::initializeCoefficients ( const int  maxRefinementRatio_,
const int  interpolateOrder_,
const int  numberOfDimensions_,
const int *  interpolateOffset_ 
)
protected
int Interpolate::interpolateCoarseFromFine ( realArray uc,
const Index  Iv[3],
const realArray uf,
const IntegerArray amrRefinementRatio_ = Overture::nullIntArray(),
const InterpolateOptionEnum  interpOption = injection,
const int  update = 0,
const int  transferWidth = useDefaultTransferWidth 
)

Interpolate coarse from fine.

Parameters
Iv[3]: coarse grid points to interpolate
update: 0= set uf=interpolant(uc) 1= set uf=uf+interpolant(uc)
transferWidth: by default use the current value of interpolateOrder+1, otherwise use this width. This value is only used with the fullWeighting options. The default full weighting width is 3. Author WDH.

References Overture::abort(), amrRefinementRatio, assert, CopyArray::copyArray(), doNotUseMask, getCPU(), getLocalArrayWithGhostBoundaries(), injection, interpCoarseFromFine, interpolateOrder, max(), min(), numberOfDimensions, printF(), R0, timing, and useDefaultTransferWidth.

Referenced by Ogmg::buildPredefinedVariableCoefficients(), Ogmg::fineToCoarse(), and interpolateFineFromCoarse().

int Interpolate::interpolateCoarseFromFine ( realArray uc,
const intSerialArray &  mask,
const Index  Iv[3],
const realArray uf,
const IntegerArray amrRefinementRatio_ = Overture::nullIntArray(),
const InterpolateOptionEnum  interpOption = injection,
const int  update = 0,
const int  transferWidth = useDefaultTransferWidth,
const MaskOptionEnum  maskOption = maskGreaterThanZero 
)

Interpolate coarse to fine with a mask.

Parameters
Iv[3]: coarse grid points to interpolate
update: 0= set uf=interpolant(uc) 1= set uf=uf+interpolant(uc)
transferWidth: by default use the current value of interpolateOrder+1, otherwise use this width. This value is only used with the fullWeighting options. The default full weighting width is 3.

References Overture::abort(), amrRefinementRatio, assert, c, computeIndexes(), CopyArray::copyArray(), getCPU(), ParallelUtility::getLocalArrayBounds(), getLocalArrayWithGhostBoundaries(), injection, interpCoarseFromFine, interpolateOrder, max(), min(), numberOfDimensions, printF(), R0, timing, and useDefaultTransferWidth.

int Interpolate::interpolateCoarseToFine ( realArray fineGridArray,
const Index  Iv[3],
const realArray coarseGridArray,
const IntegerArray amrRefinementRatio_ = Overture::nullIntArray() 
)
int Interpolate::interpolateFineFromCoarse ( realArray uf,
const Index  Iv[3],
const realArray uc,
const IntegerArray amrRefinementRatio_ = Overture::nullIntArray(),
const int  update = 0,
const int  transferWidth = useDefaultTransferWidth 
)

Interpolate fine from coarse.

Parameters
Iv[3]: fine grid points to interpolate
update: 0= set uf=interpolant(uc) 1= set uf=uf+interpolant(uc)
transferWidth: by default use the current value of interpolateOrder, otherwise use this width. The default is transferWidth==2 corresponding to linear interpolation. Author WDH.

References amrRefinementRatio, assert, IndexBox::base(), IndexBox::bound(), ParallelUtility::copy(), CopyArray::copyArray(), debug, debugFile, display(), doNotUseMask, getCPU(), CopyArray::getLocalArrayBoxWithGhost(), getLocalArrayWithGhostBoundaries(), interpFineFromCoarse, interpolateOrder, max(), min(), NULL, numberOfDimensions, IndexBox::setBounds(), timing, and useDefaultTransferWidth.

Referenced by Ogmg::coarseToFine(), InterpolateRefinements::interpolateRefinementBoundaries(), and InterpolateRefinements::interpolateRefinements().

int Interpolate::interpolateFineFromCoarse ( realArray uf,
const intSerialArray &  mask,
const Index  Iv[3],
const realArray uc,
const IntegerArray amrRefinementRatio_ = Overture::nullIntArray(),
const int  update = 0,
const int  transferWidth = useDefaultTransferWidth,
const MaskOptionEnum  maskOption = maskGreaterThanZero 
)

Interpolate coarse to fine with a mask.

Parameters
Iv[3]: fine grid points to interpolate
update: 0= set uf=interpolant(uc) 1= set uf=uf+interpolant(uc)
transferWidth: by default use the current value of interpolateOrder, otherwise use this width. The default is transferWidth==2 corresponding to linear interpolation.

References Overture::abort(), amrRefinementRatio, IndexBox::base(), IndexBox::bound(), ParallelUtility::copy(), CopyArray::copyArray(), debug, display(), getCPU(), CopyArray::getLocalArrayBoxWithGhost(), getLocalArrayWithGhostBoundaries(), interpFineFromCoarse, interpolateCoarseFromFine(), interpolateOrder, max(), min(), NULL, numberOfDimensions, IndexBox::setBounds(), timing, and useDefaultTransferWidth.

int Interpolate::interpolateFineToCoarse ( realArray coarseGridArray,
const Index  Iv[3],
const realArray fineGridArray,
const IntegerArray amrRefinementRatio_ = Overture::nullIntArray() 
)

Member Data Documentation

IntegerArray Interpolate::amrRefinementRatio
protected
RealArray Interpolate::coeff
protected
bool Interpolate::debug
GridFunctionParameters::GridFunctionType Interpolate::gridCentering
protected
int Interpolate::interpolateOrder
protected
InterpolateParameters::InterpolateType Interpolate::interpolateType
protected
int Interpolate::numberOfDimensions
protected
bool Interpolate::preComputeAllCoefficients
protected
bool Interpolate::timing
bool Interpolate::useGeneralInterpolationFormula
protected

The documentation for this class was generated from the following files: