version 3.8
multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_MULTIDOMAIN_BOUNDARY_FFPM_FFMMOMENTUMPORENETWORK_COUPLINGMANAGER_HH
14#define DUMUX_MULTIDOMAIN_BOUNDARY_FFPM_FFMMOMENTUMPORENETWORK_COUPLINGMANAGER_HH
15
16#include <utility>
17#include <memory>
18
19#include <dune/common/float_cmp.hh>
20#include <dune/common/exceptions.hh>
25
26namespace Dumux {
27
32template<class MDTraits>
34: public CouplingManager<MDTraits>
35{
36 using Scalar = typename MDTraits::Scalar;
38
39public:
40 static constexpr auto freeFlowMomentumIndex = typename MDTraits::template SubDomain<0>::Index();
41 static constexpr auto poreNetworkIndex = typename MDTraits::template SubDomain<1>::Index();
42
44private:
45 // obtain the type tags of the sub problems
46 using FreeFlowMomentumTypeTag = typename MDTraits::template SubDomain<freeFlowMomentumIndex>::TypeTag;
47 using PoreNetworkTypeTag = typename MDTraits::template SubDomain<poreNetworkIndex>::TypeTag;
48
49 using CouplingStencils = std::unordered_map<std::size_t, std::vector<std::size_t> >;
50 using CouplingStencil = CouplingStencils::mapped_type;
51
52 // the sub domain type tags
53 template<std::size_t id>
54 using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag;
55
56 template<std::size_t id> using GridView = typename GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>::GridView;
57 template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>;
58 template<std::size_t id> using ElementVolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::LocalView;
59 template<std::size_t id> using GridVolumeVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>;
60 template<std::size_t id> using VolumeVariables = typename GetPropType<SubDomainTypeTag<id>, Properties::GridVolumeVariables>::VolumeVariables;
61 template<std::size_t id> using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>;
62 template<std::size_t id> using FVElementGeometry = typename GridGeometry<id>::LocalView;
63 template<std::size_t id> using GridVariables = GetPropType<SubDomainTypeTag<id>, Properties::GridVariables>;
64 template<std::size_t id> using GridFluxVariablesCache = GetPropType<SubDomainTypeTag<id>, Properties::GridFluxVariablesCache>;
65 template<std::size_t id> using ElementFluxVariablesCache = typename GridFluxVariablesCache<id>::LocalView;
66 template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity;
67 template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>;
68 template<std::size_t id> using SubControlVolumeFace = typename FVElementGeometry<id>::SubControlVolumeFace;
69 template<std::size_t id> using SubControlVolume = typename FVElementGeometry<id>::SubControlVolume;
70
71 using VelocityVector = typename Element<freeFlowMomentumIndex>::Geometry::GlobalCoordinate;
72
73 struct FreeFlowMomentumCouplingContext
74 {
75 FVElementGeometry<poreNetworkIndex> fvGeometry;
76 ElementVolumeVariables<poreNetworkIndex> elemVolVars;
77 ElementFluxVariablesCache<poreNetworkIndex> elemFluxVarsCache;
78 std::size_t poreNetworkDofIdx;
79 };
80
81 struct PoreNetworkCouplingContext
82 {
83 SubControlVolumeFace<freeFlowMomentumIndex> freeFlowMomentumScvf;
84 VelocityVector faceVelocity;
85 std::size_t freeFlowMomentumDofIdx;
86 };
87
88 using CouplingMapper = StaggeredFreeFlowPoreNetworkCouplingMapper;
89 using GridVariablesTuple = typename MDTraits::template TupleOfSharedPtr<GridVariables>;
90
91public:
92
96 // \{
97
99 void init(std::shared_ptr<Problem<freeFlowMomentumIndex>> freeFlowMomentumProblem,
100 std::shared_ptr<Problem<poreNetworkIndex>> porousMediumProblem,
101 GridVariablesTuple&& gridVariables,
102 std::shared_ptr<CouplingMapper> couplingMapper,
104 {
105 couplingMapper_ = couplingMapper;
106 gridVariables_ = gridVariables;
107 this->setSubProblems(std::make_tuple(freeFlowMomentumProblem, porousMediumProblem));
108 this->attachSolution(curSol);
109 }
110
111 // \}
112
113
117 // \{
118
122 template<std::size_t i, class Assembler>
123 void bindCouplingContext(Dune::index_constant<i> domainI, const Element<i>& element, const Assembler& assembler) const
124 {
125 bindCouplingContext_(domainI, element);
126 }
127
131 template<std::size_t i>
132 void bindCouplingContext(Dune::index_constant<i> domainI, const Element<i>& element) const
133 {
134 bindCouplingContext_(domainI, element);
135 }
136
140 template<std::size_t i, std::size_t j, class LocalAssemblerI>
141 void updateCouplingContext(Dune::index_constant<i> domainI,
142 const LocalAssemblerI& localAssemblerI,
143 Dune::index_constant<j> domainJ,
144 std::size_t dofIdxGlobalJ,
145 const PrimaryVariables<j>& priVarsJ,
146 int pvIdxJ)
147 {
148 this->curSol(domainJ)[dofIdxGlobalJ][pvIdxJ] = priVarsJ[pvIdxJ];
149
150 const auto eIdx = localAssemblerI.fvGeometry().gridGeometry().elementMapper().index(localAssemblerI.fvGeometry().element());
151 if (!isCoupledElement_(domainI, eIdx))
152 return;
153
154 // we need to update all solution-depenent components of the coupling context
155 // the dof of domain J has been deflected
156
157 // update the faceVelocity in the PoreNetworkCouplingContext
158 if constexpr (domainJ == freeFlowMomentumIndex)
159 {
160 // we only need to update if we are assembling the porous medium domain
161 // since the freeflow domain will not use the velocity from the context
162 if constexpr (domainI == poreNetworkIndex)
163 {
164 auto& context = std::get<poreNetworkIndex>(couplingContext_);
165 for (auto& c : context)
166 {
167 if (c.freeFlowMomentumDofIdx == dofIdxGlobalJ)
168 {
169 assert(c.freeFlowMomentumScvf.isFrontal() && c.freeFlowMomentumScvf.boundary());
170 c.faceVelocity = faceVelocity(c.freeFlowMomentumScvf, c.freeFlowMomentumDofIdx);
171 }
172 }
173 }
174 }
175
176 // update the elemVolVars and elemFluxVarsCache in the FreeFlowMomentumCouplingContext
177 else if constexpr (domainJ == poreNetworkIndex)
178 {
179 assert(couplingContextBoundForElement_[domainI] == localAssemblerI.fvGeometry().gridGeometry().elementMapper().index(localAssemblerI.fvGeometry().element()));
180 // there is only one context per coupled free-flow momentum dof
181 auto& context = std::get<freeFlowMomentumIndex>(couplingContext_)[0];
182 const auto& ggJ = context.fvGeometry.gridGeometry();
183 const auto& element = context.fvGeometry.element();
184 const auto elemSol = elementSolution(element, this->curSol(domainJ), ggJ);
185
186 for (const auto& scv : scvs(context.fvGeometry))
187 {
188 if (scv.dofIndex() == dofIdxGlobalJ)
189 {
190 if constexpr (ElementVolumeVariables<poreNetworkIndex>::GridVolumeVariables::cachingEnabled)
191 gridVars_(poreNetworkIndex).curGridVolVars().volVars(scv).update(std::move(elemSol), this->problem(domainJ), element, scv);
192 else
193 context.elemVolVars[scv].update(std::move(elemSol), this->problem(domainJ), element, scv);
194 }
195 }
196
197 const auto& scvf = context.fvGeometry.scvf(0);
198 if constexpr (ElementFluxVariablesCache<poreNetworkIndex>::GridFluxVariablesCache::cachingEnabled)
199 {
200 const auto eIdx = ggJ.elementMapper().index(element);
201 gridVars_(poreNetworkIndex).gridFluxVarsCache().cache(eIdx, scvf.index()).update(this->problem(domainJ), element, context.fvGeometry, context.elemVolVars, scvf);
202 }
203 else
204 context.elemFluxVarsCache[scvf].update(this->problem(domainJ), element, context.fvGeometry, context.elemVolVars, scvf);
205 }
206 }
207
208 // \}
209
213 const auto& couplingContext(const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry,
214 const SubControlVolumeFace<freeFlowMomentumIndex> scvf) const
215 {
216 auto& contexts = std::get<freeFlowMomentumIndex>(couplingContext_);
217
218 if (contexts.empty() || couplingContextBoundForElement_[freeFlowMomentumIndex] != fvGeometry.elementIndex())
219 bindCouplingContext_(freeFlowMomentumIndex, fvGeometry);
220
221
222 return contexts[0];
223 }
224
228 const auto& couplingContext(const FVElementGeometry<poreNetworkIndex>& fvGeometry,
229 const SubControlVolume<poreNetworkIndex> scv) const
230 {
231 auto& contexts = std::get<poreNetworkIndex>(couplingContext_);
232
233 const auto eIdx = fvGeometry.gridGeometry().elementMapper().index(fvGeometry.element());
234 if (contexts.empty() || couplingContextBoundForElement_[poreNetworkIndex] != eIdx)
235 bindCouplingContext_(poreNetworkIndex, fvGeometry);
236
237 return contexts;
238 }
239
243 // \{
244
248 const CouplingStencil& couplingStencil(Dune::index_constant<poreNetworkIndex> domainI,
249 const Element<poreNetworkIndex>& element,
250 Dune::index_constant<freeFlowMomentumIndex> domainJ) const
251 {
252 const auto eIdx = this->problem(domainI).gridGeometry().elementMapper().index(element);
253 return couplingMapper_->poreNetworkToFreeFlowMomentumCouplingStencil(eIdx);
254 }
255
265 const CouplingStencil& couplingStencil(Dune::index_constant<freeFlowMomentumIndex> domainI,
266 const Element<freeFlowMomentumIndex>& elementI,
267 const SubControlVolume<freeFlowMomentumIndex>& scvI,
268 Dune::index_constant<poreNetworkIndex> domainJ) const
269 {
270 return couplingMapper_->freeFlowMomentumToPoreNetworkCouplingStencil(scvI.dofIndex());
271 }
272
274
279 template<class LocalAssemblerI, std::size_t j>
280 decltype(auto) evalCouplingResidual(Dune::index_constant<freeFlowMomentumIndex> domainI,
281 const LocalAssemblerI& localAssemblerI,
282 const SubControlVolume<freeFlowMomentumIndex>& scvI,
283 Dune::index_constant<j> domainJ,
284 std::size_t dofIdxGlobalJ) const
285 {
286 return localAssemblerI.evalLocalResidual();
287 }
288
289 // \}
290
294 bool isCoupledLateralScvf(Dune::index_constant<freeFlowMomentumIndex> domainI, const SubControlVolumeFace<freeFlowMomentumIndex>& scvf) const
295 { return couplingMapper_->isCoupledFreeFlowMomentumLateralScvf(scvf.index()); }
296
300 bool isCoupled(Dune::index_constant<freeFlowMomentumIndex> domainI, const SubControlVolumeFace<freeFlowMomentumIndex>& scvf) const
301 {
302 return couplingMapper_->isCoupledFreeFlowMomentumScvf(scvf.index()) || couplingMapper_->isCoupledFreeFlowMomentumLateralScvf(scvf.index());
303 }
304
310 bool isCoupled(Dune::index_constant<poreNetworkIndex> domainI,
311 const SubControlVolume<poreNetworkIndex>& scv) const
312 { return couplingMapper_->isCoupledPoreNetworkDof(scv.dofIndex()); }
313
317 auto faceVelocity(const SubControlVolumeFace<freeFlowMomentumIndex>& scvf,
318 std::size_t freeFlowMomentumDofIdx) const
319 {
320 // create a unit normal vector oriented in positive coordinate direction
321 auto velocity = scvf.unitOuterNormal();
322 using std::abs;
323 std::for_each(velocity.begin(), velocity.end(), [](auto& v){ v = abs(v); });
324
325 // create the actual velocity vector
326 velocity *= this->curSol(freeFlowMomentumIndex)[freeFlowMomentumDofIdx];
327
328 return velocity;
329 }
330
331private:
332
336 template<std::size_t i>
337 bool isCoupledElement_(Dune::index_constant<i> domainI, std::size_t eIdx) const
338 {
339 if constexpr (i == freeFlowMomentumIndex)
340 return couplingMapper_->isCoupledFreeFlowElement(eIdx);
341 else
342 return couplingMapper_->isCoupledPoreNetworkElement(eIdx);
343 }
344
348 template<std::size_t i>
349 void bindCouplingContext_(Dune::index_constant<i> domainI, const Element<i>& element) const
350 {
351 const auto fvGeometry = localView(this->problem(domainI).gridGeometry()).bindElement(element);
352 bindCouplingContext_(domainI, fvGeometry);
353 }
354
358 void bindCouplingContext_(Dune::index_constant<freeFlowMomentumIndex> domainI, const FVElementGeometry<freeFlowMomentumIndex>& fvGeometry) const
359 {
360 auto& context = std::get<domainI>(couplingContext_);
361 const auto eIdx = fvGeometry.elementIndex();
362
363 // do nothing if the element is already correctly bound
364 if ((!context.empty() && couplingContextBoundForElement_[domainI] == eIdx))
365 return;
366
367 bool bindElement = false;
368 std::size_t actuallyCoupledFreeFlowElementIndex;
369
370 // if the element is directly coupled to a lowDim dof,
371 // bind the element itself
372 if (couplingMapper_->isCoupledFreeFlowElement(eIdx))
373 {
374 bindElement = true;
375 actuallyCoupledFreeFlowElementIndex = eIdx;
376 }
377 else
378 {
379 // if we assemble another element that is not directly coupled to the lowDim dof
380 // but shares an intersection (and hence, a dof) with a neighbor element that does, bind that neighbor
381 for (const auto& intersection : intersections(fvGeometry.gridGeometry().gridView(), fvGeometry.element()))
382 {
383 const auto dofIdx = fvGeometry.gridGeometry().intersectionMapper().globalIntersectionIndex(fvGeometry.element(), intersection.indexInInside());
384 if (couplingMapper_->isCoupledFreeFlowMomentumDof(dofIdx))
385 {
386 bindElement = true;
387 actuallyCoupledFreeFlowElementIndex = fvGeometry.gridGeometry().elementMapper().index(intersection.outside());
388 }
389 }
390 }
391
392 // do nothing if the element is not coupled to the other domain
393 if (!bindElement)
394 return;
395
396 context.clear();
397 couplingContextBoundForElement_[domainI] = eIdx;
398
399 auto poreNetworkFVGeometry = localView(this->problem(poreNetworkIndex).gridGeometry());
400 auto poreNetworkElemVolVars = localView(gridVars_(poreNetworkIndex).curGridVolVars());
401 auto poreNetworkElemFluxVarsCache = localView(gridVars_(poreNetworkIndex).gridFluxVarsCache());
402
403 const auto poreNetworkElemIdx = couplingMapper_->freeFlowElementToPNMElementMap().at(actuallyCoupledFreeFlowElementIndex);
404 const auto& poreNetworkElement = this->problem(poreNetworkIndex).gridGeometry().element(poreNetworkElemIdx);
405
406 poreNetworkFVGeometry.bindElement(poreNetworkElement);
407 poreNetworkElemVolVars.bind(poreNetworkElement, poreNetworkFVGeometry, this->curSol(poreNetworkIndex));
408 poreNetworkElemFluxVarsCache.bind(poreNetworkElement, poreNetworkFVGeometry, poreNetworkElemVolVars);
409
410 const std::size_t poreNetworkDofIdx = [&]
411 {
412 std::size_t idx = 0;
413 std::size_t counter = 0;
414 for (const auto& scv : scvs(poreNetworkFVGeometry))
415 {
416 if (couplingMapper_->isCoupledPoreNetworkDof(scv.dofIndex()))
417 {
418 idx = scv.dofIndex();
419 ++counter;
420 }
421 }
422
423 if (counter != 1)
424 DUNE_THROW(Dune::InvalidStateException, "Exactly one pore per throat needs to be coupled with the FF domain");
425
426 return idx;
427 }();
428
429 context.push_back({std::move(poreNetworkFVGeometry),
430 std::move(poreNetworkElemVolVars),
431 std::move(poreNetworkElemFluxVarsCache),
432 poreNetworkDofIdx}
433 );
434 }
435
439 void bindCouplingContext_(Dune::index_constant<poreNetworkIndex> domainI, const FVElementGeometry<poreNetworkIndex>& fvGeometry) const
440 {
441 auto& context = std::get<domainI>(couplingContext_);
442 const auto eIdx = fvGeometry.gridGeometry().elementMapper().index(fvGeometry.element());
443
444 // do nothing if the element is already bound or not coupled to the other domain
445 if ((!context.empty() && couplingContextBoundForElement_[domainI] == eIdx) || !isCoupledElement_(domainI, eIdx))
446 return;
447
448 context.clear();
449 couplingContextBoundForElement_[domainI] = eIdx;
450
451 const auto& stencil = couplingStencil(poreNetworkIndex, fvGeometry.element(), freeFlowMomentumIndex);
452 const auto& freeFlowElements = couplingMapper_->pnmElementToFreeFlowElementsMap().at(eIdx);
453 auto ffFVGeometry = localView(this->problem(freeFlowMomentumIndex).gridGeometry());
454
455 for (const auto ffElementIdx : freeFlowElements)
456 {
457 const auto& ffElement = this->problem(freeFlowMomentumIndex).gridGeometry().element(ffElementIdx);
458 ffFVGeometry.bindElement(ffElement);
459 for (const auto& scv : scvs(ffFVGeometry))
460 {
461 if (couplingMapper_->isCoupledFreeFlowMomentumDof(scv.dofIndex()))
462 {
463 if (std::any_of(stencil.begin(), stencil.end(), [&](const auto x){ return scv.dofIndex() == x; } ))
464 {
465 const auto& coupledScvf = ffFVGeometry.frontalScvfOnBoundary(scv);
466 context.push_back({coupledScvf,
467 faceVelocity(coupledScvf, scv.dofIndex()),
468 scv.dofIndex()}
469 );
470 }
471 }
472 }
473 }
474 }
475
480 template<std::size_t i>
481 const GridVariables<i>& gridVars_(Dune::index_constant<i> domainIdx) const
482 {
483 if (std::get<i>(gridVariables_))
484 return *std::get<i>(gridVariables_);
485 else
486 DUNE_THROW(Dune::InvalidStateException, "The gridVariables pointer was not set. Use setGridVariables() before calling this function");
487 }
488
493 template<std::size_t i>
494 GridVariables<i>& gridVars_(Dune::index_constant<i> domainIdx)
495 {
496 if (std::get<i>(gridVariables_))
497 return *std::get<i>(gridVariables_);
498 else
499 DUNE_THROW(Dune::InvalidStateException, "The gridVariables pointer was not set. Use setGridVariables() before calling this function");
500 }
501
503 GridVariablesTuple gridVariables_;
504
505 mutable std::tuple<std::vector<FreeFlowMomentumCouplingContext>, std::vector<PoreNetworkCouplingContext>> couplingContext_;
506 mutable std::array<std::size_t, 2> couplingContextBoundForElement_;
507
508 std::shared_ptr<CouplingMapper> couplingMapper_;
509};
510
511} // end namespace Dumux
512
513#endif
The interface of the coupling manager for multi domain problems.
Definition: multidomain/couplingmanager.hh:48
void attachSolution(SolutionVectorStorage &curSol)
Attach a solution vector stored outside of this class.
Definition: multidomain/couplingmanager.hh:322
void setSubProblems(const std::tuple< std::shared_ptr< SubProblems >... > &problems)
set the pointers to the sub problems
Definition: multidomain/couplingmanager.hh:287
const Problem< i > & problem(Dune::index_constant< i > domainIdx) const
Return a reference to the sub problem.
Definition: multidomain/couplingmanager.hh:309
SubSolutionVector< i > & curSol(Dune::index_constant< i > domainIdx)
the solution vector of the subproblem
Definition: multidomain/couplingmanager.hh:338
typename Traits::template TupleOfSharedPtr< SubSolutionVector > SolutionVectorStorage
the type in which the solution vector is stored in the manager
Definition: multidomain/couplingmanager.hh:71
Coupling manager for free-flow momentum and pore-network models.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:35
void bindCouplingContext(Dune::index_constant< i > domainI, const Element< i > &element, const Assembler &assembler) const
Methods to be accessed by the assembly.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:123
typename ParentType::SolutionVectorStorage SolutionVectorStorage
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:43
void bindCouplingContext(Dune::index_constant< i > domainI, const Element< i > &element) const
prepares all data and variables that are necessary to evaluate the residual (called from the local as...
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:132
bool isCoupledLateralScvf(Dune::index_constant< freeFlowMomentumIndex > domainI, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns whether a given scvf is coupled to the other domain.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:294
bool isCoupled(Dune::index_constant< poreNetworkIndex > domainI, const SubControlVolume< poreNetworkIndex > &scv) const
If the boundary entity is on a coupling boundary.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:310
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)
Update the coupling context.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:141
static constexpr auto poreNetworkIndex
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:41
const auto & couplingContext(const FVElementGeometry< poreNetworkIndex > &fvGeometry, const SubControlVolume< poreNetworkIndex > scv) const
Access the coupling context needed for the PNM domain.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:228
static constexpr auto freeFlowMomentumIndex
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:40
const CouplingStencil & couplingStencil(Dune::index_constant< freeFlowMomentumIndex > domainI, const Element< freeFlowMomentumIndex > &elementI, const SubControlVolume< freeFlowMomentumIndex > &scvI, Dune::index_constant< poreNetworkIndex > domainJ) const
returns an iterable container of all indices of degrees of freedom of domain j that couple with / inf...
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:265
const auto & couplingContext(const FVElementGeometry< freeFlowMomentumIndex > &fvGeometry, const SubControlVolumeFace< freeFlowMomentumIndex > scvf) const
Access the coupling context needed for the Stokes domain.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:213
void init(std::shared_ptr< Problem< freeFlowMomentumIndex > > freeFlowMomentumProblem, std::shared_ptr< Problem< poreNetworkIndex > > porousMediumProblem, GridVariablesTuple &&gridVariables, std::shared_ptr< CouplingMapper > couplingMapper, SolutionVectorStorage &curSol)
Methods to be accessed by main.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:99
auto faceVelocity(const SubControlVolumeFace< freeFlowMomentumIndex > &scvf, std::size_t freeFlowMomentumDofIdx) const
Returns the velocity at a given sub control volume face.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:317
const CouplingStencil & couplingStencil(Dune::index_constant< poreNetworkIndex > domainI, const Element< poreNetworkIndex > &element, Dune::index_constant< freeFlowMomentumIndex > domainJ) const
The coupling stencils.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:248
decltype(auto) evalCouplingResidual(Dune::index_constant< freeFlowMomentumIndex > domainI, const LocalAssemblerI &localAssemblerI, const SubControlVolume< freeFlowMomentumIndex > &scvI, Dune::index_constant< j > domainJ, std::size_t dofIdxGlobalJ) const
evaluate the coupling residual special interface for fcstaggered methods
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:280
bool isCoupled(Dune::index_constant< freeFlowMomentumIndex > domainI, const SubControlVolumeFace< freeFlowMomentumIndex > &scvf) const
Returns whether a given scvf is coupled to the other domain.
Definition: multidomain/boundary/freeflowporenetwork/ffmomentumporenetwork/couplingmanager.hh:300
Defines all properties used in Dumux.
GridCache::LocalView localView(const GridCache &gridCache)
Free function to get the local view of a grid cache object.
Definition: localview.hh:26
auto elementSolution(const Element &element, const SolutionVector &sol, const GridGeometry &gg) -> std::enable_if_t< GridGeometry::discMethod==DiscretizationMethods::cctpfa||GridGeometry::discMethod==DiscretizationMethods::ccmpfa, CCElementSolution< typename GridGeometry::LocalView, std::decay_t< decltype(std::declval< SolutionVector >()[0])> > >
Make an element solution for cell-centered schemes.
Definition: cellcentered/elementsolution.hh:101
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...
Definition: multidomain/couplingmanager.hh:249
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The interface of the coupling manager for multi domain problems.
Definition: adapt.hh:17
The local element solution class for staggered methods.