version 3.8
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 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, 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.

◆ setVerbose()

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

◆ verbose()

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

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