SGridTable< T, t_entry > Class Template Reference

The grid table class. More...

#include <SGrid.hpp>

Inheritance diagram for SGridTable< T, t_entry >:

Inheritance graph
[legend]
Collaboration diagram for SGridTable< T, t_entry >:

Collaboration graph
[legend]
List of all members.

Public Member Functions

void PrintInfo (unsigned disp_type=SG_DISP_RED)
 Prints the information about the grid table.
int Dimension () const
 Returns the dimensionality.
void AddLevel (int level)
 Adds a new level with all the entries and the grid functions.
virtual void CreateGridVec (Array< int > &position, t_entry &vec)=0
 User-defined function that resets the sizes of the grid assinged to a given grid table position. By this function the user provides the method of translation of the positions to grid sizes.
virtual GridVec< T > & Solution (t_entry &entry)=0
 User-defined function that returns the reference to the solution kept in the contents of a given grid table entry.
virtual void InitSolution (t_entry &entry)
 User-defined function that initializes the grid functions in the contents, for ex. sets the initial conditions. This function should not return any value but may throw an exception on an error.
virtual void ComputeSolution (t_entry &entry)
 User-defined function that computes the solution on one grid. This function should not return any value but may throw an exception on an error.
void InitAllSolutions ()
 Initializes the grid functions on all the grids.
void ComputeAllSolutions ()
 Computes the grid functions on all the grids.
virtual void LookAtPartialSol (SGridTableEntry< T, t_entry > &entry)
 This function servers the debugging.
 SGridTable ()
 The dummy constructor.
 SGridTable (int the_dim, int max_level=0)
 Creates a blank table.
virtual ~SGridTable ()
 Virtual destructor.

Static Public Member Functions

static long binom_coef (long r, long k)
 Computes binomial coefficients.

Detailed Description

template<typename T, class t_entry>
class SGridTable< T, t_entry >

The grid table class.


Constructor & Destructor Documentation

template<typename T, class t_entry>
SGridTable< T, t_entry >::SGridTable (  )  [inline]

The dummy constructor.

template<typename T, class t_entry>
SGridTable< T, t_entry >::SGridTable ( int  the_dim,
int  max_level = 0 
) [inline]

Creates a blank table.

Parameters:
[in] the_dim The dimensionality
[in] max_level The finest level

template<typename T, class t_entry>
virtual SGridTable< T, t_entry >::~SGridTable (  )  [inline, virtual]

Virtual destructor.


Member Function Documentation

template<typename T, class t_entry>
void SGridTable< T, t_entry >::PrintInfo ( unsigned  disp_type = SG_DISP_RED  )  [inline]

Prints the information about the grid table.

Parameters:
[in] disp_type How much to print

template<typename T, class t_entry>
int SGridTable< T, t_entry >::Dimension (  )  const [inline]

Returns the dimensionality.

template<typename T, class t_entry>
void SGridTable< T, t_entry >::AddLevel ( int  level  )  [inline]

Adds a new level with all the entries and the grid functions.

Parameters:
[in] level The level to add

template<typename T, class t_entry>
virtual void SGridTable< T, t_entry >::CreateGridVec ( Array< int > &  position,
t_entry &  vec 
) [pure virtual]

User-defined function that resets the sizes of the grid assinged to a given grid table position. By this function the user provides the method of translation of the positions to grid sizes.

Parameters:
[in] position Position in the grid table
[in] vec The grid function to reset

Implemented in SparseGridTable< T >.

template<typename T, class t_entry>
virtual GridVec<T>& SGridTable< T, t_entry >::Solution ( t_entry &  entry  )  [pure virtual]

User-defined function that returns the reference to the solution kept in the contents of a given grid table entry.

Parameters:
[in] entry The entry of the grid table

Implemented in SparseGridTable< T >.

template<typename T, class t_entry>
virtual void SGridTable< T, t_entry >::InitSolution ( t_entry &  entry  )  [inline, virtual]

User-defined function that initializes the grid functions in the contents, for ex. sets the initial conditions. This function should not return any value but may throw an exception on an error.

Parameters:
[in] entry The grid table entry to place the solution in

Reimplemented in SparseGridTable< T >.

template<typename T, class t_entry>
virtual void SGridTable< T, t_entry >::ComputeSolution ( t_entry &  entry  )  [inline, virtual]

User-defined function that computes the solution on one grid. This function should not return any value but may throw an exception on an error.

Parameters:
[in] entry The grid table entry to place the solution in

Reimplemented in SparseGridTable< T >.

template<typename T, class t_entry>
void SGridTable< T, t_entry >::InitAllSolutions (  )  [inline]

Initializes the grid functions on all the grids.

Note:
InitAllSolutions runs the user-defined function InitSolution for all the grids in the table. So if InitSolution does nothing then you have no need to call InitAllSolutions.

template<typename T, class t_entry>
void SGridTable< T, t_entry >::ComputeAllSolutions (  )  [inline]

Computes the grid functions on all the grids.

Note:
ComputeAllSolutions runs the user-defined function ComputeSolution for all the grids in the table.

template<typename T, class t_entry>
virtual void SGridTable< T, t_entry >::LookAtPartialSol ( SGridTableEntry< T, t_entry > &  entry  )  [inline, virtual]

This function servers the debugging.

This function is called during the computation of the combination of the partial solutions, separately for every solution. The USER should override this function to print or plot the partial solution and its factor in the conbination. DO NOT CHANGE anything in the grid-table entry in this function!

Parameters:
[in] entry Table entry of the partial solution.
Note:
The default action: do nothing.

template<typename T, class t_entry>
static long SGridTable< T, t_entry >::binom_coef ( long  r,
long  k 
) [inline, static]

Computes binomial coefficients.

Parameters:
[in] r r
[in] k k
Note:
We assume that r >= k


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