Manages the coupling between bulk elements and lower dimensional elements Point sources on each integration point are computed by an AABB tree. More...
#include <dumux/multidomain/embedded/couplingmanager1d3d_kernel.hh>
Manages the coupling between bulk elements and lower dimensional elements Point sources on each integration point are computed by an AABB tree.
Public Types | |
using | MultiDomainTraits = MDTraits |
export traits More... | |
using | PointSourceTraits = DefaultPointSourceTraits< MDTraits > |
export the point source traits More... | |
using | CouplingStencils = std::unordered_map< GridIndex< id >, CouplingStencil< id > > |
export stencil types More... | |
using | CouplingStencilType = std::vector< std::size_t > |
default type used for coupling element stencils More... | |
Public Member Functions | |
void | init (std::shared_ptr< Problem< bulkIdx > > bulkProblem, std::shared_ptr< Problem< lowDimIdx > > lowDimProblem, const SolutionVector &curSol) |
template<std::size_t id, class JacobianPattern > | |
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... | |
template<std::size_t i, class LocalAssemblerI , class JacobianMatrixDiagBlock , class GridVariables > | |
void | evalAdditionalDomainDerivatives (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, const typename LocalAssemblerI::LocalResidual::ElementResidualVector &, 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 (per default this is not the case) More... | |
void | computePointSourceData (std::size_t order=1, bool verbose=false) |
void | computeLowDimVolumeFractions () |
Compute the low dim volume fraction in the bulk domain cells. More... | |
Scalar | radius (std::size_t id) const |
Methods to be accessed by the subproblems. More... | |
Scalar | lowDimVolume (const Element< bulkIdx > &element) const |
The volume the lower dimensional domain occupies in the bulk domain element. More... | |
Scalar | lowDimVolumeFraction (const Element< bulkIdx > &element) const |
The volume fraction the lower dimensional domain occupies in the bulk domain element. More... | |
const std::vector< std::size_t > & | bulkSourceIds (GridIndex< bulkIdx > eIdx, int scvIdx=0) const |
return all source ids for a bulk elements More... | |
const std::vector< Scalar > & | bulkSourceWeights (GridIndex< bulkIdx > eIdx, int scvIdx=0) const |
return all source ids for a bulk elements More... | |
Scalar | fluxScalingFactor (std::size_t id) const |
The flux scaling factor for a source with id. More... | |
const ParentType::template CouplingStencils< bulkIdx >::mapped_type & | extendedSourceStencil (std::size_t eIdx) const |
Extended source stencil (for the bulk domain) More... | |
void | updateAfterGridAdaption (std::shared_ptr< const GridGeometry< bulkIdx > > bulkGridGeometry, std::shared_ptr< const GridGeometry< lowDimIdx > > lowDimGridGeometry) |
call this after grid adaption More... | |
void | init (std::shared_ptr< Problem< bulkIdx > > bulkProblem, std::shared_ptr< Problem< lowDimIdx > > lowDimProblem, const SolutionVector &curSol) |
Methods to be accessed by main. More... | |
const CouplingStencil< j > & | couplingStencil (Dune::index_constant< i > domainI, const Element< i > &element, Dune::index_constant< j > domainJ) const |
Methods to be accessed by the assembly. More... | |
decltype(auto) | evalCouplingResidual (Dune::index_constant< i > domainI, const LocalAssemblerI &localAssemblerI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ) |
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... | |
const PointSourceData & | pointSourceData (std::size_t id) const |
Methods to be accessed by the subproblems. More... | |
const std::vector< PointSourceData > & | pointSourceData () const |
Return reference to point source data vector member. More... | |
const GridView< id > & | gridView (Dune::index_constant< id > domainIdx) const |
Return a reference to the bulk problem. More... | |
PrimaryVariables< bulkIdx > | bulkPriVars (std::size_t id) const |
Return data for a bulk point source with the identifier id. More... | |
PrimaryVariables< lowDimIdx > | lowDimPriVars (std::size_t id) const |
Return data for a low dim point source with the identifier id. More... | |
Scalar | averageDistance (std::size_t id) const |
return the average distance to the coupled bulk cell center More... | |
const std::vector< PointSource< bulkIdx > > & | bulkPointSources () const |
Return reference to bulk point sources. More... | |
const std::vector< PointSource< lowDimIdx > > & | lowDimPointSources () const |
Return reference to low dim point sources. More... | |
const std::vector< PointSource< i > > & | pointSources (Dune::index_constant< i > dom) const |
Return the point source if domain i. More... | |
const CouplingStencils< i > & | couplingStencils (Dune::index_constant< i > dom) const |
Return reference to bulk coupling stencil member of domain i. More... | |
const CouplingStencil< i > & | emptyStencil (Dune::index_constant< i > dom) const |
Return a reference to an empty stencil. More... | |
auto & | curSol (Dune::index_constant< i > domainIdx) |
the solution vector of the subproblem More... | |
const auto & | curSol (Dune::index_constant< i > domainIdx) const |
the solution vector of the subproblem More... | |
void | computeColorsForAssembly () |
Compute colors for multithreaded assembly. More... | |
void | assembleMultithreaded (Dune::index_constant< i > domainId, AssembleElementFunc &&assembleElement) const |
Execute assembly kernel in parallel. More... | |
Static Public Attributes | |
static constexpr Embedded1d3dCouplingMode::Kernel | couplingMode {} |
Protected Types | |
using | SolutionVectorStorage = typename Traits::template TupleOfSharedPtr< SubSolutionVector > |
the type in which the solution vector is stored in the manager More... | |
Protected Member Functions | |
std::vector< PointSourceData > & | pointSourceData () |
Return reference to point source data vector member. More... | |
std::vector< PointSource< i > > & | pointSources (Dune::index_constant< i > dom) |
Return the point source if domain i. More... | |
CouplingStencils< i > & | couplingStencils (Dune::index_constant< i > dom) |
Return reference to bulk coupling stencil member of domain i. More... | |
void | precomputeVertexIndices (Dune::index_constant< id > domainIdx) |
computes the vertex indices per element for the box method More... | |
void | getShapeValues (Dune::index_constant< i > domainI, const FVGG &gridGeometry, const Geometry &geo, const GlobalPosition &globalPos, ShapeValues &shapeValues) |
compute the shape function for a given point and geometry More... | |
void | clear () |
Clear all internal data members. More... | |
void | glueGrids () |
compute the intersections between the two grids More... | |
std::vector< Scalar > & | averageDistanceToBulkCell () |
Return reference to average distances to bulk cell. More... | |
std::vector< GridIndex< i > > & | vertexIndices (Dune::index_constant< i > dom, GridIndex< i > eIdx) |
Return a reference to the vertex indices. More... | |
std::vector< std::vector< GridIndex< i > > > & | vertexIndices (Dune::index_constant< i > dom) |
Return a reference to the vertex indices container. More... | |
const GlueType & | glue () const |
Embedded1d3dCouplingManager< MDTraits, Embedded1d3dCouplingMode::Kernel > & | asImp_ () |
Returns the implementation of the problem (i.e. static polymorphism) More... | |
const Embedded1d3dCouplingManager< MDTraits, Embedded1d3dCouplingMode::Kernel > & | asImp_ () const |
Returns the implementation of the problem (i.e. static polymorphism) More... | |
Protected Attributes | |
std::size_t | idCounter_ |
id generator for point sources 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 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) | 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... | |
void | attachSolution (SolutionVectorStorage &curSol) |
Attach a solution vector stored outside of this class. More... | |
|
inherited |
export stencil types
|
inherited |
default type used for coupling element stencils
|
inherited |
export traits
|
inherited |
export the point source traits
|
protectedinherited |
the type in which the solution vector is stored in the manager
|
inlineprotectedinherited |
Returns the implementation of the problem (i.e. static polymorphism)
|
inlineprotectedinherited |
Returns the implementation of the problem (i.e. static polymorphism)
|
inlineinherited |
Execute assembly kernel in parallel.
domainI | the domain index of domain i |
assembleElement | kernel function to execute for one element |
|
inlineprotectedinherited |
Attach a solution vector stored outside of this class.
|
inlineinherited |
return the average distance to the coupled bulk cell center
|
inlineprotectedinherited |
Return reference to average distances to bulk cell.
|
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 |
Return reference to bulk point sources.
|
inlineinherited |
Return data for a bulk point source with the identifier id.
|
inline |
return all source ids for a bulk elements
|
inline |
return all source ids for a bulk elements
|
inlineprotectedinherited |
Clear all internal data members.
|
inlineinherited |
Compute colors for multithreaded assembly.
|
inline |
Compute the low dim volume fraction in the bulk domain cells.
|
inline |
|
inlineinherited |
Methods to be accessed by the assembly.
returns an iterable 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 |
element | the coupled element of domain í |
domainJ | the domain index of domain j |
|
inlineprotectedinherited |
Return reference to bulk coupling stencil member of domain i.
|
inlineinherited |
Return reference to bulk coupling stencil member of domain i.
|
inlineinherited |
the solution vector of the subproblem
domainIdx | The domain index |
|
inlineinherited |
the solution vector of the subproblem
domainIdx | The domain index |
|
inlineinherited |
Return a reference to an empty stencil.
|
inline |
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 (per default this is not the case)
|
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 |
|
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 |
Extended source stencil (for the bulk domain)
|
inline |
extend the jacobian pattern of the diagonal block of domain i by those entries that are not already in the uncoupled pattern
|
inline |
The flux scaling factor for a source with id.
|
inlineprotectedinherited |
compute the shape function for a given point and geometry
|
inlineprotectedinherited |
|
inlineprotectedinherited |
compute the intersections between the two grids
|
inlineinherited |
Return a reference to the bulk problem.
|
inline |
|
inlineinherited |
Methods to be accessed by main.
|
inlineinherited |
Return reference to low dim point sources.
|
inlineinherited |
Return data for a low dim point source with the identifier id.
|
inline |
The volume the lower dimensional domain occupies in the bulk domain element.
|
inline |
The volume fraction the lower dimensional domain occupies in the bulk domain element.
|
inlineinherited |
return the numeric epsilon used for deflecting primary variables of coupled domain i
|
inlineprotectedinherited |
Return reference to point source data vector member.
|
inlineinherited |
Return reference to point source data vector member.
|
inlineinherited |
Methods to be accessed by the subproblems.
Return a reference to the pointSource data
|
inlineprotectedinherited |
Return the point source if domain i.
|
inlineinherited |
Return the point source if domain i.
|
inlineprotectedinherited |
computes the vertex indices per element for the box method
|
inlineinherited |
Return a reference to the sub problem.
domainIdx | The domain index We avoid exception handling here because the performance of this function is critical |
|
inline |
Methods to be accessed by the subproblems.
Return a reference to the bulk problem
|
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 |
call this after grid adaption
|
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 |
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 |
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.
|
inlineprotectedinherited |
Return a reference to the vertex indices container.
|
inlineprotectedinherited |
Return a reference to the vertex indices.
|
staticconstexpr |
|
protectedinherited |
id generator for point sources