Opm::CPRPreconditioner< M, X, Y, P > Class Template Reference

CPR preconditioner. More...

#include <CPRPreconditioner.hpp>

Inheritance diagram for Opm::CPRPreconditioner< M, X, Y, P >:
Inheritance graph

Public Types

enum  { category }
 
typedef P ParallelInformation
 The type describing the parallel information. More...
 
typedef Dune::remove_const< M >
::type 
matrix_type
 The matrix type the preconditioner is for. More...
 
typedef X domain_type
 The domain type of the preconditioner. More...
 
typedef Y range_type
 The range type of the preconditioner. More...
 
typedef X::field_type field_type
 The field type of the preconditioner. More...
 
typedef CPRSelector< M, X, X,
P >::Operator 
Operator
 Elliptic Operator. More...
 
typedef Dune::Preconditioner
< X, X > 
WholeSystemPreconditioner
 preconditioner for the whole system (here either ILU(0) or ILU(n) More...
 
typedef CPRSelector< M, X, X,
P >
::EllipticPreconditionerPointer 
EllipticPreconditionerPointer
 type of the unique pointer to the ilu-0 preconditioner used the for the elliptic system More...
 
typedef CPRSelector< M, X, X,
P >::AMG 
AMG
 amg preconditioner for the elliptic system More...
 

Public Member Functions

 CPRPreconditioner (const CPRParameter &param, const M &A, const M &Ae, const ParallelInformation &comm=ParallelInformation(), const ParallelInformation &commAe=ParallelInformation())
 Constructor. More...
 
virtual void pre (X &, Y &)
 Prepare the preconditioner. More...
 
virtual void apply (X &v, const Y &d)
 Apply the preconditoner. More...
 
virtual void post (X &)
 Clean up. More...
 

Protected Member Functions

void solveElliptic (Y &x, Y &de)
 
void createEllipticPreconditioner (const bool amg, const P &comm)
 

Protected Attributes

const CPRParameterparam_
 Parameter collection for CPR. More...
 
const matrix_typeA_
 The matrix for the full linear problem. More...
 
const matrix_typeAe_
 The elliptic part of the matrix. More...
 
de_
 temporary variables for elliptic solve More...
 
ve_
 
dmodified_
 
std::unique_ptr< OperatoropAe_
 elliptic operator More...
 
EllipticPreconditionerPointer precond_
 ILU0 preconditioner for the elliptic system. More...
 
std::unique_ptr< AMGamg_
 AMG preconditioner with ILU0 smoother. More...
 
std::shared_ptr
< WholeSystemPreconditioner
pre_
 The preconditioner for the whole system. More...
 
vilu_
 temporary variables for ILU solve More...
 
const P & comm_
 The information about the parallelization of the whole system. More...
 
const P & commAe_
 The information about the parallelization of the elliptic part of the system. More...
 

Detailed Description

template<class M, class X, class Y, class P = Dune::Amg::SequentialInformation>
class Opm::CPRPreconditioner< M, X, Y, P >

CPR preconditioner.

This is a two-stage preconditioner, combining an elliptic-type partial solution with ILU0 for the whole system.

Template Parameters
MThe matrix type to operate on
XType of the update
YType of the defect
PType of the parallel information. If not provided this will be Dune::Amg::SequentialInformation. The preconditioner is parallel if this is Dune::OwnerOverlapCopyCommunication<int,int>

Member Typedef Documentation

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef CPRSelector<M,X,X,P>::AMG Opm::CPRPreconditioner< M, X, Y, P >::AMG

amg preconditioner for the elliptic system

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef X Opm::CPRPreconditioner< M, X, Y, P >::domain_type

The domain type of the preconditioner.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef CPRSelector<M,X,X,P>::EllipticPreconditionerPointer Opm::CPRPreconditioner< M, X, Y, P >::EllipticPreconditionerPointer

type of the unique pointer to the ilu-0 preconditioner used the for the elliptic system

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef X::field_type Opm::CPRPreconditioner< M, X, Y, P >::field_type

The field type of the preconditioner.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef Dune::remove_const<M>::type Opm::CPRPreconditioner< M, X, Y, P >::matrix_type

The matrix type the preconditioner is for.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef CPRSelector<M,X,X,P>::Operator Opm::CPRPreconditioner< M, X, Y, P >::Operator

Elliptic Operator.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef P Opm::CPRPreconditioner< M, X, Y, P >::ParallelInformation

The type describing the parallel information.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef Y Opm::CPRPreconditioner< M, X, Y, P >::range_type

The range type of the preconditioner.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
typedef Dune::Preconditioner<X,X> Opm::CPRPreconditioner< M, X, Y, P >::WholeSystemPreconditioner

preconditioner for the whole system (here either ILU(0) or ILU(n)

Member Enumeration Documentation

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
anonymous enum
Enumerator
category 

The category the preconditioner is part of.

Constructor & Destructor Documentation

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
Opm::CPRPreconditioner< M, X, Y, P >::CPRPreconditioner ( const CPRParameter param,
const M A,
const M Ae,
const ParallelInformation comm = ParallelInformation(),
const ParallelInformation commAe = ParallelInformation() 
)
inline

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
AeThe top-left elliptic part of A.
relaxThe ILU0 relaxation factor.
useAMGif true, AMG is used as a preconditioner for the elliptic sub-system, otherwise ilu-0 (default)
useBiCGif true, BiCG solver is used (default), otherwise CG solver
paralleInformationThe information about the parallelization, if this is a parallel run

References Opm::CPRPreconditioner< M, X, Y, P >::A_, Opm::CPRPreconditioner< M, X, Y, P >::comm_, Opm::CPRPreconditioner< M, X, Y, P >::commAe_, Opm::CPRParameter::cpr_ilu_n_, Opm::CPRParameter::cpr_relax_, Opm::CPRParameter::cpr_use_amg_, Opm::CPRPreconditioner< M, X, Y, P >::createEllipticPreconditioner(), Opm::CPRPreconditioner< M, X, Y, P >::param_, and Opm::CPRPreconditioner< M, X, Y, P >::pre_.

Member Function Documentation

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
void Opm::CPRPreconditioner< M, X, Y, P >::createEllipticPreconditioner ( const bool  amg,
const P &  comm 
)
inlineprotected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
virtual void Opm::CPRPreconditioner< M, X, Y, P >::post ( X &  )
inlinevirtual

Clean up.

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
virtual void Opm::CPRPreconditioner< M, X, Y, P >::pre ( X &  ,
Y &   
)
inlinevirtual

Prepare the preconditioner.

Member Data Documentation

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
const matrix_type& Opm::CPRPreconditioner< M, X, Y, P >::A_
protected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
const matrix_type& Opm::CPRPreconditioner< M, X, Y, P >::Ae_
protected

The elliptic part of the matrix.

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::createEllipticPreconditioner().

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
std::unique_ptr< AMG > Opm::CPRPreconditioner< M, X, Y, P >::amg_
protected

AMG preconditioner with ILU0 smoother.

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::solveElliptic().

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
const P& Opm::CPRPreconditioner< M, X, Y, P >::comm_
protected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
const P& Opm::CPRPreconditioner< M, X, Y, P >::commAe_
protected

The information about the parallelization of the elliptic part of the system.

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::CPRPreconditioner(), and Opm::CPRPreconditioner< M, X, Y, P >::solveElliptic().

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
Y Opm::CPRPreconditioner< M, X, Y, P >::de_
protected

temporary variables for elliptic solve

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::apply().

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
Y Opm::CPRPreconditioner< M, X, Y, P >::dmodified_
protected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
std::unique_ptr<Operator> Opm::CPRPreconditioner< M, X, Y, P >::opAe_
protected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
const CPRParameter& Opm::CPRPreconditioner< M, X, Y, P >::param_
protected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
std::shared_ptr< WholeSystemPreconditioner > Opm::CPRPreconditioner< M, X, Y, P >::pre_
protected

The preconditioner for the whole system.

We have to use a shared_ptr instead of a unique_ptr as we need to use a custom allocator based on dynamic information. But for unique_ptr the type of this deleter has to be available at coompile time.

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::apply(), and Opm::CPRPreconditioner< M, X, Y, P >::CPRPreconditioner().

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
EllipticPreconditionerPointer Opm::CPRPreconditioner< M, X, Y, P >::precond_
protected

ILU0 preconditioner for the elliptic system.

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::solveElliptic().

template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
Y Opm::CPRPreconditioner< M, X, Y, P >::ve_
protected
template<class M , class X , class Y , class P = Dune::Amg::SequentialInformation>
Y Opm::CPRPreconditioner< M, X, Y, P >::vilu_
protected

temporary variables for ILU solve

Referenced by Opm::CPRPreconditioner< M, X, Y, P >::apply().


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