version 3.10-dev
Dumux::LinearPDESolver< Assembler, LinearSolver, Comm > Class Template Reference

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

#include <dumux/linear/pdesolver.hh>

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

Description

template<class Assembler, class LinearSolver, class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
class Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >
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 Communication = Comm
 
using Assembler = Assembler
 export the assembler and linear solver types More...
 
using LinearSolver = LinearSolver
 
using Variables = Detail::PDESolver::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 Communication &comm=Dune::MPIHelper::getCommunication(), const std::string &paramGroup="")
 The Constructor. More...
 
 LinearPDESolver (std::shared_ptr< Assembler > assembler, std::shared_ptr< LinearSolver > linearSolver, const std::string &paramGroup)
 The Constructor. More...
 
bool apply (Variables &vars) override
 Solve a linear PDE system. More...
 
void solve (Variables &vars) 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 setVerbosity (int val)
 Specifies if the solver ought to be chatty. More...
 
int verbosity () 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, 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...
 
bool checkSizesOfSubMatrices (const M &) const
 Default implementation for any matrix type. More...
 

Member Typedef Documentation

◆ Assembler

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

◆ Communication

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
using Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::Communication = Comm

◆ LinearSolver

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

◆ Variables

Constructor & Destructor Documentation

◆ LinearPDESolver() [1/2]

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::LinearPDESolver ( std::shared_ptr< Assembler assembler,
std::shared_ptr< LinearSolver linearSolver,
const Communication comm = Dune::MPIHelper::getCommunication(),
const std::string &  paramGroup = "" 
)
inline

◆ LinearPDESolver() [2/2]

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::LinearPDESolver ( std::shared_ptr< Assembler assembler,
std::shared_ptr< LinearSolver linearSolver,
const std::string &  paramGroup 
)
inline

Member Function Documentation

◆ apply()

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
bool Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::apply ( Variables vars)
inlineoverridevirtual

◆ assembler() [1/2]

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

◆ assembler() [2/2]

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

◆ checkSizesOfSubMatrices() [1/2]

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

◆ checkSizesOfSubMatrices() [2/2]

bool Dumux::PDESolver< Assembler , LinearSolver >::checkSizesOfSubMatrices ( const M &  ) const
inlineprotectedinherited

◆ linearSolver() [1/2]

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

◆ linearSolver() [2/2]

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

◆ paramGroup()

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
const std::string & Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::paramGroup ( ) const
inline

◆ report()

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

◆ reuseMatrix()

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
void Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::reuseMatrix ( bool  reuse = true)
inline
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.

◆ setVerbosity()

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
void Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::setVerbosity ( int  val)
inline

◆ solve() [1/2]

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
void Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::solve ( Variables vars)
inlineoverridevirtual

◆ solve() [2/2]

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

◆ suggestTimeStepSize()

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
Scalar Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::suggestTimeStepSize ( Scalar  oldTimeStep) const
inline
Note
For compatibility with other PDE solvers (e.g. Newton)

◆ verbosity()

template<class Assembler , class LinearSolver , class Comm = Dune::Communication<Dune::MPIHelper::MPICommunicator>>
int Dumux::LinearPDESolver< Assembler, LinearSolver, Comm >::verbosity ( ) const
inline

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