AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

GridHierarchy Class Reference

GridHierarchy stores the hierarchical structure on an adaptive application. More...

#include <GridHierarchy.h>

Collaboration diagram for GridHierarchy:

Collaboration graph
[legend]
List of all members.

Public Methods

 GridHierarchy (const int ndim, const int type, const int max_level)
 ~GridHierarchy (void)
void DAGH_SetBaseGrid (double const *bbox, const int *shape, const int &ncuts, const int *cuts)
void DAGH_SetTimeSpecs (double const starttime, double const stoptime, const int ntsteps)
void DAGH_GetTimeSpecs (double &starttime, double &stoptime)
void DAGH_SetBoundaryType (const int type)
void DAGH_SetAdaptBoundaryType (const int type)
void DAGH_SetBoundaryWidth (const int width)
void DAGH_SetPeriodicBoundaries (const int dir, const int value)
void DAGH_SetExternalGhostWidth (const int width)
void DAGH_SetRefineFactor (const int rfactor)
void DAGH_SetRefineFactor (const int lev, const int rfactor)
void DAGH_SetDistributionType (const int type)
void DAGH_SetDistributionType (const int type, BBoxList &bbl)
void DAGH_SetWorkFunction (void *wf)
void DAGH_SetNestingBuffer (const int &nb)
void DAGH_PeriodicBoundaries (GridBoxList *gbl, GridBoxList *agbl)
void DAGH_CreateGridUnitList (GridUnitList *&gul, BBoxList **bbla, int count=(0))
void DAGH_CreateGridUnitList (GridUnitList *&gul, const BBox &_bb)
void DAGH_CreateBBoxList (BBoxList *&bbl, GridUnitList &gul)
void DAGH_ComposeHierarchy (void)
 Compose the grid hierarchy.

int DAGH_AddGridFunction (GridFunctionVoid *gfv)
void DAGH_DelGridFunction (const int gfid)
void DAGH_ComposeGridFunctions (void)
int DAGH_GridFunctionTemplate (GridFunctionVoid &gfv)
void DAGH_RecomposeHierarchy (int Partition)
 Recompose the whole hierachy and all associated GridFunctions. More...

void DAGH_RecomposeHierarchy ()
void DAGH_Refine (const int lev)
 Use entire level as new refinement region.

void DAGH_Refine (BBoxList &bblist, const int lev)
 Sets refinement regions on a particular level. More...

void DAGH_RedistributeHierarchy (const int type)
void DAGH_RedistributeHierarchy (const int type, BBoxList &bbl)
void DAGH_Checkpoint (const char *name)
 Write GridHierarchy into checkpointing-file.

void DAGH_Checkpoint (strstream &ofs)
 Write GridHierarchy into memory.

int DAGH_Checkpoint_StrStream_Memory ()
void DAGH_ComposeHierarchy (const char *name)
void DAGH_RecomposeHierarchy (const char *name)
 Recompose GridHierarchy from checkpointing-file.

void DAGH_RecomposeHierarchy (strstream &ifs)
 Recompose GridHierarchy from memory.

void DAGH_InitChkpt (const char *name)
void DAGH_InitChkpt ()
void DAGH_StopChkpt ()
int DAGH_OpenChkptIStream (const int p, ifstream &ifs)
void DAGH_CloseChkptIStream (ifstream &ifs)
int DAGH_OpenChkptIStream (const int p, streampos *&chkptdir, char *&chkptnamedir, ifstream &ifs)
int DAGH_OpenChkptStrStream (streampos *&chkptdir, char *&chkptnamedir, strstream &ifs)
void DAGH_CloseChkptIStream (streampos *&chkptdir, char *&chkptnamedir, ifstream &ifs)
void DAGH_CloseChkptStrStream (streampos *&chkptdir, char *&chkptnamedir, strstream &ifs)
int DAGH_GetGFChkptIStream (const int p, const char *gfname, const int gfid, ifstream &ifs)
int DAGH_GetGFChkptStrStream (const char *gfname, const int gfid, strstream &ifs)
int DAGH_OpenChkptOStream (const int p, ofstream &ofs)
void DAGH_CloseChkptOStream (ofstream &ofs)
int DAGH_CommInit (MPI_Comm c=0)
void DAGH_CommKill (void)
int default_alignment (const int r) const
int dagh_type (void) const
int boundarywidth (void) const
int boundarytype (void) const
int adaptboundarytype (void) const
int periodicboundary (const int d) const
int periodicindex (const int d) const
int externalghostwidth (void) const
int totallevels (void) const
int coarselevel (void) const
int maxlevel (void) const
int finelevel (void) const
int stepsize (const int lev) const
 Step-size in internal integer time-units on a particular level. More...

int timestep (const int lev) const
int stepstaken (const int t, const int l) const
 Steps already taken in a subiteration on the refined grids.

double delta_t (const int l) const
 Physical time-step on level l.

double delta_x (const int dim, const int l) const
 Physical step-size on level l.

int refinefactor (const int lev) const
 Refinement factor employed for new refinement grids on level lev.

int refinedby (const int lev) const
 Refinement factor of level lev in respect to the coarsest grid.

int refinedby (const int l1, const int l2) const
 Refinement factor between levels l1 and l2.

int buffer () const
 Buffer size for proper nesting of refinement grids.

const int & gucfactor () const
 The GridUnit-coarsening factor. More...

const int & guminwidth () const
 The minimal GridUnit-width.

void setgucfactor (const int &cfac)
 Enforce an appropriate minimal GridUnit-width. More...

int updatedvaluestep () const
void setupdatedvaluestep (const int ustep)
void chkpt_filename (ostrstream &obuf, const char *name, const int p)
int chkpt_restart (void) const
const char * chkpt_name (void) const
int chkpt_pnum (void) const
void chkpt_reset (void)
int getCurrentTime (const int lev) const
 Actual time in internal integer time-units. More...

void setCurrentTime (const int ctime, const int lev)
void incrCurrentTime (const int lev)
 Increment the actual integer-time on a level by one time-step.

int getPreviousTime (const int lev) const
 Previous time in internal integer time-units.

int getNextTime (const int lev) const
 Next time in internal integer time-units.

int GlobalLength (int lev)
int GlobalMaxIndex (int lev)
int LocalLength (int lev)
GridUnitListclist ()
GridUnitListllist ()
GridBoxList ** lgbl ()
 Local GridBoxLists on all levels.

GridBoxList ** ggbl ()
 Global GridBoxLists on all levels.

GridBoxList ** oldlgbl ()
GridBoxList ** oldggbl ()
GridBoxListlgbl (int lev)
 Actual local GridBoxList on level lev.

GridBoxListggbl (int lev)
 Actual global GridBoxList on level lev.

GridBoxListoldlgbl (int lev)
GridBoxListoldggbl (int lev)
void llb (int *lc) const
void lub (int *lc) const
Coords llb (void) const
 Integer coords of the basbox.

Coords lub (void) const
void wlb (double *wc) const
void wub (double *wc) const
DCoords worldCoords (const int *lc, const int *ls) const
 Transform integer-coordinates into physical coordinates.

DCoords worldCoordsUpper (const int *lc, const int *ls) const
DCoords worldCoordsLower (const int *lc, const int *ls) const
DCoords worldStep (const int *ls) const
void worldCoords (const int *lc, const int *ls, double *wc) const
void worldStep (const int *ls, double *ws) const
Coords localCoords (double const *wc) const
Coords localStep (double const *ws) const
void localCoords (double const *wc, int *lc) const
void localStep (double const *ws, int *ls) const
BBox bbbox (void) const
 Bounding box of the entire base grid.

BBox glbbbox (void) const
BBox wholebbox (void) const
 Interior box of the entire base grid.

BBoxListwholebaselist (void) const
 Interior boxes of the actual base grid.

const double * wholebndry (void) const
 Coordinates of entire base grid and cut-off regions.

const int & nbndry (void) const
void glb_bboxlist (BBoxList &bbl, const int l, const int type=(1)) const
void DAGH_IOServe (void)
void DAGH_IOType (const int type)
void DAGH_IOEnd (void)
void DAGH_SyncGhostRegions (const int t, const int l)
void DAGH_SyncGhostRegions (const int t, const int l, const int axis, const int dir)

Static Public Methods

void DAGH_InitOverlaps (const int Type, short *olap)
int daghoverlapCC_or_NCC (const int type)

Public Attributes

short const rank
 Grid rank.

short distribution_type
 Distribution information.

DAGHDistributiondistribution
GridUnitListcomplist
 The COMPOSITE list.

GridBoxList ** globalgbl
 Actual and last Grid BoxList for the global topology of each level.

GridBoxList ** oldglobalgbl
 Actual and last Grid BoxList for the global topology of each level.

GridUnitListlocallist
 Local GridUnit list.

GridBoxList ** localgbl
 Actual and last Grid BoxList for the local topology of each level.

GridBoxList ** oldlocalgbl
 Actual and last Grid BoxList for the local topology of each level.

BBoxList ** localbboxarray
 New refinement topology.

short gfnum
 GridFunction Information.

GridFunctionVoid ** gflist
short io_type
 IO Servers.

DAGHIOServerRcv * io_write_server
DAGHIOServerSnd * io_read_server
DAGHIOServerPing * io_end_server

Friends

ostream & operator<< (ostream &os, const GridHierarchy &)
ofstream & operator<< (ofstream &ofs, const GridHierarchy &)
ifstream & operator>> (ifstream &ifs, GridHierarchy &)
strstream & operator<< (strstream &ofs, const GridHierarchy &)
strstream & operator>> (strstream &ifs, GridHierarchy &)
void DAGHIO_EndIOPingFunction (GridHierarchy &GH)

Detailed Description

GridHierarchy stores the hierarchical structure on an adaptive application.

The global topology of each level is stored in a GridBoxList of the array globalgbl. The local portion of each processor is stored in localgbl. All GridFunctions follow automatically the topology determined by these lists. A change of the hierarchy is initiated by initializing the BBoxLists in localbboxarray with the new topology found on each processor. When RecomposeHierarchy() is called the global union of these BBoxLists is constructed on each level. The workload of the entire hierachy is estimated and accumulated in GridUnit-objects. The minimal size of a GridUnit is one cell of the coarsest level. The usage of larger GridUnits can be enforced with setgucfactor(), the GridUnit-coarsening factor. The partitioning algorithm breaks up the derived composite GridUnitList complist in load-balanced portions and assigns a locallist to each processor. Each node derives its new GridBoxList localgbl by intersecting its locallist with the global union of BBoxLists. globalgbl is finally found as global union of all localgbl's. Employing localgbl, globalgbl and their counterparts oldlocalgbl, oldglobalgbl of the preceeding hierarchy all GridFunctions are reconstructed.

Author:
Ralf Deiterding, Manish Parashar

Definition at line 146 of file GridHierarchy.h.


Member Function Documentation

void GridHierarchy::DAGH_RecomposeHierarchy int    Partition
 

Recompose the whole hierachy and all associated GridFunctions.

When RecomposeHierarchy() is called the global union of localbbl is constructed on each level. The workload of the entire hierachy is estimated and accumulated in GridUnit-objects. The partitioning algorithm breaks up the derived composite GridUnitList complist in load-balanced portions and assigns a locallist to each processor. Each node derives its new GridBoxList localgbl by intersecting its locallist with the global union of BBoxLists. globalgbl is finally found as global union of all localgbl's. Employing localgbl, globalgbl and their counterparts oldlocalgbl, oldglobalgbl of the preceeding hierarchy all GridFunctions are reconstructed.

Parameters:
Partition  int. DAGHFalse=skip the partitioner (minimizes communication).

Definition at line 799 of file GridHierarchy.C.

References GridBoxList::add(), BBoxList::add(), buffer(), complist, GridBoxList::empty(), BBox::empty(), Bucket< GridBox >::first(), Bucket< BBox >::first(), GridBox::gbBBox(), GridFunctionVoid::GF_FreeTmpStorage(), GridFunctionVoid::GF_Recompose(), gfnum, globalgbl, BBox::grow(), BBox::growupper(), guminwidth(), GridBoxList::isempty(), BBoxList::isempty(), localbboxarray, localgbl, locallist, BBoxList::mergeboxes(), Bucket< GridBox >::next(), Bucket< BBox >::next(), GridBoxList::number(), oldglobalgbl, oldlocalgbl, SimpleBucketVoid::pack(), DAGHDistribution::partition(), BBox::refine(), refinedby(), refinefactor(), BBox::setstepsize(), BBox::stepsize(), and wholebbox().

void GridHierarchy::DAGH_Refine BBoxList   bblist,
const int    lev
 

Sets refinement regions on a particular level.

Parameters:
bblist  BBoxList &. Refinement region.
lev  int. Level.

Definition at line 1416 of file GridHierarchy.C.

References BBoxList::add(), BBox::coarsen(), BBoxList::empty(), Bucket< BBox >::first(), Bucket< GridBox >::first(), GridBox::gbBBox(), localbboxarray, localgbl, Bucket< BBox >::next(), BBox::rank, BBox::refine(), BBox::stepsize(), and stepsize().

int GridHierarchy::getCurrentTime const int    lev const [inline]
 

Actual time in internal integer time-units.

To each time-step that took place during a run a unique integer time-value is assigned. The time-value depends on the actual level and is calculated in respect to the list of refinement factors.

Definition at line 643 of file GridHierarchy.h.

const int& GridHierarchy::gucfactor   const [inline]
 

The GridUnit-coarsening factor.

Coarsen level 0 by this factor when constructing GridUnits. The GuC-factor determines the minimal size of elements for partitioning. The usage of coarser GridFunctions, e.g. for error estimation or multigrid algorithms, requires coarser GridUnits. Otherwise it is not guaranteed that all data is local available.

Definition at line 604 of file GridHierarchy.h.

void GridHierarchy::setgucfactor const int &    cfac [inline]
 

Enforce an appropriate minimal GridUnit-width.

Application-dependent.

Definition at line 608 of file GridHierarchy.h.

int GridHierarchy::stepsize const int    lev const [inline]
 

Step-size in internal integer time-units on a particular level.

On the highest possible level stepsize is 1.

Definition at line 556 of file GridHierarchy.h.

Referenced by DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), and DAGH_Refine().


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


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04