GridTable< T > Class Template Reference

Template for a multidimensional hierarchical representation of grid data. More...

#include <GridTable.hpp>

Inheritance diagram for GridTable< T >:

Inheritance graph
[legend]
Collaboration diagram for GridTable< T >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 GridTable ()
 GridTable (int d, int maxLev)
void DoNotSaveSolutions ()
int Dimension ()
int InsertComplete (Array< int > &pos, List< Array< int > > &newGrids)
 Recursively inserts a new grid and all its hierarchical ancestors, if not already there.
int SetGridData (gridData< T > &dat)
int InsertAtLevel (const int level, gridData< T > &dat)
 Insert at the given level, if not already there.
int GetValue (Array< int > &pos, double &val)
 Gets the value corresponding to position pos and leaves list pointer there.
int SetValue (Array< int > &pos, double val)
int GetSurplus (Array< int > &pos, double &val)
int SetSurplus (Array< int > &pos, double val)
int CalcSurplus ()
int CalcSurplus (Array< int > &pos)
double CalcSurplusRecursive (Array< int > &pos, int lev)
int CalcSurplus (List< Array< int > > &list)
int CalcWeight (Array< int > &pos)
int Print (std::ostream &out)

Protected Attributes

int dim
int maxLevel
int currentLevel
bool saveSolutions
Array< List< gridData< T > > > table
SortedList< refinementInfoactiveSet

Detailed Description

template<typename T>
class GridTable< T >

Template for a multidimensional hierarchical representation of grid data.

provides basic operations, eg insertion of grids, computation of surplus, printing...


Constructor & Destructor Documentation

template<typename T>
GridTable< T >::GridTable (  )  [inline]

template<typename T>
GridTable< T >::GridTable ( int  d,
int  maxLev 
) [inline]


Member Function Documentation

template<typename T>
void GridTable< T >::DoNotSaveSolutions (  )  [inline]

template<typename T>
int GridTable< T >::Dimension (  )  [inline]

template<typename T>
int GridTable< T >::InsertComplete ( Array< int > &  pos,
List< Array< int > > &  newGrids 
) [inline]

Recursively inserts a new grid and all its hierarchical ancestors, if not already there.

It is assumed that before the table was admissible in the sense that for each grid all hierarchical ancestors are in the table newly added grids are automatically added to active set!

template<typename T>
int GridTable< T >::SetGridData ( gridData< T > &  dat  )  [inline]

template<typename T>
int GridTable< T >::InsertAtLevel ( const int  level,
gridData< T > &  dat 
) [inline]

Insert at the given level, if not already there.

Returns:
1...if inserted, 0...else

template<typename T>
int GridTable< T >::GetValue ( Array< int > &  pos,
double &  val 
) [inline]

Gets the value corresponding to position pos and leaves list pointer there.

template<typename T>
int GridTable< T >::SetValue ( Array< int > &  pos,
double  val 
) [inline]

template<typename T>
int GridTable< T >::GetSurplus ( Array< int > &  pos,
double &  val 
) [inline]

template<typename T>
int GridTable< T >::SetSurplus ( Array< int > &  pos,
double  val 
) [inline]

template<typename T>
int GridTable< T >::CalcSurplus (  )  [inline]

template<typename T>
int GridTable< T >::CalcSurplus ( Array< int > &  pos  )  [inline]

template<typename T>
double GridTable< T >::CalcSurplusRecursive ( Array< int > &  pos,
int  lev 
) [inline]

template<typename T>
int GridTable< T >::CalcSurplus ( List< Array< int > > &  list  )  [inline]

template<typename T>
int GridTable< T >::CalcWeight ( Array< int > &  pos  )  [inline]

template<typename T>
int GridTable< T >::Print ( std::ostream &  out  )  [inline]


Member Data Documentation

template<typename T>
int GridTable< T >::dim [protected]

template<typename T>
int GridTable< T >::maxLevel [protected]

template<typename T>
int GridTable< T >::currentLevel [protected]

The level of the currently finest grid

template<typename T>
bool GridTable< T >::saveSolutions [protected]

Indicates if the solutions on each grid are fully saved or not (saves memory)

template<typename T>
Array<List<gridData<T> > > GridTable< T >::table [protected]

The table of grids has dim dimensions, the entries have positions i_1, ..., i_dim they are ordered according to the level i_1 + ... + i_d, ie all grids with 2^{i_1}+1, ..., 2^{i_dim}+1 points in each of the directions are stored in the list table[level], where level = i_1 + ... + i_d. in the case of the sparse grid all possible combinations will be present in each line, in general however this is not necessarily the case and is just a useful way of storing the grids

template<typename T>
SortedList<refinementInfo> GridTable< T >::activeSet [protected]

Contains the "active boundary" of indices contained in the table such that at least one neighbour is not yet in the table; they are ordered according to the indicator, such that adaptive refinement can be performed easily


The documentation for this class was generated from the following file:
Generated on Fri Sep 21 12:34:12 2007 for SG2 by  doxygen 1.5.2