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 box scheme in the bulk domain. More...
#include <dumux/multidomain/facet/box/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 box scheme in the bulk domain.
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 | |
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 coincide with the lower-dimensional element whose dof idx is 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 element that coincide with the given element. 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 of the neighboring bulk elements 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<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... | |
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. 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 ¶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... | |
using Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::box >::CouplingStencilType = typename CouplingMapper::template Stencil< CouplingMapper::template gridId<GridView<j>::dimension>() > |
types used for coupling stencils
using Dumux::FacetCouplingManager< MDTraits, CouplingMapper, bulkDomainId, lowDimDomainId, DiscretizationMethod::box >::SolutionVector = typename MDTraits::SolutionVector |
the type of the solution vector
|
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.
|
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 |
|
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.
|
inline |
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 |
|
inline |
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
|
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 |
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 coincide with the lower-dimensional element whose dof idx is 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 element that coincide with the given element.
|
inline |
Computes the sources in a lower-dimensional element stemming from the bulk domain.
|
inlineinherited |
extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern
|
inline |
Empty stencil to be returned for elements that aren't coupled.
|
inline |
returns the lower-dimensional element coinciding with a bulk scvf.
|
inline |
returns the index of the lower-dimensional element coinciding with a bulk scvf.
|
inline |
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 |
|
inline |
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.
|
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 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 |
|
inline |
Update the coupling context for a derivative bulk -> bulk. Here, we simply have to update the solution.
|
inline |
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 |
|
inline |
After deflecting the solution of the bulk domain, we have to update the element volume variables of the neighboring bulk elements stored in the context.
|
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.
|
inlineinherited |
Updates the entire solution vector, e.g. before assembly or after grid adaption.