SG++-Doxygen-Documentation
sgpp::pde::HeatEquationSolver Class Reference

This class provides a simple-to-use solver of the multi dimensional Heat Equation on Sparse Grids. More...

#include <HeatEquationSolver.hpp>

Inheritance diagram for sgpp::pde::HeatEquationSolver:

## Public Member Functions

void constructGrid (sgpp::base::BoundingBox &myBoundingBox, size_t level)
Use this routine the construct a regular grid to solve a PDE. More...

HeatEquationSolver ()
Std-Constructor of the solver. More...

void initGridWithSmoothHeat (sgpp::base::DataVector &alpha, double mu, double sigma, double factor)
Inits the grid with a smooth heat distribution based on the normal distribution formula. More...

virtual void initScreen ()
Inits the screen object. More...

void setHeatCoefficient (double a)
This method sets the heat coefficient of the regarded material. More...

virtual void solveCrankNicolson (size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, sgpp::base::DataVector &alpha, size_t NumImEul=0)
Call this routine to use the Crank Nicolson algorithm to solve the parabolic PDE. More...

virtual void solveExplicitEuler (size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, sgpp::base::DataVector &alpha, bool verbose=false, bool generateAnimation=false)
Call this routine to use an explicit Euler algorithm to solve the parabolic PDE. More...

virtual void solveImplicitEuler (size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, sgpp::base::DataVector &alpha, bool verbose=false, bool generateAnimation=false)
Call this routine to use an explicit Euler algorithm to solve the parabolic PDE. More...

void storeInnerRHS (sgpp::base::DataVector &alpha, std::string tFilename, double timestepsize)
Routine to export the RHS of the inner system which has to be solved in order to solve the Poisson equation. More...

void storeInnerSolution (sgpp::base::DataVector &alpha, size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, std::string tFilename)
Routine to export the solution of the inner system which has been calculated by Up/Down scheme. More...

virtual ~HeatEquationSolver ()
Std-Destructor of the solver. More...

Public Member Functions inherited from sgpp::pde::ParabolicPDESolver
ParabolicPDESolver ()
the size of one timestep More...

virtual ~ParabolicPDESolver ()
Std-Destructor of the solver. More...

Public Member Functions inherited from sgpp::pde::PDESolver
void coarsenInitialGridSurplus (sgpp::base::DataVector &alpha, double dThreshold)
Coarsens a grid by taking the grid's coefficients into account. More...

void deleteGrid ()
deletes the grid created within that solver More...

void evaluateCuboid (sgpp::base::DataVector &alpha, sgpp::base::DataVector &FunctionValues, sgpp::base::DataMatrix &EvaluationPoints)
Evaluates the sparse grid's function given by the stored grid and the alpha coefficients. More...

double evaluatePoint (sgpp::base::DataVector &evalPoint, sgpp::base::DataVector &alpha)
Determines the value of the function in the d-dimensional space. More...

std::string getGrid () const
gets the a string the describes the grid which is currently used to solve More...

size_t getNumberDimensions () const
use this the determine the number of dimensions that are currently used in the solver. More...

size_t getNumberGridPoints () const
use this to determine the number of grid points, used to solve the current problem More...

size_t getNumberInnerGridPoints () const
use this to determine the number of inner grid points, used to solve the current problem More...

PDESolver ()
Std-Constructor of the solver. More...

virtual void printGrid (sgpp::base::DataVector &alpha, size_t PointesPerDimension, std::string tfilename) const
This is some kind of debug functionality. More...

virtual void printGridDomain (sgpp::base::DataVector &alpha, size_t PointesPerDimension, sgpp::base::BoundingBox &GridArea, std::string tfilename) const
This is some kind of debug functionality. More...

virtual void printLevelIndexGrid (std::string tfilename) const
Prints the level,index pairs of the grid for each Gridpoint to a file. More...

virtual void printSparseGrid (sgpp::base::DataVector &alpha, std::string tfilename, bool bSurplus) const
Prints the sgpp::base::Grid Points of the Sparse sgpp::base::Grid either with their node basis value or their hierarchical surplus. More...

virtual void printSparseGridExpTransform (sgpp::base::DataVector &alpha, std::string tfilename, bool bSurplus) const
Prints the sgpp::base::Grid Points of the Sparse sgpp::base::Grid either with their node basis value or their hierarchical surplus. More...

void refineInitialGridSurplus (sgpp::base::DataVector &alpha, int numRefinePoints, double dThreshold)
Refines a grid by taking the grid's coefficients into account. More...

void refineInitialGridSurplusSubDomain (sgpp::base::DataVector &alpha, int numRefinePoints, double dThreshold, std::vector< double > &norm_mu, std::vector< double > &norm_sigma)
Refines a grid by taking the grid's coefficients into account. More...

void refineInitialGridSurplusToMaxLevel (sgpp::base::DataVector &alpha, double dThreshold, sgpp::base::level_t maxLevel)
Refines a grid by taking the grid's coefficients into account. More...

void refineInitialGridSurplusToMaxLevelSubDomain (sgpp::base::DataVector &alpha, double dThreshold, sgpp::base::level_t maxLevel, std::vector< double > &norm_mu, std::vector< double > &norm_sigma)
Refines a grid by taking the grid's coefficients into account. More...

void setGrid (const std::string &serializedGrid)
Sets the grid used in this BlackScholes Solver by an given serialized string of the grid. More...

virtual ~PDESolver ()
Std-Destructor of the solver. More...

## Protected Attributes

double a
the heat coefficient More...

sgpp::base::ScreenOutputmyScreen
screen object used in this solver More...

Protected Attributes inherited from sgpp::pde::PDESolver
bool bGridConstructed
stores if the grid was created inside the solver More...

size_t dim
the dimension of the grid More...

int levels
the number of levels used for an regular grid More...

sgpp::base::BoundingBoxmyBoundingBox
Stores Pointer to the sgpp::base::Grid's Bounding Box. More...

sgpp::base::GridmyGrid
The Sparse sgpp::base::Grid needed in this classificator. More...

sgpp::base::GridStoragemyGridStorage
Stores Pointer to the Girs's Storage. More...

Protected Member Functions inherited from sgpp::pde::PDESolver
virtual void getGridNormalDistribution (sgpp::base::DataVector &alpha, std::vector< double > &norm_mu, std::vector< double > &norm_sigma)
This function calculates for every grid point the value of a normal distribution given by norm_mu and norm_sigma. More...

## Detailed Description

This class provides a simple-to-use solver of the multi dimensional Heat Equation on Sparse Grids.

The class's aim is, to hide all complex details of solving the Heat Equation on Sparse Grids!

## Constructor & Destructor Documentation

 sgpp::pde::HeatEquationSolver::HeatEquationSolver ( )

Std-Constructor of the solver.

References sgpp::pde::PDESolver::bGridConstructed, and myScreen.

 sgpp::pde::HeatEquationSolver::~HeatEquationSolver ( )
virtual

Std-Destructor of the solver.

References myScreen.

## Member Function Documentation

 void sgpp::pde::HeatEquationSolver::constructGrid ( sgpp::base::BoundingBox & myBoundingBox, size_t level )
virtual

Use this routine the construct a regular grid to solve a PDE.

Parameters
 myBoundingBox reference to a bounding box that describes the grid level number of the regular's grid levels

Implements sgpp::pde::PDESolver.

 void sgpp::pde::HeatEquationSolver::initGridWithSmoothHeat ( sgpp::base::DataVector & alpha, double mu, double sigma, double factor )

Inits the grid with a smooth heat distribution based on the normal distribution formula.

Parameters
 alpha reference to the coefficient's vector mu the exspected value of the normal distribution sigma the sigma of the normal distribution factor a factor that is used to stretch the function values
 void sgpp::pde::HeatEquationSolver::initScreen ( )
virtual

Inits the screen object.

References myScreen, and sgpp::base::ScreenOutput::writeTitle().

 void sgpp::pde::HeatEquationSolver::setHeatCoefficient ( double a )

This method sets the heat coefficient of the regarded material.

Parameters
 a the heat coefficient

References a.

 void sgpp::pde::HeatEquationSolver::solveCrankNicolson ( size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, sgpp::base::DataVector & alpha, size_t NumImEul = 0 )
virtual

Call this routine to use the Crank Nicolson algorithm to solve the parabolic PDE.

Parameters
 numTimesteps the number of timesteps that should be executed timestepsize the size of the interval one timestep moves forward maxCGIterations the maximum of interation in the CG solver epsilonCG the epsilon used in the CG alpha the coefficients of the Sparse Gird's basis functions NumImEul specifies how many ImEul steps should be executed before CrNic is used, default is 0

Implements sgpp::pde::ParabolicPDESolver.

 void sgpp::pde::HeatEquationSolver::solveExplicitEuler ( size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, sgpp::base::DataVector & alpha, bool verbose = false, bool generateAnimation = false )
virtual

Call this routine to use an explicit Euler algorithm to solve the parabolic PDE.

Parameters
 numTimesteps the number of timesteps that should be executed timestepsize the size of the interval one timestep moves forward maxCGIterations the maximum of interation in the CG solver epsilonCG the epsilon used in the CG alpha the coefficients of the Sparse Gird's basis functions verbose enables verbose output during solving generateAnimation set this to true, if you want to generate a grid output in every timestep

Implements sgpp::pde::ParabolicPDESolver.

 void sgpp::pde::HeatEquationSolver::solveImplicitEuler ( size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, sgpp::base::DataVector & alpha, bool verbose = false, bool generateAnimation = false )
virtual

Call this routine to use an explicit Euler algorithm to solve the parabolic PDE.

Parameters
 numTimesteps the number of timesteps that should be executed timestepsize the size of the interval one timestep moves forward maxCGIterations the maximum of interation in the CG solver epsilonCG the epsilon used in the CG alpha the coefficients of the Sparse Gird's basis functions verbose enables verbose output during solving generateAnimation set this to true, if you want to generate a grid output in every timestep

Implements sgpp::pde::ParabolicPDESolver.

 void sgpp::pde::HeatEquationSolver::storeInnerRHS ( sgpp::base::DataVector & alpha, std::string tFilename, double timestepsize )

Routine to export the RHS of the inner system which has to be solved in order to solve the Poisson equation.

Parameters
 alpha the start solution tFilename file into which the rhs is written timestepsize the size of the timesteps
 void sgpp::pde::HeatEquationSolver::storeInnerSolution ( sgpp::base::DataVector & alpha, size_t numTimesteps, double timestepsize, size_t maxCGIterations, double epsilonCG, std::string tFilename )

Routine to export the solution of the inner system which has been calculated by Up/Down scheme.

Parameters
 alpha the start solution numTimesteps number timesteps timestepsize size of timesteps maxCGIterations the maximum of interation in the CG solver epsilonCG the epsilon used in the C tFilename file into which the rhs is written

## Member Data Documentation

 double sgpp::pde::HeatEquationSolver::a
protected

the heat coefficient

 sgpp::base::ScreenOutput* sgpp::pde::HeatEquationSolver::myScreen
protected

screen object used in this solver

The documentation for this class was generated from the following files: