GridHierarchy stores the hierarchical structure on an adaptive application. More...
#include <GridHierarchy.h>
Public Member Functions | |
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. | |
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. | |
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 (std::stringstream &ofs) |
Write GridHierarchy into memory. | |
int | DAGH_Checkpoint_StrStream_Memory () |
void | DAGH_ComposeHierarchy (const char *name) |
bool | DAGH_RecomposeHierarchy (const char *name) |
Recompose GridHierarchy from checkpointing-file. | |
void | DAGH_RecomposeHierarchy (std::stringstream &ifs) |
Recompose GridHierarchy from memory. | |
void | DAGH_InitChkpt (const char *name) |
void | DAGH_InitChkpt () |
void | DAGH_StopChkpt () |
int | DAGH_OpenChkptIStream (const int p, std::ifstream &ifs) |
void | DAGH_CloseChkptIStream (std::ifstream &ifs) |
int | DAGH_OpenChkptIStream (const int p, std::streampos *&chkptdir, char *&chkptnamedir, std::ifstream &ifs) |
int | DAGH_OpenChkptStrStream (std::streampos *&chkptdir, char *&chkptnamedir, std::stringstream &ifs) |
void | DAGH_CloseChkptIStream (std::streampos *&chkptdir, char *&chkptnamedir, std::ifstream &ifs) |
void | DAGH_CloseChkptStrStream (std::streampos *&chkptdir, char *&chkptnamedir, std::stringstream &ifs) |
int | DAGH_GetGFChkptIStream (const int p, const char *gfname, const int gfid, std::ifstream &ifs) |
int | DAGH_GetGFChkptStrStream (const char *gfname, const int gfid, std::stringstream &ifs) |
int | DAGH_OpenChkptOStream (const int p, std::ofstream &ofs) |
void | DAGH_CloseChkptOStream (std::ofstream &ofs) |
void | DAGH_GlbConcat (void *snddata, int sndsize, void *&rcvdata, int &rcvsize, MPI_Comm Cin=0) |
void | DAGH_PingIONode (const int tag, int flg) |
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. | |
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. | |
const int & | guminwidth () const |
The minimal GridUnit-width. | |
void | setgucfactor (const int &cfac) |
Enforce an appropriate minimal GridUnit-width. | |
const int & | maxGridBoxSize () const |
Maximal size of GridBox. | |
void | setmaxGridBoxSize (const int &mgsize) |
const int & | timerefinewl () const |
Time step refinement in workload calculation. | |
void | settimerefinewl (const int &tref) |
int | updatedvaluestep () const |
void | setupdatedvaluestep (const int ustep) |
void | chkpt_filename (std::ostringstream &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. | |
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) |
GridUnitList * | clist () |
GridUnitList * | llist () |
GridBoxList ** | lgbl () |
Local GridBoxLists on all levels. | |
GridBoxList ** | ggbl () |
Global GridBoxLists on all levels. | |
GridBoxList ** | oldlgbl () |
GridBoxList ** | oldggbl () |
GridBoxList * | lgbl (int lev) |
Actual local GridBoxList on level lev. | |
GridBoxList * | ggbl (int lev) |
Actual global GridBoxList on level lev. | |
GridBoxList * | oldlgbl (int lev) |
GridBoxList * | oldggbl (int lev) |
void | llb (int *lc) const |
void | lub (int *lc) const |
Coords | llb (void) const |
Integer coords of the basebox. | |
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. | |
BBoxList * | wholebaselist (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 | glb_bboxlist (BBoxList &bbl, const int l, const int type, BBox &bb) const |
void | DAGH_IOServe (void) |
void | DAGH_SetIOType (const short type) |
const short & | DAGH_IOType (void) |
DAGHIO_WriteFunc | DAGH_IOWrite (void) |
DAGHIO_ReadFunc | DAGH_IORead (void) |
void | DAGH_IOFlush (void) |
void | DAGH_IOClose (void) |
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 Member Functions | |
static void | DAGH_InitOverlaps (const int Type, short *olap) |
static int | daghoverlapCC_or_NCC (const int type) |
Public Attributes | |
short const | rank |
Grid rank. | |
short | distribution_type |
Distribution information. | |
DAGHDistribution * | distribution |
GridUnitList * | complist |
The COMPOSITE list. | |
GridBoxList ** | globalgbl |
Actual and last Grid BoxList for the global topology of each level. | |
GridBoxList ** | oldglobalgbl |
GridUnitList * | locallist |
Local GridUnit list. | |
GridBoxList ** | localgbl |
Actual and last Grid BoxList for the local topology of each level. | |
GridBoxList ** | oldlocalgbl |
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_flush_server |
DAGHIOServerPing * | io_close_server |
DAGHIOServerPing * | io_end_server |
Friends | |
std::ostream & | operator<< (std::ostream &os, const GridHierarchy &) |
std::ofstream & | operator<< (std::ofstream &ofs, const GridHierarchy &) |
std::ifstream & | operator>> (std::ifstream &ifs, GridHierarchy &) |
std::stringstream & | operator<< (std::stringstream &ofs, const GridHierarchy &) |
std::stringstream & | operator>> (std::stringstream &ifs, GridHierarchy &) |
void | DAGHIO_EndIOPingFunction (GridHierarchy &GH) |
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.
GridHierarchy::GridHierarchy | ( | const int | ndim, | |
const int | type, | |||
const int | max_level | |||
) |
References DAGH_CommInit(), DAGH_InitOverlaps(), DAGHBlockAllDistribution, DAGHBlockXDistribution, DAGHBlockXYDistribution, DAGHDefaultDistribution, DAGHDefaultRefineFactor, DAGHFalse, distribution, distribution_type, globalgbl, AllocError::Init(), localbboxarray, localgbl, oldglobalgbl, oldlocalgbl, rank, and DAGHDistribution::set_dist().
GridHierarchy::~GridHierarchy | ( | void | ) |
References complist, DAGH_CommKill(), distribution, gflist, gfnum, globalgbl, io_close_server, io_end_server, io_flush_server, io_read_server, io_write_server, localbboxarray, localgbl, locallist, oldglobalgbl, and oldlocalgbl.
int GridHierarchy::adaptboundarytype | ( | void | ) | const [inline] |
BBox GridHierarchy::bbbox | ( | void | ) | const [inline] |
Bounding box of the entire base grid.
int GridHierarchy::boundarytype | ( | void | ) | const [inline] |
int GridHierarchy::boundarywidth | ( | void | ) | const [inline] |
Referenced by DAGH_PeriodicBoundaries().
int GridHierarchy::buffer | ( | ) | const [inline] |
Buffer size for proper nesting of refinement grids.
Referenced by DAGH_RecomposeHierarchy().
void GridHierarchy::chkpt_filename | ( | std::ostringstream & | obuf, | |
const char * | name, | |||
const int | p | |||
) |
Referenced by DAGH_GetGFChkptIStream(), DAGH_OpenChkptIStream(), and DAGH_OpenChkptOStream().
const char* GridHierarchy::chkpt_name | ( | void | ) | const [inline] |
int GridHierarchy::chkpt_pnum | ( | void | ) | const [inline] |
void GridHierarchy::chkpt_reset | ( | void | ) | [inline] |
References DAGHFalse.
int GridHierarchy::chkpt_restart | ( | void | ) | const [inline] |
References DAGHTrue.
Referenced by DAGH_ComposeGridFunctions(), DAGH_RecomposeHierarchy(), and GridFunction< GFType, dim >::GridFunction().
GridUnitList* GridHierarchy::clist | ( | ) | [inline] |
References complist.
int GridHierarchy::coarselevel | ( | void | ) | const [inline] |
Referenced by CoarseLevel().
int GridHierarchy::DAGH_AddGridFunction | ( | GridFunctionVoid * | gfv | ) |
References comm_service::add_comm(), comm_service::dce(), gflist, GFListIncrement, gfnum, comm_service::inc_commarray(), and comm_service::num_comm().
Referenced by GridFunction< GFType, dim >::GridFunction().
void GridHierarchy::DAGH_Checkpoint | ( | std::stringstream & | ofs | ) |
Write GridHierarchy into memory.
References DAGH_InitChkpt(), DAGH_StopChkpt(), DAGHBktGFNameWidth, END_WATCH, GridFunctionVoid::GF_Checkpoint(), gflist, gfnum, and START_WATCH.
void GridHierarchy::DAGH_Checkpoint | ( | const char * | name | ) |
Write GridHierarchy into checkpointing-file.
References DAGH_CloseChkptOStream(), DAGH_InitChkpt(), DAGH_OpenChkptOStream(), DAGH_StopChkpt(), DAGHBktGFNameWidth, DAGHTrue, END_WATCH, GridFunctionVoid::GF_Checkpoint(), gflist, gfnum, comm_service::proc_me(), and START_WATCH.
Referenced by Checkpoint().
int GridHierarchy::DAGH_Checkpoint_StrStream_Memory | ( | ) |
References complist, DAGHBktGFNameWidth, gflist, gfnum, globalgbl, localbboxarray, localgbl, locallist, and Bucket< Type >::number().
void GridHierarchy::DAGH_CloseChkptIStream | ( | std::streampos *& | chkptdir, | |
char *& | chkptnamedir, | |||
std::ifstream & | ifs | |||
) |
void GridHierarchy::DAGH_CloseChkptIStream | ( | std::ifstream & | ifs | ) |
Referenced by DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_CloseChkptOStream | ( | std::ofstream & | ofs | ) |
Referenced by DAGH_Checkpoint().
void GridHierarchy::DAGH_CloseChkptStrStream | ( | std::streampos *& | chkptdir, | |
char *& | chkptnamedir, | |||
std::stringstream & | ifs | |||
) | [inline] |
Referenced by DAGH_RecomposeHierarchy().
int GridHierarchy::DAGH_CommInit | ( | MPI_Comm | c = 0 |
) |
Referenced by GridHierarchy().
void GridHierarchy::DAGH_CommKill | ( | void | ) |
Referenced by ~GridHierarchy().
void GridHierarchy::DAGH_ComposeGridFunctions | ( | void | ) | [inline] |
References chkpt_restart(), GridFunctionVoid::GF_CheckpointRestart(), GridFunctionVoid::GF_Compose(), gflist, and gfnum.
Referenced by ComposeGridFunctions().
void GridHierarchy::DAGH_ComposeHierarchy | ( | const char * | name | ) |
void GridHierarchy::DAGH_ComposeHierarchy | ( | void | ) |
Compose the grid hierarchy.
References Bucket< Type >::add(), complist, DAGH_CreateBBoxList(), DAGH_CreateGridUnitList(), DAGH_GlbConcat(), DAGH_InitOverlaps(), DAGH_IOServe(), DAGH_PeriodicBoundaries(), DAGHIO_Close, DAGHIO_Flush, DAGHIO_Read, DAGHIO_Write, DAGHIOCloseReqTag, DAGHIOEndReqTag, DAGHIOFlushReqTag, DAGHIOReadReqTag, DAGHIOTag, DAGHIOWriteReqTag, DAGHMaxRank, DAGHShadowFactor, distribution, Bucket< Type >::empty(), END_WATCH, Bucket< Type >::first(), globalgbl, BBox::growupperbydim(), guminwidth(), dimspec::hfine, dimspec::high, Bucket< Type >::insert(), io_close_server, comm_service::io_enabled(), io_end_server, io_flush_server, io_read_server, io_type, io_write_server, Bucket< Type >::isempty(), localgbl, locallist, comm_service::log(), lower(), BBox::lower(), maxGridBoxSize(), BBoxList::mergeboxes(), dimspec::n, Bucket< Type >::next(), dimspec::nfine, number(), Bucket< Type >::pack(), DAGHDistribution::partition(), Bucket< Type >::prev(), comm_service::proc_io(), comm_service::proc_me(), comm_service::proc_num(), comm_service::proc_world(), refinedby(), refinefactor(), AllocError::SetTexts(), START_WATCH, stepsize(), timerefinewl(), upper(), BBox::upper(), wholebbox(), and worldCoords().
Referenced by ComposeHierarchy().
void GridHierarchy::DAGH_CreateBBoxList | ( | BBoxList *& | bbl, | |
GridUnitList & | gul | |||
) |
References Bucket< Type >::add(), DAGHMaxRank, Bucket< Type >::empty(), Bucket< Type >::first(), gucfactor(), BBox::lower(), BBoxList::mergeboxes(), Bucket< Type >::next(), BBox::rank, refine(), BBox::stepsize(), stepsize(), and BBox::upper().
Referenced by DAGH_ComposeHierarchy(), and DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_CreateGridUnitList | ( | GridUnitList *& | gul, | |
const BBox & | _bb | |||
) |
void GridHierarchy::DAGH_CreateGridUnitList | ( | GridUnitList *& | gul, | |
BBoxList ** | bbla, | |||
int | count = (0) | |||
) |
References Bucket< Type >::add(), BBoxNULL, coarsen(), GridUnitList::decompose(), BBox::empty(), Bucket< Type >::empty(), Bucket< Type >::first(), first(), for_1, for_2, for_3, GridUnit::guBBox(), gucfactor(), GridUnit::guCrsLev(), GridUnit::guExtent(), guminwidth(), GridUnit::guSetWorkload(), comm_service::log(), lower(), BBox::lower(), Bucket< Type >::next(), BBox::rank, BBox::stepsize(), upper(), BBox::upper(), and wholebbox().
Referenced by DAGH_ComposeHierarchy(), and DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_DelGridFunction | ( | const int | gfid | ) | [inline] |
References comm_service::dce(), comm_service::delete_comm(), gflist, and gfnum.
Referenced by GridFunction< GFType, dim >::~GridFunction().
int GridHierarchy::DAGH_GetGFChkptIStream | ( | const int | p, | |
const char * | gfname, | |||
const int | gfid, | |||
std::ifstream & | ifs | |||
) |
References chkpt_filename(), DAGHBktGFNameWidth, DAGHFalse, and DAGHTrue.
int GridHierarchy::DAGH_GetGFChkptStrStream | ( | const char * | gfname, | |
const int | gfid, | |||
std::stringstream & | ifs | |||
) |
References DAGHBktGFNameWidth, DAGHFalse, and DAGHTrue.
void GridHierarchy::DAGH_GetTimeSpecs | ( | double & | starttime, | |
double & | stoptime | |||
) | [inline] |
References dimspec::high, and dimspec::low.
void GridHierarchy::DAGH_GlbConcat | ( | void * | snddata, | |
int | sndsize, | |||
void *& | rcvdata, | |||
int & | rcvsize, | |||
MPI_Comm | Cin = 0 | |||
) |
Referenced by DAGH_ComposeHierarchy(), and DAGH_RecomposeHierarchy().
int GridHierarchy::DAGH_GridFunctionTemplate | ( | GridFunctionVoid & | gfv | ) | [inline] |
References DAGHTemplateComm, and GridFunctionVoid::gfid.
Referenced by GridFunctionTemplate().
void GridHierarchy::DAGH_InitChkpt | ( | ) | [inline] |
References DAGHTrue.
Referenced by DAGH_Checkpoint(), and DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_InitChkpt | ( | const char * | name | ) | [inline] |
References DAGHChkPtTagNameSize, and DAGHTrue.
static void GridHierarchy::DAGH_InitOverlaps | ( | const int | Type, | |
short * | olap | |||
) | [inline, static] |
void GridHierarchy::DAGH_IOClose | ( | void | ) |
Referenced by DAGHIOClose().
void GridHierarchy::DAGH_IOEnd | ( | void | ) |
Referenced by DAGHIOEnd().
void GridHierarchy::DAGH_IOFlush | ( | void | ) |
Referenced by DAGHIOFlush().
DAGHIO_ReadFunc GridHierarchy::DAGH_IORead | ( | void | ) | [inline] |
References DAGHIO_Read, and io_type.
Referenced by DAGHIORead().
void GridHierarchy::DAGH_IOServe | ( | void | ) |
References comm_service::comminit(), io_end_server, comm_service::log(), comm_service::proc_me(), comm_service::req(), and comm_service::serve().
Referenced by DAGH_ComposeHierarchy().
const short& GridHierarchy::DAGH_IOType | ( | void | ) | [inline] |
References io_type.
Referenced by DAGHIOType().
DAGHIO_WriteFunc GridHierarchy::DAGH_IOWrite | ( | void | ) | [inline] |
References DAGHIO_Write, and io_type.
Referenced by DAGHIOWrite().
int GridHierarchy::DAGH_OpenChkptIStream | ( | const int | p, | |
std::streampos *& | chkptdir, | |||
char *& | chkptnamedir, | |||
std::ifstream & | ifs | |||
) |
References chkpt_filename(), DAGHBktGFNameWidth, DAGHFalse, and DAGHTrue.
int GridHierarchy::DAGH_OpenChkptIStream | ( | const int | p, | |
std::ifstream & | ifs | |||
) |
References chkpt_filename(), DAGHFalse, and DAGHTrue.
Referenced by DAGH_RecomposeHierarchy().
int GridHierarchy::DAGH_OpenChkptOStream | ( | const int | p, | |
std::ofstream & | ofs | |||
) |
References chkpt_filename(), DAGHFalse, DAGHTrue, and comm_service::proc_num().
Referenced by DAGH_Checkpoint().
int GridHierarchy::DAGH_OpenChkptStrStream | ( | std::streampos *& | chkptdir, | |
char *& | chkptnamedir, | |||
std::stringstream & | ifs | |||
) |
References DAGHBktGFNameWidth, and DAGHTrue.
Referenced by DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_PeriodicBoundaries | ( | GridBoxList * | gbl, | |
GridBoxList * | agbl | |||
) |
References boundarywidth(), BBox::coarsen(), coarsen(), Bucket< Type >::first(), GridBox::gbBBox(), BBox::grow(), gucfactor(), Bucket< Type >::isempty(), Bucket< Type >::next(), Bucket< Type >::number(), periodicboundary(), BBox::refine(), BBox::stepsize(), and wholebbox().
Referenced by DAGH_ComposeHierarchy(), and DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_PingIONode | ( | const int | tag, | |
int | flg | |||
) |
void GridHierarchy::DAGH_RecomposeHierarchy | ( | std::stringstream & | ifs | ) |
Recompose GridHierarchy from memory.
References chkpt_restart(), complist, DAGH_CloseChkptStrStream(), DAGH_InitChkpt(), DAGH_OpenChkptStrStream(), DAGH_StopChkpt(), DAGHFalse, DAGHTrue, comm_service::dce(), END_WATCH, finelevel(), GridFunctionVoid::GF_CheckpointRecompose(), gflist, gfnum, globalgbl, localgbl, locallist, comm_service::log(), oldglobalgbl, oldlocalgbl, comm_service::reset_comm(), AllocError::SetTexts(), and START_WATCH.
bool GridHierarchy::DAGH_RecomposeHierarchy | ( | const char * | name | ) |
Recompose GridHierarchy from checkpointing-file.
References Bucket< Type >::add(), add(), GridFunctionVoid::checkpoint(), chkpt_restart(), coarsen(), comm_service::comm(), complist, DAGH_CloseChkptIStream(), DAGH_CreateBBoxList(), DAGH_CreateGridUnitList(), DAGH_GlbConcat(), DAGH_InitChkpt(), DAGH_InitOverlaps(), DAGH_OpenChkptIStream(), DAGH_PeriodicBoundaries(), DAGH_StopChkpt(), DAGHFalse, DAGHMaxRank, DAGHShadowFactor, DAGHTrue, comm_service::dce(), distribution, BBox::empty(), Bucket< Type >::empty(), END_WATCH, finelevel(), first(), Bucket< Type >::first(), GridBox::gbBBox(), GridFunctionVoid::GF_CheckpointRecompose(), GridFunctionVoid::GF_Name(), GridFunctionVoid::GF_SetCheckpointFlag(), gflist, gfnum, globalgbl, guminwidth(), Bucket< Type >::insert(), Bucket< Type >::isempty(), localbboxarray, localgbl, locallist, comm_service::log(), BBox::lower(), maxGridBoxSize(), BBoxList::mergeboxes(), Bucket< Type >::next(), number(), oldglobalgbl, oldlocalgbl, Bucket< Type >::pack(), DAGHDistribution::partition(), Bucket< Type >::prev(), comm_service::proc_me(), comm_service::proc_num(), comm_service::proc_world(), BBox::refine(), refine(), refinefactor(), comm_service::reset_comm(), AllocError::SetTexts(), START_WATCH, stepsize(), and wholebbox().
void GridHierarchy::DAGH_RecomposeHierarchy | ( | ) | [inline] |
References DAGH_RecomposeHierarchy(), and DAGHTrue.
Referenced by DAGH_RecomposeHierarchy(), and DAGH_RedistributeHierarchy().
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.
Partition | int. DAGHFalse=skip the partitioner (minimizes communication). |
References Bucket< Type >::add(), add(), GridBoxList::bboxlist(), buffer(), chkpt_restart(), coarsen(), comm_service::comm(), complist, DAGH_CreateBBoxList(), DAGH_CreateGridUnitList(), DAGH_GlbConcat(), DAGH_InitOverlaps(), DAGH_PeriodicBoundaries(), DAGH_StopChkpt(), DAGHMaxRank, DAGHShadowFactor, comm_service::dce(), distribution, Bucket< Type >::empty(), BBox::empty(), END_WATCH, first(), Bucket< Type >::first(), GridBox::gbBBox(), GridFunctionVoid::GF_FreeTmpStorage(), GridFunctionVoid::GF_Recompose(), gflist, gfnum, globalgbl, BBox::grow(), BBox::growupper(), growupper(), guminwidth(), Bucket< Type >::insert(), BBox::intersects(), Bucket< Type >::isempty(), isempty(), localbboxarray, localgbl, locallist, comm_service::log(), BBox::lower(), maxGridBoxSize(), BBoxList::mergeboxes(), Bucket< Type >::next(), Bucket< Type >::number(), number(), oldglobalgbl, oldlocalgbl, Bucket< Type >::pack(), DAGHDistribution::partition(), Bucket< Type >::prev(), comm_service::proc_me(), comm_service::proc_num(), comm_service::proc_world(), BBoxList::reduce(), BBox::refine(), refine(), refinedby(), refinefactor(), comm_service::reset_comm(), BBox::setstepsize(), AllocError::SetTexts(), START_WATCH, BBox::stepsize(), timerefinewl(), and wholebbox().
Referenced by RecomposeHierarchy().
void GridHierarchy::DAGH_RedistributeHierarchy | ( | const int | type, | |
BBoxList & | bbl | |||
) | [inline] |
References DAGH_RecomposeHierarchy(), distribution, and DAGHDistribution::set_dist().
void GridHierarchy::DAGH_RedistributeHierarchy | ( | const int | type | ) | [inline] |
References DAGH_RecomposeHierarchy(), distribution, and DAGHDistribution::set_dist().
Referenced by RedistributeHierarchy().
void GridHierarchy::DAGH_Refine | ( | BBoxList & | bblist, | |
const int | lev | |||
) |
Sets refinement regions on a particular level.
bblist | BBoxList &. Refinement region. | |
lev | int. Level. |
References Bucket< Type >::add(), BBox::coarsen(), Bucket< Type >::empty(), Bucket< Type >::first(), first(), GridBox::gbBBox(), localbboxarray, localgbl, comm_service::log(), Bucket< Type >::next(), BBox::rank, BBox::refine(), BBox::stepsize(), and stepsize().
void GridHierarchy::DAGH_Refine | ( | const int | lev | ) |
Use entire level as new refinement region.
References add(), Bucket< Type >::empty(), first(), GridBox::gbBBox(), localbboxarray, localgbl, comm_service::log(), and Bucket< Type >::next().
Referenced by Refine().
void GridHierarchy::DAGH_SetAdaptBoundaryType | ( | const int | type | ) | [inline] |
Referenced by SetAdaptBoundaryType().
void GridHierarchy::DAGH_SetBaseGrid | ( | double const * | bbox, | |
const int * | shape, | |||
const int & | ncuts, | |||
const int * | cuts | |||
) |
References dimspec::h, dimspec::high, dimspec::low, BBox::lower(), dimspec::n, rank, and BBox::upper().
Referenced by SetBaseGrid().
void GridHierarchy::DAGH_SetBoundaryType | ( | const int | type | ) | [inline] |
Referenced by SetBoundaryType().
void GridHierarchy::DAGH_SetBoundaryWidth | ( | const int | width | ) | [inline] |
Referenced by SetBoundaryWidth().
void GridHierarchy::DAGH_SetDistributionType | ( | const int | type, | |
BBoxList & | bbl | |||
) | [inline] |
References distribution, distribution_type, and DAGHDistribution::set_dist().
void GridHierarchy::DAGH_SetDistributionType | ( | const int | type | ) | [inline] |
References distribution, distribution_type, and DAGHDistribution::set_dist().
Referenced by SetDistributionType().
void GridHierarchy::DAGH_SetExternalGhostWidth | ( | const int | width | ) | [inline] |
Referenced by SetExternalGhostWidth().
void GridHierarchy::DAGH_SetIOType | ( | const short | type | ) | [inline] |
References io_type.
Referenced by DAGHSetIOType().
void GridHierarchy::DAGH_SetNestingBuffer | ( | const int & | nb | ) | [inline] |
void GridHierarchy::DAGH_SetPeriodicBoundaries | ( | const int | dir, | |
const int | value | |||
) | [inline] |
References rank.
Referenced by SetPeriodicBoundaries().
void GridHierarchy::DAGH_SetRefineFactor | ( | const int | lev, | |
const int | rfactor | |||
) |
References DAGHDefaultRefineFactor.
void GridHierarchy::DAGH_SetRefineFactor | ( | const int | rfactor | ) |
References DAGHDefaultRefineFactor.
Referenced by SetRefineFactor().
void GridHierarchy::DAGH_SetTimeSpecs | ( | double const | starttime, | |
double const | stoptime, | |||
const int | ntsteps | |||
) |
References dimspec::h, dimspec::high, dimspec::low, and dimspec::n.
Referenced by SetTimeSpecs().
void GridHierarchy::DAGH_SetWorkFunction | ( | void * | wf | ) | [inline] |
References distribution, and DAGHDistribution::set_workfunc().
Referenced by SetWorkFunction().
void GridHierarchy::DAGH_StopChkpt | ( | ) | [inline] |
References DAGHFalse.
Referenced by DAGH_Checkpoint(), and DAGH_RecomposeHierarchy().
void GridHierarchy::DAGH_SyncGhostRegions | ( | const int | t, | |
const int | l, | |||
const int | axis, | |||
const int | dir | |||
) | [inline] |
References GridFunctionVoid::GF_ReadGhosts(), GridFunctionVoid::GF_WriteGhosts(), gflist, and gfnum.
void GridHierarchy::DAGH_SyncGhostRegions | ( | const int | t, | |
const int | l | |||
) | [inline] |
References GridFunctionVoid::GF_ReadGhosts(), GridFunctionVoid::GF_WriteGhosts(), gflist, and gfnum.
Referenced by Sync().
int GridHierarchy::dagh_type | ( | void | ) | const [inline] |
static int GridHierarchy::daghoverlapCC_or_NCC | ( | const int | type | ) | [inline, static] |
References DAGHCellCentered.
int GridHierarchy::default_alignment | ( | const int | r | ) | const [inline] |
double GridHierarchy::delta_t | ( | const int | l | ) | const [inline] |
double GridHierarchy::delta_x | ( | const int | dim, | |
const int | l | |||
) | const [inline] |
int GridHierarchy::externalghostwidth | ( | void | ) | const [inline] |
int GridHierarchy::finelevel | ( | void | ) | const [inline] |
Referenced by DAGH_RecomposeHierarchy(), and FineLevel().
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.
Referenced by AbsStepsTaken(), GridFunction< GFType, dim >::comm(), CurrentTime(), GridFunction< GFType, dim >::dagh_timeindex(), GridFunction< GFType, dim >::dagh_timevalue(), GridFunction< GFType, dim >::get_phystime_timevalue(), GridFunction< GFType, dim >::GF_CurrentTime(), GridFunction< GFType, dim >::GF_NextTime(), GridFunction< GFType, dim >::GF_PreviousTime(), GridFunction< GFType, dim >::set_phystime_timevalue(), and StepsTaken().
int GridHierarchy::getNextTime | ( | const int | lev | ) | const [inline] |
Next time in internal integer time-units.
References timestep().
int GridHierarchy::getPreviousTime | ( | const int | lev | ) | const [inline] |
Previous time in internal integer time-units.
References timestep().
GridBoxList* GridHierarchy::ggbl | ( | int | lev | ) | [inline] |
Actual global GridBoxList on level lev.
References globalgbl.
GridBoxList** GridHierarchy::ggbl | ( | ) | [inline] |
Global GridBoxLists on all levels.
References globalgbl.
void GridHierarchy::glb_bboxlist | ( | BBoxList & | bbl, | |
const int | l, | |||
const int | type = (1) | |||
) | const |
BBox GridHierarchy::glbbbox | ( | void | ) | const [inline] |
int GridHierarchy::GlobalMaxIndex | ( | int | lev | ) | [inline] |
References globalgbl.
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.
Referenced by DAGH_CreateBBoxList(), DAGH_CreateGridUnitList(), DAGH_PeriodicBoundaries(), and GuCFactor().
const int& GridHierarchy::guminwidth | ( | ) | const [inline] |
The minimal GridUnit-width.
Referenced by DAGH_ComposeHierarchy(), DAGH_CreateGridUnitList(), and DAGH_RecomposeHierarchy().
void GridHierarchy::incrCurrentTime | ( | const int | lev | ) | [inline] |
Increment the actual integer-time on a level by one time-step.
References timestep().
Referenced by IncrCurrentTime().
GridBoxList* GridHierarchy::lgbl | ( | int | lev | ) | [inline] |
Actual local GridBoxList on level lev.
References localgbl.
GridBoxList** GridHierarchy::lgbl | ( | ) | [inline] |
Local GridBoxLists on all levels.
References localgbl.
Coords GridHierarchy::llb | ( | void | ) | const [inline] |
Integer coords of the basebox.
References BBox::lower().
void GridHierarchy::llb | ( | int * | lc | ) | const |
References BBox::lower().
GridUnitList* GridHierarchy::llist | ( | ) | [inline] |
References locallist.
void GridHierarchy::localCoords | ( | double const * | wc, | |
int * | lc | |||
) | const |
References toLocal().
void GridHierarchy::localStep | ( | double const * | ws, | |
int * | ls | |||
) | const |
References dimspec::hfine.
Coords GridHierarchy::localStep | ( | double const * | ws | ) | const |
Coords GridHierarchy::lub | ( | void | ) | const [inline] |
References BBox::upper().
void GridHierarchy::lub | ( | int * | lc | ) | const |
References BBox::upper().
const int& GridHierarchy::maxGridBoxSize | ( | ) | const [inline] |
Maximal size of GridBox.
Referenced by DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), and MaxGridBoxSize().
int GridHierarchy::maxlevel | ( | void | ) | const [inline] |
Referenced by MaxLevel().
const int& GridHierarchy::nbndry | ( | void | ) | const [inline] |
GridBoxList* GridHierarchy::oldggbl | ( | int | lev | ) | [inline] |
References oldglobalgbl.
GridBoxList** GridHierarchy::oldggbl | ( | ) | [inline] |
References oldglobalgbl.
GridBoxList* GridHierarchy::oldlgbl | ( | int | lev | ) | [inline] |
References oldlocalgbl.
GridBoxList** GridHierarchy::oldlgbl | ( | ) | [inline] |
References oldlocalgbl.
int GridHierarchy::periodicboundary | ( | const int | d | ) | const [inline] |
Referenced by DAGH_PeriodicBoundaries().
int GridHierarchy::periodicindex | ( | const int | d | ) | const [inline] |
int GridHierarchy::refinedby | ( | const int | l1, | |
const int | l2 | |||
) | const [inline] |
Refinement factor between levels l1 and l2.
int GridHierarchy::refinedby | ( | const int | lev | ) | const [inline] |
Refinement factor of level lev in respect to the coarsest grid.
References Min().
Referenced by DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), delta_t(), delta_x(), RefinedBy(), and GridFunctionVoid::usedbbox().
int GridHierarchy::refinefactor | ( | const int | lev | ) | const [inline] |
Refinement factor employed for new refinement grids on level lev.
Referenced by DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), and RefineFactor().
void GridHierarchy::setCurrentTime | ( | const int | ctime, | |
const int | lev | |||
) | [inline] |
Referenced by SetCurrentTime().
void GridHierarchy::setgucfactor | ( | const int & | cfac | ) | [inline] |
void GridHierarchy::setmaxGridBoxSize | ( | const int & | mgsize | ) | [inline] |
Referenced by SetMaxGridBoxSize().
void GridHierarchy::settimerefinewl | ( | const int & | tref | ) | [inline] |
Referenced by SetTimeRefineWL().
void GridHierarchy::setupdatedvaluestep | ( | const int | ustep | ) | [inline] |
Referenced by SetUpdatedValueStep().
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.
References Max().
Referenced by DAGH_ComposeHierarchy(), DAGH_CreateBBoxList(), DAGH_RecomposeHierarchy(), DAGH_Refine(), GridFunction< GFType, dim >::GF_StepSize(), and StepSize().
int GridHierarchy::stepstaken | ( | const int | t, | |
const int | l | |||
) | const [inline] |
Steps already taken in a subiteration on the refined grids.
References timestep().
Referenced by AbsStepsTaken(), and StepsTaken().
const int& GridHierarchy::timerefinewl | ( | ) | const [inline] |
Time step refinement in workload calculation.
Referenced by DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), and TimeRefineWL().
int GridHierarchy::timestep | ( | const int | lev | ) | const [inline] |
References Max().
Referenced by AbsStepsTaken(), getNextTime(), getPreviousTime(), GridFunction< GFType, dim >::GF_TimeStep(), incrCurrentTime(), stepstaken(), and TimeStep().
int GridHierarchy::totallevels | ( | void | ) | const [inline] |
Referenced by GridFunction< GFType, dim >::get_phystime_timeindex(), GridFunction< GFType, dim >::get_phystime_timevalue(), GridFunction< GFType, dim >::GF_CreateStorage(), GridFunction< GFType, dim >::GF_DeleteStorage(), GridFunction< GFType, dim >::GridFunction(), GridFunctionVoid::GridFunctionVoid(), GridFunction< GFType, dim >::set_phystime_timeindex(), GridFunction< GFType, dim >::set_phystime_timevalue(), and TotalLevels().
int GridHierarchy::updatedvaluestep | ( | ) | const [inline] |
Referenced by UpdatedValueAt().
BBoxList* GridHierarchy::wholebaselist | ( | void | ) | const [inline] |
Interior boxes of the actual base grid.
BBox GridHierarchy::wholebbox | ( | void | ) | const [inline] |
Interior box of the entire base grid.
References shrinkupperbydim().
Referenced by DAGH_ComposeHierarchy(), DAGH_CreateGridUnitList(), DAGH_PeriodicBoundaries(), and DAGH_RecomposeHierarchy().
const double* GridHierarchy::wholebndry | ( | void | ) | const [inline] |
Coordinates of entire base grid and cut-off regions.
void GridHierarchy::wlb | ( | double * | wc | ) | const |
References toWorld().
void GridHierarchy::worldCoords | ( | const int * | lc, | |
const int * | ls, | |||
double * | wc | |||
) | const |
References BBox::lower(), and toWorld().
DCoords GridHierarchy::worldCoords | ( | const int * | lc, | |
const int * | ls | |||
) | const |
Transform integer-coordinates into physical coordinates.
References BBox::lower(), and toWorld().
Referenced by DAGH_ComposeHierarchy().
DCoords GridHierarchy::worldCoordsLower | ( | const int * | lc, | |
const int * | ls | |||
) | const |
References BBox::lower(), and toWorldLower().
DCoords GridHierarchy::worldCoordsUpper | ( | const int * | lc, | |
const int * | ls | |||
) | const |
References BBox::lower(), and toWorldUpper().
void GridHierarchy::worldStep | ( | const int * | ls, | |
double * | ws | |||
) | const |
DCoords GridHierarchy::worldStep | ( | const int * | ls | ) | const |
References dimspec::hfine.
Referenced by GridFunction< GFType, dim >::GF_norm().
void GridHierarchy::wub | ( | double * | wc | ) | const |
References BBox::lower(), toWorld(), and BBox::upper().
void DAGHIO_EndIOPingFunction | ( | GridHierarchy & | GH | ) | [friend] |
std::stringstream& operator<< | ( | std::stringstream & | ofs, | |
const GridHierarchy & | gh | |||
) | [friend] |
std::ofstream& operator<< | ( | std::ofstream & | ofs, | |
const GridHierarchy & | gh | |||
) | [friend] |
std::ostream& operator<< | ( | std::ostream & | os, | |
const GridHierarchy & | gh | |||
) | [friend] |
std::stringstream& operator>> | ( | std::stringstream & | ifs, | |
GridHierarchy & | gh | |||
) | [friend] |
std::ifstream& operator>> | ( | std::ifstream & | ifs, | |
GridHierarchy & | gh | |||
) | [friend] |
The COMPOSITE list.
Referenced by clist(), DAGH_Checkpoint_StrStream_Memory(), DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), operator>>(), and ~GridHierarchy().
Distribution information.
Referenced by DAGH_SetDistributionType(), and GridHierarchy().
short GridHierarchy::gfnum |
Actual and last Grid BoxList for the global topology of each level.
Referenced by DAGH_Checkpoint_StrStream_Memory(), DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), ggbl(), glb_bboxlist(), GlobalLength(), GlobalMaxIndex(), GridHierarchy(), operator>>(), and ~GridHierarchy().
Referenced by DAGH_ComposeHierarchy(), operator>>(), and ~GridHierarchy().
Referenced by DAGH_ComposeHierarchy(), DAGH_IOServe(), operator>>(), and ~GridHierarchy().
Referenced by DAGH_ComposeHierarchy(), operator>>(), and ~GridHierarchy().
Referenced by DAGH_ComposeHierarchy(), operator>>(), and ~GridHierarchy().
short GridHierarchy::io_type |
IO Servers.
Referenced by DAGH_ComposeHierarchy(), DAGH_IORead(), DAGH_IOType(), DAGH_IOWrite(), DAGH_SetIOType(), GridFunction< GFType, dim >::GF_Read(), and GridFunction< GFType, dim >::GF_Write().
Referenced by DAGH_ComposeHierarchy(), operator>>(), and ~GridHierarchy().
New refinement topology.
Referenced by DAGH_Checkpoint_StrStream_Memory(), DAGH_RecomposeHierarchy(), DAGH_Refine(), GridHierarchy(), operator>>(), and ~GridHierarchy().
Actual and last Grid BoxList for the local topology of each level.
Referenced by DAGH_Checkpoint_StrStream_Memory(), DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), DAGH_Refine(), GridHierarchy(), lgbl(), LocalLength(), operator>>(), and ~GridHierarchy().
Local GridUnit list.
Referenced by DAGH_Checkpoint_StrStream_Memory(), DAGH_ComposeHierarchy(), DAGH_RecomposeHierarchy(), llist(), operator>>(), and ~GridHierarchy().
Referenced by DAGH_RecomposeHierarchy(), GridHierarchy(), oldggbl(), operator>>(), and ~GridHierarchy().
Referenced by DAGH_RecomposeHierarchy(), GridHierarchy(), oldlgbl(), operator>>(), and ~GridHierarchy().
short const GridHierarchy::rank |
Grid rank.
Referenced by DAGH_SetBaseGrid(), DAGH_SetPeriodicBoundaries(), default_alignment(), GridFunction< GFType, dim >::GF_Copy(), GridFunction< GFType, dim >::GF_divide(), GridFunction< GFType, dim >::GF_equals(), GridFunction< GFType, dim >::GF_maxval(), GridFunction< GFType, dim >::GF_minus(), GridFunction< GFType, dim >::GF_minval(), GridFunction< GFType, dim >::GF_multiply(), GridFunction< GFType, dim >::GF_norm(), GridFunction< GFType, dim >::GF_plus(), GridFunction< GFType, dim >::GF_product(), GridFunction< GFType, dim >::GF_Read(), GridFunction< GFType, dim >::GF_sum(), GridFunction< GFType, dim >::GF_Write(), GridHierarchy(), and operator<<().