3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Types | Public Member Functions | Protected Member Functions | List of all members
Dumux::LinearPDESolver< Assembler, LinearSolver > Class Template Referenceabstract

An implementation of a linear PDE solver. More...

#include <dumux/linear/pdesolver.hh>

Inheritance diagram for Dumux::LinearPDESolver< Assembler, LinearSolver >:

Description

template<class Assembler, class LinearSolver>
class Dumux::LinearPDESolver< Assembler, LinearSolver >

An implementation of a linear PDE solver.

Template Parameters
Assemblerthe assembler
LinearSolverthe linear solver
Commthe communication object used to communicate with all processes
Note
If you want to specialize only some methods but are happy with the defaults of the reference solver, derive your solver from this class and simply overload the required methods.

Public Types

using Assembler = Assembler
 export the assembler and linear solver types More...
 
using LinearSolver = LinearSolver
 
using Variables = Detail::AssemblerVariables< Assembler >
 export the type of variables that represent a numerical solution More...
 

Public Member Functions

 LinearPDESolver (std::shared_ptr< Assembler > assembler, std::shared_ptr< LinearSolver > linearSolver, const std::string &paramGroup="")
 The Constructor. More...
 
void solve (SolutionVector &uCurrentIter) override
 Solve a linear PDE system. More...
 
void report (std::ostream &sout=std::cout) const
 output statistics / report More...
 
Scalar suggestTimeStepSize (Scalar oldTimeStep) const
 Suggest a new time-step size based on the old time-step size. More...
 
void setVerbose (bool val)
 Specifies if the solver ought to be chatty. More...
 
bool verbose () const
 Returns true if the solver ought to be chatty. More...
 
const std::string & paramGroup () const
 Returns the parameter group. More...
 
void reuseMatrix (bool reuse=true)
 Set whether the matrix should be reused. More...
 
virtual void solve (Variables &vars)=0
 Solve the given PDE system (usually assemble + solve linear system + update) More...
 
virtual void solve (Variables &vars, TimeLoop &timeLoop)
 Solve the given PDE system with time step control. More...
 
const Assemblerassembler () const
 Access the assembler. More...
 
Assemblerassembler ()
 Access the assembler. More...
 
const LinearSolverlinearSolver () const
 Access the linear solver. More...
 

Protected Member Functions

LinearSolverlinearSolver ()
 Access the linear solver. More...
 
bool checkSizesOfSubMatrices (const Dune::MultiTypeBlockMatrix< FirstRow, Args... > &matrix) const
 Helper function to assure the MultiTypeBlockMatrix's sub-blocks have the correct sizes. More...
 

Member Typedef Documentation

◆ Assembler

using Dumux::PDESolver< Assembler , LinearSolver >::Assembler = Assembler
inherited

export the assembler and linear solver types

◆ LinearSolver

using Dumux::PDESolver< Assembler , LinearSolver >::LinearSolver = LinearSolver
inherited

◆ Variables

export the type of variables that represent a numerical solution

Constructor & Destructor Documentation

◆ LinearPDESolver()

template<class Assembler , class LinearSolver >
Dumux::LinearPDESolver< Assembler, LinearSolver >::LinearPDESolver ( std::shared_ptr< Assembler assembler,
std::shared_ptr< LinearSolver linearSolver,
const std::string &  paramGroup = "" 
)
inline

The Constructor.

Member Function Documentation

◆ assembler() [1/2]

Assembler & Dumux::PDESolver< Assembler , LinearSolver >::assembler ( )
inlineinherited

Access the assembler.

◆ assembler() [2/2]

const Assembler & Dumux::PDESolver< Assembler , LinearSolver >::assembler ( ) const
inlineinherited

Access the assembler.

◆ checkSizesOfSubMatrices()

bool Dumux::PDESolver< Assembler , LinearSolver >::checkSizesOfSubMatrices ( const Dune::MultiTypeBlockMatrix< FirstRow, Args... > &  matrix) const
inlineprotectedinherited

Helper function to assure the MultiTypeBlockMatrix's sub-blocks have the correct sizes.

◆ linearSolver() [1/2]

LinearSolver & Dumux::PDESolver< Assembler , LinearSolver >::linearSolver ( )
inlineprotectedinherited

Access the linear solver.

◆ linearSolver() [2/2]

const LinearSolver & Dumux::PDESolver< Assembler , LinearSolver >::linearSolver ( ) const
inlineinherited

Access the linear solver.

◆ paramGroup()

template<class Assembler , class LinearSolver >
const std::string & Dumux::LinearPDESolver< Assembler, LinearSolver >::paramGroup ( ) const
inline

Returns the parameter group.

◆ report()

template<class Assembler , class LinearSolver >
void Dumux::LinearPDESolver< Assembler, LinearSolver >::report ( std::ostream &  sout = std::cout) const
inline

output statistics / report

Todo:
Implement some solver statistics output

◆ reuseMatrix()

template<class Assembler , class LinearSolver >
void Dumux::LinearPDESolver< Assembler, LinearSolver >::reuseMatrix ( bool  reuse = true)
inline

Set whether the matrix should be reused.

Note
If this is set to true, the matrix will not be assembled. Make sure there is an assembled matrix that can be reused before setting this flag to true.

◆ setVerbose()

template<class Assembler , class LinearSolver >
void Dumux::LinearPDESolver< Assembler, LinearSolver >::setVerbose ( bool  val)
inline

Specifies if the solver ought to be chatty.

◆ solve() [1/3]

template<class Assembler , class LinearSolver >
void Dumux::LinearPDESolver< Assembler, LinearSolver >::solve ( SolutionVector &  uCurrentIter)
inlineoverride

Solve a linear PDE system.

◆ solve() [2/3]

virtual void Dumux::PDESolver< Assembler , LinearSolver >::solve ( Variables vars)
pure virtualinherited

Solve the given PDE system (usually assemble + solve linear system + update)

Parameters
varsinstance of the Variables class representing a numerical solution, defining primary and possibly secondary variables and information on the time level.

Implemented in Dumux::NewtonSolver< Assembler, LinearSolver, Reassembler, Comm >, and Dumux::NewtonSolver< Assembler, LinearSolver, DefaultPartialReassembler, Dune::Communication< Dune::MPIHelper::MPICommunicator > >.

◆ solve() [3/3]

virtual void Dumux::PDESolver< Assembler , LinearSolver >::solve ( Variables vars,
TimeLoop timeLoop 
)
inlinevirtualinherited

Solve the given PDE system with time step control.

Note
This is used for solvers that are allowed to e.g. automatically reduce the time step if the solve was not successful
Parameters
varsinstance of the Variables class representing a numerical solution
timeLoopa reference to the current time loop

Reimplemented in Dumux::NewtonSolver< Assembler, LinearSolver, Reassembler, Comm >, and Dumux::NewtonSolver< Assembler, LinearSolver, DefaultPartialReassembler, Dune::Communication< Dune::MPIHelper::MPICommunicator > >.

◆ suggestTimeStepSize()

template<class Assembler , class LinearSolver >
Scalar Dumux::LinearPDESolver< Assembler, LinearSolver >::suggestTimeStepSize ( Scalar  oldTimeStep) const
inline

Suggest a new time-step size based on the old time-step size.

Note
For compatibility with other PDE solvers (e.g. Newton)

◆ verbose()

template<class Assembler , class LinearSolver >
bool Dumux::LinearPDESolver< Assembler, LinearSolver >::verbose ( ) const
inline

Returns true if the solver ought to be chatty.


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