3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Loading...
Searching...
No Matches
Dumux::StaggeredFVAssembler< TypeTag, diffMethod, isImplicit > Class Template Reference

A linear system assembler (residual and Jacobian) for staggered finite volume schemes. This is basically just a wrapper for the MultiDomainFVAssembler which simplifies the set-up of uncoupled problems using the staggered scheme. More...

#include <dumux/assembly/staggeredfvassembler.hh>

Inheritance diagram for Dumux::StaggeredFVAssembler< TypeTag, diffMethod, isImplicit >:
Inheritance graph

Description

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

A linear system assembler (residual and Jacobian) for staggered finite volume schemes. This is basically just a wrapper for the MultiDomainFVAssembler which simplifies the set-up of uncoupled problems using the staggered scheme.

Template Parameters
TypeTagthe TypeTag
diffMethodthe differentiation method to residual compute derivatives
isImplicitif to use an implicit or explicit time discretization

Public Types

using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>
using CouplingManager = typename ParentType::CouplingManager
using Traits
using Scalar
using LocalResidual
 TODO get rid of this GetPropType.
using JacobianMatrix
using ResidualType

Public Member Functions

 StaggeredFVAssembler (std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables)
 The constructor for stationary problems.
 StaggeredFVAssembler (std::shared_ptr< const Problem > problem, std::shared_ptr< const GridGeometry > gridGeometry, std::shared_ptr< GridVariables > gridVariables, std::shared_ptr< const TimeLoop > timeLoop)
 The constructor for instationary problems.
 StaggeredFVAssembler (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.
auto & gridVariables ()
const auto & gridVariables () const
const GridGeometrygridGeometry () const
void assembleJacobianAndResidual (const SolutionVector &curSol)
 Assembles the global Jacobian of the residual and the residual for the current solution.
void assembleResidual (const SolutionVector &curSol)
 compute the residuals using the internal residual
void assembleResidual (ResidualType &r, const SolutionVector &curSol)
 assemble a residual r
Scalar residualNorm (const SolutionVector &curSol)
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.
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.
void setJacobianBuildMode (JacobianMatrix &jac) const
 Sets the jacobian build mode.
void setJacobianPattern (JacobianMatrix &jac) const
 Sets the jacobian sparsity pattern.
void setResidualSize (SolutionVector &res) const
 Resizes the residual.
void updateGridVariables (const SolutionVector &curSol)
 Updates the grid variables with the given solution.
void resetTimeStep (const SolutionVector &curSol)
 Resets the grid variables to the last time step.
std::size_t numDofs (Dune::index_constant< i > domainId) const
 the number of dof locations of domain i
const auto & problem (Dune::index_constant< i > domainId) const
 the problem of domain i
const auto & gridGeometry (Dune::index_constant< i > domainId) const
 the finite volume grid geometry of domain i
const auto & gridView (Dune::index_constant< i > domainId) const
 the grid view of domain i
GridVariables< i > & gridVariables (Dune::index_constant< i > domainId)
 the grid variables of domain i
const GridVariables< i > & gridVariables (Dune::index_constant< i > domainId) const
 the grid variables of domain i
const CouplingManagercouplingManager () const
 the coupling manager
JacobianMatrixjacobian ()
 the full Jacobian matrix
SolutionVector & residual ()
 the full residual vector
const SolutionVector & prevSol () const
 the solution of the previous time step
void setTimeManager (std::shared_ptr< const TimeLoop > timeLoop)
 Set time loop for instationary problems.
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.
bool isStationaryProblem () const
 Whether we are assembling a stationary or instationary problem.
LocalResidual< i > localResidual (Dune::index_constant< i > domainId) const
 Create a local residual object (used by the local assembler).

Static Public Member Functions

static constexpr bool isImplicit ()
 Returns true if the assembler considers implicit assembly.

Protected Attributes

std::shared_ptr< CouplingManagercouplingManager_
 the coupling manager coupling the sub domains

Member Typedef Documentation

◆ CouplingManager

template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
using Dumux::StaggeredFVAssembler< TypeTag, diffMethod, isImplicit >::CouplingManager = typename ParentType::CouplingManager

◆ GridGeometry

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

◆ GridVariables

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

◆ JacobianMatrix

using Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::JacobianMatrix
inherited

◆ LocalResidual

using Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::LocalResidual
inherited

TODO get rid of this GetPropType.

◆ ResidualType

using Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::ResidualType
inherited

◆ Scalar

using Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::Scalar
inherited

◆ Traits

using Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::Traits
inherited

Constructor & Destructor Documentation

◆ StaggeredFVAssembler() [1/3]

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

The constructor for stationary problems.

◆ StaggeredFVAssembler() [2/3]

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

The constructor for instationary problems.

◆ StaggeredFVAssembler() [3/3]

template<class TypeTag, DiffMethod diffMethod, bool isImplicit = true>
Dumux::StaggeredFVAssembler< TypeTag, diffMethod, isImplicit >::StaggeredFVAssembler ( 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.

Member Function Documentation

◆ assembleJacobianAndResidual()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::assembleJacobianAndResidual ( const SolutionVector & curSol)
inlineinherited

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

◆ assembleResidual() [1/2]

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::assembleResidual ( const SolutionVector & curSol)
inlineinherited

compute the residuals using the internal residual

◆ assembleResidual() [2/2]

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::assembleResidual ( ResidualType & r,
const SolutionVector & curSol )
inlineinherited

assemble a residual r

◆ couplingManager()

const CouplingManager & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::couplingManager ( ) const
inlineinherited

the coupling manager

◆ gridGeometry() [1/2]

const auto & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::gridGeometry ( Dune::index_constant< i > domainId) const
inlineinherited

the finite volume grid geometry of domain i

◆ gridGeometry() [2/2]

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

◆ gridVariables() [1/4]

GridVariables< i > & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::gridVariables ( Dune::index_constant< i > domainId)
inlineinherited

the grid variables of domain i

◆ gridVariables() [2/4]

const GridVariables< i > & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::gridVariables ( Dune::index_constant< i > domainId) const
inlineinherited

the grid variables of domain i

◆ gridVariables() [3/4]

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

◆ gridVariables() [4/4]

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

◆ gridView()

const auto & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::gridView ( Dune::index_constant< i > domainId) const
inlineinherited

the grid view of domain i

◆ isImplicit()

constexpr bool Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::isImplicit ( )
inlinestaticconstexprinherited

Returns true if the assembler considers implicit assembly.

◆ isStationaryProblem()

bool Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::isStationaryProblem ( ) const
inlineinherited

Whether we are assembling a stationary or instationary problem.

◆ jacobian()

JacobianMatrix & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::jacobian ( )
inlineinherited

the full Jacobian matrix

◆ localResidual()

LocalResidual< i > Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::localResidual ( Dune::index_constant< i > domainId) const
inlineinherited

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

◆ numDofs()

std::size_t Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::numDofs ( Dune::index_constant< i > domainId) const
inlineinherited

the number of dof locations of domain i

◆ prevSol()

const SolutionVector & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::prevSol ( ) const
inlineinherited

the solution of the previous time step

◆ problem()

const auto & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::problem ( Dune::index_constant< i > domainId) const
inlineinherited

the problem of domain i

◆ resetTimeStep()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::resetTimeStep ( const SolutionVector & curSol)
inlineinherited

Resets the grid variables to the last time step.

◆ residual()

SolutionVector & Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::residual ( )
inlineinherited

the full residual vector

◆ residualNorm()

Scalar Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::residualNorm ( const SolutionVector & curSol)
inlineinherited

compute the residual and return it's vector norm TODO: this needs to be adapted in parallel

◆ setJacobianBuildMode()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setJacobianBuildMode ( JacobianMatrix & jac) const
inlineinherited

Sets the jacobian build mode.

◆ setJacobianPattern()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setJacobianPattern ( JacobianMatrix & jac) const
inlineinherited

Sets the jacobian sparsity pattern.

◆ setLinearSystem() [1/2]

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setLinearSystem ( )
inlineinherited

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]

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setLinearSystem ( std::shared_ptr< JacobianMatrix > A,
std::shared_ptr< SolutionVector > r )
inlineinherited

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()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setPreviousSolution ( const SolutionVector & u)
inlineinherited

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

◆ setResidualSize()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setResidualSize ( SolutionVector & res) const
inlineinherited

Resizes the residual.

◆ setTimeManager()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::setTimeManager ( std::shared_ptr< const TimeLoop > timeLoop)
inlineinherited

Set time loop for instationary problems.

Note
calling this turns this into a stationary assembler

◆ updateGridVariables()

void Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::updateGridVariables ( const SolutionVector & curSol)
inlineinherited

Updates the grid variables with the given solution.

Member Data Documentation

◆ couplingManager_

std::shared_ptr<CouplingManager> Dumux::MultiDomainFVAssembler< StaggeredMultiDomainTraits< TypeTag, TypeTag >, StaggeredCouplingManager< StaggeredMultiDomainTraits< TypeTag, TypeTag > >, diffMethod, true >::couplingManager_
protectedinherited

the coupling manager coupling the sub domains


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