version 3.8
Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly > Class Template Reference

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

#include <dumux/multidomain/fvassembler.hh>

Inheritance diagram for Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >:

Description

template<class MDTraits, class CMType, DiffMethod diffMethod, bool useImplicitAssembly = true>
class Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >
Template Parameters
MDTraitsthe multidimensional traits
diffMethodthe differentiation method to residual compute derivatives
useImplicitAssemblyif to use an implicit or explicit time discretization

Public Types

using Traits = MDTraits
 
using Scalar = typename MDTraits::Scalar
 
template<std::size_t id>
using LocalResidual = GetPropType< SubDomainTypeTag< id >, Properties::LocalResidual >
 TODO get rid of this GetPropType. More...
 
template<std::size_t id>
using GridVariables = typename MDTraits::template SubDomain< id >::GridVariables
 
template<std::size_t id>
using GridGeometry = typename MDTraits::template SubDomain< id >::GridGeometry
 
template<std::size_t id>
using Problem = typename MDTraits::template SubDomain< id >::Problem
 
using JacobianMatrix = typename MDTraits::JacobianMatrix
 
using SolutionVector = typename MDTraits::SolutionVector
 
using ResidualType = typename MDTraits::ResidualVector
 
using CouplingManager = CMType
 

Public Member Functions

 MultiDomainFVAssembler (ProblemTuple problem, GridGeometryTuple gridGeometry, GridVariablesTuple gridVariables, std::shared_ptr< CouplingManager > couplingManager)
 The constructor for stationary problems. More...
 
 MultiDomainFVAssembler (ProblemTuple problem, GridGeometryTuple gridGeometry, GridVariablesTuple gridVariables, std::shared_ptr< CouplingManager > couplingManager, std::shared_ptr< const TimeLoop > timeLoop, const SolutionVector &prevSol)
 The constructor for instationary problems. More...
 
void assembleJacobianAndResidual (const SolutionVector &curSol)
 Assembles the global Jacobian of the residual and the residual for the current solution. More...
 
void assembleResidual (const SolutionVector &curSol)
 compute the residuals using the internal residual More...
 
void assembleResidual (ResidualType &r, const SolutionVector &curSol)
 assemble a residual r More...
 
void setLinearSystem (std::shared_ptr< JacobianMatrix > A, std::shared_ptr< ResidualType > 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 setJacobianBuildMode (JacobianMatrix &jac) const
 Sets the jacobian build mode. More...
 
void updateAfterGridAdaption ()
 Resizes jacobian and residual and recomputes colors. More...
 
void updateGridVariables (const SolutionVector &curSol)
 Updates the grid variables with the given solution. More...
 
void resetTimeStep (const SolutionVector &curSol)
 Resets the grid variables to the last time step. More...
 
template<std::size_t i>
std::size_t numDofs (Dune::index_constant< i > domainId) const
 the number of dof locations of domain i More...
 
template<std::size_t i>
const auto & problem (Dune::index_constant< i > domainId) const
 the problem of domain i More...
 
template<std::size_t i>
const auto & gridGeometry (Dune::index_constant< i > domainId) const
 the finite volume grid geometry of domain i More...
 
template<std::size_t i>
const auto & gridView (Dune::index_constant< i > domainId) const
 the grid view of domain i More...
 
template<std::size_t i>
GridVariables< i > & gridVariables (Dune::index_constant< i > domainId)
 the grid variables of domain i More...
 
template<std::size_t i>
const GridVariables< i > & gridVariables (Dune::index_constant< i > domainId) const
 the grid variables of domain i More...
 
const CouplingManagercouplingManager () const
 the coupling manager More...
 
JacobianMatrixjacobian ()
 the full Jacobian matrix More...
 
ResidualTyperesidual ()
 the full residual vector More...
 
const SolutionVectorprevSol () const
 the solution of the previous time step More...
 
void setTimeManager (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...
 
template<std::size_t i>
LocalResidual< i > localResidual (Dune::index_constant< i > domainId) const
 Create a local residual object (used by the local assembler) More...
 

Static Public Member Functions

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

Protected Attributes

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

Member Typedef Documentation

◆ CouplingManager

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::CouplingManager = CMType

◆ GridGeometry

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t id>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::GridGeometry = typename MDTraits::template SubDomain<id>::GridGeometry

◆ GridVariables

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t id>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::GridVariables = typename MDTraits::template SubDomain<id>::GridVariables

◆ JacobianMatrix

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::JacobianMatrix = typename MDTraits::JacobianMatrix

◆ LocalResidual

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t id>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::LocalResidual = GetPropType<SubDomainTypeTag<id>, Properties::LocalResidual>

◆ Problem

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t id>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::Problem = typename MDTraits::template SubDomain<id>::Problem

◆ ResidualType

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::ResidualType = typename MDTraits::ResidualVector

◆ Scalar

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::Scalar = typename MDTraits::Scalar

◆ SolutionVector

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::SolutionVector = typename MDTraits::SolutionVector

◆ Traits

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
using Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::Traits = MDTraits

Constructor & Destructor Documentation

◆ MultiDomainFVAssembler() [1/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::MultiDomainFVAssembler ( ProblemTuple  problem,
GridGeometryTuple  gridGeometry,
GridVariablesTuple  gridVariables,
std::shared_ptr< CouplingManager couplingManager 
)
inline
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

◆ MultiDomainFVAssembler() [2/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::MultiDomainFVAssembler ( ProblemTuple  problem,
GridGeometryTuple  gridGeometry,
GridVariablesTuple  gridVariables,
std::shared_ptr< CouplingManager couplingManager,
std::shared_ptr< const TimeLoop timeLoop,
const SolutionVector prevSol 
)
inline
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

◆ assembleJacobianAndResidual()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::assembleJacobianAndResidual ( const SolutionVector curSol)
inline

◆ assembleResidual() [1/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::assembleResidual ( const SolutionVector curSol)
inline

◆ assembleResidual() [2/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::assembleResidual ( ResidualType r,
const SolutionVector curSol 
)
inline

◆ couplingManager()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
const CouplingManager & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::couplingManager ( ) const
inline

◆ gridGeometry()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
const auto & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::gridGeometry ( Dune::index_constant< i >  domainId) const
inline

◆ gridVariables() [1/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
GridVariables< i > & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::gridVariables ( Dune::index_constant< i >  domainId)
inline

◆ gridVariables() [2/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
const GridVariables< i > & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::gridVariables ( Dune::index_constant< i >  domainId) const
inline

◆ gridView()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
const auto & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::gridView ( Dune::index_constant< i >  domainId) const
inline

◆ isImplicit()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
static constexpr bool Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::isImplicit ( )
inlinestaticconstexpr

◆ isStationaryProblem()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
bool Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::isStationaryProblem ( ) const
inline

◆ jacobian()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
JacobianMatrix & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::jacobian ( )
inline

◆ localResidual()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
LocalResidual< i > Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::localResidual ( Dune::index_constant< i >  domainId) const
inline

◆ numDofs()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
std::size_t Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::numDofs ( Dune::index_constant< i >  domainId) const
inline

◆ prevSol()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
const SolutionVector & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::prevSol ( ) const
inline

◆ problem()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
template<std::size_t i>
const auto & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::problem ( Dune::index_constant< i >  domainId) const
inline

◆ resetTimeStep()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::resetTimeStep ( const SolutionVector curSol)
inline

◆ residual()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
ResidualType & Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::residual ( )
inline

◆ setJacobianBuildMode()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::setJacobianBuildMode ( JacobianMatrix jac) const
inline

◆ setLinearSystem() [1/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::setLinearSystem ( )
inline

◆ setLinearSystem() [2/2]

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::setLinearSystem ( std::shared_ptr< JacobianMatrix A,
std::shared_ptr< ResidualType r 
)
inline

◆ setPreviousSolution()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::setPreviousSolution ( const SolutionVector u)
inline

◆ setTimeManager()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::setTimeManager ( std::shared_ptr< const TimeLoop timeLoop)
inline
Note
calling this turns this into a stationary assembler

◆ updateAfterGridAdaption()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::updateAfterGridAdaption ( )
inline

◆ updateGridVariables()

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
void Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::updateGridVariables ( const SolutionVector curSol)
inline

Member Data Documentation

◆ couplingManager_

template<class MDTraits , class CMType , DiffMethod diffMethod, bool useImplicitAssembly = true>
std::shared_ptr<CouplingManager> Dumux::MultiDomainFVAssembler< MDTraits, CMType, diffMethod, useImplicitAssembly >::couplingManager_
protected

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