Provides the common code which is required by most linear solvers. More...

#include <parallelbasebackend.hh>

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

Public Member Functions

 ParallelBaseBackend (const Simulator &simulator)
 
 ~ParallelBaseBackend ()
 
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 ()
 Register all run-time parameters for the linear solver. More...
 

Protected Types

enum  { dimWorld = GridView::dimensionworld }
 
using Implementation = GetPropType< TypeTag, Properties::LinearSolverBackend >
 
using Simulator = GetPropType< TypeTag, Properties::Simulator >
 
using Scalar = GetPropType< TypeTag, Properties::Scalar >
 
using LinearSolverScalar = GetPropType< TypeTag, Properties::LinearSolverScalar >
 
using SparseMatrixAdapter = GetPropType< TypeTag, Properties::SparseMatrixAdapter >
 
using Vector = GetPropType< TypeTag, Properties::GlobalEqVector >
 
using BorderListCreator = GetPropType< TypeTag, Properties::BorderListCreator >
 
using GridView = GetPropType< TypeTag, Properties::GridView >
 
using Overlap = GetPropType< TypeTag, Properties::Overlap >
 
using OverlappingVector = GetPropType< TypeTag, Properties::OverlappingVector >
 
using OverlappingMatrix = GetPropType< TypeTag, Properties::OverlappingMatrix >
 
using PreconditionerWrapper = GetPropType< TypeTag, Properties::PreconditionerWrapper >
 
using SequentialPreconditioner = typename PreconditionerWrapper::SequentialPreconditioner
 
using ParallelPreconditioner = Opm::Linear::OverlappingPreconditioner< SequentialPreconditioner, Overlap >
 
using ParallelScalarProduct = Opm::Linear::OverlappingScalarProduct< OverlappingVector, Overlap >
 
using ParallelOperator = Opm::Linear::OverlappingOperator< OverlappingMatrix, OverlappingVector, OverlappingVector >
 

Protected Member Functions

ImplementationasImp_ ()
 
const ImplementationasImp_ () const
 
void cleanup_ ()
 
std::shared_ptr< ParallelPreconditionerpreparePreconditioner_ ()
 
void cleanupPreconditioner_ ()
 
void writeOverlapToVTK_ ()
 

Protected Attributes

const Simulatorsimulator_
 
int gridSequenceNumber_
 
size_t lastIterations_
 
OverlappingMatrixoverlappingMatrix_
 
OverlappingVectoroverlappingb_
 
OverlappingVectoroverlappingx_
 
PreconditionerWrapper precWrapper_
 

Detailed Description

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

Provides the common code which is required by most linear solvers.

This class provides access to all preconditioners offered by dune-istl using the PreconditionerWrapper property:

template<class TypeTag>
struct PreconditionerWrapper<TypeTag, TTag::YourTypeTag>
{ using type = Opm::Linear::PreconditionerWrapper$PRECONDITIONER<TypeTag>; };
GetPropType< TypeTag, Properties::PreconditionerWrapper > PreconditionerWrapper
Definition: parallelbasebackend.hh:125

Where the choices possible for '$PRECONDITIONER' are:

  • Jacobi: A Jacobi preconditioner
  • GaussSeidel: A Gauss-Seidel preconditioner
  • SSOR: A symmetric successive overrelaxation (SSOR) preconditioner
  • SOR: A successive overrelaxation (SOR) preconditioner
  • ILUn: An ILU(n) preconditioner
  • ILU0: An ILU(0) preconditioner. The results of this preconditioner are the same as setting the PreconditionerOrder property to 0 and using the ILU(n) preconditioner. The reason for the existence of ILU0 is that it is computationally cheaper because it does not need to consider things which are only required for higher orders

Member Typedef Documentation

◆ BorderListCreator

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

◆ GridView

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::GridView = GetPropType<TypeTag, Properties::GridView>
protected

◆ Implementation

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

◆ LinearSolverScalar

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::LinearSolverScalar = GetPropType<TypeTag, Properties::LinearSolverScalar>
protected

◆ Overlap

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::Overlap = GetPropType<TypeTag, Properties::Overlap>
protected

◆ OverlappingMatrix

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

◆ OverlappingVector

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::OverlappingVector = GetPropType<TypeTag, Properties::OverlappingVector>
protected

◆ ParallelOperator

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::ParallelOperator = Opm::Linear::OverlappingOperator<OverlappingMatrix, OverlappingVector, OverlappingVector>
protected

◆ ParallelPreconditioner

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::ParallelPreconditioner = Opm::Linear::OverlappingPreconditioner<SequentialPreconditioner, Overlap>
protected

◆ ParallelScalarProduct

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::ParallelScalarProduct = Opm::Linear::OverlappingScalarProduct<OverlappingVector, Overlap>
protected

◆ PreconditionerWrapper

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

◆ Scalar

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::Scalar = GetPropType<TypeTag, Properties::Scalar>
protected

◆ SequentialPreconditioner

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

◆ Simulator

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::Simulator = GetPropType<TypeTag, Properties::Simulator>
protected

◆ SparseMatrixAdapter

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::SparseMatrixAdapter = GetPropType<TypeTag, Properties::SparseMatrixAdapter>
protected

◆ Vector

template<class TypeTag >
using Opm::Linear::ParallelBaseBackend< TypeTag >::Vector = GetPropType<TypeTag, Properties::GlobalEqVector>
protected

Member Enumeration Documentation

◆ anonymous enum

template<class TypeTag >
anonymous enum
protected
Enumerator
dimWorld 

Constructor & Destructor Documentation

◆ ParallelBaseBackend()

◆ ~ParallelBaseBackend()

Member Function Documentation

◆ asImp_() [1/2]

◆ asImp_() [2/2]

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

◆ cleanup_()

◆ cleanupPreconditioner_()

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

◆ eraseMatrix()

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

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
inline

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
inline

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  
)
inline

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_()

◆ registerParameters()

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

◆ setMatrix()

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

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)
inline

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_.

◆ solve()

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

◆ writeOverlapToVTK_()

Member Data Documentation

◆ gridSequenceNumber_

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

◆ lastIterations_

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

◆ overlappingb_

◆ overlappingMatrix_

◆ overlappingx_

◆ precWrapper_

◆ simulator_


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