26#ifndef DUMUX_MULTIDOMAIN_STAGGERED_LOCAL_ASSEMBLER_HH
27#define DUMUX_MULTIDOMAIN_STAGGERED_LOCAL_ASSEMBLER_HH
29#include <dune/common/reservedvector.hh>
30#include <dune/common/indices.hh>
31#include <dune/common/hybridutilities.hh>
32#include <dune/grid/common/gridenums.hh>
56template<std::
size_t id,
class TypeTag,
class Assembler,
class Implementation,
bool isImplicit = true>
63 using SolutionVector =
typename Assembler::SolutionVector;
66 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
67 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
68 using Scalar =
typename GridVariables::Scalar;
71 using CellCenterResidualValue =
typename LocalResidual::CellCenterResidualValue;
72 using FaceResidualValue =
typename LocalResidual::FaceResidualValue;
74 using GridGeometry =
typename GridVariables::GridGeometry;
75 using FVElementGeometry =
typename GridGeometry::LocalView;
76 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
77 using GridView =
typename GridGeometry::GridView;
78 using Element =
typename GridView::template Codim<0>::Entity;
80 using CouplingManager =
typename Assembler::CouplingManager;
85 static constexpr auto domainId =
typename Dune::index_constant<id>();
86 static constexpr auto cellCenterId = GridGeometry::cellCenterIdx();
87 static constexpr auto faceId = GridGeometry::faceIdx();
92 using ParentType::ParentType;
96 const SolutionVector&
curSol,
116 template<
class JacobianMatrixRow,
class SubSol,
class Gr
idVariablesTuple>
119 this->
asImp_().bindLocalViews();
122 assembleJacobianAndResidualImpl_(
domainId, jacRow, res, gridVariables);
128 template<
class SubSol>
131 this->
asImp_().bindLocalViews();
136 const auto cellCenterGlobalI =
problem().gridGeometry().elementMapper().index(this->
element());
137 res[cellCenterGlobalI] = this->
asImp_().assembleCellCenterResidualImpl();
142 res[scvf.dofIndex()] += this->
asImp_().assembleFaceResidualImpl(scvf);
153 if (this->
assembler().isStationaryProblem())
154 DUNE_THROW(Dune::InvalidStateException,
"Using explicit jacobian assembler with stationary local residual");
158 return CellCenterResidualValue(0.0);
171 const ElementFaceVariables& elemFaceVars)
const
175 if (!this->
assembler().isStationaryProblem())
179 const auto cellCenterGlobalI =
problem().gridGeometry().elementMapper().index(this->
element());
180 const auto& scvI = this->
fvGeometry().scv(cellCenterGlobalI);
232 if (this->
assembler().isStationaryProblem())
233 DUNE_THROW(Dune::InvalidStateException,
"Using explicit jacobian assembler with stationary local residual");
237 return FaceResidualValue(0.0);
251 const ElementVolumeVariables& elemVolVars,
252 const ElementFaceVariables& elemFaceVars)
const
256 if (!this->
assembler().isStationaryProblem())
260 this->
fvGeometry(), scvf, elemVolVars, elemFaceVars,
286 const ElementVolumeVariables& elemVolVars,
287 const ElementFaceVariables& elemFaceVars)
const
308 {
return curElemFaceVars_; }
312 {
return prevElemFaceVars_; }
316 {
return curElemFaceVars_; }
320 {
return prevElemFaceVars_; }
323 {
return couplingManager_; }
328 template<
class JacobianMatrixRow,
class SubSol,
class Gr
idVariablesTuple>
329 auto assembleJacobianAndResidualImpl_(Dune::index_constant<cellCenterId>, JacobianMatrixRow& jacRow, SubSol& res, GridVariablesTuple& gridVariables)
331 auto& gridVariablesI = *std::get<domainId>(gridVariables);
332 const auto cellCenterGlobalI =
problem().gridGeometry().elementMapper().index(this->
element());
333 const auto residual = this->
asImp_().assembleCellCenterJacobianAndResidualImpl(jacRow[
domainId], gridVariablesI);
334 res[cellCenterGlobalI] = residual;
338 using namespace Dune::Hybrid;
340 forEach(otherDomainIds, [&](
auto&& domainJ)
342 this->
asImp_().assembleJacobianCellCenterCoupling(domainJ, jacRow[domainJ], residual, gridVariablesI);
346 incorporateDirichletCells_(jacRow);
350 template<
class JacobianMatrixRow,
class SubSol,
class Gr
idVariablesTuple>
351 void assembleJacobianAndResidualImpl_(Dune::index_constant<faceId>, JacobianMatrixRow& jacRow, SubSol& res, GridVariablesTuple& gridVariables)
353 auto& gridVariablesI = *std::get<domainId>(gridVariables);
354 const auto residual = this->
asImp_().assembleFaceJacobianAndResidualImpl(jacRow[
domainId], gridVariablesI);
357 res[scvf.dofIndex()] += residual[scvf.localFaceIdx()];
360 using namespace Dune::Hybrid;
362 forEach(otherDomainIds, [&](
auto&& domainJ)
364 this->
asImp_().assembleJacobianFaceCoupling(domainJ, jacRow[domainJ], residual, gridVariablesI);
369 template<
class JacobianMatrixRow>
370 void incorporateDirichletCells_(JacobianMatrixRow& jacRow)
372 const auto cellCenterGlobalI =
problem().gridGeometry().elementMapper().index(this->
element());
380 using namespace Dune::Hybrid;
381 forEach(integralRange(Dune::Hybrid::size(jacRow)), [&,
domainId =
domainId](
auto&& i)
383 auto& ccRowI = jacRow[i][cellCenterGlobalI];
384 for (
auto col = ccRowI.begin(); col != ccRowI.end(); ++col)
386 ccRowI[col.index()][eqIdx] = 0.0;
388 if ((i ==
domainId) && (col.index() == cellCenterGlobalI))
389 ccRowI[col.index()][eqIdx][eqIdx] = 1.0;
396 ElementFaceVariables curElemFaceVars_;
397 ElementFaceVariables prevElemFaceVars_;
398 CouplingManager& couplingManager_;
411template<std::
size_t id,
class TypeTag,
class Assembler,
class Implementation>
415 static constexpr auto domainId = Dune::index_constant<id>();
417 using ParentType::ParentType;
436 if (!this->
assembler().isStationaryProblem())
455template<std::
size_t id,
class TypeTag,
class Assembler, DiffMethod DM = DiffMethod::numeric,
bool implicit = true>
478template<std::
size_t id,
class TypeTag,
class Assembler>
481 SubDomainStaggeredLocalAssembler<id, TypeTag, Assembler, DiffMethod::numeric, true> >
487 using CellCenterResidualValue =
typename LocalResidual::CellCenterResidualValue;
488 using FaceResidualValue =
typename LocalResidual::FaceResidualValue;
492 using FaceVariables =
typename ElementFaceVariables::FaceVariables;
494 using FVElementGeometry =
typename GridGeometry::LocalView;
495 using SubControlVolumeFace =
typename GridGeometry::SubControlVolumeFace;
502 static constexpr int maxNeighbors = 4*(2*ModelTraits::dim());
503 static constexpr auto domainI = Dune::index_constant<id>();
504 static constexpr auto cellCenterId = GridGeometry::cellCenterIdx();
505 static constexpr auto faceId = GridGeometry::faceIdx();
507 static constexpr auto numEq = ModelTraits::numEq();
508 static constexpr auto numEqCellCenter = CellCenterPrimaryVariables::dimension;
509 static constexpr auto numEqFace = FacePrimaryVariables::dimension;
512 using ParentType::ParentType;
530 template<
class JacobianMatrixDiagBlock,
class Gr
idVariables>
533 assert(domainI == cellCenterId);
539 const auto& gridGeometry = this->
problem().gridGeometry();
542 const auto cellCenterGlobalI = gridGeometry.elementMapper().index(
element);
550 auto evaluateCellCenterDerivatives = [&](
const std::size_t globalJ)
554 const auto elementJ =
fvGeometry.gridGeometry().element(globalJ);
556 const auto origVolVars(curVolVars);
558 for (
int pvIdx = 0; pvIdx < numEqCellCenter; ++pvIdx)
560 CellCenterPrimaryVariables cellCenterPriVars =
curSol[globalJ];
561 using PrimaryVariables =
typename VolumeVariables::PrimaryVariables;
564 constexpr auto offset = numEq - numEqCellCenter;
566 auto evalResidual = [&](Scalar priVar)
569 priVars[pvIdx + offset] = priVar;
571 curVolVars.update(elemSol, this->
problem(), elementJ, scvJ);
574 cellCenterPriVars[pvIdx] = priVar;
575 this->
couplingManager().updateCouplingContext(domainI, *
this, domainI, globalJ, cellCenterPriVars, pvIdx);
582 CellCenterResidualValue partialDeriv(0.0);
585 const auto& paramGroup = this->
problem().paramGroup();
587 static const auto eps = this->
couplingManager().numericEpsilon(domainI, paramGroup);
589 eps(priVars[pvIdx + offset], pvIdx), numDiffMethod);
595 curVolVars = origVolVars;
598 this->
couplingManager().updateCouplingContext(domainI, *
this, domainI, globalJ,
curSol[globalJ], pvIdx);
603 const auto& connectivityMap = gridGeometry.connectivityMap();
606 evaluateCellCenterDerivatives(cellCenterGlobalI);
609 for (
const auto& globalJ : connectivityMap(cellCenterId, cellCenterId, cellCenterGlobalI))
610 evaluateCellCenterDerivatives(globalJ);
621 template<
class JacobianMatrixDiagBlock,
class Gr
idVariables>
624 assert(domainI == faceId);
630 const auto& gridGeometry = this->
problem().gridGeometry();
634 FaceSolutionVector origResiduals;
652 const auto faceGlobalI = scvf.dofIndex();
655 const auto origFaceSolution = FaceSolution(scvf,
curSol, gridGeometry);
658 auto evaluateFaceDerivatives = [&](
const std::size_t globalJ)
661 auto& faceVars = getFaceVarAccess_(gridVariables.curGridFaceVars(), this->curElemFaceVars(), scvf);
662 const auto origFaceVars = faceVars;
664 for (
int pvIdx = 0; pvIdx < numEqFace; ++pvIdx)
666 auto faceSolution = origFaceSolution;
668 auto evalResidual = [&](Scalar priVar)
671 faceSolution[globalJ][pvIdx] = priVar;
675 this->
couplingManager().updateCouplingContext(domainI, *
this, domainI, globalJ, faceSolution[globalJ], pvIdx);
682 FaceResidualValue partialDeriv(0.0);
683 const auto& paramGroup =
problem.paramGroup();
685 static const auto eps = this->
couplingManager().numericEpsilon(domainI, paramGroup);
687 eps(faceSolution[globalJ][pvIdx], pvIdx), numDiffMethod);
693 faceVars = origFaceVars;
696 this->
couplingManager().updateCouplingContext(domainI, *
this, domainI, globalJ, origFaceSolution[globalJ], pvIdx);
701 evaluateFaceDerivatives(scvf.dofIndex());
704 const auto& connectivityMap = gridGeometry.connectivityMap();
707 for (
const auto& globalJ : connectivityMap(faceId, faceId, scvf.index()))
708 evaluateFaceDerivatives(globalJ);
711 return origResiduals;
718 template<
class JacobianBlock,
class Gr
idVariables>
720 const CellCenterResidualValue& origResidual, GridVariables& gridVariables)
729 const auto& gridGeometry = this->
problem().gridGeometry();
732 const auto cellCenterGlobalI = gridGeometry.elementMapper().index(
element);
736 const auto globalJ = scvfJ.dofIndex();
739 auto& faceVars = getFaceVarAccess_(gridVariables.curGridFaceVars(), this->curElemFaceVars(), scvfJ);
740 const auto origFaceVars(faceVars);
742 for (
int pvIdx = 0; pvIdx < numEqFace; ++pvIdx)
744 auto facePriVars =
curSol[globalJ];
746 auto evalResidual = [&](Scalar priVar)
749 facePriVars[pvIdx] = priVar;
750 faceVars.updateOwnFaceOnly(facePriVars);
753 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, facePriVars, pvIdx);
760 CellCenterResidualValue partialDeriv(0.0);
763 const auto& paramGroup = this->
assembler().problem(domainJ).paramGroup();
765 static const auto epsCoupl = this->
couplingManager().numericEpsilon(domainJ, paramGroup);
767 epsCoupl(facePriVars[pvIdx], pvIdx), numDiffMethod);
773 faceVars = origFaceVars;
776 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ,
curSol[globalJ], pvIdx);
781 template<std::
size_t otherId,
class JacobianBlock,
class Gr
idVariables>
783 const CellCenterResidualValue& res, GridVariables& gridVariables)
798 for (
const auto globalJ : stencil)
800 const auto origResidual = this->
couplingManager().evalCouplingResidual(domainI, *
this, domainJ, globalJ);
802 const auto origPriVarsJ =
curSol[globalJ];
804 for (
int pvIdx = 0; pvIdx < JacobianBlock::block_type::cols; ++pvIdx)
806 auto evalCouplingResidual = [&](Scalar priVar)
808 auto deflectedPriVarsJ = origPriVarsJ;
809 deflectedPriVarsJ[pvIdx] = priVar;
810 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, deflectedPriVarsJ, pvIdx);
811 return this->
couplingManager().evalCouplingResidual(domainI, *
this, domainJ, globalJ);
815 CellCenterResidualValue partialDeriv(0.0);
818 const auto& paramGroup = this->
assembler().problem(domainJ).paramGroup();
820 static const auto epsCoupl = this->
couplingManager().numericEpsilon(domainJ, paramGroup);
822 epsCoupl(origPriVarsJ[pvIdx], pvIdx), numDiffMethod);
825 const auto cellCenterGlobalI = this->
problem().gridGeometry().elementMapper().index(
element);
829 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, origPriVarsJ, pvIdx);
838 template<
class JacobianBlock,
class ElementRes
idualVector,
class Gr
idVariables>
849 const auto& gridGeometry = this->
problem().gridGeometry();
850 const auto& connectivityMap = gridGeometry.connectivityMap();
857 const auto faceGlobalI = scvf.dofIndex();
860 for (
const auto& globalJ : connectivityMap(faceId, cellCenterId, scvf.index()))
864 const auto elementJ =
fvGeometry.gridGeometry().element(globalJ);
865 auto& curVolVars = this->
getVolVarAccess(gridVariables.curGridVolVars(), this->curElemVolVars(), scvJ);
866 const auto origVolVars(curVolVars);
867 const auto origCellCenterPriVars =
curSol[globalJ];
869 for (
int pvIdx = 0; pvIdx < numEqCellCenter; ++pvIdx)
871 using PrimaryVariables =
typename VolumeVariables::PrimaryVariables;
874 constexpr auto offset = PrimaryVariables::dimension - CellCenterPrimaryVariables::dimension;
876 auto evalResidual = [&](Scalar priVar)
879 priVars[pvIdx + offset] = priVar;
881 curVolVars.update(elemSol,
problem, elementJ, scvJ);
884 auto deflectedCellCenterPriVars = origCellCenterPriVars;
885 deflectedCellCenterPriVars[pvIdx] = priVar;
886 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, deflectedCellCenterPriVars, pvIdx);
893 FaceResidualValue partialDeriv(0.0);
894 const auto& paramGroup = this->
assembler().problem(domainJ).paramGroup();
896 static const auto epsCoupl = this->
couplingManager().numericEpsilon(domainJ, paramGroup);
898 epsCoupl(priVars[pvIdx + offset], pvIdx), numDiffMethod);
904 curVolVars = origVolVars;
907 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, origCellCenterPriVars, pvIdx);
913 template<std::
size_t otherId,
class JacobianBlock,
class ElementRes
idualVector,
class Gr
idVariables>
929 const auto faceGlobalI = scvf.dofIndex();
932 const auto& stencil = this->
couplingManager().couplingStencil(domainI, scvf, domainJ);
938 for (
const auto& globalJ : stencil)
940 const auto origPriVarsJ =
curSol[globalJ];
941 const auto origResidual = this->
couplingManager().evalCouplingResidual(domainI, scvf, *
this, domainJ, globalJ);
943 for (
int pvIdx = 0; pvIdx < JacobianBlock::block_type::cols; ++pvIdx)
945 auto evalCouplingResidual = [&](Scalar priVar)
947 auto deflectedPriVars = origPriVarsJ;
948 deflectedPriVars[pvIdx] = priVar;
949 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, deflectedPriVars, pvIdx);
950 return this->
couplingManager().evalCouplingResidual(domainI, scvf, *
this, domainJ, globalJ);
954 FaceResidualValue partialDeriv(0.0);
955 const auto& paramGroup = this->
assembler().problem(domainJ).paramGroup();
957 static const auto epsCoupl = this->
couplingManager().numericEpsilon(domainJ, paramGroup);
959 epsCoupl(origPriVarsJ[pvIdx], pvIdx), numDiffMethod);
965 this->
couplingManager().updateCouplingContext(domainI, *
this, domainJ, globalJ, origPriVarsJ, pvIdx);
971 template<
class JacobianMatrixDiagBlock,
class Gr
idVariables>
973 JacobianMatrixDiagBlock& A, GridVariables& gridVariables)
981 template<
class SubMatrix,
class CCOrFacePrimaryVariables>
986 const CCOrFacePrimaryVariables& partialDeriv)
988 for (
int eqIdx = 0; eqIdx < partialDeriv.size(); eqIdx++)
996 assert(eqIdx < matrix[globalI][globalJ].size());
997 assert(pvIdx < matrix[globalI][globalJ][eqIdx].size());
998 matrix[globalI][globalJ][eqIdx][pvIdx] += partialDeriv[eqIdx];
1004 FaceVariables& getFaceVarAccess_(GridFaceVariables& gridFaceVariables, ElementFaceVariables& elemFaceVars,
const SubControlVolumeFace& scvf)
1007 return gridFaceVariables.faceVars(scvf.index());
1009 return elemFaceVars[scvf];
A base class for all local assemblers.
An enum class to define various differentiation methods available in order to compute the derivatives...
Utilities for template meta programming.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
A arithmetic block vector type based on DUNE's reserved vector.
A class for numeric differentiation.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition localview.hh:38
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::box, BoxElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for box schemes.
Definition box/elementsolution.hh:118
PrimaryVariables makePriVarsFromCellCenterPriVars(const CellCenterPrimaryVariables &cellCenterPriVars)
Helper function to create a PrimaryVariables object from CellCenterPrimaryVariables.
Definition staggered/elementsolution.hh:41
DiffMethod
Differentiation methods in order to compute the derivatives of the residual i.e. the entries in the j...
Definition diffmethod.hh:37
@ numeric
Definition diffmethod.hh:38
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:161
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition adapt.hh:29
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:180
typename Detail::ConcatSeq< decltype(std::make_index_sequence< e >{}), e+1, decltype(std::make_index_sequence<(n > e) ?(n - e - 1) :0 >{})>::type makeIncompleteIntegerSequence
Definition utility.hh:70
Definition deprecated.hh:149
ElementVolumeVariables & curElemVolVars()
Definition fvlocalassemblerbase.hh:265
typename LocalResidual::ElementResidualVector ElementResidualVector
Definition fvlocalassemblerbase.hh:68
ElementBoundaryTypes & elemBcTypes()
Definition fvlocalassemblerbase.hh:281
Implementation & asImp_()
Definition fvlocalassemblerbase.hh:309
ElementVolumeVariables & prevElemVolVars()
Definition fvlocalassemblerbase.hh:269
FVLocalAssemblerBase(const Assembler &assembler, const Element &element, const SolutionVector &curSol)
Definition fvlocalassemblerbase.hh:73
FVElementGeometry & fvGeometry()
Definition fvlocalassemblerbase.hh:261
const Assembler & assembler() const
Definition fvlocalassemblerbase.hh:245
ElementFluxVariablesCache & elemFluxVarsCache()
Definition fvlocalassemblerbase.hh:273
bool elementIsGhost() const
Definition fvlocalassemblerbase.hh:253
LocalResidual & localResidual()
Definition fvlocalassemblerbase.hh:277
static constexpr bool isImplicit()
Definition fvlocalassemblerbase.hh:113
const Element & element() const
Definition fvlocalassemblerbase.hh:249
VolumeVariables & getVolVarAccess(GridVolumeVariables &gridVolVars, ElementVolumeVariables &elemVolVars, const SubControlVolume &scv)
Definition fvlocalassemblerbase.hh:316
const SolutionVector & curSol() const
Definition fvlocalassemblerbase.hh:257
static void partialDerivative(const Function &function, Scalar x0, FunctionEvalType &derivative, const FunctionEvalType &fx0, const int numericDifferenceMethod=1)
Computes the derivative of a function with respect to a function parameter.
Definition numericdifferentiation.hh:61
FaceResidualValue evalLocalResidualForFace(const SubControlVolumeFace &scvf) const
Convenience function to evaluate the local residual for the current face. Automatically chooses the t...
Definition subdomainstaggeredlocalassembler.hh:229
const ElementFaceVariables & curElemFaceVars() const
The current element volume variables.
Definition subdomainstaggeredlocalassembler.hh:315
FaceResidualValue evalLocalFluxAndSourceResidualForFace(const SubControlVolumeFace &scvf, const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars) const
Evaluates the flux and source terms (i.e, the terms without a time derivative) of the local residual ...
Definition subdomainstaggeredlocalassembler.hh:285
void assembleJacobianAndResidual(JacobianMatrixRow &jacRow, SubSol &res, GridVariablesTuple &gridVariables)
Computes the derivatives with respect to the given element and adds them to the global matrix....
Definition subdomainstaggeredlocalassembler.hh:117
ElementFaceVariables & prevElemFaceVars()
The element volume variables of the provious time step.
Definition subdomainstaggeredlocalassembler.hh:311
static constexpr auto domainId
Definition subdomainstaggeredlocalassembler.hh:85
void assembleResidual(SubSol &res)
Assemble the residual only.
Definition subdomainstaggeredlocalassembler.hh:129
const Problem & problem() const
Definition subdomainstaggeredlocalassembler.hh:303
SubDomainStaggeredLocalAssemblerBase(const Assembler &assembler, const Element &element, const SolutionVector &curSol, CouplingManager &couplingManager)
Definition subdomainstaggeredlocalassembler.hh:94
FaceResidualValue evalLocalFluxAndSourceResidualForFace(const SubControlVolumeFace &scvf) const
Convenience function to evaluate the flux and source terms (i.e, the terms without a time derivative)...
Definition subdomainstaggeredlocalassembler.hh:272
CellCenterResidualValue evalLocalFluxAndSourceResidualForCellCenter() const
Convenience function to evaluate the flux and source terms (i.e, the terms without a time derivative)...
Definition subdomainstaggeredlocalassembler.hh:196
static constexpr auto faceId
Definition subdomainstaggeredlocalassembler.hh:87
static constexpr auto faceOffset
Definition subdomainstaggeredlocalassembler.hh:90
FaceResidualValue evalLocalResidualForFace(const SubControlVolumeFace &scvf, const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars) const
Evaluates the complete local residual for the current face.
Definition subdomainstaggeredlocalassembler.hh:250
static constexpr auto numEqCellCenter
Definition subdomainstaggeredlocalassembler.hh:89
const ElementFaceVariables & prevElemFaceVars() const
The element volume variables of the provious time step.
Definition subdomainstaggeredlocalassembler.hh:319
CellCenterResidualValue evalLocalResidualForCellCenter() const
Convenience function to evaluate the complete local residual for the current element....
Definition subdomainstaggeredlocalassembler.hh:150
FaceResidualValue evalLocalStorageResidualForFace(const SubControlVolumeFace &scvf) const
Convenience function to evaluate storage term (i.e, the term with a time derivative) of the local res...
Definition subdomainstaggeredlocalassembler.hh:298
CouplingManager & couplingManager()
Definition subdomainstaggeredlocalassembler.hh:322
static constexpr auto cellCenterId
Definition subdomainstaggeredlocalassembler.hh:86
CellCenterResidualValue evalLocalResidualForCellCenter(const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars) const
Evaluates the complete local residual for the current cell center.
Definition subdomainstaggeredlocalassembler.hh:170
CellCenterResidualValue evalLocalFluxAndSourceResidualForCellCenter(const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars) const
Evaluates the flux and source terms (i.e, the terms without a time derivative) of the local residual ...
Definition subdomainstaggeredlocalassembler.hh:209
CellCenterResidualValue evalLocalStorageResidualForCellCenter() const
Convenience function to evaluate storage term (i.e, the term with a time derivative) of the local res...
Definition subdomainstaggeredlocalassembler.hh:219
ElementFaceVariables & curElemFaceVars()
The current element volume variables.
Definition subdomainstaggeredlocalassembler.hh:307
A base class for all implicit multidomain local assemblers (staggered).
Definition subdomainstaggeredlocalassembler.hh:413
void bindLocalViews()
Definition subdomainstaggeredlocalassembler.hh:419
The staggered multidomain local assembler.
Definition subdomainstaggeredlocalassembler.hh:456
void assembleJacobianFaceCoupling(Dune::index_constant< cellCenterId > domainJ, JacobianBlock &A, const ElementResidualVector &origResiduals, GridVariables &gridVariables)
Computes the derivatives with respect to the given element and adds them to the global matrix.
Definition subdomainstaggeredlocalassembler.hh:839
void assembleJacobianFaceCoupling(Dune::index_constant< otherId > domainJ, JacobianBlock &A, const ElementResidualVector &res, GridVariables &gridVariables)
Definition subdomainstaggeredlocalassembler.hh:914
FaceResidualValue assembleFaceResidualImpl(const SubControlVolumeFace &scvf)
Definition subdomainstaggeredlocalassembler.hh:519
CellCenterResidualValue assembleCellCenterJacobianAndResidualImpl(JacobianMatrixDiagBlock &A, GridVariables &gridVariables)
Computes the derivatives with respect to the given element and adds them to the global matrix.
Definition subdomainstaggeredlocalassembler.hh:531
void assembleJacobianCellCenterCoupling(Dune::index_constant< faceId > domainJ, JacobianBlock &A, const CellCenterResidualValue &origResidual, GridVariables &gridVariables)
Computes the derivatives with respect to the given element and adds them to the global matrix.
Definition subdomainstaggeredlocalassembler.hh:719
CellCenterResidualValue assembleCellCenterResidualImpl()
Definition subdomainstaggeredlocalassembler.hh:514
static void updateGlobalJacobian_(SubMatrix &matrix, const int globalI, const int globalJ, const int pvIdx, const CCOrFacePrimaryVariables &partialDeriv)
Updates the current global Jacobian matrix with the partial derivatives of all equations in regard to...
Definition subdomainstaggeredlocalassembler.hh:982
void evalAdditionalDerivatives(const std::vector< std::size_t > &additionalDofDependencies, JacobianMatrixDiagBlock &A, GridVariables &gridVariables)
Definition subdomainstaggeredlocalassembler.hh:972
auto assembleFaceJacobianAndResidualImpl(JacobianMatrixDiagBlock &A, GridVariables &gridVariables)
Computes the derivatives with respect to the given element and adds them to the global matrix.
Definition subdomainstaggeredlocalassembler.hh:622
void assembleJacobianCellCenterCoupling(Dune::index_constant< otherId > domainJ, JacobianBlock &A, const CellCenterResidualValue &res, GridVariables &gridVariables)
Definition subdomainstaggeredlocalassembler.hh:782
The local element solution class for staggered methods.
Declares all properties used in Dumux.