3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Types | Public Member Functions | List of all members
Dumux::FVAssembler< TypeTag, diffMethod, isImplicit > Class Template Reference

A linear system assembler (residual and Jacobian) for finite volume schemes (box, tpfa, mpfa, ...) More...

#include <dumux/assembly/fvassembler.hh>

Description

template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
class Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >

A linear system assembler (residual and Jacobian) for finite volume schemes (box, tpfa, mpfa, ...)

Template Parameters
TypeTagThe TypeTag
diffMethodThe differentiation method to residual compute derivatives
isImplicitSpecifies whether the time discretization is implicit or not not (i.e. explicit)

Public Types

using Scalar = GetPropType< TypeTag, Properties::Scalar >
 
using JacobianMatrix = GetPropType< TypeTag, Properties::JacobianMatrix >
 
using GridGeometry = GetPropType< TypeTag, Properties::GridGeometry >
 
using Problem = GetPropType< TypeTag, Properties::Problem >
 
using GridVariables = GetPropType< TypeTag, Properties::GridVariables >
 
using ResidualType = SolutionVector
 

Public Member Functions

 FVAssembler (std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables)
 The constructor for stationary problems. More...
 
 FVAssembler (std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables, std::shared_ptr< const TimeLoop > timeLoop, const SolutionVector &prevSol)
 The constructor for instationary problems. More...
 
template<class PartialReassembler = DefaultPartialReassembler>
void assembleJacobianAndResidual (const SolutionVector &curSol, const PartialReassembler *partialReassembler=nullptr)
 Assembles the global Jacobian of the residual and the residual for the current solution. More...
 
void assembleJacobian (const SolutionVector &curSol)
 Assembles only the global Jacobian of the residual. More...
 
void assembleResidual (const SolutionVector &curSol)
 compute the residuals using the internal residual More...
 
void assembleResidual (ResidualType &r, const SolutionVector &curSol) const
 assemble a residual r More...
 
Scalar residualNorm (const SolutionVector &curSol) const
 compute the residual and return it's vector norm More...
 
void setLinearSystem (std::shared_ptr< JacobianMatrix > A, std::shared_ptr< SolutionVector > r)
 Tells the assembler which jacobian and residual to use. This also resizes the containers to the required sizes and sets the sparsity pattern of the jacobian matrix. More...
 
void setLinearSystem ()
 The version without arguments uses the default constructor to create the jacobian and residual objects in this assembler if you don't need them outside this class. More...
 
void setJacobianPattern ()
 Resizes the jacobian and sets the jacobian' sparsity pattern. More...
 
void setResidualSize ()
 Resizes the residual. More...
 
std::size_t numDofs () const
 Returns the number of degrees of freedom. More...
 
const Problemproblem () const
 The problem. More...
 
const GridGeometrygridGeometry () const
 The global finite volume geometry. More...
 
const GridView & gridView () const
 The gridview. More...
 
GridVariablesgridVariables ()
 The global grid variables. More...
 
const GridVariablesgridVariables () const
 The global grid variables. More...
 
JacobianMatrixjacobian ()
 The jacobian matrix. More...
 
SolutionVector & residual ()
 The residual vector (rhs) More...
 
const SolutionVector & prevSol () const
 The solution of the previous time step. More...
 
void setTimeLoop (std::shared_ptr< const TimeLoop > timeLoop)
 Set time loop for instationary problems. More...
 
void setPreviousSolution (const SolutionVector &u)
 Sets the solution from which to start the time integration. Has to be called prior to assembly for time-dependent problems. More...
 
bool isStationaryProblem () const
 Whether we are assembling a stationary or instationary problem. More...
 
LocalResidual localResidual () const
 Create a local residual object (used by the local assembler) More...
 
void updateGridVariables (const SolutionVector &cursol)
 Update the grid variables. More...
 
void resetTimeStep (const SolutionVector &cursol)
 Reset the gridVariables. More...
 

Member Typedef Documentation

◆ GridGeometry

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
using Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>

◆ GridVariables

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
using Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::GridVariables = GetPropType<TypeTag, Properties::GridVariables>

◆ JacobianMatrix

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
using Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::JacobianMatrix = GetPropType<TypeTag, Properties::JacobianMatrix>

◆ Problem

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
using Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::Problem = GetPropType<TypeTag, Properties::Problem>

◆ ResidualType

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
using Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::ResidualType = SolutionVector

◆ Scalar

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
using Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::Scalar = GetPropType<TypeTag, Properties::Scalar>

Constructor & Destructor Documentation

◆ FVAssembler() [1/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::FVAssembler ( std::shared_ptr< const Problem problem,
std::shared_ptr< const GridGeometry gridGeometry,
std::shared_ptr< GridVariables gridVariables 
)
inline

The constructor for stationary problems.

Note
the grid variables might be temporarily changed during assembly (if caching is enabled) it is however guaranteed that the state after assembly will be the same as before

◆ FVAssembler() [2/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::FVAssembler ( std::shared_ptr< const Problem problem,
std::shared_ptr< const GridGeometry gridGeometry,
std::shared_ptr< GridVariables gridVariables,
std::shared_ptr< const TimeLoop timeLoop,
const SolutionVector &  prevSol 
)
inline

The constructor for instationary problems.

Note
the grid variables might be temporarily changed during assembly (if caching is enabled) it is however guaranteed that the state after assembly will be the same as before

Member Function Documentation

◆ assembleJacobian()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::assembleJacobian ( const SolutionVector &  curSol)
inline

Assembles only the global Jacobian of the residual.

◆ assembleJacobianAndResidual()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
template<class PartialReassembler = DefaultPartialReassembler>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::assembleJacobianAndResidual ( const SolutionVector &  curSol,
const PartialReassembler partialReassembler = nullptr 
)
inline

Assembles the global Jacobian of the residual and the residual for the current solution.

◆ assembleResidual() [1/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::assembleResidual ( const SolutionVector &  curSol)
inline

compute the residuals using the internal residual

◆ assembleResidual() [2/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::assembleResidual ( ResidualType r,
const SolutionVector &  curSol 
) const
inline

assemble a residual r

◆ gridGeometry()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
const GridGeometry & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::gridGeometry ( ) const
inline

The global finite volume geometry.

◆ gridVariables() [1/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
GridVariables & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::gridVariables ( )
inline

The global grid variables.

◆ gridVariables() [2/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
const GridVariables & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::gridVariables ( ) const
inline

The global grid variables.

◆ gridView()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
const GridView & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::gridView ( ) const
inline

The gridview.

◆ isStationaryProblem()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
bool Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::isStationaryProblem ( ) const
inline

Whether we are assembling a stationary or instationary problem.

◆ jacobian()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
JacobianMatrix & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::jacobian ( )
inline

The jacobian matrix.

◆ localResidual()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
LocalResidual Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::localResidual ( ) const
inline

Create a local residual object (used by the local assembler)

◆ numDofs()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
std::size_t Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::numDofs ( ) const
inline

Returns the number of degrees of freedom.

◆ prevSol()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
const SolutionVector & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::prevSol ( ) const
inline

The solution of the previous time step.

◆ problem()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
const Problem & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::problem ( ) const
inline

The problem.

◆ resetTimeStep()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::resetTimeStep ( const SolutionVector &  cursol)
inline

Reset the gridVariables.

◆ residual()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
SolutionVector & Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::residual ( )
inline

The residual vector (rhs)

◆ residualNorm()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
Scalar Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::residualNorm ( const SolutionVector &  curSol) const
inline

compute the residual and return it's vector norm

◆ setJacobianPattern()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::setJacobianPattern ( )
inline

Resizes the jacobian and sets the jacobian' sparsity pattern.

◆ setLinearSystem() [1/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::setLinearSystem ( )
inline

The version without arguments uses the default constructor to create the jacobian and residual objects in this assembler if you don't need them outside this class.

◆ setLinearSystem() [2/2]

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::setLinearSystem ( std::shared_ptr< JacobianMatrix A,
std::shared_ptr< SolutionVector >  r 
)
inline

Tells the assembler which jacobian and residual to use. This also resizes the containers to the required sizes and sets the sparsity pattern of the jacobian matrix.

◆ setPreviousSolution()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::setPreviousSolution ( const SolutionVector &  u)
inline

Sets the solution from which to start the time integration. Has to be called prior to assembly for time-dependent problems.

◆ setResidualSize()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::setResidualSize ( )
inline

Resizes the residual.

◆ setTimeLoop()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::setTimeLoop ( std::shared_ptr< const TimeLoop timeLoop)
inline

Set time loop for instationary problems.

Note
calling this turns this into a stationary assembler

◆ updateGridVariables()

template<class TypeTag , DiffMethod diffMethod, bool isImplicit = true>
void Dumux::FVAssembler< TypeTag, diffMethod, isImplicit >::updateGridVariables ( const SolutionVector &  cursol)
inline

Update the grid variables.


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