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>
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.
MDTraits | The multidomain traits containing the types on all sub-domains |
CouplingMapper | Class containing maps on the coupling between dofs of different grids |
bulkDomainId | The domain id of the bulk problem |
lowDimDomainId | The 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 ¶mGroup) 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... | |
SolutionVector & | curSol () |
the solution vector of the coupled problem More... | |
const SolutionVector & | curSol () const |
the solution vector of the coupled problem More... | |
|
inherited |
types used for coupling stencils
using Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::ccmpfa >::SolutionVector = typename MDTraits::SolutionVector |
the type of the solution vector
|
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.
|
inlineinherited |
prepares all data and variables that are necessary to evaluate the residual of the element of domain i
domainI | the domain index of domain i |
elementI | the element whose residual we are assemling next |
assembler | the multidomain assembler for access to all data necessary for the assembly of all domains |
|
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.
|
inlineprotectedinherited |
Return references to the bulk coupling contexts.
|
inlineprotectedinherited |
Return const references to the bulk coupling contexts.
|
inlineinherited |
The coupling stencil of a given bulk domain element.
|
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
domainI | the domain index of domain i |
elementI | the coupled element of domain í |
domainJ | the domain index of domain j |
|
inlineinherited |
The coupling stencil of the lower-dimensional domain with the bulk domain.
|
inlineprotectedinherited |
the solution vector of the coupled problem
|
inlineprotectedinherited |
the solution vector of the coupled problem
|
inline |
The bulk domain has no additional derivatives.
|
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)
|
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)
|
inlineprotectedinherited |
evaluates the bulk-facet exchange fluxes for a given facet element
|
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.
|
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
domainI | the domain index of domain i |
localAssemblerI | the local assembler assembling the element residual of an element of domain i |
domainJ | the domain index of domain j |
dofIdxGlobalJ | the index of the degree of freedom of domain j which has an influence on the element residual of domain i |
|
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.
|
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.
|
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.
|
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.
|
inline |
Computes the sources in a lower-dimensional sub-control volume stemming from the bulk domain.
|
inline |
The bulk domain has no extended jacobian pattern.
|
inlineinherited |
extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern
|
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.
|
inlineinherited |
Empty stencil to be returned for elements that aren't coupled.
|
inlineinherited |
returns the lower-dimensional element coinciding with a bulk scvf.
|
inlineinherited |
returns the index of the lower-dimensional element coinciding with a bulk scvf.
|
inlineinherited |
returns the vol vars of a lower-dimensional element coinciding with a bulk scvf.
|
inline |
Initialize the coupling manager.
bulkProblem | The problem to be solved on the bulk domain |
lowDimProblem | The problem to be solved on the lower-dimensional domain |
couplingMapper | The mapper object containing the connectivity between the domains |
curSol | The current solution |
|
inlineinherited |
returns true if a bulk scvf flux depends on data in the facet domain.
|
inline |
returns true if a bulk scvf coincides with a facet element.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
|
inlineinherited |
return the numeric epsilon used for deflecting primary variables of coupled domain i
|
inlineinherited |
Return a reference to the sub problem.
domainIdx | The domain index |
|
inlineinherited |
set a pointer to one of the sub problems
problem | a pointer to the sub problem |
domainIdx | the domain index of the sub problem |
|
inlineinherited |
set the pointers to the sub problems
problems | A tuple of shared pointers to the sub problems |
|
inlineinherited |
Update the transmissibilities in the bulk domain after the coupling context changed.
|
inlineinherited |
Update the transmissibilities in the bulk domain after the coupling context changed.
|
inlineinherited |
update variables of domain i that depend on variables in domain j after the coupling context has been updated
domainI | the index of domain i |
localAssemblerI | the local assembler assembling the element residual of an element of domain i |
elemVolVars | the element volume variables (all volume variables in the element local stencil) to be updated |
elemFluxVarsCache | the element flux variable cache (all flux variables in the element local stencil) to be updated |
|
inlineinherited |
Update the coupling context for a derivative bulk -> bulk. Here, we simply have to update the solution.
|
inlineinherited |
After deflecting the solution of the lower-dimensional domain, we have to update the element volume variables object if the context.
|
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
domainI | the domain index of domain i |
localAssemblerI | the local assembler assembling the element residual of an element of domain i |
domainJ | the domain index of domain j |
dofIdxGlobalJ | the index of the degree of freedom of domain j whose solution changed |
priVarsJ | the new solution at the degree of freedom of domain j with index dofIdxGlobalJ |
pvIdxJ | the index of the primary variable of domain j which has been updated |
|
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.
|
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.
|
inlineinherited |
Updates the entire solution vector, e.g. before assembly or after grid adaption.