Template Numerical Library version\ main:a0a944a8c
Loading...
Searching...
No Matches
TNL::Solvers::DirectSolver< Real, Index, SolverMonitor > Class Template Reference

Base class for direct solvers. More...

#include <TNL/Solvers/DirectSolver.h>

Collaboration diagram for TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >:

Public Types

using IndexType = Index
 Indexing type.
using RealType = Real
 Floating point type used for computations.
using SolverMonitorType = SolverMonitor
 Type of an object used for monitoring of the convergence.

Public Member Functions

 DirectSolver ()=default
 Default constructor.
const RealgetResidue () const
 Gets the residue reached at the current iteration.
void setRefreshRate (const Index &refreshRate)
 Sets the refresh rate (in milliseconds) for the solver monitor.
void setResidue (const Real &residue)
 Sets the residue reached at the current iteration.
void setSolverMonitor (SolverMonitorType &solverMonitor)
 Sets the solver monitor object.
bool setup (const Config::ParameterContainer &parameters, const std::string &prefix="")
 Method for setup of the direct 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 constexpr bool isDirectSolver ()
 Returns true if the solver is a direct solver.
static constexpr bool isIterativeSolver ()
 Returns true if the solver is an iterative solver.

Protected Attributes

Real currentResidue = std::numeric_limits< RealType >::max()
Index refreshRate = 1
SolverMonitorsolverMonitor = nullptr

Detailed Description

template<typename Real, typename Index, typename SolverMonitor = IterativeSolverMonitor< double >>
class TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >

Base class for direct solvers.

Template Parameters
Realis a floating point type used for computations.
Indexis an indexing type.
IterativeSolverMonitor<Real > is type of an object used for monitoring of the convergence.

Member Function Documentation

◆ configSetup()

template<typename Real, typename Index, typename SolverMonitor>
void TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >::configSetup ( Config::ConfigDescription & config,
const std::string & prefix = "" )
static

This method defines configuration entries for setup of the iterative solver.

The following entries are defined:

refresh-rate - number of milliseconds between solver monitor refreshes.

Parameters
configcontains description of configuration parameters.
prefixis a prefix of particular configuration entries.

◆ getResidue()

template<typename Real, typename Index, typename SolverMonitor>
const Real & TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >::getResidue ( ) const

Gets the residue reached at the current iteration.

Returns
residue reached at the current iteration.

◆ setRefreshRate()

template<typename Real, typename Index, typename SolverMonitor>
void TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >::setRefreshRate ( const Index & refreshRate)

Sets the refresh rate (in milliseconds) for the solver monitor.

Parameters
refreshRateof the solver monitor in milliseconds.

◆ setResidue()

template<typename Real, typename Index, typename SolverMonitor>
void TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >::setResidue ( const Real & residue)

Sets the residue reached at the current iteration.

Parameters
residuereached at the current iteration.

◆ setSolverMonitor()

template<typename Real, typename Index, typename SolverMonitor>
void TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >::setSolverMonitor ( SolverMonitorType & solverMonitor)

Sets the solver monitor object.

The solver monitor is an object for monitoring the status of the iterative solver. Usually it prints the number of iterations, current residue or elapsed time.

Parameters
solverMonitoris an object for monitoring the iterative solver.

◆ setup()

template<typename Real, typename Index, typename SolverMonitor>
bool TNL::Solvers::DirectSolver< Real, Index, SolverMonitor >::setup ( const Config::ParameterContainer & parameters,
const std::string & prefix = "" )

Method for setup of the direct solver based on configuration parameters.

Parameters
parameterscontains values of the define configuration entries.
prefixis a prefix of particular configuration entries.

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