SG++-Doxygen-Documentation
sgpp::solver::OperationParabolicPDESolverSystem Class Referenceabstract

Abstract definition of a System that is used to solve parabolic partial differential equations. More...

#include <OperationParabolicPDESolverSystem.hpp>

Inheritance diagram for sgpp::solver::OperationParabolicPDESolverSystem:

## Public Member Functions

void abortTimestep ()
aborts the current timestep execution More...

virtual void coarsenAndRefine (bool isLastTimestep=false)=0

virtual void finishTimestep ()=0
performs some action that might be needed after a timestep has be finished in the ODE Solver, e.g. More...

virtual sgpp::base::DataVectorgenerateRHS ()=0
generates the right hand side of the system More...

sgpp::base::GridgetGrid ()
get the pointer to the underlying grid object More...

sgpp::base::DataVectorgetGridCoefficients ()
gets a pointer to the sparse grids coefficients with evtl. More...

virtual sgpp::base::DataVectorgetGridCoefficientsForCG ()=0
gets a pointer to the sparse grids coefficients used in the CG method to solve one timestep. More...

void getGridCoefficientsForSC (sgpp::base::DataVector &Values)
stores the values of the (dehierarchized) grid in the sgpp::base::DataVector Values used by time step size control methods More...

sgpp::base::GridStoragegetGridStorage ()

std::string getODESolver ()
Returns the specified ODE solver for this instance. More...

sgpp::base::GridStoragegetOldGridStorage ()

sgpp::base::GridStoragegetSecondGridStorage ()

size_t getSumGridPointsComplete ()
Returns the number of average grid points for the complete grid. More...

size_t getSumGridPointsInner ()
Returns the number of average grid points for the inner grid. More...

virtual void mult (sgpp::base::DataVector &alpha, sgpp::base::DataVector &result)=0
Multiplicates a vector with the matrix. More...

OperationParabolicPDESolverSystem ()
Constructor. More...

void saveAlpha ()
stores the current alpha_complete into alpha_complete_old to be available in the next timestep More...

void setODESolver (std::string ode)
defines the used ODE Solver for this instance, this is important because the implementation of mult and generateRHS depends on the used ODE solver More...

void setTimestepSize (double newTimestepSize)
set the size of the new timestep More...

virtual void startTimestep ()=0
Implements some start jobs of every timestep, e.g.discounting boundaries. More...

virtual ~OperationParabolicPDESolverSystem ()
Destructor. More...

Public Member Functions inherited from sgpp::base::OperationMatrix
OperationMatrix ()
Constructor. More...

virtual ~OperationMatrix ()
Destructor. More...

## Protected Attributes

sgpp::base::DataVectoralpha_complete
Pointer to the alphas (ansatzfunctions' coefficients) More...

sgpp::base::DataVectoralpha_complete_old
Pointer to the alphas from the last timestep, needed when using variable timestep sizes. More...

sgpp::base::DataVectoralpha_complete_tmp
Pointer to temporary alphas, needed when using variable timestep sizes. More...

bool bnewODESolver
checks whether a new ODE solver has been selected after creation More...

sgpp::base::GridBoundGrid
Pointer to the grid object. More...

size_t numSumGridpointsComplete
Stores number of average gridpoints, complete grid. More...

size_t numSumGridpointsInner
Stores number of average gridpoints, inner grid. More...

sgpp::base::GridStorageoldGridStorage
Pointer to the grid from the last iteration. More...

sgpp::base::DataVectorrhs

sgpp::base::GridStoragesecondGridStorage
Pointer to the grid from the last aborted iteration. More...

double TimestepSize
the size of one timestep used in the ODE Solver More...

double TimestepSize_old
the size of the last timestep More...

std::string tOperationMode
specifies in which solver this matrix is used, valid values are: ExEul for explicit Euler ImEul for implicit Euler CrNic for Crank Nicolson solver More...

## Detailed Description

Abstract definition of a System that is used to solve parabolic partial differential equations.

So an instance of this class has to pass to any ODE Solver used in SGpp.

$$A \dot{u} = L \vec{u}$$

A: mass matrix L: space discretization (L-Operator)

## ◆ OperationParabolicPDESolverSystem()

 sgpp::solver::OperationParabolicPDESolverSystem::OperationParabolicPDESolverSystem ( )

## ◆ ~OperationParabolicPDESolverSystem()

 sgpp::solver::OperationParabolicPDESolverSystem::~OperationParabolicPDESolverSystem ( )
virtual

Destructor.

## ◆ abortTimestep()

 void sgpp::solver::OperationParabolicPDESolverSystem::abortTimestep ( )

aborts the current timestep execution

## ◆ coarsenAndRefine()

 virtual void sgpp::solver::OperationParabolicPDESolverSystem::coarsenAndRefine ( bool isLastTimestep = false )
pure virtual

## ◆ finishTimestep()

 virtual void sgpp::solver::OperationParabolicPDESolverSystem::finishTimestep ( )
pure virtual

performs some action that might be needed after a timestep has be finished in the ODE Solver, e.g.

## ◆ generateRHS()

 virtual sgpp::base::DataVector* sgpp::solver::OperationParabolicPDESolverSystem::generateRHS ( )
pure virtual

generates the right hand side of the system

Returns
returns the rhs

## ◆ getGrid()

 sgpp::base::Grid * sgpp::solver::OperationParabolicPDESolverSystem::getGrid ( )

get the pointer to the underlying grid object

Returns
returns a pointer to the underlying grid object

References BoundGrid.

Referenced by sgpp::solver::Euler::solve().

## ◆ getGridCoefficients()

 sgpp::base::DataVector * sgpp::solver::OperationParabolicPDESolverSystem::getGridCoefficients ( )

gets a pointer to the sparse grids coefficients with evtl.

boundaries

Returns
alpha vector of complete grid

References alpha_complete.

## ◆ getGridCoefficientsForCG()

 virtual sgpp::base::DataVector* sgpp::solver::OperationParabolicPDESolverSystem::getGridCoefficientsForCG ( )
pure virtual

gets a pointer to the sparse grids coefficients used in the CG method to solve one timestep.

This is useful because (direchlet) boundaries can be skipped when solving the system.

Returns
alpha vector for CG method

## ◆ getGridCoefficientsForSC()

 void sgpp::solver::OperationParabolicPDESolverSystem::getGridCoefficientsForSC ( sgpp::base::DataVector & Values )

stores the values of the (dehierarchized) grid in the sgpp::base::DataVector Values used by time step size control methods

Parameters
 Values sgpp::base::DataVector in which the values will be stored

## ◆ getGridStorage()

 sgpp::base::GridStorage * sgpp::solver::OperationParabolicPDESolverSystem::getGridStorage ( )

## ◆ getODESolver()

 std::string sgpp::solver::OperationParabolicPDESolverSystem::getODESolver ( )

Returns the specified ODE solver for this instance.

Returns
the ODE solver: ExEul, ImEul or CrNic

References tOperationMode.

## ◆ getOldGridStorage()

 sgpp::base::GridStorage * sgpp::solver::OperationParabolicPDESolverSystem::getOldGridStorage ( )

References oldGridStorage.

## ◆ getSecondGridStorage()

 sgpp::base::GridStorage * sgpp::solver::OperationParabolicPDESolverSystem::getSecondGridStorage ( )

References secondGridStorage.

## ◆ getSumGridPointsComplete()

 size_t sgpp::solver::OperationParabolicPDESolverSystem::getSumGridPointsComplete ( )

Returns the number of average grid points for the complete grid.

Returns
the number of average grid points for the complete grid

References numSumGridpointsComplete.

## ◆ getSumGridPointsInner()

 size_t sgpp::solver::OperationParabolicPDESolverSystem::getSumGridPointsInner ( )

Returns the number of average grid points for the inner grid.

Returns
the number of average grid points for the inner grid

References numSumGridpointsInner.

## ◆ mult()

 virtual void sgpp::solver::OperationParabolicPDESolverSystem::mult ( sgpp::base::DataVector & alpha, sgpp::base::DataVector & result )
pure virtual

Multiplicates a vector with the matrix.

Parameters
 alpha sgpp::base::DataVector that contains the ansatzfunctions' coefficients result sgpp::base::DataVector into which the result of the space discretization operation is stored

Implements sgpp::base::OperationMatrix.

## ◆ saveAlpha()

 void sgpp::solver::OperationParabolicPDESolverSystem::saveAlpha ( )

stores the current alpha_complete into alpha_complete_old to be available in the next timestep

## ◆ setODESolver()

 void sgpp::solver::OperationParabolicPDESolverSystem::setODESolver ( std::string ode )

defines the used ODE Solver for this instance, this is important because the implementation of mult and generateRHS depends on the used ODE solver

Parameters
 ode the used ODESolver: ExEul, ImEul or CrNic

References bnewODESolver, and tOperationMode.

## ◆ setTimestepSize()

 void sgpp::solver::OperationParabolicPDESolverSystem::setTimestepSize ( double newTimestepSize )

set the size of the new timestep

Parameters
 newTimestepSize the size of the next timestep

References TimestepSize, and TimestepSize_old.

## ◆ startTimestep()

 virtual void sgpp::solver::OperationParabolicPDESolverSystem::startTimestep ( )
pure virtual

Implements some start jobs of every timestep, e.g.discounting boundaries.

## ◆ alpha_complete_old

 sgpp::base::DataVector* sgpp::solver::OperationParabolicPDESolverSystem::alpha_complete_old
protected

Pointer to the alphas from the last timestep, needed when using variable timestep sizes.

## ◆ alpha_complete_tmp

 sgpp::base::DataVector* sgpp::solver::OperationParabolicPDESolverSystem::alpha_complete_tmp
protected

Pointer to temporary alphas, needed when using variable timestep sizes.

Referenced by abortTimestep(), and saveAlpha().

## ◆ bnewODESolver

 bool sgpp::solver::OperationParabolicPDESolverSystem::bnewODESolver
protected

checks whether a new ODE solver has been selected after creation

Referenced by OperationParabolicPDESolverSystem(), and setODESolver().

## ◆ BoundGrid

 sgpp::base::Grid* sgpp::solver::OperationParabolicPDESolverSystem::BoundGrid
protected

## ◆ numSumGridpointsComplete

 size_t sgpp::solver::OperationParabolicPDESolverSystem::numSumGridpointsComplete
protected

Stores number of average gridpoints, complete grid.

## ◆ numSumGridpointsInner

 size_t sgpp::solver::OperationParabolicPDESolverSystem::numSumGridpointsInner
protected

Stores number of average gridpoints, inner grid.

## ◆ oldGridStorage

 sgpp::base::GridStorage* sgpp::solver::OperationParabolicPDESolverSystem::oldGridStorage
protected

Pointer to the grid from the last iteration.

Referenced by getOldGridStorage(), and saveAlpha().

## ◆ secondGridStorage

 sgpp::base::GridStorage* sgpp::solver::OperationParabolicPDESolverSystem::secondGridStorage
protected

Pointer to the grid from the last aborted iteration.

Referenced by abortTimestep(), and getSecondGridStorage().

## ◆ TimestepSize

 double sgpp::solver::OperationParabolicPDESolverSystem::TimestepSize
protected

## ◆ TimestepSize_old

 double sgpp::solver::OperationParabolicPDESolverSystem::TimestepSize_old
protected

## ◆ tOperationMode

 std::string sgpp::solver::OperationParabolicPDESolverSystem::tOperationMode
protected

specifies in which solver this matrix is used, valid values are: ExEul for explicit Euler ImEul for implicit Euler CrNic for Crank Nicolson solver

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