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:
sgpp::base::OperationMatrix sgpp::pde::OperationParabolicPDESolverSystemDirichlet sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries sgpp::pde::HeatEquationParabolicPDESolverSystem sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP

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)

Constructor & Destructor Documentation

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

Destructor.

Member Function Documentation

void sgpp::solver::OperationParabolicPDESolverSystem::abortTimestep ( )
virtual void sgpp::solver::OperationParabolicPDESolverSystem::coarsenAndRefine ( bool  isLastTimestep = false)
pure virtual
virtual void sgpp::solver::OperationParabolicPDESolverSystem::finishTimestep ( )
pure virtual
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().

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.

Referenced by sgpp::solver::VarTimestep::predictor(), sgpp::solver::Euler::solve(), sgpp::solver::StepsizeControl::solve(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().

virtual sgpp::base::DataVector* sgpp::solver::OperationParabolicPDESolverSystem::getGridCoefficientsForCG ( )
pure virtual
void sgpp::solver::OperationParabolicPDESolverSystem::getGridCoefficientsForSC ( sgpp::base::DataVector Values)
std::string sgpp::solver::OperationParabolicPDESolverSystem::getODESolver ( )

Returns the specified ODE solver for this instance.

Returns
the ODE solver: ExEul, ImEul or CrNic

References tOperationMode.

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

References secondGridStorage.

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.

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.

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

Multiplicates a vector with the matrix.

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

Implements sgpp::base::OperationMatrix.

Implemented in sgpp::pde::OperationParabolicPDESolverSystemDirichlet, sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP, and sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries.

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

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

References alpha_complete, alpha_complete_old, alpha_complete_tmp, BoundGrid, sgpp::base::Grid::getStorage(), and oldGridStorage.

Referenced by sgpp::solver::AdamsBashforth::solve(), and sgpp::solver::StepsizeControl::solve().

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
odethe used ODESolver: ExEul, ImEul or CrNic

References bnewODESolver, and tOperationMode.

Referenced by sgpp::solver::VarTimestep::corrector(), sgpp::solver::VarTimestep::predictor(), sgpp::solver::AdamsBashforth::solve(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().

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

set the size of the new timestep

Parameters
newTimestepSizethe size of the next timestep

References TimestepSize, and TimestepSize_old.

Referenced by sgpp::solver::VarTimestep::predictor(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().

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

Member Data Documentation

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

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

Referenced by sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), and saveAlpha().

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().

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

checks whether a new ODE solver has been selected after creation

Referenced by OperationParabolicPDESolverSystem(), and setODESolver().

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

Pointer to the grid from the last iteration.

Referenced by getOldGridStorage(), and saveAlpha().

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

Pointer to the grid from the last aborted iteration.

Referenced by abortTimestep(), and getSecondGridStorage().


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