Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm > Class Template Reference

Block lower-triangular preconditioner for the field-split TPSA system. More...

#include <TpsaPreconditioner.hpp>

Inheritance diagram for Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >:
Inheritance graph

Public Member Functions

 TpsaPreconditioner (const Linear::TpsaMatrixView< Scalar > &S, const PropertyTree &prm)
 Sequential constructor. More...
 
 TpsaPreconditioner (const Linear::TpsaMatrixView< Scalar > &S, const PropertyTree &prm, const Comm &comm)
 Parallel constructor. More...
 
void pre (MultiVector &, MultiVector &) override
 Nothing to prepare, the sub-solvers set themselves up. More...
 
void post (MultiVector &) override
 Nothing to clean up after the last apply(). More...
 
Dune::SolverCategory::Category category () const override
 Solver category, overlapping in parallel and sequential otherwise. More...
 
void update () override
 Recompute the preconditioners of all five diagonal block solvers. More...
 
bool hasPerfectUpdate () const override
 The block solvers are rebuilt from the current matrix on update(). More...
 
void apply (MultiVector &v, const MultiVector &d) override
 Apply the preconditioner, i.e. approximately solve S v = d. More...
 

Static Public Attributes

static constexpr bool isParallel = !std::is_same_v<Comm, Dune::Amg::SequentialInformation>
 Whether this instance runs the parallel code path. More...
 
static constexpr auto _0 = Dune::Indices::_0
 Field indices into the multi-vector: u_x, u_y, u_z, rotation, solid pressure. More...
 
static constexpr auto _1 = Dune::Indices::_1
 
static constexpr auto _2 = Dune::Indices::_2
 
static constexpr auto _3 = Dune::Indices::_3
 
static constexpr auto _4 = Dune::Indices::_4
 
static constexpr std::size_t pressureIdx = 0
 The sub-solvers have no pressure equation to single out. More...
 

Detailed Description

template<class Scalar, class DispOp, class RotOp, class SPresOp, class Comm = Dune::Amg::SequentialInformation>
class Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >

Block lower-triangular preconditioner for the field-split TPSA system.

Solves the three scalar displacement blocks, carries their contribution over to the rotation and solid pressure defects, and solves those in turn. Each diagonal block gets its own Dune::FlexibleSolver, configured through the disp_disp_solver, rot_rot_solver and spres_spres_solver sub-trees; the three displacement blocks share the disp_disp_solver configuration.

Template Parameters
ScalarField type of the matrix entries
DispOpLinear operator type of a single scalar displacement block, SeqDispDispOperatorT or ParDispDispOperatorT
RotOpLinear operator type of the rotation block, SeqRotRotOperatorT or ParRotRotOperatorT
SPresOpLinear operator type of the solid pressure block, SeqSPresSPresOperatorT or ParSPresSPresOperatorT
CommCommunication type of the sub-solvers. Defaults to Dune::Amg::SequentialInformation, which selects the sequential implementation

Constructor & Destructor Documentation

◆ TpsaPreconditioner() [1/2]

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
requires (!isParallel)
Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::TpsaPreconditioner ( const Linear::TpsaMatrixView< Scalar > &  S,
const PropertyTree prm 
)

Sequential constructor.

Parameters
SView of the TPSA system matrix.
prmConfiguration of the diagonal block solvers. Must hold the disp_disp_solver, rot_rot_solver and spres_spres_solver sub-trees

◆ TpsaPreconditioner() [2/2]

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
requires (isParallel)
Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::TpsaPreconditioner ( const Linear::TpsaMatrixView< Scalar > &  S,
const PropertyTree prm,
const Comm comm 
)

Parallel constructor.

Parameters
SView of the TPSA system matrix.
prmConfiguration of the diagonal block solvers. Must hold the disp_disp_solver, rot_rot_solver and spres_spres_solver sub-trees
commCommunication of a single field. All five fields live on the same dof partition, so the same object is used for each of them. Only referenced, so it must outlive the preconditioner

Member Function Documentation

◆ apply()

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
void Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::apply ( MultiVector &  v,
const MultiVector &  d 
)
override

Apply the preconditioner, i.e. approximately solve S v = d.

Sweeps over the fields in the order u_x, u_y, u_z, rotation, solid pressure. The displacement updates are substituted into the rotation and solid pressure defects before those blocks are solved.

Parameters
vUpdate, overwritten by the result
dDefect to precondition

◆ category()

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
Dune::SolverCategory::Category Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::category
override

Solver category, overlapping in parallel and sequential otherwise.

◆ hasPerfectUpdate()

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
bool Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::hasPerfectUpdate
overridevirtual

◆ post()

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
void Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::post ( MultiVector &  )
override

Nothing to clean up after the last apply().

◆ pre()

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
void Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::pre ( MultiVector &  ,
MultiVector &   
)
override

Nothing to prepare, the sub-solvers set themselves up.

◆ update()

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm >
void Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::update
overridevirtual

Recompute the preconditioners of all five diagonal block solvers.

Implements Dune::PreconditionerWithUpdate< Linear::TpsaMultiVector< Scalar >, Linear::TpsaMultiVector< Scalar > >.

Member Data Documentation

◆ _0

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr auto Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::_0 = Dune::Indices::_0
staticconstexpr

Field indices into the multi-vector: u_x, u_y, u_z, rotation, solid pressure.

◆ _1

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr auto Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::_1 = Dune::Indices::_1
staticconstexpr

◆ _2

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr auto Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::_2 = Dune::Indices::_2
staticconstexpr

◆ _3

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr auto Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::_3 = Dune::Indices::_3
staticconstexpr

◆ _4

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr auto Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::_4 = Dune::Indices::_4
staticconstexpr

◆ isParallel

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr bool Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::isParallel = !std::is_same_v<Comm, Dune::Amg::SequentialInformation>
staticconstexpr

Whether this instance runs the parallel code path.

◆ pressureIdx

template<class Scalar , class DispOp , class RotOp , class SPresOp , class Comm = Dune::Amg::SequentialInformation>
constexpr std::size_t Opm::TpsaPreconditioner< Scalar, DispOp, RotOp, SPresOp, Comm >::pressureIdx = 0
staticconstexpr

The sub-solvers have no pressure equation to single out.


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