version 3.11-dev
Loading...
Searching...
No Matches
Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG > Class Template Reference

Preconditioned iterative solver for the incompressible Stokes problem. More...

#include <dumux/linear/stokes_solver.hh>

Inheritance diagram for Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >:

Description

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
class Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >
Note
Uses StokesPreconditioner as preconditioner (tailored to the incompressible Stokes problem)
Sequential and MPI-parallel (non-overlapping or overlapping decomposition)

Public Types

using PressureMatrix = typename Preconditioner::PressureLinearOperator::matrix_type
 The matrix type of the pressure operator of the preconditioner.
using Scalar = double

Public Member Functions

 StokesSolver (std::shared_ptr< const VelocityGG > vGridGeometry, std::shared_ptr< const PressureGG > pGridGeometry, const Vector &dirichletDofs, const std::string &paramGroup="")
 Constructor.
bool solve (const Matrix &A, Vector &x, const Vector &b)
void setMatrix (const Matrix &A)
 Keep a copy of the matrix, and the operator and preconditioner built on it, for solve(x, b).
void setMatrix (std::shared_ptr< Matrix > A)
 Keep a copy of the matrix, and the operator and preconditioner built on it, for solve(x, b).
bool solve (Vector &x, const Vector &b)
 Solve with the matrix kept by setMatrix.
void setPressureMatrix (std::shared_ptr< const PressureMatrix > matrix)
 Use the given matrix in place of the pressure mass matrix in the preconditioner.
void setPressureDiagonal (std::shared_ptr< const PressureVector > diagonal)
 Set the diagonal added to the inverse of the pressure block (see StokesPreconditioner::setPressureDiagonal).
void makeConsistent (Vector &v) const
 Give the copies of shared degrees of freedom the values of their owners.
void makeUnique (Vector &v) const
 Set the entries of shared degrees of freedom this process does not own to zero.
Scalar norm (const Vector &b) const
std::string name () const
const Dune::InverseOperatorResult & result () const
const std::string & paramGroup () const
 the parameter group for getting parameter from the parameter tree
int verbosity () const
 the verbosity level
void setVerbosity (int v)
 set the verbosity level
int maxIter () const
 the maximum number of linear solver iterations
void setMaxIter (int i)
 set the maximum number of linear solver iterations
Scalar residReduction () const
 the linear solver residual reduction
void setResidualReduction (Scalar r)
 set the linear solver residual reduction
Scalar relaxation () const
 the linear solver relaxation factor
void setRelaxation (Scalar r)
 set the linear solver relaxation factor
int precondIter () const
 the number of preconditioner iterations
void setPrecondIter (int i)
 set the number of preconditioner iterations
int precondVerbosity () const
 the preconditioner verbosity
void setPrecondVerbosity (int verbosityLevel)
 set the preconditioner verbosity

Member Typedef Documentation

◆ PressureMatrix

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
using Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::PressureMatrix = typename Preconditioner::PressureLinearOperator::matrix_type

◆ Scalar

using Dumux::LinearSolver::Scalar = double
inherited

export Scalar type (might be needed to set parameters from output) TODO: Do we need this?

Constructor & Destructor Documentation

◆ StokesSolver()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::StokesSolver ( std::shared_ptr< const VelocityGG > vGridGeometry,
std::shared_ptr< const PressureGG > pGridGeometry,
const Vector & dirichletDofs,
const std::string & paramGroup = "" )
inline
Parameters
vGridGeometrygrid geometry of the velocity discretization
pGridGeometrygrid geometry of the pressure discretization
dirichletDofsa vector (same size and shape as right hand side) where the dirichlet dofs are marked with 1.0 and all other entries are 0.0.
paramGroupgroup prefix when looking up keys in the parameter tree

Member Function Documentation

◆ makeConsistent()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
void Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::makeConsistent ( Vector & v) const
inline

◆ makeUnique()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
void Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::makeUnique ( Vector & v) const
inline

◆ maxIter()

int Dumux::LinearSolver::maxIter ( ) const
inlineinherited

◆ name()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
std::string Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::name ( ) const
inline

◆ norm()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
Scalar Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::norm ( const Vector & b) const
inline

◆ paramGroup()

const std::string & Dumux::LinearSolver::paramGroup ( ) const
inlineinherited

◆ precondIter()

int Dumux::LinearSolver::precondIter ( ) const
inlineinherited

◆ precondVerbosity()

int Dumux::LinearSolver::precondVerbosity ( ) const
inlineinherited

◆ relaxation()

Scalar Dumux::LinearSolver::relaxation ( ) const
inlineinherited

◆ residReduction()

Scalar Dumux::LinearSolver::residReduction ( ) const
inlineinherited

◆ result()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
const Dune::InverseOperatorResult & Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::result ( ) const
inline

◆ setMatrix() [1/2]

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
void Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::setMatrix ( const Matrix & A)
inline
Note
The preconditioner uses the pressure operator and diagonal set at the time of this call.

◆ setMatrix() [2/2]

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
void Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::setMatrix ( std::shared_ptr< Matrix > A)
inline
Note
The preconditioner uses the pressure operator and diagonal set at the time of this call.

◆ setMaxIter()

void Dumux::LinearSolver::setMaxIter ( int i)
inlineinherited

◆ setPrecondIter()

void Dumux::LinearSolver::setPrecondIter ( int i)
inlineinherited

◆ setPrecondVerbosity()

void Dumux::LinearSolver::setPrecondVerbosity ( int verbosityLevel)
inlineinherited

◆ setPressureDiagonal()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
void Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::setPressureDiagonal ( std::shared_ptr< const PressureVector > diagonal)
inline

◆ setPressureMatrix()

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
void Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::setPressureMatrix ( std::shared_ptr< const PressureMatrix > matrix)
inline
Note
The matrix has to approximate the pressure Schur complement of the system. The viscosity-weighted mass matrix does so for a Stokes problem dominated by viscosity; a transient problem with a small time step is dominated by the storage term of the velocity block and calls for a Poisson-type operator weighted by the time step size and the inverse density.
The matrix has to be invertible, and not only up to a tiny shift of the diagonal: the GMRES solver is preconditioned from the left, so the inverse of a nearly singular pressure matrix, such as a Poisson operator with Neumann boundaries only, dominates the residual it minimizes.
On a non-overlapping decomposition the rows of border dofs have to be complete.

◆ setRelaxation()

void Dumux::LinearSolver::setRelaxation ( Scalar r)
inlineinherited

◆ setResidualReduction()

void Dumux::LinearSolver::setResidualReduction ( Scalar r)
inlineinherited

◆ setVerbosity()

void Dumux::LinearSolver::setVerbosity ( int v)
inlineinherited

◆ solve() [1/2]

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
bool Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::solve ( const Matrix & A,
Vector & x,
const Vector & b )
inline

◆ solve() [2/2]

template<class Matrix, class Vector, class VelocityGG, class PressureGG>
bool Dumux::StokesSolver< Matrix, Vector, VelocityGG, PressureGG >::solve ( Vector & x,
const Vector & b )
inline

◆ verbosity()

int Dumux::LinearSolver::verbosity ( ) const
inlineinherited

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