3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Classes | Public Types | Public Member Functions | Static Public Attributes | Protected Types | Protected Member Functions | List of all members
Dumux::StokesDarcyCouplingManager< MDTraits > Class Template Reference

Coupling manager for Stokes and Darcy domains with equal dimension. More...

#include <dumux/multidomain/boundary/stokesdarcy/couplingmanager.hh>

Inheritance diagram for Dumux::StokesDarcyCouplingManager< MDTraits >:

Description

template<class MDTraits>
class Dumux::StokesDarcyCouplingManager< MDTraits >

Coupling manager for Stokes and Darcy domains with equal dimension.

Public Types

using CouplingData = StokesDarcyCouplingData< MDTraits, StokesDarcyCouplingManager< MDTraits > >
 
using Traits = MDTraits
 
using CouplingStencilType = std::vector< std::size_t >
 default type used for coupling element stencils More...
 

Public Member Functions

 StokesDarcyCouplingManager (std::shared_ptr< const GridGeometry< stokesIdx > > stokesFvGridGeometry, std::shared_ptr< const GridGeometry< darcyIdx > > darcyFvGridGeometry)
 Constructor. More...
 
void init (std::shared_ptr< const Problem< stokesIdx > > stokesProblem, std::shared_ptr< const Problem< darcyIdx > > darcyProblem, const SolutionVector &curSol)
 Methods to be accessed by main. More...
 
void computeStencils ()
 Prepare the coupling stencils. More...
 
template<std::size_t i, class Assembler , std::enable_if_t<(i==stokesCellCenterIdx||i==stokesFaceIdx), int > = 0>
void bindCouplingContext (Dune::index_constant< i > domainI, const Element< stokesCellCenterIdx > &element, const Assembler &assembler) const
 prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Darcy information) More...
 
template<std::size_t i, std::enable_if_t<(i==stokesCellCenterIdx||i==stokesFaceIdx), int > = 0>
void bindCouplingContext (Dune::index_constant< i > domainI, const Element< stokesCellCenterIdx > &element) const
 prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Darcy information) More...
 
template<class Assembler >
void bindCouplingContext (Dune::index_constant< darcyIdx > domainI, const Element< darcyIdx > &element, const Assembler &assembler) const
 prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Stokes information) More...
 
void bindCouplingContext (Dune::index_constant< darcyIdx > domainI, const Element< darcyIdx > &element) const
 prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Stokes information) More...
 
template<class LocalAssemblerI >
void updateCouplingContext (Dune::index_constant< darcyIdx > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< darcyIdx > domainJ, std::size_t dofIdxGlobalJ, const PrimaryVariables< darcyIdx > &priVarsJ, int pvIdxJ)
 Update the coupling context for the Darcy residual w.r.t. Darcy DOFs. More...
 
template<class LocalAssemblerI >
void updateCouplingContext (Dune::index_constant< darcyIdx > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< stokesCellCenterIdx > domainJ, const std::size_t dofIdxGlobalJ, const PrimaryVariables< stokesCellCenterIdx > &priVars, int pvIdxJ)
 Update the coupling context for the Darcy residual w.r.t. the Stokes cell-center DOFs (DarcyToCC) More...
 
template<class LocalAssemblerI >
void updateCouplingContext (Dune::index_constant< darcyIdx > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< stokesFaceIdx > domainJ, const std::size_t dofIdxGlobalJ, const PrimaryVariables< stokesFaceIdx > &priVars, int pvIdxJ)
 Update the coupling context for the Darcy residual w.r.t. the Stokes face DOFs (DarcyToFace) More...
 
template<std::size_t i, class LocalAssemblerI , std::enable_if_t<(i==stokesCellCenterIdx||i==stokesFaceIdx), int > = 0>
void updateCouplingContext (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< darcyIdx > domainJ, const std::size_t dofIdxGlobalJ, const PrimaryVariables< darcyIdx > &priVars, int pvIdxJ)
 Update the coupling context for the Stokes cc residual w.r.t. the Darcy DOFs (FaceToDarcy) More...
 
const auto & couplingData () const
 Access the coupling data. More...
 
const auto & stokesCouplingContext (const Element< stokesIdx > &element, const SubControlVolumeFace< stokesIdx > &scvf) const
 Access the coupling context needed for the Stokes domain. More...
 
const auto & darcyCouplingContext (const Element< darcyIdx > &element, const SubControlVolumeFace< darcyIdx > &scvf) const
 Access the coupling context needed for the Darcy domain. More...
 
const CouplingStencil & couplingStencil (Dune::index_constant< stokesCellCenterIdx > domainI, const Element< stokesIdx > &element, Dune::index_constant< darcyIdx > domainJ) const
 The coupling stencils. More...
 
template<std::size_t i, std::size_t j>
const CouplingStencil & couplingStencil (Dune::index_constant< i > domainI, const Element< i > &element, Dune::index_constant< j > domainJ) const
 The coupling stencil of domain I, i.e. which domain J DOFs the given domain I element's residual depends on. More...
 
const CouplingStencil & couplingStencil (Dune::index_constant< darcyIdx > domainI, const Element< darcyIdx > &element, Dune::index_constant< stokesCellCenterIdx > domainJ) const
 The coupling stencil of domain I, i.e. which domain J dofs the given domain I element's residual depends on. More...
 
const CouplingStencil & couplingStencil (Dune::index_constant< darcyIdx > domainI, const Element< darcyIdx > &element, Dune::index_constant< stokesFaceIdx > domainJ) const
 The coupling stencil of domain I, i.e. which domain J dofs the given domain I element's residual depends on. More...
 
template<std::size_t i, std::size_t j>
const CouplingStencil & couplingStencil (Dune::index_constant< i > domainI, const SubControlVolumeFace< stokesIdx > &scvf, Dune::index_constant< j > domainJ) const
 The coupling stencil of domain I, i.e. which domain J DOFs the given domain I element's residual depends on. More...
 
const CouplingStencil & couplingStencil (Dune::index_constant< stokesFaceIdx > domainI, const SubControlVolumeFace< stokesIdx > &scvf, Dune::index_constant< darcyIdx > domainJ) const
 The coupling stencil of a Stokes face w.r.t. Darcy DOFs. More...
 
template<class IdType >
const std::vector< std::size_t > & getAdditionalDofDependencies (IdType id, std::size_t stokesElementIdx) const
 There are no additional dof dependencies. More...
 
template<class IdType >
const std::vector< std::size_t > & getAdditionalDofDependenciesInverse (IdType id, std::size_t darcyElementIdx) const
 There are no additional dof dependencies. More...
 
bool isCoupledEntity (Dune::index_constant< stokesIdx >, const SubControlVolumeFace< stokesFaceIdx > &scvf) const
 Returns whether a given free flow scvf is coupled to the other domain. More...
 
bool isCoupledEntity (Dune::index_constant< darcyIdx >, const SubControlVolumeFace< darcyIdx > &scvf) const
 Returns whether a given free flow scvf is coupled to the other domain. More...
 
const CouplingStencil & couplingStencil (Dune::index_constant< cellCenterIdx > domainI, const Element &elementI, Dune::index_constant< faceIdx > domainJ) const
 returns an iteratable container of all indices of degrees of freedom of domain j that couple with / influence the element residual of the given element of domain i More...
 
template<std::size_t i, std::size_t j>
const CouplingStencil couplingStencil (Dune::index_constant< i > domainI, const SubControlVolumeFace &scvfI, Dune::index_constant< j > domainJ) const
 returns an iteratable container of all indices of degrees of freedom of domain j that couple with / influence the residual of the given subcontrolvolume face of domain i More...
 
const CouplingStencil & couplingStencil (Dune::index_constant< faceIdx > domainI, const SubControlVolumeFace &scvfI, Dune::index_constant< cellCenterIdx > domainJ) const
 returns an iteratable container of all indices of degrees of freedom of domain j that couple with / influence the residual of the given subcontrolvolume face of domain i More...
 
template<std::size_t i, std::size_t j, class LocalAssemblerI , class PriVarsJ >
void updateCouplingContext (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, const std::size_t dofIdxGlobalJ, const PriVarsJ &priVarsJ, int pvIdxJ)
 updates all data and variables that are necessary to evaluate the residual of the element of domain i this is called whenever one of the primary variables that the element residual depends on changes in domain j More...
 
template<class LocalAssemblerI , std::size_t j>
decltype(auto) evalCouplingResidual (Dune::index_constant< cellCenterIdx > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ) const
 Methods to be accessed by the assembly. More...
 
template<class LocalAssemblerI , std::size_t j>
decltype(auto) evalCouplingResidual (Dune::index_constant< faceIdx > domainI, const SubControlVolumeFace &scvfI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ) const
 Methods to be accessed by the assembly. More...
 
template<std::size_t i, typename std::enable_if_t<(GridGeometry< i >::discMethod !=DiscretizationMethods::staggered), int > = 0>
decltype(auto) numericEpsilon (Dune::index_constant< i > id, const std::string &paramGroup) const
 return the numeric epsilon used for deflecting primary variables of coupled domain i. More...
 
template<std::size_t i, typename std::enable_if_t<(GridGeometry< i >::discMethod==DiscretizationMethods::staggered), int > = 0>
decltype(auto) numericEpsilon (Dune::index_constant< i >, const std::string &paramGroup) const
 return the numeric epsilon used for deflecting primary variables of coupled domain i. More...
 
member functions concerning the coupling stencils
void extendJacobianPattern (Dune::index_constant< id > domainI, JacobianPattern &pattern) const
 extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern More...
 

Static Public Attributes

static constexpr auto stokesFaceIdx = typename MDTraits::template SubDomain<0>::Index()
 
static constexpr auto stokesCellCenterIdx = typename MDTraits::template SubDomain<1>::Index()
 
static constexpr auto stokesIdx = stokesFaceIdx
 
static constexpr auto darcyIdx = typename MDTraits::template SubDomain<2>::Index()
 
static constexpr auto cellCenterIdx = GridGeometry<0>::cellCenterIdx()
 
static constexpr auto faceIdx = GridGeometry<0>::faceIdx()
 

Protected Types

using SolutionVectorStorage = typename Traits::template TupleOfSharedPtr< SubSolutionVector >
 the type in which the solution vector is stored in the manager More...
 

Protected Member Functions

std::vector< std::size_t > & emptyStencil ()
 Return a reference to an empty stencil. More...
 
void removeDuplicates_ (std::vector< std::size_t > &stencil)
 

member functions concerning variable caching for element residual evaluations

void updateCouplingContext (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ, const PrimaryVariables< j > &priVarsJ, int pvIdxJ)
 updates all data and variables that are necessary to evaluate the residual of the element of domain i this is called whenever one of the primary variables that the element residual depends on changes in domain j More...
 
decltype(auto) evalCouplingResidual (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ) const
 evaluates the element residual of a coupled element of domain i which depends on the variables at the degree of freedom with index dofIdxGlobalJ of domain j More...
 
void bindCouplingContext (Dune::index_constant< i > domainI, const Element< i > &elementI, const Assembler &assembler)
 prepares all data and variables that are necessary to evaluate the residual of the element of domain i More...
 
void updateCoupledVariables (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, UpdatableElementVolVars &elemVolVars, UpdatableFluxVarCache &elemFluxVarsCache)
 update variables of domain i that depend on variables in domain j after the coupling context has been updated More...
 
void updateSolution (const SolutionVector &curSol)
 Updates the entire solution vector, e.g. before assembly or after grid adaption Overload might want to overload function if the solution vector is stored outside this class to make sure updates don't happen more than once. More...
 
void evalAdditionalDomainDerivatives (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, const typename LocalAssemblerI::LocalResidual::ElementResidualVector &origResiduals, JacobianMatrixDiagBlock &A, GridVariables &gridVariables)
 evaluate additional derivatives of the element residual of a domain with respect to dofs in the same domain that are not in the regular stencil (see CouplingManager::extendJacobianPattern) More...
 
void setSubProblems (const std::tuple< std::shared_ptr< SubProblems >... > &problems)
 set the pointers to the sub problems More...
 
void setSubProblem (std::shared_ptr< SubProblem > problem, Dune::index_constant< i > domainIdx)
 set a pointer to one of the sub problems More...
 
const Problem< i > & problem (Dune::index_constant< i > domainIdx) const
 Return a reference to the sub problem. More...
 
void attachSolution (SolutionVectorStorage &curSol)
 Attach a solution vector stored outside of this class. More...
 
SubSolutionVector< i > & curSol (Dune::index_constant< i > domainIdx)
 the solution vector of the subproblem More...
 
const SubSolutionVector< i > & curSol (Dune::index_constant< i > domainIdx) const
 the solution vector of the subproblem More...
 
decltype(auto) curSol ()
 the solution vector of the coupled problem More...
 
decltype(auto) curSol () const
 the solution vector of the coupled problem More...
 

Member Typedef Documentation

◆ CouplingData

template<class MDTraits >
using Dumux::StokesDarcyCouplingManager< MDTraits >::CouplingData = StokesDarcyCouplingData<MDTraits, StokesDarcyCouplingManager<MDTraits> >

◆ CouplingStencilType

using Dumux::CouplingManager< MDTraits >::CouplingStencilType = std::vector<std::size_t>
inherited

default type used for coupling element stencils

◆ SolutionVectorStorage

using Dumux::CouplingManager< MDTraits >::SolutionVectorStorage = typename Traits::template TupleOfSharedPtr<SubSolutionVector>
protectedinherited

the type in which the solution vector is stored in the manager

◆ Traits

template<class MDTraits >
using Dumux::StaggeredCouplingManager< MDTraits >::Traits = MDTraits
inherited

Constructor & Destructor Documentation

◆ StokesDarcyCouplingManager()

template<class MDTraits >
Dumux::StokesDarcyCouplingManager< MDTraits >::StokesDarcyCouplingManager ( std::shared_ptr< const GridGeometry< stokesIdx > >  stokesFvGridGeometry,
std::shared_ptr< const GridGeometry< darcyIdx > >  darcyFvGridGeometry 
)
inline

Constructor.

Member Function Documentation

◆ attachSolution()

void Dumux::CouplingManager< MDTraits >::attachSolution ( SolutionVectorStorage curSol)
inlineprotectedinherited

Attach a solution vector stored outside of this class.

Note
The caller has to make sure that curSol stays alive for the lifetime of the coupling manager. Otherwise we have a dangling reference here. Use with care.

◆ bindCouplingContext() [1/5]

template<class MDTraits >
void Dumux::StokesDarcyCouplingManager< MDTraits >::bindCouplingContext ( Dune::index_constant< darcyIdx domainI,
const Element< darcyIdx > &  element 
) const
inline

prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Stokes information)

◆ bindCouplingContext() [2/5]

template<class MDTraits >
template<class Assembler >
void Dumux::StokesDarcyCouplingManager< MDTraits >::bindCouplingContext ( Dune::index_constant< darcyIdx domainI,
const Element< darcyIdx > &  element,
const Assembler &  assembler 
) const
inline

prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Stokes information)

◆ bindCouplingContext() [3/5]

void Dumux::CouplingManager< MDTraits >::bindCouplingContext ( Dune::index_constant< i >  domainI,
const Element< i > &  elementI,
const Assembler &  assembler 
)
inlineinherited

prepares all data and variables that are necessary to evaluate the residual of the element of domain i

Parameters
domainIthe domain index of domain i
elementIthe element whose residual we are assemling next
assemblerthe multidomain assembler for access to all data necessary for the assembly of all domains
Note
this concerns all data that is used in the evaluation of the element residual and depends on one of the degrees of freedom returned by CouplingManager::couplingStencil
every coupled element residual depends at least on the solution of another domain, that why we always store a copy of the solution vector in the coupling manager, hence, in case the element residual only depends on primary variables of the other domain this function does nothing
overload this function in case the element residual depends on more than the primary variables of domain j

◆ bindCouplingContext() [4/5]

template<class MDTraits >
template<std::size_t i, std::enable_if_t<(i==stokesCellCenterIdx||i==stokesFaceIdx), int > = 0>
void Dumux::StokesDarcyCouplingManager< MDTraits >::bindCouplingContext ( Dune::index_constant< i >  domainI,
const Element< stokesCellCenterIdx > &  element 
) const
inline

prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Darcy information)

◆ bindCouplingContext() [5/5]

template<class MDTraits >
template<std::size_t i, class Assembler , std::enable_if_t<(i==stokesCellCenterIdx||i==stokesFaceIdx), int > = 0>
void Dumux::StokesDarcyCouplingManager< MDTraits >::bindCouplingContext ( Dune::index_constant< i >  domainI,
const Element< stokesCellCenterIdx > &  element,
const Assembler &  assembler 
) const
inline

prepares all data and variables that are necessary to evaluate the residual of an Darcy element (i.e. Darcy information)

◆ computeStencils()

template<class MDTraits >
void Dumux::StokesDarcyCouplingManager< MDTraits >::computeStencils ( )
inline

Prepare the coupling stencils.

◆ couplingData()

template<class MDTraits >
const auto & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingData ( ) const
inline

Access the coupling data.

◆ couplingStencil() [1/9]

template<class MDTraits >
const CouplingStencil & Dumux::StaggeredCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< cellCenterIdx domainI,
const Element &  elementI,
Dune::index_constant< faceIdx domainJ 
) const
inline

returns an iteratable container of all indices of degrees of freedom of domain j that couple with / influence the element residual of the given element of domain i

Parameters
domainIthe domain index of domain i
elementIthe coupled element of domain í
domainJthe domain index of domain j
Note
this is a specialization for getting the indices of the coupled staggered face dofs

◆ couplingStencil() [2/9]

template<class MDTraits >
const CouplingStencil & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< darcyIdx domainI,
const Element< darcyIdx > &  element,
Dune::index_constant< stokesCellCenterIdx domainJ 
) const
inline

The coupling stencil of domain I, i.e. which domain J dofs the given domain I element's residual depends on.

◆ couplingStencil() [3/9]

template<class MDTraits >
const CouplingStencil & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< darcyIdx domainI,
const Element< darcyIdx > &  element,
Dune::index_constant< stokesFaceIdx domainJ 
) const
inline

The coupling stencil of domain I, i.e. which domain J dofs the given domain I element's residual depends on.

◆ couplingStencil() [4/9]

template<class MDTraits >
const CouplingStencil & Dumux::StaggeredCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< faceIdx domainI,
const SubControlVolumeFace &  scvfI,
Dune::index_constant< cellCenterIdx domainJ 
) const
inline

returns an iteratable container of all indices of degrees of freedom of domain j that couple with / influence the residual of the given subcontrolvolume face of domain i

Parameters
domainIthe domain index of domain i
scvfIthe coupled subcontrolvolume face of domain í
domainJthe domain index of domain j
Note
this is a specialization for getting the indices of the coupled cellcentered dofs

◆ couplingStencil() [5/9]

template<class MDTraits >
template<std::size_t i, std::size_t j>
const CouplingStencil & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< i >  domainI,
const Element< i > &  element,
Dune::index_constant< j >  domainJ 
) const
inline

The coupling stencil of domain I, i.e. which domain J DOFs the given domain I element's residual depends on.

◆ couplingStencil() [6/9]

template<class MDTraits >
template<std::size_t i, std::size_t j>
const CouplingStencil Dumux::StaggeredCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< i >  domainI,
const SubControlVolumeFace &  scvfI,
Dune::index_constant< j >  domainJ 
) const
inline

returns an iteratable container of all indices of degrees of freedom of domain j that couple with / influence the residual of the given subcontrolvolume face of domain i

Parameters
domainIthe domain index of domain i
scvfIthe coupled subcontrolvolume face of domain í
domainJthe domain index of domain j
Note
This function has to be implemented by all coupling managers for all combinations of i and j

◆ couplingStencil() [7/9]

template<class MDTraits >
template<std::size_t i, std::size_t j>
const CouplingStencil & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< i >  domainI,
const SubControlVolumeFace< stokesIdx > &  scvf,
Dune::index_constant< j >  domainJ 
) const
inline

The coupling stencil of domain I, i.e. which domain J DOFs the given domain I element's residual depends on.

◆ couplingStencil() [8/9]

template<class MDTraits >
const CouplingStencil & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< stokesCellCenterIdx domainI,
const Element< stokesIdx > &  element,
Dune::index_constant< darcyIdx domainJ 
) const
inline

The coupling stencils.

The Stokes cell center coupling stencil w.r.t. Darcy DOFs

◆ couplingStencil() [9/9]

template<class MDTraits >
const CouplingStencil & Dumux::StokesDarcyCouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< stokesFaceIdx domainI,
const SubControlVolumeFace< stokesIdx > &  scvf,
Dune::index_constant< darcyIdx domainJ 
) const
inline

The coupling stencil of a Stokes face w.r.t. Darcy DOFs.

◆ curSol() [1/4]

decltype(auto) Dumux::CouplingManager< MDTraits >::curSol ( )
inlineprotectedinherited

the solution vector of the coupled problem

Note
in case of numeric differentiation the solution vector always carries the deflected solution The type returned does not allow assignment from a "regular" MultiTypeBlockVector (not holding references). curSol() = x; won't compile. Use couplingManager.updateSolution(x) instead or (better) use the new curSol(idx) interface.

◆ curSol() [2/4]

decltype(auto) Dumux::CouplingManager< MDTraits >::curSol ( ) const
inlineprotectedinherited

the solution vector of the coupled problem

Note
in case of numeric differentiation the solution vector always carries the deflected solution The type returned does not allow assignment from a "regular" MultiTypeBlockVector (not holding references) curSol() = x; // won't compile. Use couplingManager.updateSolution(x) instead or (better) use the new curSol(idx) interface.

◆ curSol() [3/4]

SubSolutionVector< i > & Dumux::CouplingManager< MDTraits >::curSol ( Dune::index_constant< i >  domainIdx)
inlineprotectedinherited

the solution vector of the subproblem

Parameters
domainIdxThe domain index
Note
in case of numeric differentiation the solution vector always carries the deflected solution

◆ curSol() [4/4]

const SubSolutionVector< i > & Dumux::CouplingManager< MDTraits >::curSol ( Dune::index_constant< i >  domainIdx) const
inlineprotectedinherited

the solution vector of the subproblem

Parameters
domainIdxThe domain index
Note
in case of numeric differentiation the solution vector always carries the deflected solution

◆ darcyCouplingContext()

template<class MDTraits >
const auto & Dumux::StokesDarcyCouplingManager< MDTraits >::darcyCouplingContext ( const Element< darcyIdx > &  element,
const SubControlVolumeFace< darcyIdx > &  scvf 
) const
inline

Access the coupling context needed for the Darcy domain.

◆ emptyStencil()

template<class MDTraits >
std::vector< std::size_t > & Dumux::StokesDarcyCouplingManager< MDTraits >::emptyStencil ( )
inlineprotected

Return a reference to an empty stencil.

◆ evalAdditionalDomainDerivatives()

void Dumux::CouplingManager< MDTraits >::evalAdditionalDomainDerivatives ( Dune::index_constant< i >  domainI,
const LocalAssemblerI &  localAssemblerI,
const typename LocalAssemblerI::LocalResidual::ElementResidualVector &  origResiduals,
JacobianMatrixDiagBlock &  A,
GridVariables &  gridVariables 
)
inlineinherited

evaluate additional derivatives of the element residual of a domain with respect to dofs in the same domain that are not in the regular stencil (see CouplingManager::extendJacobianPattern)

Note
Such additional dependencies can arise from the coupling, e.g. if a coupling source term depends on a non-local average of a quantity of the same domain

◆ evalCouplingResidual() [1/3]

template<class MDTraits >
template<class LocalAssemblerI , std::size_t j>
decltype(auto) Dumux::StaggeredCouplingManager< MDTraits >::evalCouplingResidual ( Dune::index_constant< cellCenterIdx domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< j >  domainJ,
std::size_t  dofIdxGlobalJ 
) const
inline

Methods to be accessed by the assembly.

◆ evalCouplingResidual() [2/3]

template<class MDTraits >
template<class LocalAssemblerI , std::size_t j>
decltype(auto) Dumux::StaggeredCouplingManager< MDTraits >::evalCouplingResidual ( Dune::index_constant< faceIdx domainI,
const SubControlVolumeFace &  scvfI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< j >  domainJ,
std::size_t  dofIdxGlobalJ 
) const
inline

Methods to be accessed by the assembly.

◆ evalCouplingResidual() [3/3]

decltype(auto) Dumux::CouplingManager< MDTraits >::evalCouplingResidual ( Dune::index_constant< i >  domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< j >  domainJ,
std::size_t  dofIdxGlobalJ 
) const
inlineinherited

evaluates the element residual of a coupled element of domain i which depends on the variables at the degree of freedom with index dofIdxGlobalJ of domain j

Parameters
domainIthe domain index of domain i
localAssemblerIthe local assembler assembling the element residual of an element of domain i
domainJthe domain index of domain j
dofIdxGlobalJthe index of the degree of freedom of domain j which has an influence on the element residual of domain i
Note
the element whose residual is to be evaluated can be retrieved from the local assembler as localAssemblerI.element() as well as all up-to-date variables and caches.
the default implementation evaluates the complete element residual if only parts (i.e. only certain scvs, or only certain terms of the residual) of the residual are coupled to dof with index dofIdxGlobalJ the function can be overloaded in the coupling manager
Returns
the element residual

◆ extendJacobianPattern()

void Dumux::CouplingManager< MDTraits >::extendJacobianPattern ( Dune::index_constant< id >  domainI,
JacobianPattern &  pattern 
) const
inlineinherited

extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern

Note
per default we do not add such additional dependencies
Such additional dependencies can arise from the coupling, e.g. if a coupling source term depends on a non-local average of a quantity of the same domain
Warning List:
if you overload this also implement evalAdditionalDomainDerivatives

◆ getAdditionalDofDependencies()

template<class MDTraits >
template<class IdType >
const std::vector< std::size_t > & Dumux::StokesDarcyCouplingManager< MDTraits >::getAdditionalDofDependencies ( IdType  id,
std::size_t  stokesElementIdx 
) const
inline

There are no additional dof dependencies.

◆ getAdditionalDofDependenciesInverse()

template<class MDTraits >
template<class IdType >
const std::vector< std::size_t > & Dumux::StokesDarcyCouplingManager< MDTraits >::getAdditionalDofDependenciesInverse ( IdType  id,
std::size_t  darcyElementIdx 
) const
inline

There are no additional dof dependencies.

◆ init()

template<class MDTraits >
void Dumux::StokesDarcyCouplingManager< MDTraits >::init ( std::shared_ptr< const Problem< stokesIdx > >  stokesProblem,
std::shared_ptr< const Problem< darcyIdx > >  darcyProblem,
const SolutionVector &  curSol 
)
inline

Methods to be accessed by main.

Initialize the coupling manager

◆ isCoupledEntity() [1/2]

template<class MDTraits >
bool Dumux::StokesDarcyCouplingManager< MDTraits >::isCoupledEntity ( Dune::index_constant< darcyIdx ,
const SubControlVolumeFace< darcyIdx > &  scvf 
) const
inline

Returns whether a given free flow scvf is coupled to the other domain.

◆ isCoupledEntity() [2/2]

template<class MDTraits >
bool Dumux::StokesDarcyCouplingManager< MDTraits >::isCoupledEntity ( Dune::index_constant< stokesIdx ,
const SubControlVolumeFace< stokesFaceIdx > &  scvf 
) const
inline

Returns whether a given free flow scvf is coupled to the other domain.

◆ numericEpsilon() [1/2]

template<class MDTraits >
template<std::size_t i, typename std::enable_if_t<(GridGeometry< i >::discMethod !=DiscretizationMethods::staggered), int > = 0>
decltype(auto) Dumux::StaggeredCouplingManager< MDTraits >::numericEpsilon ( Dune::index_constant< i >  id,
const std::string &  paramGroup 
) const
inlineinherited

return the numeric epsilon used for deflecting primary variables of coupled domain i.

Note
specialization for non-staggered schemes

◆ numericEpsilon() [2/2]

template<class MDTraits >
template<std::size_t i, typename std::enable_if_t<(GridGeometry< i >::discMethod==DiscretizationMethods::staggered), int > = 0>
decltype(auto) Dumux::StaggeredCouplingManager< MDTraits >::numericEpsilon ( Dune::index_constant< i >  ,
const std::string &  paramGroup 
) const
inlineinherited

return the numeric epsilon used for deflecting primary variables of coupled domain i.

Note
specialization for non-staggered schemes

◆ problem()

const Problem< i > & Dumux::CouplingManager< MDTraits >::problem ( Dune::index_constant< i >  domainIdx) const
inlineinherited

Return a reference to the sub problem.

Parameters
domainIdxThe domain index We avoid exception handling here because the performance of this function is critical

◆ removeDuplicates_()

template<class MDTraits >
void Dumux::StokesDarcyCouplingManager< MDTraits >::removeDuplicates_ ( std::vector< std::size_t > &  stencil)
inlineprotected

◆ setSubProblem()

void Dumux::CouplingManager< MDTraits >::setSubProblem ( std::shared_ptr< SubProblem >  problem,
Dune::index_constant< i >  domainIdx 
)
inlineinherited

set a pointer to one of the sub problems

Parameters
problema pointer to the sub problem
domainIdxthe domain index of the sub problem

◆ setSubProblems()

void Dumux::CouplingManager< MDTraits >::setSubProblems ( const std::tuple< std::shared_ptr< SubProblems >... > &  problems)
inlineinherited

set the pointers to the sub problems

Parameters
problemsA tuple of shared pointers to the sub problems

◆ stokesCouplingContext()

template<class MDTraits >
const auto & Dumux::StokesDarcyCouplingManager< MDTraits >::stokesCouplingContext ( const Element< stokesIdx > &  element,
const SubControlVolumeFace< stokesIdx > &  scvf 
) const
inline

Access the coupling context needed for the Stokes domain.

◆ updateCoupledVariables()

void Dumux::CouplingManager< MDTraits >::updateCoupledVariables ( Dune::index_constant< i >  domainI,
const LocalAssemblerI &  localAssemblerI,
UpdatableElementVolVars &  elemVolVars,
UpdatableFluxVarCache &  elemFluxVarsCache 
)
inlineinherited

update variables of domain i that depend on variables in domain j after the coupling context has been updated

Parameters
domainIthe index of domain i
localAssemblerIthe local assembler assembling the element residual of an element of domain i
elemVolVarsthe element volume variables (all volume variables in the element local stencil) to be updated
elemFluxVarsCachethe element flux variable cache (all flux variables in the element local stencil) to be updated
Note
Such variables do not necessarily exist and then this function does nothing (default)
some examples from geomechanics: the porosity of (physical) domain i (porous medium flow) depends on the displacement vector of physical domain j (mechnanics) from domaindecomposition: the transmissibilities for fluxes of domain i to domain j depend on the permeability in domain j (which might depend in turn on the primary variables of domain i)

◆ updateCouplingContext() [1/6]

template<class MDTraits >
template<class LocalAssemblerI >
void Dumux::StokesDarcyCouplingManager< MDTraits >::updateCouplingContext ( Dune::index_constant< darcyIdx domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< darcyIdx domainJ,
std::size_t  dofIdxGlobalJ,
const PrimaryVariables< darcyIdx > &  priVarsJ,
int  pvIdxJ 
)
inline

Update the coupling context for the Darcy residual w.r.t. Darcy DOFs.

◆ updateCouplingContext() [2/6]

template<class MDTraits >
template<class LocalAssemblerI >
void Dumux::StokesDarcyCouplingManager< MDTraits >::updateCouplingContext ( Dune::index_constant< darcyIdx domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< stokesCellCenterIdx domainJ,
const std::size_t  dofIdxGlobalJ,
const PrimaryVariables< stokesCellCenterIdx > &  priVars,
int  pvIdxJ 
)
inline

Update the coupling context for the Darcy residual w.r.t. the Stokes cell-center DOFs (DarcyToCC)

◆ updateCouplingContext() [3/6]

template<class MDTraits >
template<class LocalAssemblerI >
void Dumux::StokesDarcyCouplingManager< MDTraits >::updateCouplingContext ( Dune::index_constant< darcyIdx domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< stokesFaceIdx domainJ,
const std::size_t  dofIdxGlobalJ,
const PrimaryVariables< stokesFaceIdx > &  priVars,
int  pvIdxJ 
)
inline

Update the coupling context for the Darcy residual w.r.t. the Stokes face DOFs (DarcyToFace)

◆ updateCouplingContext() [4/6]

template<class MDTraits >
template<std::size_t i, class LocalAssemblerI , std::enable_if_t<(i==stokesCellCenterIdx||i==stokesFaceIdx), int > = 0>
void Dumux::StokesDarcyCouplingManager< MDTraits >::updateCouplingContext ( Dune::index_constant< i >  domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< darcyIdx domainJ,
const std::size_t  dofIdxGlobalJ,
const PrimaryVariables< darcyIdx > &  priVars,
int  pvIdxJ 
)
inline

Update the coupling context for the Stokes cc residual w.r.t. the Darcy DOFs (FaceToDarcy)

◆ updateCouplingContext() [5/6]

template<class MDTraits >
template<std::size_t i, std::size_t j, class LocalAssemblerI , class PriVarsJ >
void Dumux::StaggeredCouplingManager< MDTraits >::updateCouplingContext ( Dune::index_constant< i >  domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< j >  domainJ,
const std::size_t  dofIdxGlobalJ,
const PriVarsJ &  priVarsJ,
int  pvIdxJ 
)
inline

updates all data and variables that are necessary to evaluate the residual of the element of domain i this is called whenever one of the primary variables that the element residual depends on changes in domain j

Parameters
domainIthe domain index of domain i
localAssemblerIthe local assembler assembling the element residual of an element of domain i
domainJthe domain index of domain j
dofIdxGlobalJthe index of the degree of freedom of domain j whose solution changed
priVarsJthe new solution at the degree of freedom of domain j with index dofIdxGlobalJ
pvIdxJthe index of the primary variable of domain j which has been updated
Note
this concerns all data that is used in the evaluation of the element residual and depends on the primary variables at the degree of freedom location with index dofIdxGlobalJ
the element whose residual is to be evaluated can be retrieved from the local assembler as localAssemblerI.element()
per default, we udpate the solution vector, if the element residual of domain i depends on more than the primary variables of domain j update the other dependent data here by overloading this function

◆ updateCouplingContext() [6/6]

void Dumux::CouplingManager< MDTraits >::updateCouplingContext ( Dune::index_constant< i >  domainI,
const LocalAssemblerI &  localAssemblerI,
Dune::index_constant< j >  domainJ,
std::size_t  dofIdxGlobalJ,
const PrimaryVariables< j > &  priVarsJ,
int  pvIdxJ 
)
inlineinherited

updates all data and variables that are necessary to evaluate the residual of the element of domain i this is called whenever one of the primary variables that the element residual depends on changes in domain j

Parameters
domainIthe domain index of domain i
localAssemblerIthe local assembler assembling the element residual of an element of domain i
domainJthe domain index of domain j
dofIdxGlobalJthe index of the degree of freedom of domain j whose solution changed
priVarsJthe new solution at the degree of freedom of domain j with index dofIdxGlobalJ
pvIdxJthe index of the primary variable of domain j which has been updated
Note
this concerns all data that is used in the evaluation of the element residual and depends on the primary variables at the degree of freedom location with index dofIdxGlobalJ
the element whose residual is to be evaluated can be retrieved from the local assembler as localAssemblerI.element()
per default, we udpate the solution vector, if the element residual of domain i depends on more than the primary variables of domain j update the other dependent data here by overloading this function

◆ updateSolution()

void Dumux::CouplingManager< MDTraits >::updateSolution ( const SolutionVector curSol)
inlineinherited

Updates the entire solution vector, e.g. before assembly or after grid adaption Overload might want to overload function if the solution vector is stored outside this class to make sure updates don't happen more than once.

Member Data Documentation

◆ cellCenterIdx

template<class MDTraits >
constexpr auto Dumux::StaggeredCouplingManager< MDTraits >::cellCenterIdx = GridGeometry<0>::cellCenterIdx()
staticconstexprinherited

◆ darcyIdx

template<class MDTraits >
constexpr auto Dumux::StokesDarcyCouplingManager< MDTraits >::darcyIdx = typename MDTraits::template SubDomain<2>::Index()
staticconstexpr

◆ faceIdx

template<class MDTraits >
constexpr auto Dumux::StaggeredCouplingManager< MDTraits >::faceIdx = GridGeometry<0>::faceIdx()
staticconstexprinherited

◆ stokesCellCenterIdx

template<class MDTraits >
constexpr auto Dumux::StokesDarcyCouplingManager< MDTraits >::stokesCellCenterIdx = typename MDTraits::template SubDomain<1>::Index()
staticconstexpr

◆ stokesFaceIdx

template<class MDTraits >
constexpr auto Dumux::StokesDarcyCouplingManager< MDTraits >::stokesFaceIdx = typename MDTraits::template SubDomain<0>::Index()
staticconstexpr

◆ stokesIdx

template<class MDTraits >
constexpr auto Dumux::StokesDarcyCouplingManager< MDTraits >::stokesIdx = stokesFaceIdx
staticconstexpr

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