Arcane  v4.1.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
Référence du modèle de la classe Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >

Convenience class that bundles together a preconditioner and an iterative solver. Plus de détails...

#include </__w/arcaneframework.github.io/arcaneframework.github.io/framework/arccore/src/alina/arccore/alina/PreconditionedSolver.h>

+ Graphe d'héritage de Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >:
+ Graphe de collaboration de Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >:

Classes

struct  params
 Combined parameters of the bundled preconditioner and the iterative solver. Plus de détails...
 

Types publics

typedef IterativeSolver::backend_type backend_type
 
typedef backend_type::matrix matrix
 
typedef backend_type::value_type value_type
 
typedef backend_type::col_type col_type
 
typedef backend_type::ptr_type ptr_type
 
typedef backend_type::params backend_params
 
typedef BuiltinBackend< value_type, col_type, ptr_type >::matrix build_matrix
 
typedef math::scalar_of< value_type >::type scalar_type
 

Fonctions membres publiques

template<class Matrix>
 PreconditionedSolver (const Matrix &A, const params &prm=params(), const backend_params &bprm=backend_params())
 Sets up the preconditioner and creates the iterative solver.
 
 PreconditionedSolver (std::shared_ptr< build_matrix > A, const params &prm=params(), const backend_params &bprm=backend_params())
 
template<class Matrix, class Vec1, class Vec2>
SolverResult operator() (const Matrix &A, const Vec1 &rhs, Vec2 &&x) const
 
template<class Vec1, class Vec2>
SolverResult operator() (const Vec1 &rhs, Vec2 &&x) const
 
template<class Vec1, class Vec2>
void apply (const Vec1 &rhs, Vec2 &&x) const
 
const Precond & precond () const
 Returns reference to the constructed preconditioner.
 
Precond & precond ()
 Returns reference to the constructed preconditioner.
 
const IterativeSolver & solver () const
 Returns reference to the constructed iterative solver.
 
IterativeSolver & solver ()
 Returns reference to the constructed iterative solver.
 
std::shared_ptr< typename Precond::matrix > system_matrix_ptr () const
 Returns the system matrix in the backend format.
 
Precond::matrix const & system_matrix () const
 
void get_params (Alina::PropertyTree &p) const
 Stores the parameters used during construction into the property tree p.
 
size_t size () const
 Returns the size of the system matrix.
 
size_t bytes () const
 

Attributs publics

struct Arcane::Alina::PreconditionedSolver::params prm
 

Attributs privés

size_t n
 
Precond P
 
IterativeSolver S
 

Amis

std::ostream & operator<< (std::ostream &os, const PreconditionedSolver &p)
 

Membres hérités additionnels

- Fonctions membres protégées hérités de Arcane::Alina::detail::non_copyable
 non_copyable (non_copyable const &)=delete
 
void operator= (non_copyable const &x)=delete
 

Description détaillée

template<class Precond, class IterativeSolver>
class Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >

Convenience class that bundles together a preconditioner and an iterative solver.

Définition à la ligne 41 du fichier PreconditionedSolver.h.

Documentation des définitions de type membres

◆ backend_params

template<class Precond, class IterativeSolver>
typedef backend_type::params Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::backend_params

Définition à la ligne 57 du fichier PreconditionedSolver.h.

◆ backend_type

template<class Precond, class IterativeSolver>
typedef IterativeSolver::backend_type Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::backend_type

Définition à la ligne 51 du fichier PreconditionedSolver.h.

◆ build_matrix

template<class Precond, class IterativeSolver>
typedef BuiltinBackend<value_type,col_type,ptr_type>::matrix Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::build_matrix

Définition à la ligne 58 du fichier PreconditionedSolver.h.

◆ col_type

template<class Precond, class IterativeSolver>
typedef backend_type::col_type Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::col_type

Définition à la ligne 55 du fichier PreconditionedSolver.h.

◆ matrix

template<class Precond, class IterativeSolver>
typedef backend_type::matrix Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::matrix

Définition à la ligne 52 du fichier PreconditionedSolver.h.

◆ ptr_type

template<class Precond, class IterativeSolver>
typedef backend_type::ptr_type Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::ptr_type

Définition à la ligne 56 du fichier PreconditionedSolver.h.

◆ scalar_type

template<class Precond, class IterativeSolver>
typedef math::scalar_of<value_type>::type Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::scalar_type

Définition à la ligne 60 du fichier PreconditionedSolver.h.

◆ value_type

template<class Precond, class IterativeSolver>
typedef backend_type::value_type Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::value_type

Définition à la ligne 54 du fichier PreconditionedSolver.h.

Documentation des constructeurs et destructeur

◆ PreconditionedSolver() [1/2]

template<class Precond, class IterativeSolver>
template<class Matrix>
Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::PreconditionedSolver ( const Matrix & A,
const params & prm = params(),
const backend_params & bprm = backend_params() )
inline

Sets up the preconditioner and creates the iterative solver.

Définition à la ligne 90 du fichier PreconditionedSolver.h.

◆ PreconditionedSolver() [2/2]

template<class Precond, class IterativeSolver>
Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::PreconditionedSolver ( std::shared_ptr< build_matrix > A,
const params & prm = params(),
const backend_params & bprm = backend_params() )
inline

Définition à la ligne 101 du fichier PreconditionedSolver.h.

Documentation des fonctions membres

◆ apply()

template<class Precond, class IterativeSolver>
template<class Vec1, class Vec2>
void Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::apply ( const Vec1 & rhs,
Vec2 && x ) const
inline

Acts as a preconditioner. That is, applies the solver to the right-hand side rhs to get the solution x with zero initial approximation. Iterative methods usually use estimated residual for exit condition. For some problems the value of the estimated residual can get too far from the true residual due to round-off errors. Nesting iterative solvers in this way may allow to shave the last bits off the error. The method should not be used directly but rather allows nesting make_solver classes as in the following example:

\rst .. code-block:: cpp

typedef Arcane::Alina::PreconditionedSolver< Arcane::Alina::PreconditionedSolver< Arcane::Alina::AMG< Backend, ::Arcane::Alina::coarsening::smoothed_aggregation, ::Arcane::Alina::relaxation::spai0 >, ::Arcane::Alina::solver::cg<Backend> >, ::Arcane::Alina::solver::cg<Backend> > NestedSolver; \endrst

Définition à la ligne 167 du fichier PreconditionedSolver.h.

◆ bytes()

template<class Precond, class IterativeSolver>
size_t Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::bytes ( ) const
inline

Définition à la ligne 220 du fichier PreconditionedSolver.h.

◆ get_params()

template<class Precond, class IterativeSolver>
void Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::get_params ( Alina::PropertyTree & p) const
inline

Stores the parameters used during construction into the property tree p.

Définition à la ligne 209 du fichier PreconditionedSolver.h.

◆ operator()() [1/2]

template<class Precond, class IterativeSolver>
template<class Matrix, class Vec1, class Vec2>
SolverResult Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::operator() ( const Matrix & A,
const Vec1 & rhs,
Vec2 && x ) const
inline

Computes the solution for the given system matrix A and the right-hand side rhs. Returns the number of iterations made and the achieved residual as a std::tuple. The solution vector x provides initial approximation in input and holds the computed solution on output.

\rst The system matrix may differ from the matrix used during initialization. This may be used for the solution of non-stationary problems with slowly changing coefficients. There is a strong chance that a preconditioner built for a time step will act as a reasonably good preconditioner for several subsequent time steps [DeSh12]_. \endrst

Définition à la ligne 125 du fichier PreconditionedSolver.h.

◆ operator()() [2/2]

template<class Precond, class IterativeSolver>
template<class Vec1, class Vec2>
SolverResult Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::operator() ( const Vec1 & rhs,
Vec2 && x ) const
inline

Computes the solution for the given right-hand side rhs. Returns the number of iterations made and the achieved residual as a std::tuple. The solution vector x provides initial approximation in input and holds the computed solution on output.

Définition à la ligne 136 du fichier PreconditionedSolver.h.

◆ precond() [1/2]

template<class Precond, class IterativeSolver>
Precond & Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::precond ( )
inline

Returns reference to the constructed preconditioner.

Définition à la ligne 180 du fichier PreconditionedSolver.h.

◆ precond() [2/2]

template<class Precond, class IterativeSolver>
const Precond & Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::precond ( ) const
inline

Returns reference to the constructed preconditioner.

Définition à la ligne 174 du fichier PreconditionedSolver.h.

◆ size()

template<class Precond, class IterativeSolver>
size_t Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::size ( ) const
inline

Returns the size of the system matrix.

Définition à la ligne 215 du fichier PreconditionedSolver.h.

◆ solver() [1/2]

template<class Precond, class IterativeSolver>
IterativeSolver & Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::solver ( )
inline

Returns reference to the constructed iterative solver.

Définition à la ligne 192 du fichier PreconditionedSolver.h.

◆ solver() [2/2]

template<class Precond, class IterativeSolver>
const IterativeSolver & Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::solver ( ) const
inline

Returns reference to the constructed iterative solver.

Définition à la ligne 186 du fichier PreconditionedSolver.h.

◆ system_matrix()

template<class Precond, class IterativeSolver>
Precond::matrix const & Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::system_matrix ( ) const
inline

Définition à la ligne 203 du fichier PreconditionedSolver.h.

◆ system_matrix_ptr()

template<class Precond, class IterativeSolver>
std::shared_ptr< typename Precond::matrix > Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::system_matrix_ptr ( ) const
inline

Returns the system matrix in the backend format.

Définition à la ligne 198 du fichier PreconditionedSolver.h.

Documentation des fonctions amies et associées

◆ operator<<

template<class Precond, class IterativeSolver>
std::ostream & operator<< ( std::ostream & os,
const PreconditionedSolver< Precond, IterativeSolver > & p )
friend

Définition à la ligne 225 du fichier PreconditionedSolver.h.

Documentation des données membres

◆ n

template<class Precond, class IterativeSolver>
size_t Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::n
private

Définition à la ligne 235 du fichier PreconditionedSolver.h.

◆ P

template<class Precond, class IterativeSolver>
Precond Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::P
private

Définition à la ligne 236 du fichier PreconditionedSolver.h.

◆ S

template<class Precond, class IterativeSolver>
IterativeSolver Arcane::Alina::PreconditionedSolver< Precond, IterativeSolver >::S
private

Définition à la ligne 237 du fichier PreconditionedSolver.h.


La documentation de cette classe a été générée à partir du fichier suivant :