3.2-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
couplingmanagerbase.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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
26#ifndef DUMUX_MULTIDOMAIN_EMBEDDED_COUPLINGMANAGERBASE_HH
27#define DUMUX_MULTIDOMAIN_EMBEDDED_COUPLINGMANAGERBASE_HH
28
29#include <iostream>
30#include <fstream>
31#include <string>
32#include <utility>
33#include <unordered_map>
34
35#include <dune/common/timer.hh>
36#include <dune/geometry/quadraturerules.hh>
37
45
46namespace Dumux {
47
49template<class MDTraits>
51{
52private:
53 template<std::size_t i> using SubDomainTypeTag = typename MDTraits::template SubDomain<i>::TypeTag;
54 template<std::size_t i> using GridGeometry = GetPropType<SubDomainTypeTag<i>, Properties::GridGeometry>;
55 template<std::size_t i> using NumEqVector = GetPropType<SubDomainTypeTag<i>, Properties::NumEqVector>;
56public:
58 template<std::size_t i>
60
62 template<std::size_t i>
64
67};
68
74template<class MDTraits, class Implementation, class PSTraits = DefaultPointSourceTraits<MDTraits>>
76: public CouplingManager<MDTraits>
77{
79 using Scalar = typename MDTraits::Scalar;
80 static constexpr auto bulkIdx = typename MDTraits::template SubDomain<0>::Index();
81 static constexpr auto lowDimIdx = typename MDTraits::template SubDomain<1>::Index();
82 using SolutionVector = typename MDTraits::SolutionVector;
83 using PointSourceData = typename PSTraits::PointSourceData;
84
85 // the sub domain type tags
86 template<std::size_t id> using PointSource = typename PSTraits::template PointSource<id>;
87 template<std::size_t id> using SubDomainTypeTag = typename MDTraits::template SubDomain<id>::TypeTag;
88 template<std::size_t id> using Problem = GetPropType<SubDomainTypeTag<id>, Properties::Problem>;
89 template<std::size_t id> using PrimaryVariables = GetPropType<SubDomainTypeTag<id>, Properties::PrimaryVariables>;
90 template<std::size_t id> using GridGeometry = GetPropType<SubDomainTypeTag<id>, Properties::GridGeometry>;
91 template<std::size_t id> using GridView = typename GridGeometry<id>::GridView;
92 template<std::size_t id> using ElementMapper = typename GridGeometry<id>::ElementMapper;
93 template<std::size_t id> using Element = typename GridView<id>::template Codim<0>::Entity;
94
95 enum {
96 bulkDim = GridView<bulkIdx>::dimension,
97 lowDimDim = GridView<lowDimIdx>::dimension,
98 dimWorld = GridView<bulkIdx>::dimensionworld
99 };
100
101 template<std::size_t id>
102 static constexpr bool isBox()
103 { return GridGeometry<id>::discMethod == DiscretizationMethod::box; }
104
105 using CouplingStencil = std::vector<std::size_t>;
106 using GlobalPosition = typename Element<bulkIdx>::Geometry::GlobalCoordinate;
107 using GlueType = MultiDomainGlue<GridView<bulkIdx>, GridView<lowDimIdx>, ElementMapper<bulkIdx>, ElementMapper<lowDimIdx>>;
108
109public:
111 using MultiDomainTraits = MDTraits;
113 using PointSourceTraits = PSTraits;
115 using CouplingStencils = std::unordered_map<std::size_t, CouplingStencil>;
116
120 void updateAfterGridAdaption(std::shared_ptr<const GridGeometry<bulkIdx>> bulkFvGridGeometry,
121 std::shared_ptr<const GridGeometry<lowDimIdx>> lowDimFvGridGeometry)
122 {
123 glue_ = std::make_shared<GlueType>();
124 }
125
129 EmbeddedCouplingManagerBase(std::shared_ptr<const GridGeometry<bulkIdx>> bulkFvGridGeometry,
130 std::shared_ptr<const GridGeometry<lowDimIdx>> lowDimFvGridGeometry)
131 {
132 updateAfterGridAdaption(bulkFvGridGeometry, lowDimFvGridGeometry);
133 }
134
138 // \{
139
140 void init(std::shared_ptr<Problem<bulkIdx>> bulkProblem,
141 std::shared_ptr<Problem<lowDimIdx>> lowDimProblem,
142 const SolutionVector& curSol)
143 {
144 this->updateSolution(curSol);
145 this->setSubProblems(std::make_tuple(bulkProblem, lowDimProblem));
146
147 integrationOrder_ = getParam<int>("MixedDimension.IntegrationOrder", 1);
148 asImp_().computePointSourceData(integrationOrder_);
149 }
150
151 // \}
152
156 // \{
157
172 template<std::size_t i, std::size_t j>
173 const CouplingStencil& couplingStencil(Dune::index_constant<i> domainI,
174 const Element<i>& element,
175 Dune::index_constant<j> domainJ) const
176 {
177 static_assert(i != j, "A domain cannot be coupled to itself!");
178
179 const auto eIdx = this->problem(domainI).gridGeometry().elementMapper().index(element);
180 if (couplingStencils(domainI).count(eIdx))
181 return couplingStencils(domainI).at(eIdx);
182 else
183 return emptyStencil_;
184 }
185
198 template<std::size_t i, std::size_t j, class LocalAssemblerI>
199 decltype(auto) evalCouplingResidual(Dune::index_constant<i> domainI,
200 const LocalAssemblerI& localAssemblerI,
201 Dune::index_constant<j> domainJ,
202 std::size_t dofIdxGlobalJ)
203 {
204 static_assert(i != j, "A domain cannot be coupled to itself!");
205
206 typename LocalAssemblerI::LocalResidual::ElementResidualVector residual;
207
208 const auto& element = localAssemblerI.element();
209 const auto& fvGeometry = localAssemblerI.fvGeometry();
210 const auto& curElemVolVars = localAssemblerI.curElemVolVars();
211
212 residual.resize(fvGeometry.numScv());
213 for (const auto& scv : scvs(fvGeometry))
214 {
215 auto couplingSource = this->problem(domainI).scvPointSources(element, fvGeometry, curElemVolVars, scv);
216 couplingSource += this->problem(domainI).source(element, fvGeometry, curElemVolVars, scv);
217 couplingSource *= -scv.volume()*curElemVolVars[scv].extrusionFactor();
218 residual[scv.indexInElement()] = couplingSource;
219 }
220 return residual;
221 }
222
223 // \}
224
225 /* \brief Compute integration point point sources and associated data
226 *
227 * This method uses grid glue to intersect the given grids. Over each intersection
228 * we later need to integrate a source term. This method places point sources
229 * at each quadrature point and provides the point source with the necessary
230 * information to compute integrals (quadrature weight and integration element)
231 * \param order The order of the quadrature rule for integration of sources over an intersection
232 * \param verbose If the point source computation is verbose
233 */
234 void computePointSourceData(std::size_t order = 1, bool verbose = false)
235 {
236 // initilize the maps
237 // do some logging and profiling
238 Dune::Timer watch;
239 std::cout << "Initializing the point sources..." << std::endl;
240
241 // clear all internal members like pointsource vectors and stencils
242 // initializes the point source id counter
243 clear();
244
245 // precompute the vertex indices for efficiency for the box method
246 this->preComputeVertexIndices(bulkIdx);
247 this->preComputeVertexIndices(lowDimIdx);
248
249 const auto& bulkFvGridGeometry = this->problem(bulkIdx).gridGeometry();
250 const auto& lowDimFvGridGeometry = this->problem(lowDimIdx).gridGeometry();
251
252 // intersect the bounding box trees
253 glueGrids();
254
255 pointSourceData_.reserve(this->glue().size());
256 averageDistanceToBulkCell_.reserve(this->glue().size());
257 for (const auto& is : intersections(this->glue()))
258 {
259 // all inside elements are identical...
260 const auto& inside = is.targetEntity(0);
261 // get the intersection geometry for integrating over it
262 const auto intersectionGeometry = is.geometry();
263
264 // get the Gaussian quadrature rule for the local intersection
265 const auto& quad = Dune::QuadratureRules<Scalar, lowDimDim>::rule(intersectionGeometry.type(), order);
266 const std::size_t lowDimElementIdx = lowDimFvGridGeometry.elementMapper().index(inside);
267
268 // iterate over all quadrature points
269 for (auto&& qp : quad)
270 {
271 // compute the coupling stencils
272 for (std::size_t outsideIdx = 0; outsideIdx < is.numDomainNeighbors(); ++outsideIdx)
273 {
274 const auto& outside = is.domainEntity(outsideIdx);
275 const std::size_t bulkElementIdx = bulkFvGridGeometry.elementMapper().index(outside);
276
277 // each quadrature point will be a point source for the sub problem
278 const auto globalPos = intersectionGeometry.global(qp.position());
279 const auto id = idCounter_++;
280 const auto qpweight = qp.weight();
281 const auto ie = intersectionGeometry.integrationElement(qp.position());
282 pointSources(bulkIdx).emplace_back(globalPos, id, qpweight, ie, std::vector<std::size_t>({bulkElementIdx}));
283 pointSources(bulkIdx).back().setEmbeddings(is.numDomainNeighbors());
284 pointSources(lowDimIdx).emplace_back(globalPos, id, qpweight, ie, std::vector<std::size_t>({lowDimElementIdx}));
285 pointSources(lowDimIdx).back().setEmbeddings(is.numDomainNeighbors());
286
287 // pre compute additional data used for the evaluation of
288 // the actual solution dependent source term
289 PointSourceData psData;
290
291 if (isBox<lowDimIdx>())
292 {
293 using ShapeValues = std::vector<Dune::FieldVector<Scalar, 1> >;
294 const auto lowDimGeometry = this->problem(lowDimIdx).gridGeometry().element(lowDimElementIdx).geometry();
295 ShapeValues shapeValues;
296 this->getShapeValues(lowDimIdx, this->problem(lowDimIdx).gridGeometry(), lowDimGeometry, globalPos, shapeValues);
297 psData.addLowDimInterpolation(shapeValues, this->vertexIndices(lowDimIdx, lowDimElementIdx), lowDimElementIdx);
298 }
299 else
300 {
301 psData.addLowDimInterpolation(lowDimElementIdx);
302 }
303
304 // add data needed to compute integral over the circle
305 if (isBox<bulkIdx>())
306 {
307 using ShapeValues = std::vector<Dune::FieldVector<Scalar, 1> >;
308 const auto bulkGeometry = this->problem(bulkIdx).gridGeometry().element(bulkElementIdx).geometry();
309 ShapeValues shapeValues;
310 this->getShapeValues(bulkIdx, this->problem(bulkIdx).gridGeometry(), bulkGeometry, globalPos, shapeValues);
311 psData.addBulkInterpolation(shapeValues, this->vertexIndices(bulkIdx, bulkElementIdx), bulkElementIdx);
312 }
313 else
314 {
315 psData.addBulkInterpolation(bulkElementIdx);
316 }
317
318 // publish point source data in the global vector
319 this->pointSourceData().emplace_back(std::move(psData));
320
321 // compute average distance to bulk cell
322 averageDistanceToBulkCell_.push_back(computeDistance(outside.geometry(), globalPos));
323
324 // export the lowdim coupling stencil
325 // we insert all vertices / elements and make it unique later
326 if (isBox<bulkIdx>())
327 {
328 const auto& vertices = this->vertexIndices(bulkIdx, bulkElementIdx);
329 this->couplingStencils(lowDimIdx)[lowDimElementIdx].insert(this->couplingStencils(lowDimIdx)[lowDimElementIdx].end(),
330 vertices.begin(), vertices.end());
331 }
332 else
333 {
334 this->couplingStencils(lowDimIdx)[lowDimElementIdx].push_back(bulkElementIdx);
335 }
336
337 // export the bulk coupling stencil
338 // we insert all vertices / elements and make it unique later
339 if (isBox<lowDimIdx>())
340 {
341 const auto& vertices = this->vertexIndices(lowDimIdx, lowDimElementIdx);
342 this->couplingStencils(bulkIdx)[bulkElementIdx].insert(this->couplingStencils(bulkIdx)[bulkElementIdx].end(),
343 vertices.begin(), vertices.end());
344
345 }
346 else
347 {
348 this->couplingStencils(bulkIdx)[bulkElementIdx].push_back(lowDimElementIdx);
349 }
350 }
351 }
352 }
353
354 // make stencils unique
355 using namespace Dune::Hybrid;
356 forEach(integralRange(std::integral_constant<std::size_t, MDTraits::numSubDomains>{}), [&](const auto domainIdx)
357 {
358 for (auto&& stencil : this->couplingStencils(domainIdx))
359 {
360 std::sort(stencil.second.begin(), stencil.second.end());
361 stencil.second.erase(std::unique(stencil.second.begin(), stencil.second.end()), stencil.second.end());
362 }
363 });
364
365 std::cout << "took " << watch.elapsed() << " seconds." << std::endl;
366 }
367
371 // \{
372
374 const PointSourceData& pointSourceData(std::size_t id) const
375 { return pointSourceData_[id]; }
376
378 template<std::size_t id>
379 const GridView<id>& gridView(Dune::index_constant<id> domainIdx) const
380 { return this->problem(domainIdx).gridGeometry().gridView(); }
381
383 PrimaryVariables<bulkIdx> bulkPriVars(std::size_t id) const
384 {
385 auto& data = pointSourceData_[id];
386 return data.interpolateBulk(this->curSol()[bulkIdx]);
387 }
388
390 PrimaryVariables<lowDimIdx> lowDimPriVars(std::size_t id) const
391 {
392 auto& data = pointSourceData_[id];
393 return data.interpolateLowDim(this->curSol()[lowDimIdx]);
394 }
395
397 Scalar averageDistance(std::size_t id) const
398 { return averageDistanceToBulkCell_[id]; }
399
401 const std::vector<PointSource<bulkIdx>>& bulkPointSources() const
402 { return std::get<bulkIdx>(pointSources_); }
403
405 const std::vector<PointSource<lowDimIdx>>& lowDimPointSources() const
406 { return std::get<lowDimIdx>(pointSources_); }
407
409 template<std::size_t i>
410 const std::vector<PointSource<i>>& pointSources(Dune::index_constant<i> dom) const
411 { return std::get<i>(pointSources_); }
412
414 template<std::size_t i>
415 const CouplingStencils& couplingStencils(Dune::index_constant<i> dom) const
416 { return (i == bulkIdx) ? bulkCouplingStencils_ : lowDimCouplingStencils_; }
417
419 const std::vector<PointSourceData>& pointSourceData() const
420 { return pointSourceData_; }
421
423 const CouplingStencil& emptyStencil() const
424 { return emptyStencil_; }
425
426protected:
427
429 template<std::size_t id>
430 void preComputeVertexIndices(Dune::index_constant<id> domainIdx)
431 {
432 // fill helper structure for box discretization
433 if (isBox<domainIdx>())
434 {
435 this->vertexIndices(domainIdx).resize(gridView(domainIdx).size(0));
436 for (const auto& element : elements(gridView(domainIdx)))
437 {
438 constexpr int dim = GridView<domainIdx>::dimension;
439 const auto eIdx = this->problem(domainIdx).gridGeometry().elementMapper().index(element);
440 this->vertexIndices(domainIdx, eIdx).resize(element.subEntities(dim));
441 for (int i = 0; i < element.subEntities(dim); ++i)
442 this->vertexIndices(domainIdx, eIdx)[i] = this->problem(domainIdx).gridGeometry().vertexMapper().subIndex(element, i, dim);
443 }
444 }
445 }
446
448 template<std::size_t i, class FVGG, class Geometry, class ShapeValues, typename std::enable_if_t<FVGG::discMethod == DiscretizationMethod::box, int> = 0>
449 void getShapeValues(Dune::index_constant<i> domainI, const FVGG& gridGeometry, const Geometry& geo, const GlobalPosition& globalPos, ShapeValues& shapeValues)
450 {
451 const auto ipLocal = geo.local(globalPos);
452 const auto& localBasis = this->problem(domainI).gridGeometry().feCache().get(geo.type()).localBasis();
453 localBasis.evaluateFunction(ipLocal, shapeValues);
454 }
455
457 template<std::size_t i, class FVGG, class Geometry, class ShapeValues, typename std::enable_if_t<FVGG::discMethod != DiscretizationMethod::box, int> = 0>
458 void getShapeValues(Dune::index_constant<i> domainI, const FVGG& gridGeometry, const Geometry& geo, const GlobalPosition& globalPos, ShapeValues& shapeValues)
459 {
460 DUNE_THROW(Dune::InvalidStateException, "Shape values requested for other discretization than box!");
461 }
462
464 void clear()
465 {
466 pointSources(bulkIdx).clear();
467 pointSources(lowDimIdx).clear();
468 pointSourceData_.clear();
469 bulkCouplingStencils_.clear();
470 lowDimCouplingStencils_.clear();
471 bulkVertexIndices_.clear();
472 lowDimVertexIndices_.clear();
473 averageDistanceToBulkCell_.clear();
474
475 idCounter_ = 0;
476 }
477
480 {
481 const auto& bulkFvGridGeometry = this->problem(bulkIdx).gridGeometry();
482 const auto& lowDimFvGridGeometry = this->problem(lowDimIdx).gridGeometry();
483
484 // intersect the bounding box trees
485 glue_->build(bulkFvGridGeometry.boundingBoxTree(), lowDimFvGridGeometry.boundingBoxTree());
486 }
487
488 template<class Geometry, class GlobalPosition>
489 Scalar computeDistance(const Geometry& geometry, const GlobalPosition& p)
490 {
491 Scalar avgDist = 0.0;
492 const auto& quad = Dune::QuadratureRules<Scalar, bulkDim>::rule(geometry.type(), 5);
493 for (auto&& qp : quad)
494 {
495 const auto globalPos = geometry.global(qp.position());
496 avgDist += (globalPos-p).two_norm()*qp.weight();
497 }
498 return avgDist;
499 }
500
502 std::vector<PointSourceData>& pointSourceData()
503 { return pointSourceData_; }
504
506 std::vector<Scalar>& averageDistanceToBulkCell()
507 { return averageDistanceToBulkCell_; }
508
510 template<std::size_t i>
511 std::vector<PointSource<i>>& pointSources(Dune::index_constant<i> dom)
512 { return std::get<i>(pointSources_); }
513
515 template<std::size_t i>
516 CouplingStencils& couplingStencils(Dune::index_constant<i> dom)
517 { return (i == 0) ? bulkCouplingStencils_ : lowDimCouplingStencils_; }
518
520 template<std::size_t i>
521 std::vector<std::size_t>& vertexIndices(Dune::index_constant<i> dom, std::size_t eIdx)
522 { return (i == 0) ? bulkVertexIndices_[eIdx] : lowDimVertexIndices_[eIdx]; }
523
525 template<std::size_t i>
526 std::vector<std::vector<std::size_t>>& vertexIndices(Dune::index_constant<i> dom)
527 { return (i == 0) ? bulkVertexIndices_ : lowDimVertexIndices_; }
528
529 const GlueType& glue() const
530 { return *glue_; }
531
533 Implementation &asImp_()
534 { return *static_cast<Implementation *>(this); }
535
537 const Implementation &asImp_() const
538 { return *static_cast<const Implementation *>(this); }
539
541 std::size_t idCounter_ = 0;
542
543private:
544
546 std::tuple<std::vector<PointSource<bulkIdx>>, std::vector<PointSource<lowDimIdx>>> pointSources_;
547 mutable std::vector<PointSourceData> pointSourceData_;
548 std::vector<Scalar> averageDistanceToBulkCell_;
549
551 std::vector<std::vector<std::size_t>> bulkVertexIndices_;
552 std::vector<std::vector<std::size_t>> lowDimVertexIndices_;
553 CouplingStencils bulkCouplingStencils_;
554 CouplingStencils lowDimCouplingStencils_;
555 CouplingStencil emptyStencil_;
556
558 std::shared_ptr<GlueType> glue_;
559
561 int integrationOrder_ = 1;
562};
563
564} // end namespace Dumux
565
566#endif
Algorithms that finds which geometric entites intersect.
The available discretization methods in Dumux.
An integration point source class, i.e. sources located at a single point in space associated with a ...
Data associated with a point source.
A class glueing two grids of potentially different dimension geometrically. Intersections are compute...
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
A vector of primary variables.
Definition: common/properties.hh:60
A vector of size number equations that can be used for Neumann fluxes, sources, residuals,...
Definition: common/properties.hh:62
Property to specify the type of a problem which has to be solved.
Definition: common/properties.hh:70
Definition: common/properties.hh:113
Definition: multidomain/couplingmanager.hh:46
void setSubProblems(const std::tuple< std::shared_ptr< SubProblems >... > &problems)
set the pointers to the sub problems
Definition: multidomain/couplingmanager.hh:247
const Problem< i > & problem(Dune::index_constant< i > domainIdx) const
Return a reference to the sub problem.
Definition: multidomain/couplingmanager.hh:264
SolutionVector & curSol()
the solution vector of the coupled problem
Definition: multidomain/couplingmanager.hh:278
void updateSolution(const SolutionVector &curSol)
Updates the entire solution vector, e.g. before assembly or after grid adaption.
Definition: multidomain/couplingmanager.hh:186
the default point source traits
Definition: couplingmanagerbase.hh:51
Manages the coupling between bulk elements and lower dimensional elements Point sources on each integ...
Definition: couplingmanagerbase.hh:77
Scalar averageDistance(std::size_t id) const
return the average distance to the coupled bulk cell center
Definition: couplingmanagerbase.hh:397
Implementation & asImp_()
Returns the implementation of the problem (i.e. static polymorphism)
Definition: couplingmanagerbase.hh:533
const std::vector< PointSource< i > > & pointSources(Dune::index_constant< i > dom) const
Return the point source if domain i.
Definition: couplingmanagerbase.hh:410
PSTraits PointSourceTraits
export the point source traits
Definition: couplingmanagerbase.hh:113
std::vector< std::vector< std::size_t > > & vertexIndices(Dune::index_constant< i > dom)
Return a reference to the vertex indices container.
Definition: couplingmanagerbase.hh:526
const GridView< id > & gridView(Dune::index_constant< id > domainIdx) const
Return a reference to the bulk problem.
Definition: couplingmanagerbase.hh:379
const Implementation & asImp_() const
Returns the implementation of the problem (i.e. static polymorphism)
Definition: couplingmanagerbase.hh:537
std::vector< Scalar > & averageDistanceToBulkCell()
Return reference to average distances to bulk cell.
Definition: couplingmanagerbase.hh:506
void preComputeVertexIndices(Dune::index_constant< id > domainIdx)
computes the vertex indices per element for the box method
Definition: couplingmanagerbase.hh:430
const std::vector< PointSource< bulkIdx > > & bulkPointSources() const
Return reference to bulk point sources.
Definition: couplingmanagerbase.hh:401
const PointSourceData & pointSourceData(std::size_t id) const
Methods to be accessed by the subproblems.
Definition: couplingmanagerbase.hh:374
EmbeddedCouplingManagerBase(std::shared_ptr< const GridGeometry< bulkIdx > > bulkFvGridGeometry, std::shared_ptr< const GridGeometry< lowDimIdx > > lowDimFvGridGeometry)
Constructor.
Definition: couplingmanagerbase.hh:129
void updateAfterGridAdaption(std::shared_ptr< const GridGeometry< bulkIdx > > bulkFvGridGeometry, std::shared_ptr< const GridGeometry< lowDimIdx > > lowDimFvGridGeometry)
call this after grid adaption
Definition: couplingmanagerbase.hh:120
void glueGrids()
compute the intersections between the two grids
Definition: couplingmanagerbase.hh:479
MDTraits MultiDomainTraits
export traits
Definition: couplingmanagerbase.hh:111
void computePointSourceData(std::size_t order=1, bool verbose=false)
Definition: couplingmanagerbase.hh:234
std::vector< std::size_t > & vertexIndices(Dune::index_constant< i > dom, std::size_t eIdx)
Return a reference to the vertex indices.
Definition: couplingmanagerbase.hh:521
std::vector< PointSourceData > & pointSourceData()
Return reference to point source data vector member.
Definition: couplingmanagerbase.hh:502
Scalar computeDistance(const Geometry &geometry, const GlobalPosition &p)
Definition: couplingmanagerbase.hh:489
CouplingStencils & couplingStencils(Dune::index_constant< i > dom)
Return reference to bulk coupling stencil member of domain i.
Definition: couplingmanagerbase.hh:516
PrimaryVariables< lowDimIdx > lowDimPriVars(std::size_t id) const
Return data for a low dim point source with the identifier id.
Definition: couplingmanagerbase.hh:390
const std::vector< PointSource< lowDimIdx > > & lowDimPointSources() const
Return reference to low dim point sources.
Definition: couplingmanagerbase.hh:405
const CouplingStencil & couplingStencil(Dune::index_constant< i > domainI, const Element< i > &element, Dune::index_constant< j > domainJ) const
Methods to be accessed by the assembly.
Definition: couplingmanagerbase.hh:173
void clear()
Clear all internal data members.
Definition: couplingmanagerbase.hh:464
const GlueType & glue() const
Definition: couplingmanagerbase.hh:529
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...
Definition: couplingmanagerbase.hh:199
const CouplingStencils & couplingStencils(Dune::index_constant< i > dom) const
Return reference to bulk coupling stencil member of domain i.
Definition: couplingmanagerbase.hh:415
void init(std::shared_ptr< Problem< bulkIdx > > bulkProblem, std::shared_ptr< Problem< lowDimIdx > > lowDimProblem, const SolutionVector &curSol)
Methods to be accessed by main.
Definition: couplingmanagerbase.hh:140
std::vector< PointSource< i > > & pointSources(Dune::index_constant< i > dom)
Return the point source if domain i.
Definition: couplingmanagerbase.hh:511
const CouplingStencil & emptyStencil() const
Return a reference to an empty stencil.
Definition: couplingmanagerbase.hh:423
PrimaryVariables< bulkIdx > bulkPriVars(std::size_t id) const
Return data for a bulk point source with the identifier id.
Definition: couplingmanagerbase.hh:383
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
Definition: couplingmanagerbase.hh:449
std::size_t idCounter_
id generator for point sources
Definition: couplingmanagerbase.hh:541
const std::vector< PointSourceData > & pointSourceData() const
Return reference to point source data vector member.
Definition: couplingmanagerbase.hh:419
std::unordered_map< std::size_t, CouplingStencil > CouplingStencils
export stencil types
Definition: couplingmanagerbase.hh:115
An integration point source class with an identifier to attach data and a quadrature weight and integ...
Definition: integrationpointsource.hh:44
A helper class calculating a DOF-index to point source map.
Definition: integrationpointsource.hh:107
A point source data class used for integration in multidimension models.
Definition: pointsourcedata.hh:43
Definition: glue.hh:38
Declares all properties used in Dumux.
The interface of the coupling manager for multi domain problems.