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

#include <Regrid.h>

Collaboration diagram for Regrid:
Collaboration graph
[legend]

Public Types

enum  GridAdditionOption { addGridsAsRefinementGrids, addGridsAsBaseGrids }
 
enum  GridAlgorithmOption { aligned, rotated }
 

Public Member Functions

 Regrid ()
 
 ~Regrid ()
 
int getDefaultNumberOfRefinementLevels () const
 
int getRefinementRatio () const
 
int displayParameters (FILE *file=stdout) const
 
bool loadBalancingIsOn () const
 
int regrid (GridCollection &gc, GridCollection &gcNew, intGridCollectionFunction &errorMask, int refinementLevel=1, int baseLevel=-1)
 
int regrid (GridCollection &gc, GridCollection &gcNew, realGridCollectionFunction &error, real errorThreshhold, int refinementLevel=1, int baseLevel=-1)
 
int printStatistics (GridCollection &gc, FILE *file=NULL, int *numberOfGridPoints=NULL)
 
void setEfficiency (real efficiency)
 
void setIndexCoarseningFactor (int factor)
 
void setNumberOfBufferZones (int numberOfBufferZones)
 
void setMinimumBoxSize (int numberOfGridPoints)
 Specify the minimum number of grid points on a refinement grid.
 
void setMinimumBoxWidth (int numberOfGridPoints)
 Specify the minimum width of a box (in coarse grid cells). The actual minimum width will be width*ratio.
 
void setWidthOfProperNesting (int widthOfProperNesting)
 
void setRefinementRatio (int refinementRatio)
 
void setUseSmartBisection (bool trueOrFalse=true)
 
void setGridAdditionOption (GridAdditionOption gridAdditionOption)
 
GridAdditionOption getGridAdditionOption () const
 
void setGridAlgorithmOption (GridAlgorithmOption gridAlgorithmOption)
 
void setMaximumNumberOfSplits (int num)
 
void setMergeBoxes (bool trueOrFalse=true)
 
void turnOnLoadBalacing (bool trueOrFalse=true)
 
LoadBalancergetLoadBalancer ()
 
int update (GenericGraphicsInterface &gi)
 
int get (const GenericDataBase &dir, const aString &name)
 
int put (GenericDataBase &dir, const aString &name) const
 

Static Public Member Functions

static int outputRefinementInfo (GridCollection &gc, const aString &gridFileName, const aString &fileName)
 

Public Attributes

int debug
 

Protected Types

enum  CutStatus { invalidCut, holeCut, steepCut, bisectCut }
 

Protected Member Functions

int buildProperNestingDomains (GridCollection &gc, int baseGrid, int refinementLevel, int baseLevel, int numberOfRefinementLevels)
 
int buildTaggedCells (MappedGrid &mg, intMappedGridFunction &tag, const realArray &error, real errorThreshhold, bool useErrorMask, bool cellCentred=true)
 
Box cellCenteredBox (MappedGrid &mg, int ratio=1)
 
Box cellCenteredBaseBox (MappedGrid &mg)
 
int findCut (int *hist, int lo, int hi, CutStatus &status)
 
int findCutPoint (BOX &box, const intSerialArray &ia, int &cutDirection, int &cutPoint)
 
BOX getBox (const intArray &ia)
 
BOX buildBox (Index Iv[3])
 
BOX getBoundedBox (const intSerialArray &ia, const Box &boundingBox)
 
real getEfficiency (const intSerialArray &ia, const BOX &box)
 
int buildGrids (GridCollection &gc, GridCollection &gcNew, int baseGrid, int baseLevel, int refinementLevel, BoxList *refinementBoxList, IntegerArray **gridInfo)
 
int regridAligned (GridCollection &gc, GridCollection &gcNew, bool useErrorFunction, realGridCollectionFunction *pError, real errorThreshhold, intGridCollectionFunction &tagCollection, int refinementLevel=1, int baseLevel=-1)
 
int regridRotated (GridCollection &gc, GridCollection &gcNew, bool useErrorFunction, realGridCollectionFunction *pError, real errorThreshhold, intGridCollectionFunction &tagCollection, int refinementLevel=1, int baseLevel=-1)
 
int splitBox (BOX &box, const intSerialArray &ia, BoxList &boxList, int refinementLevel)
 
int splitBoxRotated (RotatedBox &box, ListOfRotatedBox &boxList, realArray &xa, int refinementLevel)
 
int merge (ListOfRotatedBox &boxList)
 
int coarsenIndexLower (int i, int dir) const
 
int coarsenIndexUpper (int i, int dir) const
 
int refineIndex (int i, int dir) const
 
void setupCoarseIndexSpace (GridCollection &gc, int baseGrid, int level)
 

Protected Attributes

int defaultNumberOfRefinementLevels
 
real efficiency
 
int refinementRatio
 
int numberOfBufferZones
 
int widthOfProperNesting
 
bool useCoarsenedIndexSpace
 
int indexCoarseningFactor
 
int piab [6]
 
int maximumNumberOfSplits
 
int splitNumber
 
int numberOfDimensions
 
int minimumBoxSize
 
int minimumBoxWidth
 
bool useSmartBisection
 
bool mergeBoxes
 
int myid
 
bool loadBalance
 
LoadBalancer loadBalancer
 
GridAdditionOption gridAdditionOption
 
GridAlgorithmOption gridAlgorithmOption
 
BoxList * properNestingDomain
 
BoxList * complementOfProperNestingDomain
 
real timeForRegrid
 
real timeForBuildGrids
 
real timeForBuildTaggedCells
 
real timeForSomethingElse1
 
real timeForSomethingElse2
 
real timeForSomethingElse3
 

Member Enumeration Documentation

enum Regrid::CutStatus
protected
Enumerator
invalidCut 
holeCut 
steepCut 
bisectCut 
Enumerator
addGridsAsRefinementGrids 
addGridsAsBaseGrids 
Enumerator
aligned 
rotated 

Constructor & Destructor Documentation

Regrid::Regrid ( )
Regrid::~Regrid ( )

Member Function Documentation

BOX Regrid::buildBox ( Index  Iv[3])
protected
int Regrid::buildGrids ( GridCollection gc,
GridCollection gcNew,
int  baseGrid,
int  baseLevel,
int  refinementLevel,
BoxList *  refinementBoxList,
IntegerArray **  gridInfo 
)
protected
int Regrid::buildProperNestingDomains ( GridCollection gc,
int  baseGrid,
int  refinementLevel,
int  baseLevel,
int  numberOfRefinementLevels 
)
protected
int Regrid::buildTaggedCells ( MappedGrid mg,
intMappedGridFunction tag,
const realArray error,
real  errorThreshhold,
bool  useErrorMask,
bool  cellCentred = true 
)
protected
Box Regrid::cellCenteredBaseBox ( MappedGrid mg)
protected
Box Regrid::cellCenteredBox ( MappedGrid mg,
int  ratio = 1 
)
protected
int Regrid::coarsenIndexLower ( int  i,
int  dir 
) const
inlineprotected
int Regrid::coarsenIndexUpper ( int  i,
int  dir 
) const
inlineprotected

References iab, and max().

Referenced by buildBox(), cellCenteredBaseBox(), and cellCenteredBox().

int Regrid::displayParameters ( FILE *  file = stdout) const

Referenced by update().

int Regrid::findCut ( int *  hist,
int  lo,
int  hi,
CutStatus status 
)
protected
int Regrid::findCutPoint ( BOX &  box,
const intSerialArray &  ia,
int &  cutDirection,
int &  cutPoint 
)
protected
int Regrid::get ( const GenericDataBase dir,
const aString name 
)
BOX Regrid::getBoundedBox ( const intSerialArray &  ia,
const Box &  boundingBox 
)
protected
BOX Regrid::getBox ( const intArray &  ia)
protected

References assert, max(), min(), numberOfDimensions, and R.

Referenced by getBoundedBox(), regridAligned(), and splitBox().

int Regrid::getDefaultNumberOfRefinementLevels ( ) const
real Regrid::getEfficiency ( const intSerialArray &  ia,
const BOX &  box 
)
protected

References ParallelUtility::getSum(), and max().

Referenced by splitBox().

Regrid::GridAdditionOption Regrid::getGridAdditionOption ( ) const

References gridAdditionOption.

LoadBalancer & Regrid::getLoadBalancer ( )

References loadBalancer.

Referenced by main().

int Regrid::getRefinementRatio ( ) const

References refinementRatio.

bool Regrid::loadBalancingIsOn ( ) const

References loadBalance.

Referenced by main().

int Regrid::merge ( ListOfRotatedBox boxList)
protected
int Regrid::outputRefinementInfo ( GridCollection gc,
const aString gridFileName,
const aString fileName 
)
static
int Regrid::printStatistics ( GridCollection gc,
FILE *  file = NULL,
int *  numberOfGridPoints = NULL 
)
int Regrid::put ( GenericDataBase dir,
const aString name 
) const
int Regrid::refineIndex ( int  i,
int  dir 
) const
inlineprotected

References iab.

Referenced by buildGrids(), and regridAligned().

int Regrid::regrid ( GridCollection gc,
GridCollection gcNew,
intGridCollectionFunction errorMask,
int  refinementLevel = 1,
int  baseLevel = -1 
)
int Regrid::regrid ( GridCollection gc,
GridCollection gcNew,
realGridCollectionFunction error,
real  errorThreshhold,
int  refinementLevel = 1,
int  baseLevel = -1 
)
int Regrid::regridAligned ( GridCollection gc,
GridCollection gcNew,
bool  useErrorFunction,
realGridCollectionFunction pError,
real  errorThreshhold,
intGridCollectionFunction tagCollection,
int  refinementLevel = 1,
int  baseLevel = -1 
)
protected

References addGridsAsRefinementGrids, assert, axis2, GenericGridCollection::baseGridNumber, MappedGrid::boundaryCondition(), boundingBox, buildGrids(), buildProperNestingDomains(), buildTaggedCells(), cellCenteredBaseBox(), cellCenteredBox(), Overture::checkMemoryUsage(), coarsenIndexLower(), complementOfProperNestingDomain, debug, LoadBalancer::determineLoadBalance(), MappedGrid::dimension(), display(), End, MappedGrid::extendedIndexRange(), FOR_3D, getBoundedBox(), getBox(), getCPU(), getIndex(), getLocalArrayWithGhostBoundaries(), MappedGrid::getPartition(), ParallelUtility::getSum(), gridAdditionOption, GenericGridCollectionData::gridDistributionList, GenericGridCollection::gridNumber, i2, MappedGrid::indexRange(), loadBalance, loadBalancer, max(), min(), myid, NULL, Overture::nullRealDistributedArray(), GenericGridCollection::numberOfBaseGrids(), GenericGridCollection::numberOfComponentGrids(), numberOfDimensions, GridCollection::numberOfDimensions(), GenericGridCollection::numberOfGrids(), GenericGridCollection::numberOfRefinementLevels(), intMappedGridFunction::periodicUpdate(), printF(), properNestingDomain, R0, refineIndex(), GridCollection::refinementLevel, GenericGridCollection::refinementLevelNumber, refinementRatio, GridCollection::replaceRefinementLevels(), LoadBalancer::sequentialAssignment, GridDistribution::setGridAndRefinementLevel(), LoadBalancer::setLoadBalancer(), GridDistribution::setProcessors(), setupCoarseIndexSpace(), GridDistribution::setWorkLoadAndGridPoints(), splitBox(), splitNumber, sPrintF(), Start, GenericGridCollection::THErefinementLevel, timeForBuildGrids, timeForBuildTaggedCells, timeForRegrid, GridCollection::update(), useCoarsenedIndexSpace, and widthOfProperNesting.

Referenced by regrid().

int Regrid::regridRotated ( GridCollection gc,
GridCollection gcNew,
bool  useErrorFunction,
realGridCollectionFunction pError,
real  errorThreshhold,
intGridCollectionFunction tagCollection,
int  refinementLevel = 1,
int  baseLevel = -1 
)
protected
void Regrid::setEfficiency ( real  efficiency)

References efficiency.

Referenced by main().

void Regrid::setGridAdditionOption ( GridAdditionOption  gridAdditionOption)

References gridAdditionOption.

Referenced by main().

void Regrid::setGridAlgorithmOption ( GridAlgorithmOption  gridAlgorithmOption)

References gridAlgorithmOption.

Referenced by main().

void Regrid::setIndexCoarseningFactor ( int  factor)

References indexCoarseningFactor, and useCoarsenedIndexSpace.

Referenced by update().

void Regrid::setMaximumNumberOfSplits ( int  num)

References maximumNumberOfSplits.

void Regrid::setMergeBoxes ( bool  trueOrFalse = true)

References mergeBoxes.

Referenced by main().

void Regrid::setMinimumBoxSize ( int  numberOfGridPoints)

Specify the minimum number of grid points on a refinement grid.

/param numberOfGridPoints: the minimum (total) number of grid points on a refinement grid

References minimumBoxSize.

Referenced by main().

void Regrid::setMinimumBoxWidth ( int  width)

Specify the minimum width of a box (in coarse grid cells). The actual minimum width will be width*ratio.

/param width:

References minimumBoxWidth.

void Regrid::setNumberOfBufferZones ( int  numberOfBufferZones)

References numberOfBufferZones, and printF().

Referenced by main(), and update().

void Regrid::setRefinementRatio ( int  refinementRatio)

References refinementRatio.

Referenced by main().

void Regrid::setupCoarseIndexSpace ( GridCollection gc,
int  baseGrid,
int  level 
)
protected
void Regrid::setUseSmartBisection ( bool  trueOrFalse = true)

References useSmartBisection.

Referenced by main().

void Regrid::setWidthOfProperNesting ( int  widthOfProperNesting)

References printF(), and widthOfProperNesting.

Referenced by main(), and update().

int Regrid::splitBox ( BOX &  box,
const intSerialArray &  ia,
BoxList &  boxList,
int  refinementLevel 
)
protected
int Regrid::splitBoxRotated ( RotatedBox box,
ListOfRotatedBox boxList,
realArray xa,
int  refinementLevel 
)
protected
void Regrid::turnOnLoadBalacing ( bool  trueOrFalse = true)

References loadBalance.

Referenced by main().

int Regrid::update ( GenericGraphicsInterface gi)

Member Data Documentation

BoxList* Regrid::complementOfProperNestingDomain
protected
int Regrid::debug
int Regrid::defaultNumberOfRefinementLevels
protected
real Regrid::efficiency
protected
GridAdditionOption Regrid::gridAdditionOption
protected
GridAlgorithmOption Regrid::gridAlgorithmOption
protected
int Regrid::indexCoarseningFactor
protected
bool Regrid::loadBalance
protected
LoadBalancer Regrid::loadBalancer
protected
int Regrid::maximumNumberOfSplits
protected
bool Regrid::mergeBoxes
protected
int Regrid::minimumBoxSize
protected
int Regrid::minimumBoxWidth
protected
int Regrid::myid
protected
int Regrid::numberOfBufferZones
protected
int Regrid::numberOfDimensions
protected
int Regrid::piab[6]
protected
BoxList* Regrid::properNestingDomain
protected
int Regrid::refinementRatio
protected
int Regrid::splitNumber
protected

Referenced by regridAligned(), and splitBox().

real Regrid::timeForBuildGrids
protected
real Regrid::timeForBuildTaggedCells
protected
real Regrid::timeForRegrid
protected
real Regrid::timeForSomethingElse1
protected
real Regrid::timeForSomethingElse2
protected
real Regrid::timeForSomethingElse3
protected
bool Regrid::useCoarsenedIndexSpace
protected
bool Regrid::useSmartBisection
protected
int Regrid::widthOfProperNesting
protected

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