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

CPR preconditioner. More...

#include <CPRPreconditioner.hpp>

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

Public Types

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

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.
 
const matrix_typeA_
 The matrix for the full linear problem.
 
const matrix_typeAe_
 The elliptic part of the matrix.
 
de_
 temporary variables for elliptic solve
 
ve_
 
dmodified_
 
std::unique_ptr< OperatoropAe_
 elliptic operator
 
EllipticPreconditionerPointer precond_
 ILU0 preconditioner for the elliptic system.
 
std::unique_ptr< AMGamg_
 AMG preconditioner with ILU0 smoother.
 
std::shared_ptr< WholeSystemPreconditionerpre_
 The preconditioner for the whole system. More...
 
vilu_
 temporary variables for ILU solve
 
const P & comm_
 The information about the parallelization of the whole system.
 
const P & commAe_
 The information about the parallelization of the elliptic part of the system.
 

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 Enumeration Documentation

◆ anonymous enum

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

◆ CPRPreconditioner()

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

Member Function Documentation

◆ apply()

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

Apply the preconditoner.

◆ post()

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.

◆ pre()

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

◆ pre_

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.


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