version 3.9-dev
Dumux::PDESolver< A, LS > Class Template Referenceabstract

A high-level interface for a PDESolver. More...

#include <dumux/common/pdesolver.hh>

Inheritance diagram for Dumux::PDESolver< A, LS >:

Description

template<class A, class LS>
class Dumux::PDESolver< A, LS >

A PDESolver is constructed with an assembler and a linear solver and has a method solve that linearizes (if not already linear), assembles, solves and updates given an initial solution producing a new solution.

Template Parameters
AAssembler for linearized system of the PDE
LSLinear system solver

Public Types

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

Public Member Functions

 PDESolver (std::shared_ptr< Assembler > assembler, std::shared_ptr< LinearSolver > linearSolver)
 Constructor. More...
 
virtual ~PDESolver ()=default
 
virtual bool apply (Variables &vars)=0
 Solve the given PDE system (usually assemble + solve linear system + update) 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...
 
template<class FirstRow , class ... Args>
bool checkSizesOfSubMatrices (const Dune::MultiTypeBlockMatrix< FirstRow, Args... > &matrix) const
 Helper function to assure the MultiTypeBlockMatrix's sub-blocks have the correct sizes. More...
 
template<class M >
bool checkSizesOfSubMatrices (const M &) const
 Default implementation for any matrix type. More...
 

Member Typedef Documentation

◆ Assembler

template<class A , class LS >
using Dumux::PDESolver< A, LS >::Assembler = A

◆ LinearSolver

template<class A , class LS >
using Dumux::PDESolver< A, LS >::LinearSolver = LS

◆ Variables

template<class A , class LS >
using Dumux::PDESolver< A, LS >::Variables = Detail::PDESolver::AssemblerVariables<Assembler>

Constructor & Destructor Documentation

◆ PDESolver()

template<class A , class LS >
Dumux::PDESolver< A, LS >::PDESolver ( std::shared_ptr< Assembler assembler,
std::shared_ptr< LinearSolver linearSolver 
)
inline
Parameters
assemblerpointer to the assembler of the linear system
linearSolverpointer to the solver of the resulting linear system

◆ ~PDESolver()

template<class A , class LS >
virtual Dumux::PDESolver< A, LS >::~PDESolver ( )
virtualdefault

Member Function Documentation

◆ apply()

template<class A , class LS >
virtual bool Dumux::PDESolver< A, LS >::apply ( Variables vars)
pure virtual
Parameters
varsinstance of the Variables class representing a numerical solution, defining primary and possibly secondary variables and information on the time level.
Returns
bool true if the solver converged
Postcondition
If converged, the given Variables will represent the solution. If the solver does not converge, it may be the case that they are in some intermediate (implementation-dependent) state.

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

◆ assembler() [1/2]

template<class A , class LS >
Assembler & Dumux::PDESolver< A, LS >::assembler ( )
inline

◆ assembler() [2/2]

template<class A , class LS >
const Assembler & Dumux::PDESolver< A, LS >::assembler ( ) const
inline

◆ checkSizesOfSubMatrices() [1/2]

template<class A , class LS >
template<class FirstRow , class ... Args>
bool Dumux::PDESolver< A, LS >::checkSizesOfSubMatrices ( const Dune::MultiTypeBlockMatrix< FirstRow, Args... > &  matrix) const
inlineprotected

◆ checkSizesOfSubMatrices() [2/2]

template<class A , class LS >
template<class M >
bool Dumux::PDESolver< A, LS >::checkSizesOfSubMatrices ( const M &  ) const
inlineprotected

◆ linearSolver() [1/2]

template<class A , class LS >
LinearSolver & Dumux::PDESolver< A, LS >::linearSolver ( )
inlineprotected

◆ linearSolver() [2/2]

template<class A , class LS >
const LinearSolver & Dumux::PDESolver< A, LS >::linearSolver ( ) const
inline

◆ solve() [1/2]

template<class A , class LS >
virtual void Dumux::PDESolver< A, LS >::solve ( Variables vars)
pure virtual

◆ solve() [2/2]

template<class A , class LS >
virtual void Dumux::PDESolver< A, LS >::solve ( Variables vars,
TimeLoop timeLoop 
)
inlinevirtual
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 >, Dumux::NewtonSolver< Assembler, LinearSolver, DefaultPartialReassembler, Dune::Communication< Dune::MPIHelper::MPICommunicator > >, and Dumux::NewtonSolver< Assembler, LinearSolver, PartialReassembler< Assembler >, Dune::Communication< Dune::MPIHelper::MPICommunicator > >.


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