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

Manages the coupling between bulk elements and lower dimensional elements where the coupling occurs across the facets of the bulk grid. This implementation is to be used in conjunction with models using the cell-centered tpfa scheme. More...

#include <dumux/multidomain/facet/cellcentered/tpfa/couplingmanager.hh>

Inheritance diagram for Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >:

Description

template<class MDTraits, class CouplingMapper, std::size_t bulkDomainId, std::size_t lowDimDomainId>
class Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >

Manages the coupling between bulk elements and lower dimensional elements where the coupling occurs across the facets of the bulk grid. This implementation is to be used in conjunction with models using the cell-centered tpfa scheme.

Template Parameters
MDTraitsThe multidomain traits containing the types on all sub-domains
CouplingMapperClass containing maps on the coupling between dofs of different grids
bulkDomainIdThe domain id of the bulk problem
lowDimDomainIdThe domain id of the lower-dimensional problem

Public Types

template<std::size_t i, std::size_t j = (i == bulkId) ? lowDimId : bulkId>
using CouplingStencilType = typename CouplingMapper::template Stencil< CouplingMapper::template gridId< GridView< j >::dimension >() >
 types used for coupling stencils More...
 
using SolutionVector = typename MDTraits::SolutionVector
 the type of the solution vector More...
 

Public Member Functions

void init (std::shared_ptr< Problem< bulkId > > bulkProblem, std::shared_ptr< Problem< lowDimId > > lowDimProblem, std::shared_ptr< CouplingMapper > couplingMapper, const SolutionVector &curSol)
 Initialize the coupling manager. More...
 
const CouplingStencilType< bulkId > & couplingStencil (BulkIdType domainI, const Element< bulkId > &element, LowDimIdType domainJ) const
 The coupling stencil of a given bulk domain element. More...
 
const CouplingStencilType< lowDimId > & couplingStencil (LowDimIdType domainI, const Element< lowDimId > &element, BulkIdType domainJ) const
 The coupling stencil of the lower-dimensional domain with the bulk domain. More...
 
bool isCoupled (const Element< bulkId > &element, const SubControlVolumeFace< bulkId > &scvf) const
 returns true if a bulk scvf flux depends on data in the facet domain. More...
 
bool isOnInteriorBoundary (const Element< bulkId > &element, const SubControlVolumeFace< bulkId > &scvf) const
 returns true if a bulk scvf coincides with a facet element. More...
 
const VolumeVariables< lowDimId > & getLowDimVolVars (const Element< bulkId > &element, const SubControlVolumeFace< bulkId > &scvf) const
 returns the vol vars of a lower-dimensional element coinciding with a bulk scvf. More...
 
const Element< lowDimId > getLowDimElement (const Element< bulkId > &element, const SubControlVolumeFace< bulkId > &scvf) const
 returns the lower-dimensional element coinciding with a bulk scvf. More...
 
const GridIndexType< lowDimId > getLowDimElementIndex (const Element< bulkId > &element, const SubControlVolumeFace< bulkId > &scvf) const
 returns the index of the lower-dimensional element coinciding with a bulk scvf. More...
 
template<class BulkLocalAssembler >
LocalResidual< bulkId >::ElementResidualVector evalCouplingResidual (BulkIdType, const BulkLocalAssembler &bulkLocalAssembler, LowDimIdType, GridIndexType< lowDimId > dofIdxGlobalJ)
 Evaluates the coupling element residual of a bulk domain element with respect to a dof in the lower-dimensional domain (dofIdxGlobalJ). This is essentially the fluxes across the bulk element facets that depend on dofIdxGlobalJ. More...
 
template<class LowDimLocalAssembler >
LocalResidual< lowDimId >::ElementResidualVector evalCouplingResidual (LowDimIdType, const LowDimLocalAssembler &lowDimLocalAssembler, BulkIdType, GridIndexType< bulkId > dofIdxGlobalJ)
 Evaluates the coupling element residual of a lower-dimensional domain element with respect to a dof in the bulk domain (dofIdxGlobalJ). This is essentially the fluxes across the facets of the neighboring bulk elements that coincide with the given element. More...
 
template<class LowDimLocalAssembler >
LocalResidual< lowDimId >::ElementResidualVector evalCouplingResidual (LowDimIdType, const LowDimLocalAssembler &lowDimLocalAssembler, BulkIdType)
 Evaluates the coupling element residual of a lower-dimensional domain element with respect to a dof in the bulk domain (dofIdxGlobalJ). This is essentially the fluxes across the facets of the neighboring bulk elements. More...
 
NumEqVector< lowDimId > evalSourcesFromBulk (const Element< lowDimId > &element, const FVElementGeometry< lowDimId > &fvGeometry, const ElementVolumeVariables< lowDimId > &elemVolVars, const SubControlVolume< lowDimId > &scv)
 Computes the sources in a lower-dimensional element stemming from the bulk domain. More...
 
template<class Assembler >
void bindCouplingContext (BulkIdType, const Element< bulkId > &element, const Assembler &assembler)
 For the assembly of the element residual of a bulk domain element we need to prepare all variables of lower-dimensional domain elements that are coupled to the given bulk element. More...
 
template<class Assembler >
void bindCouplingContext (LowDimIdType, const Element< lowDimId > &element, const Assembler &assembler)
 For the assembly of the element residual of a bulk domain element we need to prepare the local views of one of the neighboring bulk domain elements. These are used later to compute the fluxes across the faces over which the coupling occurs. More...
 
template<class BulkLocalAssembler >
void updateCouplingContext (BulkIdType domainI, const BulkLocalAssembler &bulkLocalAssembler, LowDimIdType domainJ, GridIndexType< lowDimId > dofIdxGlobalJ, const PrimaryVariables< lowDimId > &priVarsJ, unsigned int pvIdxJ)
 After deflecting the solution of the lower-dimensional domain, we have to update the element volume variables object if the context. More...
 
template<class BulkLocalAssembler >
void updateCouplingContext (BulkIdType domainI, const BulkLocalAssembler &bulkLocalAssembler, BulkIdType domainJ, GridIndexType< bulkId > dofIdxGlobalJ, const PrimaryVariables< bulkId > &priVarsJ, unsigned int pvIdxJ)
 Update the coupling context for a derivative bulk -> bulk. Here, we simply have to update the solution. More...
 
template<class LowDimLocalAssembler >
void updateCouplingContext (LowDimIdType domainI, const LowDimLocalAssembler &lowDimLocalAssembler, BulkIdType domainJ, GridIndexType< bulkId > dofIdxGlobalJ, const PrimaryVariables< bulkId > &priVarsJ, unsigned int pvIdxJ)
 After deflecting the solution of the bulk domain, we have to update the element volume variables and transmissibilities of the neighboring bulk element stored in the context. More...
 
template<class LowDimLocalAssembler >
void updateCouplingContext (LowDimIdType domainI, const LowDimLocalAssembler &lowDimLocalAssembler, LowDimIdType domainJ, GridIndexType< lowDimId > dofIdxGlobalJ, const PrimaryVariables< lowDimId > &priVarsJ, unsigned int pvIdxJ)
 After deflecting the solution of the lower-dimensional domain has been deflected during the assembly of the element residual of a lower-dimensional element, we have to communicate this to the volume variables stored in the context as well as the transmissibilities. More...
 
template<class BulkLocalAssembler , class UpdatableFluxVarCache >
void updateCoupledVariables (BulkIdType domainI, const BulkLocalAssembler &bulkLocalAssembler, ElementVolumeVariables< bulkId > &elemVolVars, UpdatableFluxVarCache &fluxVarsCache)
 Update the transmissibilities in the bulk domain after the coupling context changed. More...
 
template<class BulkLocalAssembler , class UpdatableFluxVarCache >
void updateCoupledVariables (BulkIdType domainI, const BulkLocalAssembler &bulkLocalAssembler, GridVolumeVariables< bulkId > &gridVolVars, UpdatableFluxVarCache &fluxVarsCache)
 Update the transmissibilities in the bulk domain after the coupling context changed. More...
 
template<std::size_t id, std::enable_if_t<(id==bulkId||id==lowDimId), int > = 0>
const CouplingMapper::template Stencil< id > & getEmptyStencil (Dune::index_constant< id >) const
 Empty stencil to be returned for elements that aren't coupled. More...
 
member functions concerning the coupling stencils
const CouplingStencilType< i, j > & couplingStencil (Dune::index_constant< i > domainI, const Element< i > &elementI, 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 element residual of the given element of domain i More...
 
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...
 

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

const BulkCouplingContext & bulkCouplingContext () const
 Return const references to the bulk coupling contexts. More...
 
const LowDimCouplingContext & lowDimCouplingContext () const
 
BulkCouplingContext & bulkCouplingContext ()
 Return references to the bulk coupling contexts. More...
 
LowDimCouplingContext & lowDimCouplingContext ()
 
template<class BulkScvfIndices >
NumEqVector< bulkId > evalBulkFluxes (const Element< bulkId > &elementI, const FVElementGeometry< bulkId > &fvGeometry, const ElementVolumeVariables< bulkId > &elemVolVars, const ElementFluxVariablesCache< bulkId > &elemFluxVarsCache, const LocalResidual< bulkId > &localResidual, const BulkScvfIndices &scvfIndices) const
 evaluates the bulk-facet exchange fluxes for a given facet element More...
 

member functions concerning variable caching for element residual evaluations

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 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...
 
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...
 
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 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...
 
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...
 
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

◆ CouplingStencilType

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<std::size_t i, std::size_t j = (i == bulkId) ? lowDimId : bulkId>
using Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::CouplingStencilType = typename CouplingMapper::template Stencil< CouplingMapper::template gridId<GridView<j>::dimension>() >

types used for coupling stencils

◆ SolutionVector

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
using Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::SolutionVector = typename MDTraits::SolutionVector

the type of the solution vector

◆ SolutionVectorStorage

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

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

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/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class Assembler >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::bindCouplingContext ( BulkIdType  ,
const Element< bulkId > &  element,
const Assembler &  assembler 
)
inline

For the assembly of the element residual of a bulk domain element we need to prepare all variables of lower-dimensional domain elements that are coupled to the given bulk element.

◆ bindCouplingContext() [2/3]

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() [3/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class Assembler >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::bindCouplingContext ( LowDimIdType  ,
const Element< lowDimId > &  element,
const Assembler &  assembler 
)
inline

For the assembly of the element residual of a bulk domain element we need to prepare the local views of one of the neighboring bulk domain elements. These are used later to compute the fluxes across the faces over which the coupling occurs.

Note
Since the low-dim coupling residua are fluxes stemming from the bulk domain, we have to prepare the bulk coupling context for the neighboring element (where fluxes are calculated) as well.

◆ bulkCouplingContext() [1/2]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
BulkCouplingContext & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::bulkCouplingContext ( )
inlineprotected

Return references to the bulk coupling contexts.

◆ bulkCouplingContext() [2/2]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const BulkCouplingContext & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::bulkCouplingContext ( ) const
inlineprotected

Return const references to the bulk coupling contexts.

◆ couplingStencil() [1/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const CouplingStencilType< bulkId > & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::couplingStencil ( BulkIdType  domainI,
const Element< bulkId > &  element,
LowDimIdType  domainJ 
) const
inline

The coupling stencil of a given bulk domain element.

◆ couplingStencil() [2/3]

const CouplingStencilType< i, j > & Dumux::CouplingManager< MDTraits >::couplingStencil ( Dune::index_constant< i >  domainI,
const Element< i > &  elementI,
Dune::index_constant< j >  domainJ 
) const
inlineinherited

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
The element residual definition depends on the discretization scheme of domain i box: a container of the residuals of all sub control volumes cc : the residual of the (sub) control volume fem: the residual of the element
This function has to be implemented by all coupling managers for all combinations of i and j

◆ couplingStencil() [3/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const CouplingStencilType< lowDimId > & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::couplingStencil ( LowDimIdType  domainI,
const Element< lowDimId > &  element,
BulkIdType  domainJ 
) const
inline

The coupling stencil of the lower-dimensional domain with the bulk domain.

◆ 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

◆ 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

◆ evalBulkFluxes()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class BulkScvfIndices >
NumEqVector< bulkId > Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::evalBulkFluxes ( const Element< bulkId > &  elementI,
const FVElementGeometry< bulkId > &  fvGeometry,
const ElementVolumeVariables< bulkId > &  elemVolVars,
const ElementFluxVariablesCache< bulkId > &  elemFluxVarsCache,
const LocalResidual< bulkId > &  localResidual,
const BulkScvfIndices &  scvfIndices 
) const
inlineprotected

evaluates the bulk-facet exchange fluxes for a given facet element

◆ evalCouplingResidual() [1/4]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class BulkLocalAssembler >
LocalResidual< bulkId >::ElementResidualVector Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::evalCouplingResidual ( BulkIdType  ,
const BulkLocalAssembler &  bulkLocalAssembler,
LowDimIdType  ,
GridIndexType< lowDimId >  dofIdxGlobalJ 
)
inline

Evaluates the coupling element residual of a bulk domain element with respect to a dof in the lower-dimensional domain (dofIdxGlobalJ). This is essentially the fluxes across the bulk element facets that depend on dofIdxGlobalJ.

◆ evalCouplingResidual() [2/4]

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

◆ evalCouplingResidual() [3/4]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class LowDimLocalAssembler >
LocalResidual< lowDimId >::ElementResidualVector Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::evalCouplingResidual ( LowDimIdType  ,
const LowDimLocalAssembler &  lowDimLocalAssembler,
BulkIdType   
)
inline

Evaluates the coupling element residual of a lower-dimensional domain element with respect to a dof in the bulk domain (dofIdxGlobalJ). This is essentially the fluxes across the facets of the neighboring bulk elements.

◆ evalCouplingResidual() [4/4]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class LowDimLocalAssembler >
LocalResidual< lowDimId >::ElementResidualVector Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::evalCouplingResidual ( LowDimIdType  ,
const LowDimLocalAssembler &  lowDimLocalAssembler,
BulkIdType  ,
GridIndexType< bulkId >  dofIdxGlobalJ 
)
inline

Evaluates the coupling element residual of a lower-dimensional domain element with respect to a dof in the bulk domain (dofIdxGlobalJ). This is essentially the fluxes across the facets of the neighboring bulk elements that coincide with the given element.

Note
The coupling residual in this case is always the entire transfer flux from bulk to the lowDim domain. It is therefore independent of the given dof index in the bulk domain, which is why we directly forward to the index-independent function.

◆ evalSourcesFromBulk()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
NumEqVector< lowDimId > Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::evalSourcesFromBulk ( const Element< lowDimId > &  element,
const FVElementGeometry< lowDimId > &  fvGeometry,
const ElementVolumeVariables< lowDimId > &  elemVolVars,
const SubControlVolume< lowDimId > &  scv 
)
inline

Computes the sources in a lower-dimensional element stemming from the bulk domain.

◆ 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

◆ getEmptyStencil()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<std::size_t id, std::enable_if_t<(id==bulkId||id==lowDimId), int > = 0>
const CouplingMapper::template Stencil< id > & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::getEmptyStencil ( Dune::index_constant< id >  ) const
inline

Empty stencil to be returned for elements that aren't coupled.

◆ getLowDimElement()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const Element< lowDimId > Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::getLowDimElement ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inline

returns the lower-dimensional element coinciding with a bulk scvf.

◆ getLowDimElementIndex()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const GridIndexType< lowDimId > Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::getLowDimElementIndex ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inline

returns the index of the lower-dimensional element coinciding with a bulk scvf.

◆ getLowDimVolVars()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const VolumeVariables< lowDimId > & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::getLowDimVolVars ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inline

returns the vol vars of a lower-dimensional element coinciding with a bulk scvf.

◆ init()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::init ( std::shared_ptr< Problem< bulkId > >  bulkProblem,
std::shared_ptr< Problem< lowDimId > >  lowDimProblem,
std::shared_ptr< CouplingMapper >  couplingMapper,
const SolutionVector curSol 
)
inline

Initialize the coupling manager.

Parameters
bulkProblemThe problem to be solved on the bulk domain
lowDimProblemThe problem to be solved on the lower-dimensional domain
couplingMapperThe mapper object containing the connectivity between the domains
curSolThe current solution

◆ isCoupled()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
bool Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::isCoupled ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inline

returns true if a bulk scvf flux depends on data in the facet domain.

◆ isOnInteriorBoundary()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
bool Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::isOnInteriorBoundary ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inline

returns true if a bulk scvf coincides with a facet element.

Note
for tpfa, this is always true for coupled scvfs

◆ lowDimCouplingContext() [1/2]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
LowDimCouplingContext & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::lowDimCouplingContext ( )
inlineprotected

◆ lowDimCouplingContext() [2/2]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const LowDimCouplingContext & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::lowDimCouplingContext ( ) const
inlineprotected

◆ numericEpsilon()

decltype(auto) Dumux::CouplingManager< 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

◆ 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

◆ 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

◆ updateCoupledVariables() [1/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class BulkLocalAssembler , class UpdatableFluxVarCache >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::updateCoupledVariables ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
ElementVolumeVariables< bulkId > &  elemVolVars,
UpdatableFluxVarCache &  fluxVarsCache 
)
inline

Update the transmissibilities in the bulk domain after the coupling context changed.

Note
Specialization of the function for deactivated grid-wide volume variables caching

◆ updateCoupledVariables() [2/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class BulkLocalAssembler , class UpdatableFluxVarCache >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::updateCoupledVariables ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
GridVolumeVariables< bulkId > &  gridVolVars,
UpdatableFluxVarCache &  fluxVarsCache 
)
inline

Update the transmissibilities in the bulk domain after the coupling context changed.

Note
Specialization of the function for enabled grid-wide volume variables caching

◆ updateCoupledVariables() [3/3]

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/5]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class BulkLocalAssembler >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::updateCouplingContext ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
BulkIdType  domainJ,
GridIndexType< bulkId >  dofIdxGlobalJ,
const PrimaryVariables< bulkId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inline

Update the coupling context for a derivative bulk -> bulk. Here, we simply have to update the solution.

◆ updateCouplingContext() [2/5]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class BulkLocalAssembler >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::updateCouplingContext ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
LowDimIdType  domainJ,
GridIndexType< lowDimId >  dofIdxGlobalJ,
const PrimaryVariables< lowDimId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inline

After deflecting the solution of the lower-dimensional domain, we have to update the element volume variables object if the context.

◆ updateCouplingContext() [3/5]

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

◆ updateCouplingContext() [4/5]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class LowDimLocalAssembler >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::updateCouplingContext ( LowDimIdType  domainI,
const LowDimLocalAssembler &  lowDimLocalAssembler,
BulkIdType  domainJ,
GridIndexType< bulkId >  dofIdxGlobalJ,
const PrimaryVariables< bulkId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inline

After deflecting the solution of the bulk domain, we have to update the element volume variables and transmissibilities of the neighboring bulk element stored in the context.

◆ updateCouplingContext() [5/5]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class LowDimLocalAssembler >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethods::CCTpfa >::updateCouplingContext ( LowDimIdType  domainI,
const LowDimLocalAssembler &  lowDimLocalAssembler,
LowDimIdType  domainJ,
GridIndexType< lowDimId >  dofIdxGlobalJ,
const PrimaryVariables< lowDimId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inline

After deflecting the solution of the lower-dimensional domain has been deflected during the assembly of the element residual of a lower-dimensional element, we have to communicate this to the volume variables stored in the context as well as the transmissibilities.

◆ 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.


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