CPR preconditioner. More...
#include <CPRPreconditioner.hpp>
Public Types | |
enum | { category = std::is_same<P, overlapping } |
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 ¶m, const M &A, const M &Ae, const ParallelInformation &comm=ParallelInformation(), const ParallelInformation &commAe=ParallelInformation()) | |
Constructor. | |
virtual void | pre (X &, Y &) |
Prepare the preconditioner. | |
virtual void | apply (X &v, const Y &d) |
Apply the preconditoner. | |
virtual void | post (X &) |
Clean up. | |
Protected Member Functions | |
void | solveElliptic (Y &x, Y &de) |
void | createEllipticPreconditioner (const bool amg, const P &comm) |
Protected Attributes | |
const CPRParameter & | param_ |
Parameter collection for CPR. | |
const matrix_type & | A_ |
The matrix for the full linear problem. | |
const matrix_type & | Ae_ |
The elliptic part of the matrix. | |
Y | de_ |
temporary variables for elliptic solve | |
Y | ve_ |
Y | dmodified_ |
std::unique_ptr< Operator > | opAe_ |
elliptic operator | |
EllipticPreconditionerPointer | precond_ |
ILU0 preconditioner for the elliptic system. | |
std::unique_ptr< AMG > | amg_ |
AMG preconditioner with ILU0 smoother. | |
std::shared_ptr < WholeSystemPreconditioner > | pre_ |
The preconditioner for the whole system. | |
Y | 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. |
CPR preconditioner.
This is a two-stage preconditioner, combining an elliptic-type partial solution with ILU0 for the whole system.
M | The matrix type to operate on | |
X | Type of the update | |
Y | Type of the defect | |
P | Type of the parallel information. If not provided this will be Dune::Amg::SequentialInformation. The preconditioner is parallel if this is Dune::OwnerOverlapCopyCommunication<int,int> |
anonymous enum |
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.
A | The matrix to operate on. | |
Ae | The top-left elliptic part of A. | |
relax | The ILU0 relaxation factor. | |
useAMG | if true, AMG is used as a preconditioner for the elliptic sub-system, otherwise ilu-0 (default) | |
useBiCG | if true, BiCG solver is used (default), otherwise CG solver | |
paralleInformation | The information about the parallelization, if this is a parallel run |
virtual void Opm::CPRPreconditioner< M, X, Y, P >::apply | ( | X & | v, | |
const Y & | d | |||
) | [inline, virtual] |
Apply the preconditoner.
virtual void Opm::CPRPreconditioner< M, X, Y, P >::post | ( | X & | ) | [inline, virtual] |
Clean up.
virtual void Opm::CPRPreconditioner< M, X, Y, P >::pre | ( | X & | , | |
Y & | ||||
) | [inline, virtual] |
Prepare the preconditioner.
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.