Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT > Class Template Reference

A two-step version of an overlapping Schwarz preconditioner using one step ILU0 as. More...

#include <ParallelOverlappingILU0.hpp>

Inheritance diagram for Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >:
Inheritance graph

Classes

struct  CRS
 

Public Types

using matrix_type = typename std::remove_const< Matrix >::type
 The matrix type the preconditioner is for. More...
 
using domain_type = Domain
 The domain type of the preconditioner. More...
 
using range_type = Range
 The range type of the preconditioner. More...
 
using field_type = typename Domain::field_type
 The field type of the preconditioner. More...
 
using block_type = typename matrix_type::block_type
 
using size_type = typename matrix_type::size_type
 

Public Member Functions

Dune::SolverCategory::Category category () const override
 
 ParallelOverlappingILU0 (const Matrix &A, const int n, const field_type w, MILU_VARIANT milu, bool redblack=false, bool reorder_sphere=true)
 Constructor. More...
 
 ParallelOverlappingILU0 (const Matrix &A, const ParallelInfo &comm, const int n, const field_type w, MILU_VARIANT milu, bool redblack=false, bool reorder_sphere=true)
 Constructor gets all parameters to operate the prec. More...
 
 ParallelOverlappingILU0 (const Matrix &A, const field_type w, MILU_VARIANT milu, bool redblack=false, bool reorder_sphere=true)
 Constructor. More...
 
 ParallelOverlappingILU0 (const Matrix &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, bool redblack=false, bool reorder_sphere=true)
 Constructor. More...
 
 ParallelOverlappingILU0 (const Matrix &A, const ParallelInfo &comm, const field_type w, MILU_VARIANT milu, size_type interiorSize, bool redblack=false, bool reorder_sphere=true)
 Constructor. More...
 
void pre (Domain &, Range &) override
 Prepare the preconditioner. More...
 
void apply (Domain &v, const Range &d) override
 Apply the preconditoner. More...
 
template<class V >
void copyOwnerToAll (V &v) const
 
void post (Range &) override
 Clean up. More...
 
void update () override
 

Protected Member Functions

Range & reorderD (const Range &d)
 Reorder D if needed and return a reference to it. More...
 
Domain & reorderV (Domain &v)
 Reorder V if needed and return a reference to it. More...
 
void reorderBack (const Range &reorderedV, Range &v)
 

Protected Attributes

std::unique_ptr< Matrix > ILU_
 The ILU0 decomposition of the matrix. More...
 
CRS lower_
 
CRS upper_
 
std::vector< block_typeinv_
 
std::vector< std::size_t > ordering_
 the reordering of the unknowns More...
 
Range reorderedD_
 The reordered right hand side. More...
 
Domain reorderedV_
 The reordered left hand side. More...
 
const ParallelInfo * comm_
 
const field_type w_
 The relaxation factor to use. More...
 
const bool relaxation_
 
size_type interiorSize_
 
const Matrix * A_
 
int iluIteration_
 
MILU_VARIANT milu_
 
bool redBlack_
 
bool reorderSphere_
 

Detailed Description

template<class Matrix, class Domain, class Range, class ParallelInfoT>
class Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >

A two-step version of an overlapping Schwarz preconditioner using one step ILU0 as.

This preconditioner differs from a ParallelRestrictedOverlappingSchwarz with Dune:SeqILU0 in the following way: During apply we make sure that the current residual is consistent (i.e. each process knows the same value for each index. Then we solve Ly = d for y and make y consistent again. Last we solve Ux = y and make sure that x is consistent. In contrast for ParallelRestrictedOverlappingSchwarz we solve (LU)x = d for x without forcing consistency between the two steps.

Template Parameters
MatrixThe type of the Matrix.
DomainThe type of the Vector representing the domain.
RangeThe type of the Vector representing the range.
ParallelInfoThe type of the parallel information object used, e.g. Dune::OwnerOverlapCommunication

Member Typedef Documentation

◆ block_type

template<class Matrix , class Domain , class Range , class ParallelInfoT >
using Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::block_type = typename matrix_type::block_type

◆ domain_type

template<class Matrix , class Domain , class Range , class ParallelInfoT >
using Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::domain_type = Domain

The domain type of the preconditioner.

◆ field_type

template<class Matrix , class Domain , class Range , class ParallelInfoT >
using Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::field_type = typename Domain::field_type

The field type of the preconditioner.

◆ matrix_type

template<class Matrix , class Domain , class Range , class ParallelInfoT >
using Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::matrix_type = typename std::remove_const<Matrix>::type

The matrix type the preconditioner is for.

◆ range_type

template<class Matrix , class Domain , class Range , class ParallelInfoT >
using Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::range_type = Range

The range type of the preconditioner.

◆ size_type

template<class Matrix , class Domain , class Range , class ParallelInfoT >
using Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::size_type = typename matrix_type::size_type

Constructor & Destructor Documentation

◆ ParallelOverlappingILU0() [1/5]

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ParallelOverlappingILU0 ( const Matrix &  A,
const int  n,
const field_type  w,
MILU_VARIANT  milu,
bool  redblack = false,
bool  reorder_sphere = true 
)

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
nILU fill in level (for testing). This does not work in parallel.
wThe relaxation factor.
miluThe modified ILU variant to use. 0 means traditional ILU.
See also
MILU_VARIANT.
Parameters
redblackWhether to use a red-black ordering.
reorder_sphereIf true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

References Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::interiorSize_, and Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::update().

◆ ParallelOverlappingILU0() [2/5]

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ParallelOverlappingILU0 ( const Matrix &  A,
const ParallelInfo &  comm,
const int  n,
const field_type  w,
MILU_VARIANT  milu,
bool  redblack = false,
bool  reorder_sphere = true 
)

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
commcommunication object, e.g. Dune::OwnerOverlapCopyCommunication
nILU fill in level (for testing). This does not work in parallel.
wThe relaxation factor.
miluThe modified ILU variant to use. 0 means traditional ILU.
See also
MILU_VARIANT.
Parameters
redblackWhether to use a red-black ordering.
reorder_sphereIf true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

References Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::interiorSize_, and Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::update().

◆ ParallelOverlappingILU0() [3/5]

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ParallelOverlappingILU0 ( const Matrix &  A,
const field_type  w,
MILU_VARIANT  milu,
bool  redblack = false,
bool  reorder_sphere = true 
)

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
wThe relaxation factor.
miluThe modified ILU variant to use. 0 means traditional ILU.
See also
MILU_VARIANT.
Parameters
redblackWhether to use a red-black ordering.
reorder_sphereIf true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

◆ ParallelOverlappingILU0() [4/5]

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ParallelOverlappingILU0 ( const Matrix &  A,
const ParallelInfo &  comm,
const field_type  w,
MILU_VARIANT  milu,
bool  redblack = false,
bool  reorder_sphere = true 
)

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
commcommunication object, e.g. Dune::OwnerOverlapCopyCommunication
wThe relaxation factor.
miluThe modified ILU variant to use. 0 means traditional ILU.
See also
MILU_VARIANT.
Parameters
redblackWhether to use a red-black ordering.
reorder_sphereIf true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

References Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::interiorSize_, and Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::update().

◆ ParallelOverlappingILU0() [5/5]

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ParallelOverlappingILU0 ( const Matrix &  A,
const ParallelInfo &  comm,
const field_type  w,
MILU_VARIANT  milu,
size_type  interiorSize,
bool  redblack = false,
bool  reorder_sphere = true 
)

Constructor.

Constructor gets all parameters to operate the prec.

Parameters
AThe matrix to operate on.
nILU fill in level (for testing). This does not work in parallel.
wThe relaxation factor.
miluThe modified ILU variant to use. 0 means traditional ILU.
See also
MILU_VARIANT.
Parameters
interiorSizeThe number of interior/owner rows in the matrix.
redblackWhether to use a red-black ordering.
reorder_sphereIf true, we start the reordering at a root node. The vertices on each layer aound it (same distance) are ordered consecutivly. If false, we preserver the order of the vertices with the same color.

References Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::update().

Member Function Documentation

◆ apply()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
void Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::apply ( Domain &  v,
const Range &  d 
)
override

Apply the preconditoner.

◆ category()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Dune::SolverCategory::Category Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::category
override

◆ copyOwnerToAll()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
template<class V >
void Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::copyOwnerToAll ( V &  v) const

◆ post()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
void Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::post ( Range &  )
inlineoverride

Clean up.

◆ pre()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
void Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::pre ( Domain &  ,
Range &   
)
inlineoverride

Prepare the preconditioner.

◆ reorderBack()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
void Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::reorderBack ( const Range &  reorderedV,
Range &  v 
)
protected

◆ reorderD()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Range & Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::reorderD ( const Range &  d)
protected

Reorder D if needed and return a reference to it.

◆ reorderV()

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Domain & Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::reorderV ( Domain &  v)
protected

Reorder V if needed and return a reference to it.

◆ update()

Member Data Documentation

◆ A_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
const Matrix* Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::A_
protected

◆ comm_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
const ParallelInfo* Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::comm_
protected

◆ ILU_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
std::unique_ptr<Matrix> Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ILU_
protected

The ILU0 decomposition of the matrix.

◆ iluIteration_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
int Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::iluIteration_
protected

◆ interiorSize_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
size_type Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::interiorSize_
protected

◆ inv_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
std::vector< block_type > Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::inv_
protected

◆ lower_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
CRS Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::lower_
protected

◆ milu_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
MILU_VARIANT Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::milu_
protected

◆ ordering_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
std::vector< std::size_t > Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::ordering_
protected

the reordering of the unknowns

◆ redBlack_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
bool Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::redBlack_
protected

◆ relaxation_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
const bool Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::relaxation_
protected

◆ reorderedD_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Range Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::reorderedD_
protected

The reordered right hand side.

◆ reorderedV_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
Domain Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::reorderedV_
protected

The reordered left hand side.

◆ reorderSphere_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
bool Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::reorderSphere_
protected

◆ upper_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
CRS Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::upper_
protected

◆ w_

template<class Matrix , class Domain , class Range , class ParallelInfoT >
const field_type Opm::ParallelOverlappingILU0< Matrix, Domain, Range, ParallelInfoT >::w_
protected

The relaxation factor to use.


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