SGrid.hpp File Reference

Templates of the base classes for the sparse grids and combination techniques. More...

#include <iostream>
#include "sgdisp.hpp"
#include "Array.hpp"
#include "GridVec.hpp"
#include "sg_mpi.hpp"

Include dependency graph for SGrid.hpp:

This graph shows which files directly or indirectly include this file:


Classes

class  SGridTableEntry< T, t_entry >
 The grid table entry class template. More...
class  SGridTable< T, t_entry >
 The grid table class. More...
class  SparseGridTable< T >
 The simplified grid table with the entries consisting of GridVec<T>. More...
class  GridVecInterpolation< T >
 Solution interpolation/accumulator base class. More...
class  InterpolationAtPoint< T >
 Interpolates a partial solution linearly at a given point and adds this value multiplied by a given factor to the sparse grid solution. More...
class  GridInterpolation< T >
 Interpolates a partial solution at every point of a given grid and adds the result multiplied by a given factor to the sparse grid solution. More...
class  GridConstInterpolation< T >
 Piecewise constant interpolation onto a grid. More...
class  VecAccumulator< T >
 Identity interpolation. More...
class  SGridCombTechn< T, t_entry >
 Combination technique base class template. More...
class  SGridCombTechn2o< T, t_entry >
 The simple combination technique that preserves the order of the product discretizations (and has the order 1 for the other discretizations). More...

Detailed Description

Templates of the base classes for the sparse grids and combination techniques.

This implementation of the combination technique allows systems of equations of different dimensionality. For such a system, the grid table is created for the maximum dimension, so that the position in the grid table describes the refinement in the full-dimensional problem domain. But for the equations of the lower dimensionality only the FIRST indices of the position are used.

This implementation of the sparse grid computations is based on the following three classes:

  1. Objects of SGridTable keep and manage the grid table, i.e. the table of the grid functions involved in the computation. Besides, they 'manage' the computations on every grid. Note that the method of translation of the positions in the grid table to the grid-function sizes is specified by the user: The user should derive his own class from SGridTable and provide the virtual function CreateGridVec that resets the sizes of the grid function according to the given position. Furthermore, the user provides the virtual functions ComputeSolution and (optionally) InitSolution that perfom the computations on a given grid. Otherwise objects of these classes are passive: They do not support any interactions between the partial solutions.
  2. Objects of classes derived from GridVecInterpolation accumulate the partial solutions in the sparse grid solution. The derived classes should be designed for every resulting type of the solution: one scalar value, a value at a given grid point, grid function etc.
  3. Objects of SGridCombTechn implement combination techniques. They add all necessary grids to the grid table, compute the factors for the combination technique and perform the computation of the sparse grid solution (using objects of SGridTable).

How to use these templates:

  1. Decide what should be saved in the grid table. Declare a class for the contents of the entries of the grid table or use an existing type for it. Specify this type as the second argument of 'SGridTable'. In the simplest case, this type is GridVec<T>. In this case, you can use the class template SparseGridTable<T> derived from SGridTable specially for this case.
    Remark: The type 't_entry' of the contents of the grid table entries should declare a constructor with no arguments and the function Reset() that releases the memory allocated by the objects. Besides, you should select a GridVec inside of this type that is considered as a solution in the combination technique. The reference to this GridVec is returned by the user-provided virtual function SGridTable<...>Solution. The class SparseGridTable<T> defines the simple version of this function.
  2. Derive you out class from SGridTable<...> (or SparseGridTable<...>). Define the functions CreateGridVec, ComputeSolution and optionally InitSolution in it.
  3. In your application, define an object of you grid table class and an object of a combination technique. Prepare the grid table for the computations using SGridCombTechn<...>PrepareGridTable. This creates all the necessary entries and computes the combination coefficients. Then you can call InitAllSolutions and ComputeAllSolutions for the computation of the solutions on the partial grids.
  4. To get the combined solution, call SGridCombTechn<...>Combine.

Date:
Aug. 26, 2005 - created

Feb. 17, 2006 - more general templates


Generated on Fri Sep 21 12:33:51 2007 for SG2 by  doxygen 1.5.2