Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct > Class Template Reference

Flexible GMRES method. \rst Flexible version of the GMRES method [Saad03]_. \endrst. More...

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

Inheritance diagram for Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >:
Collaboration diagram for Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >:

Public Types

typedef Backend backend_type
typedef Backend::vector vector
typedef Backend::value_type value_type
typedef Backend::params backend_params
typedef math::scalar_of< value_type >::type scalar_type
typedef math::rhs_of< value_type >::type rhs_type
typedef math::inner_product_impl< rhs_type >::return_type coef_type
using params = FlexibleGMRESSolverParams

Public Member Functions

 FlexibleGMRESSolver (size_t n, const params &prm=params(), const backend_params &bprm=backend_params(), const InnerProduct &inner_product=InnerProduct())
 Preallocates necessary data structures for the system of size n.
template<class Matrix, class Precond, class Vec1, class Vec2>
SolverResult operator() (Matrix const &A, Precond const &P, Vec1 const &rhs, Vec2 &x) const
 Computes the solution for the given system matrix.
template<class Precond, class Vec1, class Vec2>
SolverResult operator() (Precond const &P, Vec1 const &rhs, Vec2 &x) const
 Computes the solution for the given right-hand side.
size_t bytes () const
 Memory used in bytes.

Public Attributes

params prm

Private Member Functions

template<class Vec>
scalar_type norm (const Vec &x) const

Private Attributes

size_t n
multi_array< coef_type, 2 > H
std::vector< coef_type > s
std::vector< coef_type > cs
std::vector< coef_type > sn
std::shared_ptr< vector > r
std::vector< std::shared_ptr< vector > > v
std::vector< std::shared_ptr< vector > > z
InnerProduct inner_product

Friends

std::ostream & operator<< (std::ostream &os, const FlexibleGMRESSolver &s)

Detailed Description

template<class Backend, class InnerProduct = detail::default_inner_product>
class Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >

Flexible GMRES method. \rst Flexible version of the GMRES method [Saad03]_. \endrst.

Definition at line 99 of file FlexibleGMRESSolver.h.

Member Typedef Documentation

◆ backend_params

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef Backend::params Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::backend_params

Definition at line 108 of file FlexibleGMRESSolver.h.

◆ backend_type

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef Backend Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::backend_type

Definition at line 104 of file FlexibleGMRESSolver.h.

◆ coef_type

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef math::inner_product_impl<rhs_type>::return_type Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::coef_type

Definition at line 112 of file FlexibleGMRESSolver.h.

◆ params

template<class Backend, class InnerProduct = detail::default_inner_product>
using Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::params = FlexibleGMRESSolverParams

Definition at line 114 of file FlexibleGMRESSolver.h.

◆ rhs_type

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef math::rhs_of<value_type>::type Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::rhs_type

Definition at line 111 of file FlexibleGMRESSolver.h.

◆ scalar_type

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef math::scalar_of<value_type>::type Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::scalar_type

Definition at line 110 of file FlexibleGMRESSolver.h.

◆ value_type

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef Backend::value_type Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::value_type

Definition at line 107 of file FlexibleGMRESSolver.h.

◆ vector

template<class Backend, class InnerProduct = detail::default_inner_product>
typedef Backend::vector Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::vector

Definition at line 106 of file FlexibleGMRESSolver.h.

Constructor & Destructor Documentation

◆ FlexibleGMRESSolver()

template<class Backend, class InnerProduct = detail::default_inner_product>
Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::FlexibleGMRESSolver ( size_t n,
const params & prm = params(),
const backend_params & bprm = backend_params(),
const InnerProduct & inner_product = InnerProduct() )
inline

Preallocates necessary data structures for the system of size n.

Definition at line 117 of file FlexibleGMRESSolver.h.

Member Function Documentation

◆ bytes()

template<class Backend, class InnerProduct = detail::default_inner_product>
size_t Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::bytes ( ) const
inlinevirtual

Memory used in bytes.

Implements Arcane::Alina::SolverBase.

Definition at line 255 of file FlexibleGMRESSolver.h.

◆ norm()

template<class Backend, class InnerProduct = detail::default_inner_product>
template<class Vec>
scalar_type Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::norm ( const Vec & x) const
inlineprivate

Definition at line 298 of file FlexibleGMRESSolver.h.

◆ operator()() [1/2]

template<class Backend, class InnerProduct = detail::default_inner_product>
template<class Matrix, class Precond, class Vec1, class Vec2>
SolverResult Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::operator() ( Matrix const & A,
Precond const & P,
Vec1 const & 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.

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]_.

Definition at line 155 of file FlexibleGMRESSolver.h.

◆ operator()() [2/2]

template<class Backend, class InnerProduct = detail::default_inner_product>
template<class Precond, class Vec1, class Vec2>
SolverResult Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::operator() ( Precond const & P,
Vec1 const & rhs,
Vec2 & x ) const
inline

Computes the solution for the given right-hand side.

Computes the solution for the given right-hand side rhs. The system matrix is the same that was used for the setup of the preconditioner P. 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 250 of file FlexibleGMRESSolver.h.

◆ operator<<

template<class Backend, class InnerProduct = detail::default_inner_product>
std::ostream & operator<< ( std::ostream & os,
const FlexibleGMRESSolver< Backend, InnerProduct > & s )
friend

Definition at line 273 of file FlexibleGMRESSolver.h.

Member Data Documentation

◆ cs

template<class Backend, class InnerProduct = detail::default_inner_product>
std::vector<coef_type> Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::cs
private

Definition at line 290 of file FlexibleGMRESSolver.h.

◆ H

template<class Backend, class InnerProduct = detail::default_inner_product>
multi_array<coef_type, 2> Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::H
mutableprivate

Definition at line 289 of file FlexibleGMRESSolver.h.

◆ inner_product

template<class Backend, class InnerProduct = detail::default_inner_product>
InnerProduct Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::inner_product
private

Definition at line 295 of file FlexibleGMRESSolver.h.

◆ n

template<class Backend, class InnerProduct = detail::default_inner_product>
size_t Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::n
private

Definition at line 287 of file FlexibleGMRESSolver.h.

◆ prm

template<class Backend, class InnerProduct = detail::default_inner_product>
params Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::prm

Definition at line 283 of file FlexibleGMRESSolver.h.

◆ r

template<class Backend, class InnerProduct = detail::default_inner_product>
std::shared_ptr<vector> Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::r
private

Definition at line 291 of file FlexibleGMRESSolver.h.

◆ s

template<class Backend, class InnerProduct = detail::default_inner_product>
std::vector<coef_type> Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::s
mutableprivate

Definition at line 290 of file FlexibleGMRESSolver.h.

◆ sn

template<class Backend, class InnerProduct = detail::default_inner_product>
std::vector<coef_type> Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::sn
private

Definition at line 290 of file FlexibleGMRESSolver.h.

◆ v

template<class Backend, class InnerProduct = detail::default_inner_product>
std::vector<std::shared_ptr<vector> > Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::v
private

Definition at line 292 of file FlexibleGMRESSolver.h.

◆ z

template<class Backend, class InnerProduct = detail::default_inner_product>
std::vector<std::shared_ptr<vector> > Arcane::Alina::FlexibleGMRESSolver< Backend, InnerProduct >::z
private

Definition at line 293 of file FlexibleGMRESSolver.h.


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