Template Numerical Library: TNL::Solvers::ODE::StaticExplicitSolver< Real, Index > Class Template Reference

Template Numerical Library version\ main:16b9213d5

Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
TNL::Solvers::ODE::StaticExplicitSolver< Real, Index > Class Template Reference

Base class for ODE solvers and explicit solvers od PDEs. More...

`#include <TNL/Solvers/ODE/StaticExplicitSolver.h>`

Inheritance diagram for TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >:
[legend]
Collaboration diagram for TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >:
[legend]

## Public Types
using | IndexType = Index
| Indexing type.
using | RealType = Real
| Type of the floating-point arithmetics or static vector.

## Public Member Functions
__cuda_callable__ | StaticExplicitSolver ()=default
| Default constructor.
bool __cuda_callable__ | checkConvergence () const
| Checks whether the convergence occurred already.
bool __cuda_callable__ | checkNextIteration () const
| Checks if the solver is allowed to do the next iteration.
__cuda_callable__ const RealType & | getMaxTau () const
| Getter of maximal value of the time step.
__cuda_callable__ bool | getStopOnSteadyState () const
| Getter of stopOnSteadyState flag.
__cuda_callable__ const RealType & | getStopTime () const
| Getter of the time where the evolution computation shall by stopped.
__cuda_callable__ const RealType & | getTau () const
| Getter of the time step used for the computation.
__cuda_callable__ const RealType & | getTime () const
| Getter of the current time of the evolution computed by the solver.
bool __cuda_callable__ | nextIteration ()
| Proceeds to the next iteration.
__cuda_callable__ void | setMaxTau (const RealType &maxTau)
| Setter of maximal value of the time step.
__cuda_callable__ void | setStopOnSteadyState (bool stopOnSteadyState)
| Set stopOnSteadyState flag.
__cuda_callable__ void | setStopTime (const RealType &stopTime)
| Setter of the time where the evolution computation shall by stopped.
__cuda_callable__ void | setTau (const RealType &tau)
| Setter of the time step used for the computation.
__cuda_callable__ void | setTestingMode (bool testingMode)
__cuda_callable__ void | setTime (const RealType &t)
| Setter of the current time of the evolution computed by the solver.
bool | setup (const Config::ParameterContainer &parameters, const std::string &prefix="")
| Method for setup of the iterative solver based on configuration parameters.
Public Member Functions inherited from TNL::Solvers::StaticIterativeSolver< double, int >
__cuda_callable__ | StaticIterativeSolver ()=default
| Default constructor.
__cuda_callable__ bool | checkConvergence () const
| Checks whether the convergence occurred already.
__cuda_callable__ bool | checkNextIteration () const
| Checks if the solver is allowed to do the next iteration.
__cuda_callable__ const double & | getConvergenceResidue () const
| Gets the the convergence threshold.
__cuda_callable__ const double & | getDivergenceResidue () const
| Gets the limit for the divergence criterion.
__cuda_callable__ const int & | getIterations () const
| Gets the number of iterations performed by the solver so far.
__cuda_callable__ const int & | getMaxIterations () const
| Gets the maximal number of iterations the solver is allowed to perform.
__cuda_callable__ const int & | getMinIterations () const
| Gets the minimal number of iterations the solver is supposed to do.
__cuda_callable__ const double & | getResidue () const
| Gets the residue reached at the current iteration.
__cuda_callable__ bool | nextIteration ()
| Proceeds to the next iteration.
__cuda_callable__ void | resetIterations ()
| Sets the the number of the current iterations to zero.
__cuda_callable__ void | setConvergenceResidue (const double &convergenceResidue)
| Sets the threshold for the convergence.
__cuda_callable__ void | setDivergenceResidue (const double &divergenceResidue)
| Sets the residue limit for the divergence criterion.
__cuda_callable__ void | setMaxIterations (const int &maxIterations)
| Sets the maximal number of iterations the solver is allowed to perform.
__cuda_callable__ void | setMinIterations (const int &minIterations)
| Sets the minimal number of iterations the solver is supposed to do.
__cuda_callable__ void | setResidue (const double &residue)
| Sets the residue reached at the current iteration.
bool | setup (const Config::ParameterContainer &parameters, const std::string &prefix="")
| Method for setup of the iterative solver based on configuration parameters.

## Static Public Member Functions
static void | configSetup (Config::ConfigDescription &config, const std::string &prefix="")
| This method defines configuration entries for setup of the iterative solver.
Static Public Member Functions inherited from TNL::Solvers::StaticIterativeSolver< double, int >
static void | configSetup (Config::ConfigDescription &config, const std::string &prefix="")
| This method defines configuration entries for setup of the iterative solver.

## Protected Attributes
RealType | maxTau = std::numeric_limits< RealType >::max()
bool | stopOnSteadyState = false
RealType | stopTime = 0.0
RealType | tau = 0.0
bool | testingMode = false
RealType | time = 0.0
Protected Attributes inherited from TNL::Solvers::StaticIterativeSolver< double, int >
double | convergenceResidue
int | currentIteration
double | currentResidue
double | divergenceResidue
int | maxIterations
int | minIterations
int | refreshRate

## Detailed Description

template<typename Real = double, typename Index = int>
class TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >

Base class for ODE solvers and explicit solvers od PDEs.

This is a specialization for static solvers, i.e. solvers which of scalar problem or small system of ODEs solution of which can be expressed by TNL::Containers::StaticVector. The static solvers can be created even in GPU kernels and can be combined with TNL::Algorithms::parallelFor.

Template Parameters

  Real | is type of the floating-point arithmetics or static vector ( TNL::Containers::StaticVector ).
  Index | is type for indexing.

## Member Function Documentation

## ◆ checkConvergence()

template<typename Real = double, typename Index = int>

bool __cuda_callable__ TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >::checkConvergence | ( |  | ) | const
| nodiscard

Checks whether the convergence occurred already.

Returns
  true if the convergence already occurred, and false otherwise.

## ◆ checkNextIteration()

template<typename Real = double, typename Index = int>

bool __cuda_callable__ TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >::checkNextIteration | ( |  | ) | const
| nodiscard

Checks if the solver is allowed to do the next iteration.

Returns
  true if the solver is allowed to do the next iteration, and false otherwise. This may happen because the divergence occurred.

## ◆ nextIteration()

template<typename Real = double, typename Index = int>

bool __cuda_callable__ TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >::nextIteration | ( |  | ) |

Proceeds to the next iteration.

Returns
  true if the solver is allowed to do the next iteration, and false otherwise. This may happen because the divergence occurred.

## ◆ setMaxTau()

template<typename Real = double, typename Index = int>

__cuda_callable__ void TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >::setMaxTau | ( | const RealType & | maxTau | ) |

Setter of maximal value of the time step.

If methods uses adaptive choice of the time step, this sets the upper limit.

## ◆ setStopOnSteadyState()

template<typename Real = double, typename Index = int>

__cuda_callable__ void TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >::setStopOnSteadyState | ( | bool | stopOnSteadyState | ) |

Set stopOnSteadyState flag.

If the flag is on, the solver stops when steady-state solution is reached. Otherwise, the solver stops only when the stop time is reached or criteria defined in TNL::Solvers::IterativeSolver::checkConvergence() are met.

Parameters

  stopOnSteadyState | is the new value of the flag.

## ◆ setTau()

template<typename Real = double, typename Index = int>

__cuda_callable__ void TNL::Solvers::ODE::StaticExplicitSolver< Real, Index >::setTau | ( | const RealType & | tau | ) |

Setter of the time step used for the computation.

The time step can be changed by methods using adaptive choice of the time step.

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

- src/TNL/Solvers/ODE/StaticExplicitSolver.h