Skip to content
Snippets Groups Projects
Commit ec0f49ae authored by Tomáš Oberhuber's avatar Tomáš Oberhuber Committed by Jakub Klinkovský
Browse files

Writing documentation of explicit solvers.

parent a479e883
No related branches found
No related tags found
1 merge request!125ODE solvers
......@@ -21,6 +21,8 @@ namespace ODE {
/**
* \brief Base class for ODE solvers and explicit solvers od PDEs.
*
* See also: \ref TNL::Solvers::ODE::Euler, \ref TNL::Solvers::ODE::Merson.
*
* \tparam Real is type of the floating-point arithmetics.
* \tparam Index is type for indexing.
* \tparam IterativeSolverMonitor< Real, Index > is
......@@ -52,45 +54,80 @@ public:
*/
ExplicitSolver() = default;
/**
* \brief This method defines configuration entries for setup of the iterative solver.
*/
static void
configSetup( Config::ConfigDescription& config, const String& prefix = "" );
/**
* \brief Method for setup of the iterative solver based on configuration parameters.
*/
bool
setup( const Config::ParameterContainer& parameters, const String& prefix = "" );
void setTime( const RealType& t );
/**
* \brief Settter of the current time of the evolution computed by the solver.
*/
void
setTime( const RealType& t );
/**
* \brief Getter of the current time of the evolution computed by the solver.
*/
const RealType&
getTime() const;
/**
* \brief Setter of the time where the evolution computation shall by stopped.
*/
void
setStopTime( const RealType& stopTime );
/**
* \brief Getter of the time where the evolution computation shall by stopped.
*/
const RealType& getStopTime() const;
/**
* \brief Setter of the time step used for the computation.
*
* The time step can be changed by methods using adaptive choice of the time step.
*/
void
setTau( const RealType& tau );
/**
* \brief Getter of the time step used for the computation.
*/
const RealType&
getTau() const;
/**
* \brief Setter of maximal value of the time step.
*
* If methods uses adaptive choice of the time step, this sets the upper limit.
*/
void
setMaxTau( const RealType& maxTau );
/**
* \brief Getter of maximal value of the time step.
*/
const RealType&
getMaxTau() const;
/**
* \brief This method refreshes the solver monitor.
*
* The method propagates values of time, time step and others to the
* solver monitor.
*/
void
setVerbose( IndexType v );
refreshSolverMonitor( bool force = false );
void setTestingMode( bool testingMode );
void
setRefreshRate( const IndexType& refreshRate );
void
refreshSolverMonitor( bool force = false );
protected:
/****
* Current time of the parabolic problem.
......@@ -109,8 +146,6 @@ protected:
RealType maxTau = std::numeric_limits< RealType >::max();
IndexType verbosity = 0;
bool testingMode = false;
};
......
......@@ -27,7 +27,7 @@ ExplicitSolver< Real, Index, SolverMonitor >::
setup( const Config::ParameterContainer& parameters,
const String& prefix )
{
this->setVerbose( parameters.getParameter< int >( "verbose" ) );
//this->setVerbose( parameters.getParameter< int >( "verbose" ) );
return IterativeSolver< RealType, IndexType, SolverMonitor >::setup( parameters, prefix );
}
......@@ -97,14 +97,6 @@ setStopTime( const RealType& stopTime )
this->stopTime = stopTime;
}
template< typename Real, typename Index, typename SolverMonitor >
void
ExplicitSolver< Real, Index, SolverMonitor >::
setVerbose( IndexType v )
{
this->verbosity = v;
};
template< typename Real, typename Index, typename SolverMonitor >
void
ExplicitSolver< Real, Index, SolverMonitor >::
......
......@@ -16,51 +16,104 @@ namespace TNL {
namespace Solvers {
namespace ODE {
/**
* \brief 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 \ref TNL::Containers::StaticVector.
* The static solvers can be created even in GPU kernels and can be combined with \ref TNL::Algorithms::ParallelFor.
*
* See also: \ref TNL::Solvers::ODE::StaticEuler, \ref TNL::Solvers::ODE::StaticMerson.
*
* \tparam Real is type of the floating-point arithmetics or static vector ( \ref TNL::Containers::StaticVector ).
* \tparam Index is type for indexing.
*/
template< typename Real = double,
typename Index = int >
class StaticExplicitSolver : public StaticIterativeSolver< Real, Index >
{
public:
public:
/**
* \brief Type of the floating-point arithmetics or static vector.
*/
using RealType = Real;
/**
* \brief Indexing type.
*/
using IndexType = Index;
/**
* \brief Default constructor.
*/
__cuda_callable__
StaticExplicitSolver() = default;
static void configSetup( Config::ConfigDescription& config,
const String& prefix = "" );
/**
* \brief This method defines configuration entries for setup of the iterative solver.
*/
static void
configSetup( Config::ConfigDescription& config, const String& prefix = "" );
bool setup( const Config::ParameterContainer& parameters,
const String& prefix = "" );
/**
* \brief Method for setup of the iterative solver based on configuration parameters.
*/
bool
setup( const Config::ParameterContainer& parameters, const String& prefix = "" );
/**
* \brief Settter of the current time of the evolution computed by the solver.
*/
__cuda_callable__
void setTime( const RealType& t );
/**
* \brief Getter of the current time of the evolution computed by the solver.
*/
__cuda_callable__
const RealType& getTime() const;
/**
* \brief Setter of the time where the evolution computation shall by stopped.
*/
__cuda_callable__
void setStopTime( const RealType& stopTime );
/**
* \brief Getter of the time where the evolution computation shall by stopped.
*/
__cuda_callable__
const RealType& getStopTime() const;
/**
* \brief Setter of the time step used for the computation.
*
* The time step can be changed by methods using adaptive choice of the time step.
*/
__cuda_callable__
void setTau( const RealType& tau );
/**
* \brief Getter of the time step used for the computation.
*/
__cuda_callable__
const RealType& getTau() const;
/**
* \brief Setter of maximal value of the time step.
*
* If methods uses adaptive choice of the time step, this sets the upper limit.
*/
__cuda_callable__
void setMaxTau( const RealType& maxTau );
/**
* \brief Getter of maximal value of the time step.
*/
__cuda_callable__
const RealType& getMaxTau() const;
__cuda_callable__
void setVerbose( IndexType v );
__cuda_callable__
void setTestingMode( bool testingMode );
......@@ -83,8 +136,6 @@ protected:
RealType maxTau = std::numeric_limits< RealType >::max();
IndexType verbosity = 0;
bool testingMode = false;
};
......
......@@ -97,14 +97,6 @@ setStopTime( const RealType& stopTime )
this->stopTime = stopTime;
}
template< typename Real, typename Index >
__cuda_callable__ void
StaticExplicitSolver< Real, Index >::
setVerbose( IndexType v )
{
this->verbosity = v;
};
template< typename Real, typename Index >
void
StaticExplicitSolver< Real, Index >::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment