#include <GridUnit.h>
Public Member Functions | |
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. | |
int | guOwner (void) const |
Simple Query funtions. | |
int | operator== (GridUnit const &other) const |
GridUnit domain calculus. | |
void | guRefine (const int levs=1) |
Refines the GridUnit by "levs" levels. | |
void | guCoarsen (const int levs=1) |
corsens the GridUnit by "levs" levels. | |
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. | |
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. | |
void | guSetDecompose (GridUnit &gu, const int lev, const int cnt) |
Static function to update a copy of this GridUnit. | |
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. | |
int | work |
The workload. | |
dMapIndex | baseindex |
Index corresponding to the smallest sfcIndex in the GridUnit. | |
BBox | fbb |
BBox at finest level. | |
Friends | |
class | GridUnitList |
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.
GridUnit::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.
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.
void GridUnit::guCoarsen | ( | const int | levs = 1 |
) |
void GridUnit::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.
(Base)^rank*(extlev-lev) points.
void GridUnit::guGetLevels | ( | GridUnit **& | gu | ) | const |
void GridUnit::guRefine | ( | const int | levs = 1 |
) |
short int GridUnit::extent [protected] |
Extent of the finest level i.e.
level crslev+numlev-1
int GridUnit::work [protected] |
The workload.
Assumed to be uniform.