Opm::PreconditionerFactory< Operator, Comm > Class Template Reference

#include <PreconditionerFactory.hpp>

Public Types

using Matrix = typename Operator::matrix_type
 Linear algebra types. More...
 
using Vector = typename Operator::domain_type
 
using PrecPtr = std::shared_ptr< Dune::PreconditionerWithUpdate< Vector, Vector > >
 The type of pointer returned by create(). More...
 
using Creator = std::function< PrecPtr(const Operator &, const PropertyTree &, const std::function< Vector()> &, std::size_t)>
 The type of creator functions passed to addCreator(). More...
 
using ParCreator = std::function< PrecPtr(const Operator &, const PropertyTree &, const std::function< Vector()> &, std::size_t, const Comm &)>
 
using CriterionBase = Dune::Amg::AggregationCriterion< Dune::Amg::SymmetricDependency< Matrix, Dune::Amg::FirstDiagonal > >
 
using Criterion = Dune::Amg::CoarsenCriterion< CriterionBase >
 

Static Public Member Functions

static PrecPtr create (const Operator &op, const PropertyTree &prm, const std::function< Vector()> &weightsCalculator={}, std::size_t pressureIndex=std::numeric_limits< std::size_t >::max())
 
static PrecPtr create (const Operator &op, const PropertyTree &prm, const std::function< Vector()> &weightsCalculator, const Comm &comm, std::size_t pressureIndex=std::numeric_limits< std::size_t >::max())
 
static PrecPtr create (const Operator &op, const PropertyTree &prm, const Comm &comm, std::size_t pressureIndex=std::numeric_limits< std::size_t >::max())
 
static void addCreator (const std::string &type, Creator creator)
 
static void addCreator (const std::string &type, ParCreator creator)
 

Detailed Description

template<class Operator, class Comm>
class Opm::PreconditionerFactory< Operator, Comm >

This is an object factory for creating preconditioners. The user need only interact with the factory through the static methods addStandardPreconditioners() and create(). In addition a user can call the addCreator() static method to add further preconditioners.

Member Typedef Documentation

◆ Creator

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::Creator = std::function<PrecPtr(const Operator&, const PropertyTree&, const std::function<Vector()>&, std::size_t)>

The type of creator functions passed to addCreator().

◆ Criterion

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::Criterion = Dune::Amg::CoarsenCriterion<CriterionBase>

◆ CriterionBase

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::CriterionBase = Dune::Amg::AggregationCriterion<Dune::Amg::SymmetricDependency<Matrix, Dune::Amg::FirstDiagonal> >

◆ Matrix

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::Matrix = typename Operator::matrix_type

Linear algebra types.

◆ ParCreator

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::ParCreator = std::function<PrecPtr(const Operator&, const PropertyTree&, const std::function<Vector()>&, std::size_t, const Comm&)>

◆ PrecPtr

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::PrecPtr = std::shared_ptr<Dune::PreconditionerWithUpdate<Vector, Vector> >

The type of pointer returned by create().

◆ Vector

template<class Operator , class Comm >
using Opm::PreconditionerFactory< Operator, Comm >::Vector = typename Operator::domain_type

Member Function Documentation

◆ addCreator() [1/2]

template<class Operator , class Comm >
void Opm::PreconditionerFactory< Operator, Comm >::addCreator ( const std::string &  type,
Creator  creator 
)
static

Add a creator for a serial preconditioner to the PreconditionerFactory. After the call, the user may obtain a preconditioner by calling create() with the given type string as a parameter contained in the property_tree.

Parameters
typethe type string we want the PreconditionerFactory to associate with the preconditioner.
creatora function or lambda creating a preconditioner.

◆ addCreator() [2/2]

template<class Operator , class Comm >
void Opm::PreconditionerFactory< Operator, Comm >::addCreator ( const std::string &  type,
ParCreator  creator 
)
static

Add a creator for a parallel preconditioner to the PreconditionerFactory. After the call, the user may obtain a preconditioner by calling create() with the given type string as a parameter contained in the property_tree.

Parameters
typethe type string we want the PreconditionerFactory to associate with the preconditioner.
creatora function or lambda creating a preconditioner.

◆ create() [1/3]

template<class Operator , class Comm >
PreconditionerFactory< Operator, Comm >::PrecPtr Opm::PreconditionerFactory< Operator, Comm >::create ( const Operator &  op,
const PropertyTree prm,
const Comm comm,
std::size_t  pressureIndex = std::numeric_limits<std::size_t>::max() 
)
static

Create a new parallel preconditioner and return a pointer to it.

Parameters
opoperator to be preconditioned.
prmparameters for the preconditioner, in particular its type.
commcommunication object (typically OwnerOverlapCopyCommunication).
Returns
(smart) pointer to the created preconditioner.

◆ create() [2/3]

template<class Operator , class Comm >
PreconditionerFactory< Operator, Comm >::PrecPtr Opm::PreconditionerFactory< Operator, Comm >::create ( const Operator &  op,
const PropertyTree prm,
const std::function< Vector()> &  weightsCalculator,
const Comm comm,
std::size_t  pressureIndex = std::numeric_limits<std::size_t>::max() 
)
static

Create a new parallel preconditioner and return a pointer to it.

Parameters
opoperator to be preconditioned.
prmparameters for the preconditioner, in particular its type.
commcommunication object (typically OwnerOverlapCopyCommunication).
weightsCalculatorCalculator for weights used in CPR.
Returns
(smart) pointer to the created preconditioner.

◆ create() [3/3]

template<class Operator , class Comm >
PreconditionerFactory< Operator, Comm >::PrecPtr Opm::PreconditionerFactory< Operator, Comm >::create ( const Operator &  op,
const PropertyTree prm,
const std::function< Vector()> &  weightsCalculator = {},
std::size_t  pressureIndex = std::numeric_limits<std::size_t>::max() 
)
static

Create a new serial preconditioner and return a pointer to it.

Parameters
opoperator to be preconditioned.
prmparameters for the preconditioner, in particular its type.
weightsCalculatorCalculator for weights used in CPR.
Returns
(smart) pointer to the created preconditioner.

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