Blockstructured Adaptive Mesh Refinement in object-oriented C++
#include <GridUnit.h>
Collaboration diagram for GridUnit:
Public Methods | |
GridUnit (void) | |
Constructors, Destructor. | |
GridUnit (const int nrank, const int clev, const int *bcoords, const int ext, const int mlev, const int lstep, const int reflev) | |
Constructor with baseindex specified as coordinates/ph-index. More... | |
GridUnit (const int nrank, const int clev, const int bindex, const int ext, const int mlev, const int lstep, const int reflev) | |
GridUnit (GridUnit const &other) | |
~GridUnit (void) | |
GridUnit const & | operator= (GridUnit const &other) |
int | guOwner (void) const |
Simple Query funtions. | |
int | guIndex (void) const |
int | guRank (void) const |
int | guBaseLev (void) const |
int | guFineLev (void) const |
int | guCrsLev (void) const |
int | guNumLev (void) const |
int | guMaxLev (void) const |
int | guMinLev (void) const |
int | guLevStep (void) const |
int | guLevels (void) const |
int | guExtent (const int lev) const |
int | guExtentAbs (const int lev) const |
void | guSetWorkload (const int w) |
unsigned long | guNum (const int overlap) const |
unsigned long | guWork (const int overlap) const |
unsigned long | guNum (const int lev, const int overlap) const |
unsigned long | guWork (const int lev, const int overlap) const |
unsigned long | guNum (const short *overlap) const |
unsigned long | guWork (const short *overlap) const |
unsigned long | guNum (const int lev, const short *overlap) const |
unsigned long | guWork (const int lev, const short *overlap) const |
int | guContains (const int lev) const |
int | guContains (const int minlev, const int maxlev) const |
int | guLevIndex (const int lev) const |
void | guSetOwner (const int p) |
const dMapIndex & | guBaseIndex (void) const |
dMapIndex | guTopIndex (const int lev) const |
dMapIndex | guMaxIndex (const int lev) const |
const BBox & | guBBox () const |
BBox | guBBox (const int lev, const int olap=0, const int extgh=0) const |
BBox | guBBoxAbs (const int lev, const int olap=0, const int extgh=0) const |
BBox | guBBox (const int lev, const short *olap, const int extgh=0) const |
BBox | guBBoxAbs (const int lev, const short *olap, const int extgh=0) const |
BBox | guBBox (const int minl, const int maxl, const short *olap, const int extgh=0) const |
int | guInside (const BBox &bbox, const int lev) const |
int | operator== (GridUnit const &other) const |
GridUnit domain calculus. | |
int | operator>= (GridUnit const &other) const |
int | operator<= (GridUnit const &other) const |
void | guRefine (const int levs=1) |
Refines the GridUnit by "levs" levels. More... | |
void | guRefine (GridUnit &gu, const int levs=1) |
void | guCoarsen (const int levs=1) |
corsens the GridUnit by "levs" levels. More... | |
void | guCoarsen (GridUnit &gu, const int levs=1) |
void | guDecompose (GridUnit **&gu, int &cnt, const int levs=1) const |
Decomposes the GridUnit into an array of (Base)^rank*lev GridUnits with extent = extent-lev; i.e. More... | |
void | guDecomposeReplicate (GridUnit **&gu, int &cnt, const int minext, const int levs=1) const |
If the new extent at any level is less than the "minext", that level is replicated across the grid units with the first GridUnit as the owner. | |
void | guGetLevels (GridUnit **&gu) const |
Returns the GridUnits's at different levels of the composite GridUnit as an array. More... | |
void | guGetLevels (GridUnit &gu, const int lev) const |
void | guSetDecompose (GridUnit &gu, const int lev, const int cnt) |
Static function to update a copy of this GridUnit. | |
void | guSetLevels (GridUnit &gu, const int lev) |
void | guSetRefineLevel (GridUnit &gu, const int levs=1) |
void | guSetCoarsen (GridUnit &gu, const int levs=1) |
void | guSetRefine (GridUnit &gu, const int levs=1) |
Protected Attributes | |
short int | owner |
My Owner. | |
short int | index |
My Index. | |
short int | rank |
Grid dimension. | |
short int | baselev |
Max level within which this grid unit is completely contained. | |
short int | crslev |
Level of the coarsest grid. | |
short int | finelev |
Level of the finest grid. | |
short int | maxlev |
Max possible level of refinement. | |
short int | minlev |
Min possible level of refinement. | |
short int | levstep |
Refinement Factor - power of two - default is 1. | |
short int | extent |
Extent of the finest level i.e. More... | |
int | work |
The workload. More... | |
dMapIndex | baseindex |
Index corresponding to the smallest sfcIndex in the GridUnit. | |
BBox | fbb |
BBox at finest level. | |
Friends | |
class | GridUnitList |
ostream & | operator<< (ostream &, const GridUnit &) |
ofstream & | operator<< (ofstream &, const GridUnit &) |
ifstream & | operator>> (ifstream &, GridUnit &) |
strstream & | operator<< (strstream &, const GridUnit &) |
strstream & | operator>> (strstream &, GridUnit &) |
The unit is identified by is position (baseindex) and it's size (extent) at a particular level. A GridUnit can be refined or coarsened or can be decomposed into GridUnits of smaller extent. Note, that each levels corresponds to one power of the base and not to a refinement level. For a given base, and extent at a level, the size of the GridUnit at the level is (base)^(rank*extent). Thus the size of the GridUnit is limited to powers of the base. Note that, a uniform block of a single level of the Grid can also be represented (as a special case) by GridUnit. GridUnit class provides a member function to query the baseindices of neighboring GridUnits at different levels.
Definition at line 31 of file GridUnit.h.
|
Constructor with baseindex specified as coordinates/ph-index. Uses the Map/Invert of baseindex to generate the associted sfc mapping. The extent of GridUnit is specified in terms of levels such that number of elements = base^(rank*extent). Note that the extent referers to the topmost level; num is the sum of the elements at all numlev levels; and baselev is the base level grid. An initial refinement of reflev leval can be specified - in which case numlev is set to reflev and num and extent are accordingly updated. Definition at line 31 of file GridUnit.C. References baseindex, baselev, crslev, extent, fbb, finelev, index, levstep, PeanoHilbert::Map(), maxlev, minlev, owner, rank, sfcIndex::sfcGetIndex(), and work. |
|
corsens the GridUnit by "levs" levels. The grid extent level is decremented by "levs"; i.e. the GridUnit contains (Base)^rank*(extlev-levs) points. Definition at line 435 of file GridUnit.C. References baseindex, baselev, crslev, extent, finelev, index, levstep, maxlev, minlev, owner, rank, and work. |
|
Decomposes the GridUnit into an array of (Base)^rank*lev GridUnits with extent = extent-lev; i.e. (Base)^rank*(extlev-lev) points. Definition at line 482 of file GridUnit.C. References baseindex, baselev, crslev, extent, finelev, PeanoHilbert::GetCardinality(), GridUnit(), guSetBBox(), guSetWorkload(), levstep, PeanoHilbert::SetIndex(), and work. |
|
Returns the GridUnits's at different levels of the composite GridUnit as an array. The returned array is of dimension maxlev-crslev. The undefined levels are (GridUnit *) NULL. Definition at line 576 of file GridUnit.C. References baseindex, crslev, extent, finelev, GridUnit(), guSetBBox(), guSetWorkload(), index, levstep, maxlev, minlev, owner, rank, and work. |
|
Refines the GridUnit by "levs" levels. The grid extent level is incremented by "levs"; i.e. the GridUnit contains (Base)^rank*(extlev+levs) points. Definition at line 386 of file GridUnit.C. References baseindex, baselev, extent, finelev, index, levstep, maxlev, minlev, owner, rank, and work. |
|
Extent of the finest level i.e. level crslev+numlev-1 Definition at line 61 of file GridUnit.h. Referenced by GridUnit(), guCoarsen(), guDecompose(), guDecomposeReplicate(), guGetLevels(), guOwner(), guRefine(), guSetDecompose(), and operator==(). |
|
The workload. Assumed to be uniform. Definition at line 63 of file GridUnit.h. Referenced by GridUnit(), guCoarsen(), guDecompose(), guDecomposeReplicate(), guGetLevels(), guOwner(), and guRefine(). |
Quickstart Users Guide Programmers Reference Installation Examples Download
AMROC Main Home Contactlast update: 06/01/04