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


Main Page   Class Hierarchy   Compound List   File List  

GridFunction Class Template Reference

Allocates rectangular grids of arbitrary data type according to the GridHierarchy. More...

#include <GridFunction1.h / GridFunction2.h / GridFunction3.h>

Inheritance diagram for GridFunction:

Inheritance graph
[legend]
Collaboration diagram for GridFunction:

Collaboration graph
[legend]
List of all members.

Public Methods

GridData< DAGH_GFType > & operator() (GDIterator_< DAGH_GFType > &gfi)
 GridFunction (char const name[], GridHierarchy &gh)
 GridFunction (const char name[], const int t_sten, const int s_sten, GridHierarchy &gh, const int cflag=(1), const int extghflag=((-1)))
 GridFunction (const char name[], const int t_sten, const int s_sten, const int cfac, GridHierarchy &gh, const int cflag=(1), const int extghflag=((-1)))
 GridFunction (const char name[], const int t_sten, const int s_sten, GridHierarchy &gh, const int type, const int cflag, const int bflag, const int adptbflag, const int extghflag=((-1)))
 GridFunction (const char name[], const int t_sten, const int *s_sten, GridHierarchy &gh, const int type, const int cflag, const int bflag, const int adptbflag, const int extghflag=((-1)))
 GridFunction (const char name[], const int t_sten, const int s_sten, GridHierarchy &gh, const int type, const int loff, const int cfac, const int align, const int cflag, const int bflag, const int adptbflag, const int extghflag)
 GridFunction (const char name[], const int t_sten, const int *s_sten, GridHierarchy &gh, const int type, const int loff, const int cfac, const int align, const int cflag, const int bflag, const int adptbflag, const int extghflag)
 Most flexible Construtor. More...

 GridFunction (const char name[], const int t_sten, const int s_sten, const int time, const int level, GridHierarchy &gh, const int type, const int loff, const int cfac, const int cflag, const int bflag, const int adptbflag, const int extghflag=((-1)))
 GridFunction (const char name[], const int t_sten, const int *s_sten, const int time, const int level, GridHierarchy &gh, const int type, const int loff, const int cfac, const int cflag, const int bflag, const int adptbflag, const int extghflag=((-1)))
 Constructor for a particular time and level.

 GridFunction (const char name[], const GridFunction< DAGH_GFType > &gf, const int time, const int level, const int cflag, const int bflag, const int adptbflag, const int extghflag=((-1)))
 Constructor from another GridFunction.

 ~GridFunction ()
void GF_CreateStorage (const int t)
void GF_CreateStorage (const int t, const int l)
void GF_DeleteStorage (const int t)
void GF_DeleteStorage (const int t, const int l)
void GF_CheckpointRecompose ()
 Recompose GridFunction from checkpointing-file.

void GF_CheckpointRecompose (strstream &ifs)
 Recompose GridFunction from memory.

void GF_Checkpoint (ofstream &ofs)
 Write GridFunction into checkpointing-file.

void GF_Checkpoint (strstream &ofs)
 Write GridFunction into memory.

int GF_Checkpoint_StrStream_Memory ()
void GF_CheckpointRestart (int proc=-1)
 Read GridDataBlocks from checkpointing-file. More...

void GF_CheckpointRestart (strstream &ifs)
 Read GridDataBlocks from memory, when recomposing.

void GF_SetInitFunc (void *initf)
void GF_SetUpdateFunc (void *uf)
void GF_SetBndryUpdateFunc (void *bf)
void GF_SetAdaptiveBndryUpdateFunc (void *abf)
void GF_SetProlongFunc (void *pf)
void GF_SetRestrictFunc (void *rf)
void GF_SetIOFunc (void *iof)
void GF_SetMyArgs (const int c, const char *s)
 Set auxiliary Fortran arguments.

int has_initfunc ()
int has_updatefunc ()
int has_bndryupdatefunc ()
int has_adaptivebndryupdatefunc ()
int has_prolongfunc ()
int has_restrictrunc ()
int has_iofunc ()
void GF_SetBoundaryValue (const DAGH_GFType value)
void GF_SwapTimeLevels (const int l, const int t1, const int t2)
 Swap storage for time levels.

void GF_CycleTimeLevels (const int l)
int Length (GridBoxList *gbl)
int len (int lev) const
 Number of GridDataBlocks on a particular level.

int comm () const
int comm (const int t, const int l) const
GridDataBlock< DAGH_GFType > & mygdb (const int t, const int l, const int c)
 Direct access to the cth GridDataBlock on level l at time-value t.

int exists (const int t, const int l, const int c) const
int has_parents (const int t, const int l, const int c) const
const int & parents (const int t, const int l, const int c) const
 Number of parents of the cth GridDataBlock on level l at time-value t.

const GDB_Interactionparentlist (const int t, const int l, const int c) const
 Indices of parent GridDataBlocks on level l-1 of the cth GridDataBlock on level l at time-value t.

GDB_Interactionparentlist (const int t, const int l, const int c)
const BBoxparentbox (const int t, const int l, const int c, const int j) const
const int & parentidx (const int t, const int l, const int c, const int j) const
int has_children (const int t, const int l, const int c) const
const int & children (const int t, const int l, const int c) const
 Number of children of the cth GridDataBlock on level l at time-value t.

const GDB_Interactionchildlist (const int t, const int l, const int c) const
 Indices of child GridDataBlocks on level l+1 of the cth GridDataBlock on level l at time-value t.

GDB_Interactionchildlist (const int t, const int l, const int c)
const BBoxchildbox (const int t, const int l, const int c, const int j) const
const int & childidx (const int t, const int l, const int c, const int j) const
int GF_StepSize (const int lev) const
int GF_TimeStep (const int lev) const
double GF_DeltaT (const int l) const
double GF_DeltaX (const int dim, const int l) const
int GF_CurrentTime (const int lev) const
 Actual time in internal integer time-units.

int GF_PreviousTime (const int lev) const
int GF_NextTime (const int lev) const
int dagh_timevalue (const int t, const int l) const
 Actual time in internal integer time-units. More...

int dagh_timeindex (const int t, const int l) const
 Internal storage index.

void set_phystime_timeindex (const int t, const int l, const double pht)
void set_phystime_timevalue (const int t, const int l, const double pht)
 Assigns a double-valued real time to an internal time storage index.

double get_phystime_timeindex (const int t, const int l) const
double get_phystime_timevalue (const int t, const int l) const
 Read out the a double-valued real time of an internal time storage index.

virtual void GF_WriteGhosts (const int time, const int level)
virtual void GF_WriteGhosts (const int time, const int level, const int axis, const int dir)
 Send values from regions where ghost cells of other grids overlap to neighbouring processors. More...

virtual void GF_ReadGhosts (const int time, const int level)
virtual void GF_ReadGhosts (const int time, const int level, const int axis, const int dir)
 Read ghost cell values from local and neighbouring processores. More...

void GF_BndryUpdate (const int time, const int level)
 Calls all boundary update functions in right order.

virtual void GF_Sync (const int time, const int level)
virtual void GF_Sync (const int time, const int level, const int axis, const int dir)
 Synchronize ghost cells only.

void GF_Init (const int time, const int level, char *args, const int cnt)
void GF_Init (const int time, const int level, const BBox &bb, char *args, const int cnt)
void GF_Update (const int time_from, const int time_to, const int level, char *args, const int cnt)
void GF_Update (const int time_from, const int time_to, const int level, const BBox &bb, char *args, const int cnt)
void GF_Prolong (const int tf, const int lf, const int tt, const int lt, char *args, const int cnt)
void GF_Prolong (const int tf, const int lf, const int tt, const int lt, const BBox &bb, char *args, const int cnt)
 Call pfunc for an entire level. More...

void GF_Restrict (const int tf, const int lf, const int tt, const int lt, char *args, const int cnt)
void GF_Restrict (const int tf, const int lf, const int tt, const int lt, const BBox &bb, char *args, const int cnt)
 Call rfunc for an entire level. More...

void GF_IO (const int time, const int level, char *args, const int cnt)
void GF_IO (const int time, const int level, const BBox &bb, char *args, const int cnt)
void GF_AdaptiveBndryUpdate (const int time, const int level)
 Apply boundary conditions at internal adaptive boundaries. More...

void GF_ExternalBndryUpdate (const int time, const int level)
 Apply physical boundary conditions. More...

const BBoxboundingbbox (const int t, const int l, const int c) const
BBox boundingbbox (const int t, const int l, const int c)
 BBox of the interior region + ghost cells of the cth GridDataBlock on level l at time-value t.

const BBoxinteriorbbox (const int t, const int l, const int c) const
BBox interiorbbox (const int t, const int l, const int c)
 BBox of the interior region of the cth GridDataBlock on level l at time-value t.

const BBoxdatabbox (const int t, const int l, const int c) const
BBox databbox (const int t, const int l, const int c)
 The BBox of the GridData-object stored within the cth GridDataBlock on level l at time-value t.

void boundingbboxlist (BBoxList &bbl, const int l)
void intbboxlist (BBoxList &bbl, const int l)
void databboxlist (BBoxList &bbl, const int l)
int has_externalboundaries (const int t, const int l, const int c) const
int has_externalboundary (const int t, const int l, const int c, const int dir) const
int externalboundaries (const int t, const int l, const int c, const int dir) const
int externalboundaries (const int t, const int l, const int c, const int dir)
const BBoxListexternalbndrylist (const int t, const int l, const int c, const int dir) const
BBoxListexternalbndrylist (const int t, const int l, const int c, const int dir)
int has_adaptiveboundaries (const int t, const int l, const int c) const
int has_adaptiveboundary (const int t, const int l, const int c, const int dir) const
const BBoxadaptivebndrybox (const int t, const int l, const int c, const int dir) const
BBox adaptivebndrybox (const int t, const int l, const int c, const int dir)
GridData< DAGH_GFType > const & operator() (const int t, const int l, const int c) const
GridData< DAGH_GFType > & operator() (const int t, const int l, const int c)
 Access to the GridData stored within the cth GridDataBlock on level l at time-value t.

void GF_Fill (const DAGH_GFType &val, const int time, const int level)
void GF_Copy (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2, const BBox &where)
void GF_Copy (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2)
void GF_equals (const int t, const int l, const BBox &where, const DAGH_GFType &val)
void GF_equals (const int t, const int l, const DAGH_GFType &val)
void GF_equals (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2, const BBox &where)
void GF_equals (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2)
void GF_plus (const int t, const int l, const BBox &where, const DAGH_GFType &val)
void GF_plus (const int t, const int l, const DAGH_GFType &val)
void GF_plus (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2, const BBox &where)
void GF_plus (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2)
void GF_minus (const int t, const int l, const BBox &where, const DAGH_GFType &val)
void GF_minus (const int t, const int l, const DAGH_GFType &val)
void GF_minus (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2, const BBox &where)
void GF_minus (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2)
void GF_multiply (const int t, const int l, const BBox &where, const DAGH_GFType &val)
void GF_multiply (const int t, const int l, const DAGH_GFType &val)
void GF_multiply (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2, const BBox &where)
void GF_multiply (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2)
void GF_divide (const int t, const int l, const BBox &where, const DAGH_GFType &val)
void GF_divide (const int t, const int l, const DAGH_GFType &val)
void GF_divide (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2, const BBox &where)
void GF_divide (const int t1, const int l1, const GridFunction< DAGH_GFType > &rhs, const int t2, const int l2)
DAGH_GFType GF_maxval (const int t, const int l)
DAGH_GFType GF_maxval (const int t, const int l, const BBox &where)
DAGH_GFType GF_minval (const int t, const int l)
DAGH_GFType GF_minval (const int t, const int l, const BBox &where)
DAGH_GFType GF_sum (const int t, const int l)
DAGH_GFType GF_sum (const int t, const int l, const BBox &where)
DAGH_GFType GF_product (const int t, const int l)
DAGH_GFType GF_product (const int t, const int l, const BBox &where)
double GF_norm (const int t, const int l, const int param=(1))
double GF_norm (const int t, const int l, const BBox &where, const int param=(1))
void GF_Write (const int t, const int l, const int gfdtype, char *ioname=0)
void GF_Write (const int t, const int l, const BBox &where, const int gfdtype, char *ioname=0)
void GF_Read (const int t, const int l, const int gfdtype, char *ioname=0)
void GF_Read (const int t, const int l, const BBox &where, const int gfdtype, char *ioname=0)
ostream & GF_DebugPrintData (ostream &os, const int t, const int l)
ostream & GF_DebugPrintIntData (ostream &os, const int t, const int l)
ostream & GF_DebugPrintDataBlk (ostream &os, const int time, const int level)
ostream & GF_DebugPrintTheData (ostream &os)

Friends

class GridHierarchy

Detailed Description

template<class DAGH_GFType>
class GridFunction< DAGH_GFType >

Allocates rectangular grids of arbitrary data type according to the GridHierarchy.

GridFunction-objects store all data of an adaptive application. GridFunctions capsulate all parallelization details and from the user's point of view, all GridFunctions follow the "floor plan" of their GridHierarchy automatically. For each level this floor plan is stored in a GridBoxList in GridHierarchy. The lists are accessed via GridHierarchy::lgbl() and GridHierarchy::ggbl(). For each GridBox-object a GridDataBlock-object with an appropriate GridData-storage is allocated.

Author:
Ralf Deiterding, Manish Parashar

Definition at line 31 of file GridFunction1.h / GridFunction2.h / GridFunction3.h.


Constructor & Destructor Documentation

template<class DAGH_GFType>
GridFunction< DAGH_GFType >::GridFunction const char    name[],
const int    t_sten,
const int *    s_sten,
GridHierarchy   gh,
const int    type,
const int    loff,
const int    cfac,
const int    align,
const int    cflag,
const int    bflag,
const int    adptbflag,
const int    extghflag
 

Most flexible Construtor.

Parameters:
Name  char[]. Name of the GridFunction, e.g. for IO.
t_sten  integer. Time-step radius of the numerical stencil around the actual time-step.
s_sten  integer[]. Radius of the numerical stencil in each spatial direction. This determines the size of the ghost cell regions.
gh  GridHierarchy.
type  integer. Only CellCentered really tried out yet. Be careful with Vertex- or FaceCentered!
loff  integer. Internal level offset. For each level a particular refinement factor is defined in GridHierarchy. The level offset allows the easy use of auxiliary GridFunctions that are coarsened or refined in respect to the refinement factors of the GridHierarchy. The advantage is, that in all GridFunctions the same GridDataBlock-index can be used. See GridFunctionVoid::usedbbox() for implementation details.
cfac  integer. Refines or coarsens GridFunctions by an arbitrary factor. cfac>0 coarsens. cfac<0 refines. Multiple successively coarsened GridFunctions would be used for instance in a multigrid implementation. cfac is related to GridHierarchy::gucfactor(), because only the GridHierarchy can ensure that the data on all required GridFunctions really is locally available. See GridFunctionVoid::usedbbox() for implementation details.
align  integer. Reduces the spatial dimension of the internal GridDataBlocks and assigns them to a particular side of the higher dimensional GridBox-object from which they have been derived. See GridDataBlock::gdbAlignBBox() for implementation details.
cflag  integer. GridFunction communication flag. Synchronization of ghost cells desired. Use DAGHCommSimple for standard synchronization and DAGHNoComm for GridFunctions that need not be synchronized. See DAGHParams.h for possible values.
bflag  integer. External or physical boundary types. The usual value should be DAGHBoundaryUserDef. See DAGHParams.h for possible values.
adptbflag  integer. Adaptive or internal boundary types. Use DAGHAdaptBoundaryInterp for standard linear time-space interpolation. See DAGHParams.h for possible values.
extghflag  integer. Allows additional auxiliary ghost cell. Use DAGHNoExternalGhost in standard cases. See DAGHParams.h for possible values.

Definition at line 337 of file GridFunction1.c / GridFunction2.c / GridFunction3.c.


Member Function Documentation

template<class DAGH_GFType>
int GridFunction< DAGH_GFType >::dagh_timevalue const int    t,
const int    l
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 refinement factors defined in GridHierarchy.

Definition at line 537 of file GridFunction1.h / GridFunction2.h / GridFunction3.h.

References GF_ReadGhosts(), and GF_WriteGhosts().

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_AdaptiveBndryUpdate const int    time,
const int    level
 

Apply boundary conditions at internal adaptive boundaries.

The values are derived via linear time-space interpolation from the coarser level.

Definition at line 107 of file GridFunctionBndry1.h / GridFunctionBndry2.h / GridFunctionBndry3.h.

References GDB_Interaction::bbox, BBox::empty(), and GDB_Interaction::idx.

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_CheckpointRestart int    proc = -1 [virtual]
 

Read GridDataBlocks from checkpointing-file.

A Restart on a different number of processors is possible.

Reimplemented from GridFunctionVoid.

Definition at line 2320 of file GridFunction1.c / GridFunction2.c / GridFunction3.c.

References BBox::grow(), BBox::shrinkbydim(), and BBox::shrinkupperbydim().

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_ExternalBndryUpdate const int    time,
const int    level
 

Apply physical boundary conditions.

Usually, the boundary type() will be DAGHBoundaryUserDef and the user-supplied function bfunc will be called.

Definition at line 346 of file GridFunctionBndry1.h / GridFunctionBndry2.h / GridFunctionBndry3.h.

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_Prolong const int    time_from,
const int    level_from,
const int    time_to,
const int    level_to,
const BBox   bbp,
char *    args,
const int    cnt
 

Call pfunc for an entire level.

GF_Prolong requires level lf to be synchronized, if prolongation uses ghost cells. It prolongates even into ghost cells of level lt. Calling GF_Sync() on level lt is not necessary.

Definition at line 111 of file GridFunctionFuncs1.h / GridFunctionFuncs2.h / GridFunctionFuncs3.h.

References GDB_Interaction::bbox, BBox::empty(), and GDB_Interaction::idx.

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_ReadGhosts const int    time,
const int    level,
const int    axis,
const int    dir
[virtual]
 

Read ghost cell values from local and neighbouring processores.

Local values simply have to copied. Multiple periodic boundaries are considered.

Reimplemented from GridFunctionVoid.

Definition at line 210 of file GridFunctionComm1.h / GridFunctionComm2.h / GridFunctionComm3.h.

References gdhdr::bbox, GDB_Interaction::bbox, List::empty(), BBox::empty(), GridDataBucketVoid::head(), GDB_Interaction::idx, gdhdr::index, gdhdr::level, BBox::lower(), DataBucketVoid::num(), Coords::rank, BBox::rank, BBox::stepsize(), gdhdr::time, gdhdr::time_value, and BBox::upper().

Referenced by dagh_timevalue().

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_Restrict const int    time_from,
const int    level_from,
const int    time_to,
const int    level_to,
const BBox   bbr,
char *    args,
const int    cnt
 

Call rfunc for an entire level.

GF_Restrict requires level lf to be synchronized, if restriction uses ghost cells. It restricts even into ghost cells of level lt, but only into grids with overlapping internal cells. Calling GF_Sync() on level lt is necessary for correct syncronization.

Definition at line 184 of file GridFunctionFuncs1.h / GridFunctionFuncs2.h / GridFunctionFuncs3.h.

References GDB_Interaction::bbox, BBox::coarsen(), BBox::empty(), and GDB_Interaction::idx.

template<class DAGH_GFType>
void GridFunction< DAGH_GFType >::GF_WriteGhosts const int    time,
const int    level,
const int    axis,
const int    dir
[virtual]
 

Send values from regions where ghost cells of other grids overlap to neighbouring processors.

Local values are just copied in GF_ReadGhosts and need not be considered in GF_WriteGhosts Multiple periodic boundaries are considered even over processor borders.

Reimplemented from GridFunctionVoid.

Definition at line 134 of file GridFunctionComm1.h / GridFunctionComm2.h / GridFunctionComm3.h.

References GridDataBucketVoid::head(), and DataBucketVoid::num().

Referenced by dagh_timevalue().


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