Provides a linear solver backend using the parallel algebraic multi-grid (AMG) linear solver from DUNE-ISTL. More...

#include <parallelamgbackend.hh>

Inheritance diagram for Opm::Linear::ParallelAmgBackend< TypeTag >:
Inheritance graph

Public Member Functions

 ParallelAmgBackend (const Simulator &simulator)
 
void eraseMatrix ()
 Causes the solve() method to discared the structure of the linear system of equations the next time it is called. More...
 
void prepare (const SparseMatrixAdapter &M, const Vector &)
 Set up the internal data structures required for the linear solver. More...
 
void setResidual (const Vector &b)
 Assign values to the internal data structure for the residual vector. More...
 
void getResidual (Vector &b) const
 Retrieve the synchronized internal residual vector. More...
 
void setMatrix (const SparseMatrixAdapter &M)
 Sets the values of the residual's Jacobian matrix. More...
 
bool solve (Vector &x)
 Actually solve the linear system of equations. More...
 
size_t iterations () const
 Return number of iterations used during last solve. More...
 

Static Public Member Functions

static void registerParameters ()
 

Protected Types

enum  { dimWorld = GridView::dimensionworld }
 
using Implementation = GetPropType< TypeTag, Properties::LinearSolverBackend >
 
using BorderListCreator = GetPropType< TypeTag, Properties::BorderListCreator >
 
using OverlappingMatrix = GetPropType< TypeTag, Properties::OverlappingMatrix >
 
using PreconditionerWrapper = GetPropType< TypeTag, Properties::PreconditionerWrapper >
 
using SequentialPreconditioner = typename PreconditionerWrapper::SequentialPreconditioner
 

Protected Member Functions

std::shared_ptr< AMG > preparePreconditioner_ ()
 
void cleanupPreconditioner_ ()
 
std::shared_ptr< RawLinearSolver > prepareSolver_ (ParallelOperator &parOperator, ParallelScalarProduct &parScalarProduct, AMG &parPreCond)
 
std::pair< bool, int > runSolver_ (std::shared_ptr< RawLinearSolver > solver)
 
void cleanupSolver_ ()
 
template<class ParallelIndexSet >
void setupAmgIndexSet_ (const Overlap &overlap, ParallelIndexSet &istlIndices)
 
template<typename C >
auto setUseFixedOrder (C criterion, bool booleanValue) -> decltype(criterion.setUseFixedOrder(booleanValue))
 
template<typename C >
void setUseFixedOrder (C,...)
 
void setupAmg_ ()
 
Implementation & asImp_ ()
 
const Implementation & asImp_ () const
 
void cleanup_ ()
 
void writeOverlapToVTK_ ()
 

Protected Attributes

friend ParentType
 
std::unique_ptr< ConvergenceCriterion< OverlappingVector > > convCrit_
 
std::shared_ptr< FineOperator > fineOperator_
 
std::shared_ptr< AMG > amg_
 
std::shared_ptr< OwnerOverlapCopyCommunication > istlComm_
 
const Simulator & simulator_
 
int gridSequenceNumber_
 
size_t lastIterations_
 
OverlappingMatrix * overlappingMatrix_
 
OverlappingVector * overlappingb_
 
OverlappingVector * overlappingx_
 
PreconditionerWrapper precWrapper_
 

Detailed Description

template<class TypeTag>
class Opm::Linear::ParallelAmgBackend< TypeTag >

Provides a linear solver backend using the parallel algebraic multi-grid (AMG) linear solver from DUNE-ISTL.

Member Typedef Documentation

◆ BorderListCreator

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::BorderListCreator = GetPropType<TypeTag, Properties::BorderListCreator>
protectedinherited

◆ Implementation

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::Implementation = GetPropType<TypeTag, Properties::LinearSolverBackend>
protectedinherited

◆ OverlappingMatrix

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::OverlappingMatrix = GetPropType<TypeTag, Properties::OverlappingMatrix>
protectedinherited

◆ PreconditionerWrapper

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::PreconditionerWrapper = GetPropType<TypeTag, Properties::PreconditionerWrapper>
protectedinherited

◆ SequentialPreconditioner

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::SequentialPreconditioner = typename PreconditionerWrapper::SequentialPreconditioner
protectedinherited

Member Enumeration Documentation

◆ anonymous enum

template<class TypeTag >
anonymous enum
protectedinherited
Enumerator
dimWorld 

Constructor & Destructor Documentation

◆ ParallelAmgBackend()

template<class TypeTag >
Opm::Linear::ParallelAmgBackend< TypeTag >::ParallelAmgBackend ( const Simulator &  simulator)
inline

Member Function Documentation

◆ asImp_() [1/2]

◆ asImp_() [2/2]

template<class TypeTag >
const Implementation & Opm::Linear::ParallelBaseBackend< TypeTag >::asImp_ ( ) const
inlineprotectedinherited

◆ cleanup_()

◆ cleanupPreconditioner_()

template<class TypeTag >
void Opm::Linear::ParallelAmgBackend< TypeTag >::cleanupPreconditioner_ ( )
inlineprotected

◆ cleanupSolver_()

template<class TypeTag >
void Opm::Linear::ParallelAmgBackend< TypeTag >::cleanupSolver_ ( )
inlineprotected

◆ eraseMatrix()

template<class TypeTag >
void Opm::Linear::ParallelBaseBackend< TypeTag >::eraseMatrix ( )
inlineinherited

Causes the solve() method to discared the structure of the linear system of equations the next time it is called.

References Opm::Linear::ParallelBaseBackend< TypeTag >::cleanup_().

◆ getResidual()

template<class TypeTag >
void Opm::Linear::ParallelBaseBackend< TypeTag >::getResidual ( Vector &  b) const
inlineinherited

Retrieve the synchronized internal residual vector.

This only deals with entries which are local to the current process.

References Opm::Linear::ParallelBaseBackend< TypeTag >::overlappingb_.

◆ iterations()

template<class TypeTag >
size_t Opm::Linear::ParallelBaseBackend< TypeTag >::iterations ( ) const
inlineinherited

Return number of iterations used during last solve.

References Opm::Linear::ParallelBaseBackend< TypeTag >::lastIterations_.

◆ prepare()

template<class TypeTag >
void Opm::Linear::ParallelBaseBackend< TypeTag >::prepare ( const SparseMatrixAdapter &  M,
const Vector &   
)
inlineinherited

Set up the internal data structures required for the linear solver.

This only specified the topology of the linear system of equations; it does does not assign the values of the residual vector and its Jacobian matrix.

References Opm::Linear::ParallelBaseBackend< TypeTag >::asImp_(), Opm::Linear::ParallelBaseBackend< TypeTag >::gridSequenceNumber_, Opm::Linear::ParallelBaseBackend< TypeTag >::overlappingb_, Opm::Linear::ParallelBaseBackend< TypeTag >::overlappingMatrix_, Opm::Linear::ParallelBaseBackend< TypeTag >::overlappingx_, and Opm::Linear::ParallelBaseBackend< TypeTag >::simulator_.

◆ preparePreconditioner_()

◆ prepareSolver_()

template<class TypeTag >
std::shared_ptr< RawLinearSolver > Opm::Linear::ParallelAmgBackend< TypeTag >::prepareSolver_ ( ParallelOperator &  parOperator,
ParallelScalarProduct &  parScalarProduct,
AMG &  parPreCond 
)
inlineprotected

◆ registerParameters()

template<class TypeTag >
static void Opm::Linear::ParallelAmgBackend< TypeTag >::registerParameters ( )
inlinestatic

◆ runSolver_()

template<class TypeTag >
std::pair< bool, int > Opm::Linear::ParallelAmgBackend< TypeTag >::runSolver_ ( std::shared_ptr< RawLinearSolver >  solver)
inlineprotected

◆ setMatrix()

template<class TypeTag >
void Opm::Linear::ParallelBaseBackend< TypeTag >::setMatrix ( const SparseMatrixAdapter &  M)
inlineinherited

Sets the values of the residual's Jacobian matrix.

This method also synchronizes the data structure across the processes which are involved in the simulation run.

References Opm::Linear::ParallelBaseBackend< TypeTag >::overlappingMatrix_.

◆ setResidual()

template<class TypeTag >
void Opm::Linear::ParallelBaseBackend< TypeTag >::setResidual ( const Vector &  b)
inlineinherited

Assign values to the internal data structure for the residual vector.

This method also cares about synchronizing that vector with the peer processes.

References Opm::Linear::ParallelBaseBackend< TypeTag >::overlappingb_.

◆ setupAmg_()

◆ setupAmgIndexSet_()

template<class TypeTag >
template<class ParallelIndexSet >
void Opm::Linear::ParallelAmgBackend< TypeTag >::setupAmgIndexSet_ ( const Overlap &  overlap,
ParallelIndexSet &  istlIndices 
)
inlineprotected

◆ setUseFixedOrder() [1/2]

template<class TypeTag >
template<typename C >
auto Opm::Linear::ParallelAmgBackend< TypeTag >::setUseFixedOrder ( C  criterion,
bool  booleanValue 
) -> decltype(criterion.setUseFixedOrder(booleanValue))
inlineprotected

◆ setUseFixedOrder() [2/2]

template<class TypeTag >
template<typename C >
void Opm::Linear::ParallelAmgBackend< TypeTag >::setUseFixedOrder ( C  ,
  ... 
)
inlineprotected

◆ solve()

template<class TypeTag >
bool Opm::Linear::ParallelBaseBackend< TypeTag >::solve ( Vector &  x)
inlineinherited

◆ writeOverlapToVTK_()

Member Data Documentation

◆ amg_

◆ convCrit_

template<class TypeTag >
std::unique_ptr<ConvergenceCriterion<OverlappingVector> > Opm::Linear::ParallelAmgBackend< TypeTag >::convCrit_
protected

◆ fineOperator_

template<class TypeTag >
std::shared_ptr<FineOperator> Opm::Linear::ParallelAmgBackend< TypeTag >::fineOperator_
protected

◆ gridSequenceNumber_

template<class TypeTag >
int Opm::Linear::ParallelBaseBackend< TypeTag >::gridSequenceNumber_
protectedinherited

◆ istlComm_

template<class TypeTag >
std::shared_ptr<OwnerOverlapCopyCommunication> Opm::Linear::ParallelAmgBackend< TypeTag >::istlComm_
protected

◆ lastIterations_

template<class TypeTag >
size_t Opm::Linear::ParallelBaseBackend< TypeTag >::lastIterations_
protectedinherited

◆ overlappingb_

◆ overlappingMatrix_

◆ overlappingx_

◆ ParentType

template<class TypeTag >
friend Opm::Linear::ParallelAmgBackend< TypeTag >::ParentType
protected

◆ precWrapper_

◆ simulator_


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