Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Alina::DeflatedSolver< Precond, IterativeSolver > Class Template Reference

Iterative preconditioned solver with deflation. More...

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

Inheritance diagram for Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >:
Collaboration diagram for Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >:

Classes

struct  params
 Combined parameters of the bundled preconditioner and the iterative solver. More...

Public Types

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

Public Member Functions

template<class Matrix>
 DeflatedSolver (const Matrix &A, const params &prm=params(), const backend_params &bprm=backend_params())
 DeflatedSolver (std::shared_ptr< build_matrix > A, const params &prm=params(), const backend_params &bprm=backend_params())
template<class Matrix>
void init (const Matrix &A, const backend_params &bprm)
template<class Matrix, class Vec1, class Vec2>
SolverResult operator() (const Matrix &A, const Vec1 &rhs, Vec2 &&x) const
 Computes the solution for the given system matrix.
template<class Vec1, class Vec2>
SolverResult operator() (const Vec1 &rhs, Vec2 &&x) const
 Computes the solution for the given right-hand.
template<class Vec1, class Vec2>
void apply (const Vec1 &rhs, Vec2 &&x) const
template<class Vec1, class Vec2>
void project (const Vec1 &b, 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.
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

Public Attributes

params prm

Private Attributes

size_t n
Precond P
IterativeSolver S
std::shared_ptr< vector > r
std::vector< std::shared_ptr< vector > > Z
std::vector< scalar_type > E
std::vector< scalar_type > d

Friends

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

Additional Inherited Members

Protected Member Functions inherited from Arcane::Alina::detail::non_copyable
 non_copyable (non_copyable const &)=delete
void operator= (non_copyable const &x)=delete

Detailed Description

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

Iterative preconditioned solver with deflation.

Definition at line 42 of file DeflatedSolver.h.

Member Typedef Documentation

◆ backend_params

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

Definition at line 57 of file DeflatedSolver.h.

◆ backend_type

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

Definition at line 52 of file DeflatedSolver.h.

◆ build_matrix

template<class Precond, class IterativeSolver>
typedef BuiltinBackend<value_type>::matrix Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::build_matrix

Definition at line 58 of file DeflatedSolver.h.

◆ matrix

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

Definition at line 53 of file DeflatedSolver.h.

◆ scalar_type

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

Definition at line 60 of file DeflatedSolver.h.

◆ value_type

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

Definition at line 56 of file DeflatedSolver.h.

◆ vector

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

Definition at line 54 of file DeflatedSolver.h.

Constructor & Destructor Documentation

◆ DeflatedSolver() [1/2]

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

Sets up the preconditioner and creates the iterative solver.

Definition at line 96 of file DeflatedSolver.h.

References precond(), and solver().

Here is the call graph for this function:

◆ DeflatedSolver() [2/2]

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

Definition at line 113 of file DeflatedSolver.h.

Member Function Documentation

◆ apply()

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

Definition at line 200 of file DeflatedSolver.h.

◆ bytes()

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

Definition at line 261 of file DeflatedSolver.h.

◆ get_params()

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

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

Definition at line 250 of file DeflatedSolver.h.

◆ init()

template<class Precond, class IterativeSolver>
template<class Matrix>
void Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::init ( const Matrix & A,
const backend_params & bprm )
inline

Definition at line 129 of file DeflatedSolver.h.

◆ operator()() [1/2]

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

Computes the solution for the given system matrix.

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

Definition at line 178 of file DeflatedSolver.h.

◆ operator()() [2/2]

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

Computes the solution for the given right-hand.

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.

Definition at line 193 of file DeflatedSolver.h.

◆ precond() [1/2]

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

Returns reference to the constructed preconditioner.

Definition at line 227 of file DeflatedSolver.h.

◆ precond() [2/2]

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

Returns reference to the constructed preconditioner.

Definition at line 221 of file DeflatedSolver.h.

Referenced by DeflatedSolver().

Here is the caller graph for this function:

◆ project()

template<class Precond, class IterativeSolver>
template<class Vec1, class Vec2>
void Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::project ( const Vec1 & b,
Vec2 & x ) const
inline

Definition at line 207 of file DeflatedSolver.h.

◆ size()

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

Returns the size of the system matrix.

Definition at line 256 of file DeflatedSolver.h.

◆ solver()

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

Returns reference to the constructed iterative solver.

Definition at line 233 of file DeflatedSolver.h.

Referenced by DeflatedSolver().

Here is the caller graph for this function:

◆ system_matrix()

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

Definition at line 244 of file DeflatedSolver.h.

◆ system_matrix_ptr()

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

Returns the system matrix in the backend format.

Definition at line 239 of file DeflatedSolver.h.

◆ operator<<

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

Definition at line 266 of file DeflatedSolver.h.

Member Data Documentation

◆ d

template<class Precond, class IterativeSolver>
std::vector<scalar_type> Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::d
mutableprivate

Definition at line 286 of file DeflatedSolver.h.

◆ E

template<class Precond, class IterativeSolver>
std::vector<scalar_type> Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::E
private

Definition at line 285 of file DeflatedSolver.h.

◆ n

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

Definition at line 280 of file DeflatedSolver.h.

◆ P

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

Definition at line 281 of file DeflatedSolver.h.

◆ prm

template<class Precond, class IterativeSolver>
params Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::prm

Definition at line 276 of file DeflatedSolver.h.

◆ r

template<class Precond, class IterativeSolver>
std::shared_ptr<vector> Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::r
private

Definition at line 283 of file DeflatedSolver.h.

◆ S

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

Definition at line 282 of file DeflatedSolver.h.

◆ Z

template<class Precond, class IterativeSolver>
std::vector<std::shared_ptr<vector> > Arcane::Alina::DeflatedSolver< Precond, IterativeSolver >::Z
private

Definition at line 284 of file DeflatedSolver.h.


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