Loading...
Searching...
No Matches
preconditioners.hh
Go to the documentation of this file.
// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef DUNE_ISTL_PRECONDITIONERS_HH
#define DUNE_ISTL_PRECONDITIONERS_HH
#include <cmath>
#include <complex>
#include <iostream>
#include <iomanip>
#include <memory>
#include <string>
#include <dune/common/simd/simd.hh>
#include <dune/common/parametertree.hh>
#include <dune/istl/solverregistry.hh>
#include "preconditioner.hh"
#include "solver.hh"
#include "solvercategory.hh"
#include "istlexception.hh"
#include "matrixutils.hh"
#include "gsetc.hh"
#include "dilu.hh"
#include "ildl.hh"
#include "ilu.hh"
namespace Dune {
template<class O, int c = -1>
class InverseOperator2Preconditioner :
public Preconditioner<typename O::domain_type, typename O::range_type>
{
public:
typedef typename O::domain_type domain_type;
typedef typename O::range_type range_type;
typedef typename range_type::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
typedef O InverseOperator;
InverseOperator2Preconditioner(InverseOperator& inverse_operator)
: inverse_operator_(inverse_operator)
{
if(c != -1 && SolverCategory::category(inverse_operator_) != c)
DUNE_THROW(InvalidStateException, "User-supplied solver category does not match that of the given inverse operator");
}
void pre([[maybe_unused]] domain_type&,[[maybe_unused]] range_type&) override
{}
void apply(domain_type& v, const range_type& d) override
{
InverseOperatorResult res;
range_type copy(d);
inverse_operator_.apply(v, copy, res);
}
void post([[maybe_unused]] domain_type&) override
{}
SolverCategory::Category category() const override
{
return SolverCategory::category(inverse_operator_);
}
private:
InverseOperator& inverse_operator_;
};
//=====================================================================
// Implementation of this interface for sequential ISTL-preconditioners
//=====================================================================
template<class M, class X, class Y, int l=1>
class SeqSSOR : public Preconditioner<X,Y> {
public:
typedef M matrix_type;
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
SeqSSOR (const M& A, int n, real_field_type w)
: _A_(A), _n(n), _w(w)
{
CheckIfDiagonalPresent<M,l>::check(_A_);
}
SeqSSOR (const std::shared_ptr<const AssembledLinearOperator<M,X,Y>>& A, const ParameterTree& configuration)
: SeqSSOR(A->getmat(), configuration)
{}
SeqSSOR (const M& A, const ParameterTree& configuration)
: SeqSSOR(A, configuration.get<int>("iterations",1), configuration.get<real_field_type>("relaxation",1.0))
{}
void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b) override
{}
void apply (X& v, const Y& d) override
{
for (int i=0; i<_n; i++) {
bsorf(_A_,v,d,_w,BL<l>());
bsorb(_A_,v,d,_w,BL<l>());
}
}
void post ([[maybe_unused]] X& x) override
{}
SolverCategory::Category category() const override
{
return SolverCategory::sequential;
}
private:
const M& _A_;
int _n;
real_field_type _w;
};
DUNE_REGISTER_PRECONDITIONER("ssor", defaultPreconditionerBlockLevelCreator<Dune::SeqSSOR>());
template<class M, class X, class Y, int l=1>
class SeqSOR : public Preconditioner<X,Y> {
public:
typedef M matrix_type;
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
SeqSOR (const M& A, int n, real_field_type w)
: _A_(A), _n(n), _w(w)
{
CheckIfDiagonalPresent<M,l>::check(_A_);
}
SeqSOR (const std::shared_ptr<const AssembledLinearOperator<M,X,Y>>& A, const ParameterTree& configuration)
: SeqSOR(A->getmat(), configuration)
{}
SeqSOR (const M& A, const ParameterTree& configuration)
: SeqSOR(A, configuration.get<int>("iterations",1), configuration.get<real_field_type>("relaxation",1.0))
{}
void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b) override
{}
void apply (X& v, const Y& d) override
{
this->template apply<true>(v,d);
}
template<bool forward>
void apply(X& v, const Y& d)
{
if(forward)
for (int i=0; i<_n; i++) {
bsorf(_A_,v,d,_w,BL<l>());
}
else
for (int i=0; i<_n; i++) {
bsorb(_A_,v,d,_w,BL<l>());
}
}
void post ([[maybe_unused]] X& x) override
{}
SolverCategory::Category category() const override
{
return SolverCategory::sequential;
}
private:
const M& _A_;
int _n;
real_field_type _w;
};
DUNE_REGISTER_PRECONDITIONER("sor", defaultPreconditionerBlockLevelCreator<Dune::SeqSOR>());
template<class M, class X, class Y, int l=1>
using SeqGS = SeqSOR<M,X,Y,l>;
DUNE_REGISTER_PRECONDITIONER("gs", defaultPreconditionerBlockLevelCreator<Dune::SeqGS>());
template<class M, class X, class Y, int l=1>
class SeqJac : public Preconditioner<X,Y> {
public:
typedef M matrix_type;
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
SeqJac (const M& A, int n, real_field_type w)
: _A_(A), _n(n), _w(w)
{
CheckIfDiagonalPresent<M,l>::check(_A_);
}
SeqJac (const std::shared_ptr<const AssembledLinearOperator<M,X,Y>>& A, const ParameterTree& configuration)
: SeqJac(A->getmat(), configuration)
{}
SeqJac (const M& A, const ParameterTree& configuration)
: SeqJac(A, configuration.get<int>("iterations",1), configuration.get<real_field_type>("relaxation",1.0))
{}
void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b) override
{}
void apply (X& v, const Y& d) override
{
for (int i=0; i<_n; i++) {
dbjac(_A_,v,d,_w,BL<l>());
}
}
void post ([[maybe_unused]] X& x) override
{}
SolverCategory::Category category() const override
{
return SolverCategory::sequential;
}
private:
const M& _A_;
int _n;
real_field_type _w;
};
DUNE_REGISTER_PRECONDITIONER("jac", defaultPreconditionerBlockLevelCreator<Dune::SeqJac>());
template <class M, class X, class Y, int l = 1>
class SeqDILU : public Preconditioner<X, Y>
{
public:
using matrix_type = M;
using block_type = typename matrix_type::block_type;
using domain_type = X;
using range_type = Y;
using field_type = typename X::field_type;
using scalar_field_type = Simd::Scalar<field_type>;
using real_field_type = typename FieldTraits<scalar_field_type>::real_type;
SeqDILU(const M &A, real_field_type w)
: _A_(A),
_w(w),
wNotIdentity_([w]
{using std::abs; return abs(w - real_field_type(1)) > 1e-15; }())
{
Dinv_.resize(_A_.N());
CheckIfDiagonalPresent<M, l>::check(_A_);
DILU::blockDILUDecomposition(_A_, Dinv_);
}
SeqDILU(const std::shared_ptr<const AssembledLinearOperator<M, X, Y>> &A, const ParameterTree &configuration)
: SeqDILU(A->getmat(), configuration)
{
}
SeqDILU(const M &A, const ParameterTree &config)
: SeqDILU(A, config.get<real_field_type>("relaxation", 1.0))
{
}
void pre([[maybe_unused]] X &x, [[maybe_unused]] Y &b) override
{
}
void apply(X &v, const Y &d) override
{
DILU::blockDILUBacksolve(_A_, Dinv_, v, d);
if (wNotIdentity_)
{
v *= _w;
}
}
void post([[maybe_unused]] X &x) override
{
}
SolverCategory::Category category() const override
{
return SolverCategory::sequential;
}
protected:
std::vector<block_type> Dinv_;
const M &_A_;
const real_field_type _w;
const bool wNotIdentity_;
};
DUNE_REGISTER_PRECONDITIONER("dilu", defaultPreconditionerBlockLevelCreator<Dune::SeqDILU>());
template<class M, class X, class Y, int l=1>
class SeqILU : public Preconditioner<X,Y> {
public:
typedef typename std::remove_const<M>::type matrix_type;
typedef typename matrix_type :: block_type block_type;
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
typedef typename ILU::CRS< block_type , typename M::allocator_type> CRS;
SeqILU (const M& A, real_field_type w, const bool resort = false )
: SeqILU( A, 0, w, resort ) // construct ILU(0)
{
}
SeqILU (const std::shared_ptr<const AssembledLinearOperator<M,X,Y>>& A, const ParameterTree& configuration)
: SeqILU(A->getmat(), configuration)
{}
SeqILU(const M& A, const ParameterTree& config)
: SeqILU(A, config.get("n", 0),
config.get<real_field_type>("relaxation", 1.0),
config.get("resort", false))
{}
SeqILU (const M& A, int n, real_field_type w, const bool resort = false )
: ILU_(),
lower_(),
upper_(),
inv_(),
w_(w),
wNotIdentity_([w]{using std::abs; return abs(w - real_field_type(1)) > 1e-15;}() )
{
if( n == 0 )
{
// copy A
ILU_.reset( new matrix_type( A ) );
// create ILU(0) decomposition
ILU::blockILU0Decomposition( *ILU_ );
}
else
{
// create matrix in build mode
ILU_.reset( new matrix_type( A.N(), A.M(), matrix_type::row_wise) );
// create ILU(n) decomposition
ILU::blockILUDecomposition( A, n, *ILU_ );
}
if( resort )
{
// store ILU in simple CRS format
ILU::convertToCRS( *ILU_, lower_, upper_, inv_ );
ILU_.reset();
}
}
void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b) override
{}
void apply (X& v, const Y& d) override
{
if( ILU_ )
{
ILU::blockILUBacksolve( *ILU_, v, d);
}
else
{
ILU::blockILUBacksolve(lower_, upper_, inv_, v, d);
}
if( wNotIdentity_ )
{
v *= w_;
}
}
void post ([[maybe_unused]] X& x) override
{}
SolverCategory::Category category() const override
{
return SolverCategory::sequential;
}
protected:
std::unique_ptr< matrix_type > ILU_;
CRS lower_;
CRS upper_;
std::vector< block_type, typename matrix_type::allocator_type > inv_;
const real_field_type w_;
const bool wNotIdentity_;
};
DUNE_REGISTER_PRECONDITIONER("ilu", defaultPreconditionerBlockLevelCreator<Dune::SeqILU>());
template<class X, class Y>
class Richardson : public Preconditioner<X,Y> {
public:
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
Richardson (real_field_type w=1.0) :
_w(w)
{}
Richardson (const ParameterTree& configuration)
: Richardson(configuration.get<real_field_type>("relaxation", 1.0))
{}
void pre ([[maybe_unused]] X& x, [[maybe_unused]] Y& b) override
{}
void apply (X& v, const Y& d) override
{
v = d;
v *= _w;
}
void post ([[maybe_unused]] X& x) override
{}
SolverCategory::Category category() const override
{
return SolverCategory::sequential;
}
private:
real_field_type _w;
};
DUNE_REGISTER_PRECONDITIONER("richardson", [](auto opTraits, const auto& /*op*/, const ParameterTree& config){
using OpTraits = std::decay_t<decltype(opTraits)>;
using D = typename OpTraits::domain_type;
using R = typename OpTraits::range_type;
return std::make_shared<Richardson<D,R>>(config);
});
template< class M, class X, class Y >
class SeqILDL
: public Preconditioner< X, Y >
{
typedef SeqILDL< M, X, Y > This;
typedef Preconditioner< X, Y > Base;
public:
typedef std::remove_const_t< M > matrix_type;
typedef X domain_type;
typedef Y range_type;
typedef typename X::field_type field_type;
typedef Simd::Scalar<field_type> scalar_field_type;
typedef typename FieldTraits<scalar_field_type>::real_type real_field_type;
SeqILDL (const std::shared_ptr<const AssembledLinearOperator<M,X,Y>>& A, const ParameterTree& configuration)
: SeqILDL(A->getmat(), configuration)
{}
SeqILDL(const matrix_type& A, const ParameterTree& config)
: SeqILDL(A, config.get<real_field_type>("relaxation", 1.0))
{}
explicit SeqILDL ( const matrix_type &A, real_field_type relax = real_field_type( 1 ) )
: decomposition_( A.N(), A.M(), matrix_type::random ),
relax_( relax )
{
// setup row sizes for lower triangular matrix
for( auto i = A.begin(), iend = A.end(); i != iend; ++i )
{
const auto &A_i = *i;
const auto ij = A_i.find( i.index() );
if( ij != A_i.end() )
decomposition_.setrowsize( i.index(), ij.offset()+1 );
else
DUNE_THROW( ISTLError, "diagonal entry missing" );
}
decomposition_.endrowsizes();
// setup row indices for lower triangular matrix
for( auto i = A.begin(), iend = A.end(); i != iend; ++i )
{
const auto &A_i = *i;
for( auto ij = A_i.begin(); ij.index() < i.index() ; ++ij )
decomposition_.addindex( i.index(), ij.index() );
decomposition_.addindex( i.index(), i.index() );
}
decomposition_.endindices();
// copy values of lower triangular matrix
auto i = A.begin();
for( auto row = decomposition_.begin(), rowend = decomposition_.end(); row != rowend; ++row, ++i )
{
auto ij = i->begin();
for( auto col = row->begin(), colend = row->end(); col != colend; ++col, ++ij )
*col = *ij;
}
// perform ILDL decomposition
bildl_decompose( decomposition_ );
}
void pre ([[maybe_unused]] X &x, [[maybe_unused]] Y &b) override
{}
void apply ( X &v, const Y &d ) override
{
bildl_backsolve( decomposition_, v, d, true );
v *= relax_;
}
void post ([[maybe_unused]] X &x) override
{}
SolverCategory::Category category () const override { return SolverCategory::sequential; }
private:
matrix_type decomposition_;
real_field_type relax_;
};
DUNE_REGISTER_PRECONDITIONER("ildl", defaultPreconditionerCreator<Dune::SeqILDL>());
} // end namespace
#endif
gsetc.hh
Simple iterative methods like Jacobi, Gauss-Seidel, SOR, SSOR, etc. in a generic way.
matrixutils.hh
Some handy generic functions for ISTL matrices.
istlexception.hh
solvercategory.hh
preconditioner.hh
dilu.hh
The diagonal incomplete LU factorization kernels.
ilu.hh
The incomplete LU factorization kernels.
solverregistry.hh
DUNE_REGISTER_PRECONDITIONER
#define DUNE_REGISTER_PRECONDITIONER(name,...)
Definition solverregistry.hh:13
ildl.hh
Incomplete LDL decomposition.
solver.hh
Define general, extensible interface for inverse operators.
Dune::SeqGS
SeqSOR< M, X, Y, l > SeqGS
Sequential Gauss Seidel preconditioner.
Definition preconditioners.hh:399
Dune::bsorb
void bsorb(const M &A, X &x, const Y &b, const K &w)
SSOR step.
Definition gsetc.hh:646
Dune::dbjac
void dbjac(const M &A, X &x, const Y &b, const K &w)
Jacobi step.
Definition gsetc.hh:658
Dune::bsorf
void bsorf(const M &A, X &x, const Y &b, const K &w)
SOR step.
Definition gsetc.hh:634
Dune::defaultPreconditionerBlockLevelCreator
auto defaultPreconditionerBlockLevelCreator()
Definition solverregistry.hh:34
Dune::defaultPreconditionerCreator
auto defaultPreconditionerCreator()
Definition solverregistry.hh:55
Dune
Definition allocator.hh:11
Dune::bildl_decompose
void bildl_decompose(Matrix &A)
compute ILDL decomposition of a symmetric matrix A
Definition ildl.hh:90
Dune::get
PropertyMapTypeSelector< Amg::VertexVisitedTag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > >::Type get(const Amg::VertexVisitedTag &tag, Amg::PropertiesGraph< G, Amg::VertexProperties, EP, VM, EM > &graph)
Definition dependency.hh:293
Dune::bildl_backsolve
void bildl_backsolve(const Matrix &A, X &v, const Y &d, bool isLowerTriangular=false)
Definition ildl.hh:158
Dune::DILU::blockDILUDecomposition
void blockDILUDecomposition(M &A, std::vector< typename M::block_type > &Dinv_)
Definition dilu.hh:52
Dune::DILU::blockDILUBacksolve
void blockDILUBacksolve(const M &A, const std::vector< typename M::block_type > Dinv_, X &v, const Y &d)
Definition dilu.hh:112
Dune::ILU::convertToCRS
void convertToCRS(const M &A, CRS &lower, CRS &upper, InvVector &inv)
convert ILU decomposition into CRS format for lower and upper triangular and inverse.
Definition ilu.hh:316
Dune::ILU::blockILUBacksolve
void blockILUBacksolve(const M &A, X &v, const Y &d)
LU backsolve with stored inverse.
Definition ilu.hh:103
Dune::ILU::blockILU0Decomposition
void blockILU0Decomposition(M &A)
compute ILU decomposition of A. A is overwritten by its decomposition
Definition ilu.hh:35
Dune::ILU::blockILUDecomposition
void blockILUDecomposition(const M &A, int n, M &ILU)
Definition ilu.hh:176
Dune::BL
compile-time parameter for block recursion depth
Definition gsetc.hh:45
Dune::ILU::CRS
a simple compressed row storage matrix class
Definition ilu.hh:268
Dune::CheckIfDiagonalPresent::check
static void check(const Matrix &mat)
Check whether the a matrix has diagonal values on blocklevel recursion levels.
Definition matrixutils.hh:53
Dune::AssembledLinearOperator
A linear operator exporting itself in matrix form.
Definition operators.hh:110
Dune::Preconditioner
Base class for matrix free definition of preconditioners.
Definition preconditioner.hh:33
Dune::InverseOperator2Preconditioner::range_type
O::range_type range_type
The range type of the preconditioner.
Definition preconditioners.hh:81
Dune::InverseOperator2Preconditioner::domain_type
O::domain_type domain_type
The domain type of the preconditioner.
Definition preconditioners.hh:79
Dune::InverseOperator2Preconditioner::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:116
Dune::InverseOperator2Preconditioner::field_type
range_type::field_type field_type
The field type of the preconditioner.
Definition preconditioners.hh:83
Dune::InverseOperator2Preconditioner::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
real scalar type underlying the field_type
Definition preconditioners.hh:87
Dune::InverseOperator2Preconditioner::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
scalar type underlying the field_type
Definition preconditioners.hh:85
Dune::InverseOperator2Preconditioner::post
void post(domain_type &) override
Clean up.
Definition preconditioners.hh:112
Dune::InverseOperator2Preconditioner::InverseOperator2Preconditioner
InverseOperator2Preconditioner(InverseOperator &inverse_operator)
Construct the preconditioner from the solver.
Definition preconditioners.hh:95
Dune::InverseOperator2Preconditioner::InverseOperator
O InverseOperator
type of the wrapped inverse operator
Definition preconditioners.hh:89
Dune::InverseOperator2Preconditioner::pre
void pre(domain_type &, range_type &) override
Prepare the preconditioner.
Definition preconditioners.hh:102
Dune::InverseOperator2Preconditioner::apply
void apply(domain_type &v, const range_type &d) override
Apply one step of the preconditioner to the system A(v)=d.
Definition preconditioners.hh:105
Dune::SeqSSOR::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:209
Dune::SeqSSOR::SeqSSOR
SeqSSOR(const std::shared_ptr< const AssembledLinearOperator< M, X, Y > > &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:183
Dune::SeqSSOR::SeqSSOR
SeqSSOR(const M &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:200
Dune::SeqSSOR::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:234
Dune::SeqSSOR::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:230
Dune::SeqSSOR< typename M::matrix_type, X, X >::field_type
X::field_type field_type
Definition preconditioners.hh:151
Dune::SeqSSOR< typename M::matrix_type, X, X >::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
Definition preconditioners.hh:153
Dune::SeqSSOR< typename M::matrix_type, X, X >::domain_type
X domain_type
Definition preconditioners.hh:147
Dune::SeqSSOR< typename M::matrix_type, X, X >::matrix_type
M matrix_type
Definition preconditioners.hh:145
Dune::SeqSSOR::apply
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition preconditioners.hh:217
Dune::SeqSSOR< typename M::matrix_type, X, X >::range_type
X range_type
Definition preconditioners.hh:149
Dune::SeqSSOR< typename M::matrix_type, X, X >::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
Definition preconditioners.hh:155
Dune::SeqSSOR::SeqSSOR
SeqSSOR(const M &A, int n, real_field_type w)
Constructor.
Definition preconditioners.hh:164
Dune::SeqSOR
Sequential SOR preconditioner.
Definition preconditioners.hh:262
Dune::SeqSOR::SeqSOR
SeqSOR(const std::shared_ptr< const AssembledLinearOperator< M, X, Y > > &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:303
Dune::SeqSOR::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:368
Dune::SeqSOR< M, X, Y, l >::matrix_type
M matrix_type
Definition preconditioners.hh:265
Dune::SeqSOR< M, X, Y, l >::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
Definition preconditioners.hh:275
Dune::SeqSOR::apply
void apply(X &v, const Y &d)
Apply the preconditioner in a special direction.
Definition preconditioners.hh:351
Dune::SeqSOR< M, X, Y, l >::domain_type
X domain_type
Definition preconditioners.hh:267
Dune::SeqSOR< M, X, Y, l >::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
Definition preconditioners.hh:273
Dune::SeqSOR::apply
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition preconditioners.hh:337
Dune::SeqSOR::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:329
Dune::SeqSOR< M, X, Y, l >::range_type
Y range_type
Definition preconditioners.hh:269
Dune::SeqSOR::SeqSOR
SeqSOR(const M &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:320
Dune::SeqSOR::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:372
Dune::SeqSOR< M, X, Y, l >::field_type
X::field_type field_type
Definition preconditioners.hh:271
Dune::SeqSOR::SeqSOR
SeqSOR(const M &A, int n, real_field_type w)
Constructor.
Definition preconditioners.hh:284
Dune::SeqJac::SeqJac
SeqJac(const M &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:471
Dune::SeqJac::matrix_type
M matrix_type
The matrix type the preconditioner is for.
Definition preconditioners.hh:416
Dune::SeqJac::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
scalar type underlying the field_type
Definition preconditioners.hh:424
Dune::SeqJac::SeqJac
SeqJac(const std::shared_ptr< const AssembledLinearOperator< M, X, Y > > &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:454
Dune::SeqJac::apply
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition preconditioners.hh:488
Dune::SeqJac::field_type
X::field_type field_type
The field type of the preconditioner.
Definition preconditioners.hh:422
Dune::SeqJac::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:480
Dune::SeqJac::domain_type
X domain_type
The domain type of the preconditioner.
Definition preconditioners.hh:418
Dune::SeqJac::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:504
Dune::SeqJac::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:500
Dune::SeqJac::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
real scalar type underlying the field_type
Definition preconditioners.hh:426
Dune::SeqJac::SeqJac
SeqJac(const M &A, int n, real_field_type w)
Constructor.
Definition preconditioners.hh:435
Dune::SeqJac::range_type
Y range_type
The range type of the preconditioner.
Definition preconditioners.hh:420
Dune::SeqDILU::wNotIdentity_
const bool wNotIdentity_
true if w != 1.0
Definition preconditioners.hh:681
Dune::SeqDILU::field_type
typename X::field_type field_type
The field type of the preconditioner.
Definition preconditioners.hh:576
Dune::SeqDILU::_w
const real_field_type _w
The relaxation factor to use.
Definition preconditioners.hh:679
Dune::SeqDILU::_A_
const M & _A_
The matrix we operate on.
Definition preconditioners.hh:677
Dune::SeqDILU::SeqDILU
SeqDILU(const std::shared_ptr< const AssembledLinearOperator< M, X, Y > > &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:612
Dune::SeqDILU::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
scalar type underlying the field_type
Definition preconditioners.hh:579
Dune::SeqDILU::real_field_type
typename FieldTraits< scalar_field_type >::real_type real_field_type
real scalar type underlying the field_type
Definition preconditioners.hh:581
Dune::SeqDILU::apply
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition preconditioners.hh:648
Dune::SeqDILU::matrix_type
M matrix_type
The matrix type the preconditioner is for.
Definition preconditioners.hh:567
Dune::SeqDILU::domain_type
X domain_type
The domain type of the preconditioner.
Definition preconditioners.hh:571
Dune::SeqDILU::block_type
typename matrix_type::block_type block_type
block type of matrix
Definition preconditioners.hh:569
Dune::SeqDILU::SeqDILU
SeqDILU(const M &A, real_field_type w)
Constructor.
Definition preconditioners.hh:589
Dune::SeqDILU::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:639
Dune::SeqDILU::range_type
Y range_type
The range type of the preconditioner.
Definition preconditioners.hh:573
Dune::SeqDILU::SeqDILU
SeqDILU(const M &A, const ParameterTree &config)
Constructor.
Definition preconditioners.hh:629
Dune::SeqDILU::Dinv_
std::vector< block_type > Dinv_
Definition preconditioners.hh:675
Dune::SeqDILU::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:669
Dune::SeqDILU::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:664
Dune::SeqILU::SeqILU
SeqILU(const M &A, int n, real_field_type w, const bool resort=false)
Constructor.
Definition preconditioners.hh:777
Dune::SeqILU::CRS
ILU::CRS< block_type, typename M::allocator_type > CRS
type of ILU storage
Definition preconditioners.hh:717
Dune::SeqILU::range_type
Y range_type
The range type of the preconditioner.
Definition preconditioners.hh:706
Dune::SeqILU::lower_
CRS lower_
The ILU(n) decomposition of the matrix. As storage a CRS structure is used.
Definition preconditioners.hh:857
Dune::SeqILU::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:843
Dune::SeqILU::wNotIdentity_
const bool wNotIdentity_
true if w != 1.0
Definition preconditioners.hh:864
Dune::SeqILU::SeqILU
SeqILU(const M &A, const ParameterTree &config)
Constructor.
Definition preconditioners.hh:763
Dune::SeqILU::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:813
Dune::SeqILU::matrix_type
std::remove_const< M >::type matrix_type
The matrix type the preconditioner is for.
Definition preconditioners.hh:700
Dune::SeqILU::block_type
matrix_type::block_type block_type
block type of matrix
Definition preconditioners.hh:702
Dune::SeqILU::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
real scalar type underlying the field_type
Definition preconditioners.hh:714
Dune::SeqILU::field_type
X::field_type field_type
The field type of the preconditioner.
Definition preconditioners.hh:709
Dune::SeqILU::SeqILU
SeqILU(const M &A, real_field_type w, const bool resort=false)
Constructor.
Definition preconditioners.hh:726
Dune::SeqILU::apply
void apply(X &v, const Y &d) override
Apply the preconditioner.
Definition preconditioners.hh:821
Dune::SeqILU::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:847
Dune::SeqILU::w_
const real_field_type w_
The relaxation factor to use.
Definition preconditioners.hh:862
Dune::SeqILU::SeqILU
SeqILU(const std::shared_ptr< const AssembledLinearOperator< M, X, Y > > &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:745
Dune::SeqILU::domain_type
X domain_type
The domain type of the preconditioner.
Definition preconditioners.hh:704
Dune::SeqILU::inv_
std::vector< block_type, typename matrix_type::allocator_type > inv_
Definition preconditioners.hh:859
Dune::SeqILU::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
scalar type underlying the field_type
Definition preconditioners.hh:712
Dune::SeqILU::ILU_
std::unique_ptr< matrix_type > ILU_
The ILU(n) decomposition of the matrix. As storage a BCRSMatrix is used.
Definition preconditioners.hh:854
Dune::SeqILU::upper_
CRS upper_
Definition preconditioners.hh:858
Dune::Richardson::field_type
X::field_type field_type
The field type of the preconditioner.
Definition preconditioners.hh:885
Dune::Richardson::range_type
Y range_type
The range type of the preconditioner.
Definition preconditioners.hh:883
Dune::Richardson::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:920
Dune::Richardson::Richardson
Richardson(real_field_type w=1.0)
Constructor.
Definition preconditioners.hh:896
Dune::Richardson::apply
void apply(X &v, const Y &d) override
Apply the precondioner.
Definition preconditioners.hh:928
Dune::Richardson::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:939
Dune::Richardson::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
real scalar type underlying the field_type
Definition preconditioners.hh:889
Dune::Richardson::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
scalar type underlying the field_type
Definition preconditioners.hh:887
Dune::Richardson::Richardson
Richardson(const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:911
Dune::Richardson::domain_type
X domain_type
The domain type of the preconditioner.
Definition preconditioners.hh:881
Dune::Richardson::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:943
Dune::SeqILDL::SeqILDL
SeqILDL(const matrix_type &A, const ParameterTree &config)
Constructor.
Definition preconditioners.hh:1019
Dune::SeqILDL::SeqILDL
SeqILDL(const matrix_type &A, real_field_type relax=real_field_type(1))
constructor
Definition preconditioners.hh:1031
Dune::SeqILDL::domain_type
X domain_type
domain type of the preconditioner
Definition preconditioners.hh:981
Dune::SeqILDL::post
void post(X &x) override
Clean up.
Definition preconditioners.hh:1082
Dune::SeqILDL::range_type
Y range_type
range type of the preconditioner
Definition preconditioners.hh:983
Dune::SeqILDL::matrix_type
std::remove_const_t< M > matrix_type
type of matrix the preconditioner is for
Definition preconditioners.hh:979
Dune::SeqILDL::apply
void apply(X &v, const Y &d) override
Apply one step of the preconditioner to the system A(v)=d.
Definition preconditioners.hh:1075
Dune::SeqILDL::real_field_type
FieldTraits< scalar_field_type >::real_type real_field_type
real scalar type underlying the field_type
Definition preconditioners.hh:989
Dune::SeqILDL::SeqILDL
SeqILDL(const std::shared_ptr< const AssembledLinearOperator< M, X, Y > > &A, const ParameterTree &configuration)
Constructor.
Definition preconditioners.hh:1003
Dune::SeqILDL::pre
void pre(X &x, Y &b) override
Prepare the preconditioner.
Definition preconditioners.hh:1071
Dune::SeqILDL::scalar_field_type
Simd::Scalar< field_type > scalar_field_type
scalar type underlying the field_type
Definition preconditioners.hh:987
Dune::SeqILDL::field_type
X::field_type field_type
field type of the preconditioner
Definition preconditioners.hh:985
Dune::SeqILDL::category
SolverCategory::Category category() const override
Category of the preconditioner (see SolverCategory::Category).
Definition preconditioners.hh:1086
Dune::InverseOperatorResult
Statistics about the application of an inverse operator.
Definition solver.hh:50
Dune::InverseOperator
Abstract base class for all solvers.
Definition solver.hh:101
Dune::SolverCategory::Category
Category
Definition solvercategory.hh:23
Dune::SolverCategory::sequential
@ sequential
Category for sequential solvers.
Definition solvercategory.hh:25
Dune::SolverCategory::category
static Category category(const OP &op, decltype(op.category()) *=nullptr)
Helperfunction to extract the solver category either from an enum, or from the newly introduced virtu...
Definition solvercategory.hh:34