3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
Public Types | Public Member Functions | Protected Member Functions | List of all members
Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa > 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 mpfa scheme. More...

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

Inheritance diagram for Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >:
Inheritance graph

Description

template<class MDTraits, class CouplingMapper, std::size_t bulkDomainId, std::size_t lowDimDomainId>
class Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >

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

using SolutionVector = typename MDTraits::SolutionVector
 the type of the solution vector More...
 
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...
 

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...
 
bool isOnInteriorBoundary (const Element< bulkId > &element, const SubControlVolumeFace< bulkId > &scvf) const
 returns true if a bulk scvf coincides with a facet element. 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. 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 sub-control volume stemming from the bulk domain. More...
 
template<class JacobianPattern >
void extendJacobianPattern (LowDimIdType, JacobianPattern &pattern) const
 Extend the jacobian pattern of the diagonal block of the lowdim domain by the elements that are in the coupling stencil of the neighboring bulk elements. More...
 
template<class JacobianPattern >
void extendJacobianPattern (BulkIdType, JacobianPattern &pattern) const
 The bulk domain has no extended jacobian pattern. More...
 
template<class LowDimLocalAssembler , class JacobianMatrixDiagBlock , class GridVariables >
void evalAdditionalDomainDerivatives (LowDimIdType, const LowDimLocalAssembler &lowDimLocalAssembler, const typename LowDimLocalAssembler::LocalResidual::ElementResidualVector &, JacobianMatrixDiagBlock &A, GridVariables &gridVariables)
 evaluate additional derivatives of the element residual of the low-dim domain with respect to dofs in the same domain that are not in the regular stencil (see extendJacobianPattern) More...
 
template<class LocalAssemblerI , class JacobianMatrixDiagBlock , class GridVariables >
void evalAdditionalDomainDerivatives (BulkIdType, const LocalAssemblerI &localAssemblerI, const typename LocalAssemblerI::LocalResidual::ElementResidualVector &origResiduals, JacobianMatrixDiagBlock &A, GridVariables &gridVariables)
 The bulk domain has no additional derivatives. 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...
 
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...
 
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 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 Member Functions

const BulkCouplingContext & bulkCouplingContext () const
 Return const references to the bulk coupling contexts. More...
 
BulkCouplingContext & bulkCouplingContext ()
 Return references to the bulk coupling contexts. More...
 
const LowDimCouplingContext & lowDimCouplingContext () const
 
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

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 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. 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...
 
SolutionVectorcurSol ()
 the solution vector of the coupled problem More...
 
const SolutionVectorcurSol () 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, DiscretizationMethod::cctpfa >::CouplingStencilType = typename CouplingMapper::template Stencil< CouplingMapper::template gridId<GridView<j>::dimension>() >
inherited

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, DiscretizationMethod::ccmpfa >::SolutionVector = typename MDTraits::SolutionVector

the type of the solution vector

Member Function Documentation

◆ 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, DiscretizationMethod::cctpfa >::bindCouplingContext ( BulkIdType  ,
const Element< bulkId > &  element,
const Assembler &  assembler 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::bindCouplingContext ( LowDimIdType  ,
const Element< lowDimId > &  element,
const Assembler &  assembler 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::bulkCouplingContext ( )
inlineprotectedinherited

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, DiscretizationMethod::cctpfa >::bulkCouplingContext ( ) const
inlineprotectedinherited

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, DiscretizationMethod::cctpfa >::couplingStencil ( BulkIdType  domainI,
const Element< bulkId > &  element,
LowDimIdType  domainJ 
) const
inlineinherited

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, DiscretizationMethod::cctpfa >::couplingStencil ( LowDimIdType  domainI,
const Element< lowDimId > &  element,
BulkIdType  domainJ 
) const
inlineinherited

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

◆ curSol() [1/2]

SolutionVector & 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

◆ curSol() [2/2]

const SolutionVector & 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

◆ evalAdditionalDomainDerivatives() [1/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class LocalAssemblerI , class JacobianMatrixDiagBlock , class GridVariables >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >::evalAdditionalDomainDerivatives ( BulkIdType  ,
const LocalAssemblerI &  localAssemblerI,
const typename LocalAssemblerI::LocalResidual::ElementResidualVector &  origResiduals,
JacobianMatrixDiagBlock &  A,
GridVariables &  gridVariables 
)
inline

The bulk domain has no additional derivatives.

◆ evalAdditionalDomainDerivatives() [2/3]

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

◆ evalAdditionalDomainDerivatives() [3/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class LowDimLocalAssembler , class JacobianMatrixDiagBlock , class GridVariables >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >::evalAdditionalDomainDerivatives ( LowDimIdType  ,
const LowDimLocalAssembler &  lowDimLocalAssembler,
const typename LowDimLocalAssembler::LocalResidual::ElementResidualVector &  ,
JacobianMatrixDiagBlock &  A,
GridVariables &  gridVariables 
)
inline

evaluate additional derivatives of the element residual of the low-dim domain with respect to dofs in the same domain that are not in the regular stencil (see extendJacobianPattern)

Note
Here, this is the change of the source term with respect to changes in the variables of the other elements in the coupling stencil of the neighboring bulk elements.

◆ 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, DiscretizationMethod::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
inlineprotectedinherited

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

◆ evalCouplingResidual() [1/6]

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, DiscretizationMethod::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/6]

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

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, DiscretizationMethod::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/6]

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, DiscretizationMethod::ccmpfa >::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() [5/6]

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, DiscretizationMethod::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.

◆ evalCouplingResidual() [6/6]

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, DiscretizationMethod::ccmpfa >::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.

Note
The coupling residual is independent of w.r.t. which bulk dof it is computed

◆ evalSourcesFromBulk()

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
NumEqVector< lowDimId > Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >::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 sub-control volume stemming from the bulk domain.

◆ extendJacobianPattern() [1/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class JacobianPattern >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >::extendJacobianPattern ( BulkIdType  ,
JacobianPattern &  pattern 
) const
inline

The bulk domain has no extended jacobian pattern.

◆ extendJacobianPattern() [2/3]

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

◆ extendJacobianPattern() [3/3]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
template<class JacobianPattern >
void Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >::extendJacobianPattern ( LowDimIdType  ,
JacobianPattern &  pattern 
) const
inline

Extend the jacobian pattern of the diagonal block of the lowdim domain by the elements that are in the coupling stencil of the neighboring bulk elements.

◆ 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, DiscretizationMethod::cctpfa >::getEmptyStencil ( Dune::index_constant< id >  ) const
inlineinherited

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, DiscretizationMethod::cctpfa >::getLowDimElement ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inlineinherited

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, DiscretizationMethod::cctpfa >::getLowDimElementIndex ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inlineinherited

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, DiscretizationMethod::cctpfa >::getLowDimVolVars ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inlineinherited

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, DiscretizationMethod::ccmpfa >::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, DiscretizationMethod::cctpfa >::isCoupled ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inlineinherited

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, DiscretizationMethod::ccmpfa >::isOnInteriorBoundary ( const Element< bulkId > &  element,
const SubControlVolumeFace< bulkId > &  scvf 
) const
inline

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

◆ lowDimCouplingContext() [1/2]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
LowDimCouplingContext & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::cctpfa >::lowDimCouplingContext ( )
inlineprotectedinherited

◆ lowDimCouplingContext() [2/2]

template<class MDTraits , class CouplingMapper , std::size_t bulkDomainId, std::size_t lowDimDomainId>
const LowDimCouplingContext & Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::cctpfa >::lowDimCouplingContext ( ) const
inlineprotectedinherited

◆ 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

◆ 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, DiscretizationMethod::cctpfa >::updateCoupledVariables ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
ElementVolumeVariables< bulkId > &  elemVolVars,
UpdatableFluxVarCache &  fluxVarsCache 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::updateCoupledVariables ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
GridVolumeVariables< bulkId > &  gridVolVars,
UpdatableFluxVarCache &  fluxVarsCache 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::updateCouplingContext ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
BulkIdType  domainJ,
GridIndexType< bulkId >  dofIdxGlobalJ,
const PrimaryVariables< bulkId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::updateCouplingContext ( BulkIdType  domainI,
const BulkLocalAssembler &  bulkLocalAssembler,
LowDimIdType  domainJ,
GridIndexType< lowDimId >  dofIdxGlobalJ,
const PrimaryVariables< lowDimId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::updateCouplingContext ( LowDimIdType  domainI,
const LowDimLocalAssembler &  lowDimLocalAssembler,
BulkIdType  domainJ,
GridIndexType< bulkId >  dofIdxGlobalJ,
const PrimaryVariables< bulkId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inlineinherited

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, DiscretizationMethod::cctpfa >::updateCouplingContext ( LowDimIdType  domainI,
const LowDimLocalAssembler &  lowDimLocalAssembler,
LowDimIdType  domainJ,
GridIndexType< lowDimId >  dofIdxGlobalJ,
const PrimaryVariables< lowDimId > &  priVarsJ,
unsigned int  pvIdxJ 
)
inlineinherited

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.


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