SG++-Doxygen-Documentation
|
Abstract definition of a System that is used to solve parabolic partial differential equations. More...
#include <OperationParabolicPDESolverSystem.hpp>
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::DataVector * | generateRHS ()=0 |
generates the right hand side of the system More... | |
sgpp::base::Grid * | getGrid () |
get the pointer to the underlying grid object More... | |
sgpp::base::DataVector * | getGridCoefficients () |
gets a pointer to the sparse grids coefficients with evtl. More... | |
virtual sgpp::base::DataVector * | getGridCoefficientsForCG ()=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::GridStorage * | getGridStorage () |
std::string | getODESolver () |
Returns the specified ODE solver for this instance. More... | |
sgpp::base::GridStorage * | getOldGridStorage () |
sgpp::base::GridStorage * | getSecondGridStorage () |
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::DataVector * | alpha_complete |
Pointer to the alphas (ansatzfunctions' coefficients) More... | |
sgpp::base::DataVector * | alpha_complete_old |
Pointer to the alphas from the last timestep, needed when using variable timestep sizes. More... | |
sgpp::base::DataVector * | alpha_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::Grid * | BoundGrid |
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::GridStorage * | oldGridStorage |
Pointer to the grid from the last iteration. More... | |
sgpp::base::DataVector * | rhs |
sgpp::base::GridStorage * | secondGridStorage |
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... | |
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)
sgpp::solver::OperationParabolicPDESolverSystem::OperationParabolicPDESolverSystem | ( | ) |
Constructor.
References bnewODESolver, numSumGridpointsComplete, and numSumGridpointsInner.
|
virtual |
Destructor.
void sgpp::solver::OperationParabolicPDESolverSystem::abortTimestep | ( | ) |
aborts the current timestep execution
References alpha_complete, alpha_complete_tmp, BoundGrid, sgpp::base::Grid::getStorage(), and secondGridStorage.
Referenced by sgpp::solver::VarTimestep::predictor(), sgpp::solver::StepsizeControl::solve(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().
|
pure virtual |
|
pure virtual |
performs some action that might be needed after a timestep has be finished in the ODE Solver, e.g.
some boundary adjustments.
Implemented in sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP, and sgpp::pde::HeatEquationParabolicPDESolverSystem.
Referenced by sgpp::solver::VarTimestep::corrector(), sgpp::solver::VarTimestep::predictor(), sgpp::solver::AdamsBashforth::solve(), sgpp::solver::CrankNicolson::solve(), sgpp::solver::Euler::solve(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().
|
pure virtual |
generates the right hand side of the system
Implemented in sgpp::pde::OperationParabolicPDESolverSystemDirichlet, sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP, and sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries.
Referenced by sgpp::solver::VarTimestep::corrector(), sgpp::solver::VarTimestep::predictor(), sgpp::solver::AdamsBashforth::solve(), sgpp::solver::CrankNicolson::solve(), sgpp::solver::Euler::solve(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().
sgpp::base::Grid * sgpp::solver::OperationParabolicPDESolverSystem::getGrid | ( | ) |
get the 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
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().
|
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.
Implemented in sgpp::pde::OperationParabolicPDESolverSystemDirichlet, and sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries.
Referenced by sgpp::solver::VarTimestep::corrector(), sgpp::solver::StepsizeControl::maxNorm(), sgpp::solver::VarTimestep::predictor(), sgpp::solver::AdamsBashforth::solve(), sgpp::solver::CrankNicolson::solve(), sgpp::solver::Euler::solve(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().
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
Values | sgpp::base::DataVector in which the values will be stored |
References alpha_complete, sgpp::op_factory::createOperationHierarchisation(), and sgpp::base::OperationHierarchisation::doDehierarchisation().
Referenced by sgpp::solver::VarTimestep::corrector(), sgpp::solver::VarTimestep::predictor(), sgpp::solver::StepsizeControl::solve(), sgpp::solver::StepsizeControlEJ::~StepsizeControlEJ(), and sgpp::solver::StepsizeControlH::~StepsizeControlH().
sgpp::base::GridStorage * sgpp::solver::OperationParabolicPDESolverSystem::getGridStorage | ( | ) |
References BoundGrid, and sgpp::base::Grid::getStorage().
Referenced by sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), and sgpp::solver::StepsizeControl::maxNorm().
std::string sgpp::solver::OperationParabolicPDESolverSystem::getODESolver | ( | ) |
Returns the specified ODE solver for this instance.
References tOperationMode.
sgpp::base::GridStorage * sgpp::solver::OperationParabolicPDESolverSystem::getOldGridStorage | ( | ) |
References oldGridStorage.
Referenced by sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), and sgpp::solver::StepsizeControl::maxNorm().
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.
References numSumGridpointsComplete.
size_t sgpp::solver::OperationParabolicPDESolverSystem::getSumGridPointsInner | ( | ) |
Returns the number of average grid points for the inner grid.
References numSumGridpointsInner.
|
pure virtual |
Multiplicates a vector with the matrix.
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.
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
ode | the 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
newTimestepSize | the 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().
|
pure virtual |
Implements some start jobs of every timestep, e.g.discounting boundaries.
Implemented in sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP, and sgpp::pde::HeatEquationParabolicPDESolverSystem.
Referenced by sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), and sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS().
|
protected |
Pointer to the alphas (ansatzfunctions' coefficients)
Referenced by abortTimestep(), sgpp::pde::HeatEquationParabolicPDESolverSystem::finishTimestep(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::finishTimestep(), sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), getGridCoefficients(), sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::getGridCoefficientsForCG(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::getGridCoefficientsForCG(), getGridCoefficientsForSC(), sgpp::pde::HeatEquationParabolicPDESolverSystem::HeatEquationParabolicPDESolverSystem(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::HeatEquationParabolicPDESolverSystemParallelOMP(), and saveAlpha().
|
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().
|
protected |
Pointer to temporary alphas, needed when using variable timestep sizes.
Referenced by abortTimestep(), and saveAlpha().
|
protected |
checks whether a new ODE solver has been selected after creation
Referenced by OperationParabolicPDESolverSystem(), and setODESolver().
|
protected |
Pointer to the grid object.
Referenced by abortTimestep(), getGrid(), getGridStorage(), sgpp::pde::HeatEquationParabolicPDESolverSystem::HeatEquationParabolicPDESolverSystem(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::HeatEquationParabolicPDESolverSystemParallelOMP(), and saveAlpha().
|
protected |
Stores number of average gridpoints, complete grid.
Referenced by getSumGridPointsComplete(), OperationParabolicPDESolverSystem(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::OperationParabolicPDESolverSystemDirichlet(), and sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::OperationParabolicPDESolverSystemFreeBoundaries().
|
protected |
Stores number of average gridpoints, inner grid.
Referenced by getSumGridPointsInner(), OperationParabolicPDESolverSystem(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::OperationParabolicPDESolverSystemDirichlet(), and sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::OperationParabolicPDESolverSystemFreeBoundaries().
|
protected |
Pointer to the grid from the last iteration.
Referenced by getOldGridStorage(), and saveAlpha().
|
protected |
Referenced by sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), sgpp::pde::HeatEquationParabolicPDESolverSystem::HeatEquationParabolicPDESolverSystem(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::HeatEquationParabolicPDESolverSystemParallelOMP(), sgpp::pde::HeatEquationParabolicPDESolverSystem::~HeatEquationParabolicPDESolverSystem(), and sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::~HeatEquationParabolicPDESolverSystemParallelOMP().
|
protected |
Pointer to the grid from the last aborted iteration.
Referenced by abortTimestep(), and getSecondGridStorage().
|
protected |
the size of one timestep used in the ODE Solver
Referenced by sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), sgpp::pde::HeatEquationParabolicPDESolverSystem::HeatEquationParabolicPDESolverSystem(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::HeatEquationParabolicPDESolverSystemParallelOMP(), sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::mult(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::mult(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::mult(), and setTimestepSize().
|
protected |
the size of the last timestep
Referenced by sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::mult(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::mult(), and setTimestepSize().
|
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
Referenced by sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::generateRHS(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::generateRHS(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::generateRHS(), getODESolver(), sgpp::pde::HeatEquationParabolicPDESolverSystem::HeatEquationParabolicPDESolverSystem(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::HeatEquationParabolicPDESolverSystemParallelOMP(), sgpp::pde::OperationParabolicPDESolverSystemFreeBoundaries::mult(), sgpp::pde::HeatEquationParabolicPDESolverSystemParallelOMP::mult(), sgpp::pde::OperationParabolicPDESolverSystemDirichlet::mult(), and setODESolver().