version 3.11-dev
Loading...
Searching...
No Matches
discretization/pq1bubble/fvgridgeometry.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-FileCopyrightText: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
14#ifndef DUMUX_DISCRETIZATION_PQ1BUBBLE_GRID_GEOMETRY_HH
15#define DUMUX_DISCRETIZATION_PQ1BUBBLE_GRID_GEOMETRY_HH
16
17#include <ranges>
18#include <utility>
19#include <unordered_map>
20#include <type_traits>
21#include <span>
22
23#include <dune/grid/common/mcmgmapper.hh>
24
26
29
32
41
44
45namespace Dumux {
46
47namespace Detail {
48template<class T>
50 = typename T::EnableHybridCVFE;
51
52template<class T>
53static constexpr bool enablesHybridCVFE
54 = Dune::Std::detected_or_t<std::false_type, EnableHybridCVFE, T>{};
55
56template<class GV, class T>
57using PQ1BubbleGeometryHelper_t = Dune::Std::detected_or_t<
58 std::conditional_t<enablesHybridCVFE<T>,
61 >,
63 T
64>;
65} // end namespace Detail
66
67template <class GridView, std::size_t numCubeBubbles = 1>
69{
70 using DofMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
71 static_assert(numCubeBubbles == 1 || numCubeBubbles == 2,
72 "PQ1BubbleMapperTraits supports numCubeBubbles = 1 or 2");
73 static constexpr std::size_t numCubeBubbleDofs = numCubeBubbles;
74
78 static Dune::MCMGLayout layout()
79 {
80 return [](Dune::GeometryType gt, int dimgrid) {
81 if (gt.dim() == 0)
82 return int(1);
83
84 if (gt.dim() == dimgrid)
85 return gt.isCube() ? int(numCubeBubbleDofs) : int(1);
86
87 return int(0);
88 };
89 }
90};
91
96template<class GridView,
100 class IntersectionRule = Dumux::QuadratureRules::MidpointQuadrature,
101 class BoundaryFaceRule = Dumux::QuadratureRules::MidpointQuadrature>
103
110template<class GridView, class MapperTraits = PQ1BubbleMapperTraits<GridView>, class QuadratureTraits = PQ1BubbleQuadratureTraits<GridView>>
112: public MapperTraits, public QuadratureTraits
113{
116
117 template<class GridGeometry, bool enableCache>
119
120 static constexpr std::size_t maxNumElementDofs = (1<<GridView::dimension)
121 + MapperTraits::numCubeBubbleDofs;
122};
123
130template<class BaseTraits>
132: public BaseTraits
133{ using EnableHybridCVFE = std::true_type; };
134
141template<class Scalar,
142 class GV,
143 bool enableCaching = true,
146: public BaseGridGeometry<GV, Traits>
147{
149 using ParentType = BaseGridGeometry<GV, Traits>;
150 using GridIndexType = typename IndexTraits<GV>::GridIndex;
151 using LocalIndexType = typename IndexTraits<GV>::LocalIndex;
152
153 using Element = typename GV::template Codim<0>::Entity;
154 using CoordScalar = typename GV::ctype;
155 static const int dim = GV::dimension;
156 static const int dimWorld = GV::dimensionworld;
157
158 static_assert(dim > 1, "Only implemented for dim > 1");
159
160public:
164
166
167 static constexpr std::size_t maxNumElementDofs = Traits::maxNumElementDofs;
168
172 using LocalView = typename Traits::template LocalView<ThisType, true>;
174 using SubControlVolume = typename Traits::SubControlVolume;
176 using SubControlVolumeFace = typename Traits::SubControlVolumeFace;
182 using DofMapper = typename Traits::DofMapper;
186 using GridView = GV;
190 using ScvQuadratureRule = typename Traits::ScvQuadratureRule;
192 using ScvfQuadratureRule = typename Traits::ScvfQuadratureRule;
194 using ElementQuadratureRule = typename Traits::ElementQuadratureRule;
196 using IntersectionQuadratureRule = typename Traits::IntersectionQuadratureRule;
198 using BoundaryFaceQuadratureRule = typename Traits::BoundaryFaceQuadratureRule;
199
201 PQ1BubbleFVGridGeometry(std::shared_ptr<BasicGridGeometry> gg)
202 : ParentType(std::move(gg))
203 , dofMapper_(this->gridView(), Traits::layout())
204 , cache_(*this)
205 , periodicGridTraits_(this->gridView().grid())
206 {
207 update_();
208 }
209
214
216 const DofMapper& dofMapper() const
217 { return dofMapper_; }
218
220 std::size_t numScv() const
221 { return numScv_; }
222
224 std::size_t numScvf() const
225 { return numScvf_; }
226
228 std::size_t numBoundaryScvf() const
229 { return numBoundaryScvf_; }
230
232 std::size_t numDofs() const
233 { return this->dofMapper().size(); }
234
237 {
239 update_();
240 }
241
244 {
245 ParentType::update(std::move(gridView));
246 update_();
247 }
248
250 const FeCache& feCache() const
251 { return feCache_; }
252
254 bool dofOnBoundary(GridIndexType dofIdx) const
255 { return boundaryDofIndices_[dofIdx]; }
256
258 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
259 { return periodicDofMap_.count(dofIdx); }
260
262 [[deprecated("Will be removed after release 3.11. Use periodicallyMappedDofs, returning a range of dofs")]]
263 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
264 { return periodicDofMap_.at(dofIdx)[0]; }
265
267 const std::ranges::range auto periodicallyMappedDofs(GridIndexType dofIdx) const
268 { return std::views::all(periodicDofMap_.at(dofIdx)); }
269
271 const std::unordered_map<GridIndexType, std::vector<GridIndexType>>& periodicDofMap() const
272 { return periodicDofMap_; }
273
276 { return { gg.cache_ }; }
277
278private:
279 class PQ1BubbleGridGeometryCache
280 {
281 friend class PQ1BubbleFVGridGeometry;
282 public:
286 using DofHelper = typename GeometryHelper::DofHelper;
287
288 explicit PQ1BubbleGridGeometryCache(const PQ1BubbleFVGridGeometry& gg)
289 : gridGeometry_(&gg)
290 {}
291
292 const PQ1BubbleFVGridGeometry& gridGeometry() const
293 { return *gridGeometry_; }
294
296 const std::vector<SubControlVolume>& scvs(GridIndexType eIdx) const
297 { return scvs_[eIdx]; }
298
300 const std::vector<SubControlVolumeFace>& scvfs(GridIndexType eIdx) const
301 { return scvfs_[eIdx]; }
302
304 bool hasBoundaryScvf(GridIndexType eIdx) const
305 { return hasBoundaryScvf_[eIdx]; }
306
308 const std::vector<std::array<LocalIndexType, 2>>& scvfBoundaryGeometryKeys(GridIndexType eIdx) const
309 { return scvfBoundaryGeometryKeys_.at(eIdx); }
310
312 auto boundaryFaces(GridIndexType eIdx) const -> std::span<const BoundaryFace>
313 {
314 if (auto it = boundaryFaces_.find(eIdx); it != boundaryFaces_.end())
315 return {it->second};
316 return {};
317 }
318
320 const auto& boundaryFaceScvfRanges(GridIndexType eIdx) const
321 { return boundaryFaceScvfRanges_.at(eIdx); }
322
323 private:
324 void clear_()
325 {
326 scvs_.clear();
327 scvfs_.clear();
328 hasBoundaryScvf_.clear();
329 scvfBoundaryGeometryKeys_.clear();
330 boundaryFaces_.clear();
331 boundaryFaceScvfRanges_.clear();
332 }
333
334 std::vector<std::vector<SubControlVolume>> scvs_;
335 std::vector<std::vector<SubControlVolumeFace>> scvfs_;
336 std::vector<bool> hasBoundaryScvf_;
337 std::unordered_map<GridIndexType, std::vector<std::array<LocalIndexType, 2>>> scvfBoundaryGeometryKeys_;
338 std::unordered_map<GridIndexType, Dune::ReservedVector<typename PQ1BubbleFVGridGeometry::BoundaryFace, 2*dim>> boundaryFaces_;
339 std::unordered_map<GridIndexType, Dune::ReservedVector<std::array<LocalIndexType, 2>, 2*dim>> boundaryFaceScvfRanges_;
340
341 const PQ1BubbleFVGridGeometry* gridGeometry_;
342 };
343
344public:
347 using Cache = PQ1BubbleGridGeometryCache;
348
349private:
350 using GeometryHelper = typename Cache::GeometryHelper;
351 using DofHelper = typename Cache::DofHelper;
352
353 void update_()
354 {
355 cache_.clear_();
356 dofMapper_.update(this->gridView());
357
358 auto numElements = this->gridView().size(0);
359 cache_.scvs_.resize(numElements);
360 cache_.scvfs_.resize(numElements);
361 cache_.hasBoundaryScvf_.resize(numElements, false);
362
363 boundaryDofIndices_.assign(numDofs(), false);
364 periodicDofMap_.clear();
365
366 numScv_ = 0;
367 numScvf_ = 0;
368 numBoundaryScvf_ = 0;
369
370 // Build the scvs and scv faces
371 for (const auto& element : elements(this->gridView()))
372 {
373 auto eIdx = this->elementMapper().index(element);
374
375 // get the element geometry
376 auto elementGeometry = element.geometry();
377 if (!enableHybridCVFE && elementGeometry.type().isCube() && Traits::numCubeBubbleDofs > 1)
378 DUNE_THROW(Dune::NotImplemented, "Multiple bubble dofs for cube elements only for hybrid scheme.");
379
380 const auto refElement = referenceElement(elementGeometry);
381 const auto& localCoefficients = this->feCache().get(element.type()).localCoefficients();
382
383 // instantiate the geometry helper
384 GeometryHelper geometryHelper(elementGeometry);
385
386 numScv_ += geometryHelper.numScv();
387 // construct the sub control volumes
388 cache_.scvs_[eIdx].resize(geometryHelper.numScv());
389
390 // Scvs related to control volumes
391 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < geometryHelper.numScv(); ++scvLocalIdx)
392 {
393 auto corners = geometryHelper.getScvCorners(scvLocalIdx);
394 cache_.scvs_[eIdx][scvLocalIdx] = SubControlVolume(
395 geometryHelper.scvVolume(scvLocalIdx, corners),
396 geometryHelper.dofPosition(scvLocalIdx),
397 Dumux::center(corners),
398 scvLocalIdx,
399 eIdx,
400 DofHelper::dofIndex(this->dofMapper(), element, localCoefficients.localKey(scvLocalIdx)),
401 geometryHelper.isOverlappingScv(scvLocalIdx)
402 );
403 }
404
405 // construct the sub control volume faces
406 const auto numInteriorScvfs = GeometryHelper::numInteriorScvf(elementGeometry.type());
407 numScvf_ += numInteriorScvfs;
408 cache_.scvfs_[eIdx].resize(numInteriorScvfs);
409 LocalIndexType scvfLocalIdx = 0;
410 for (; scvfLocalIdx < numInteriorScvfs; ++scvfLocalIdx)
411 {
412 const auto scvPair = geometryHelper.getScvPairForScvf(scvfLocalIdx);
413 const auto corners = geometryHelper.getScvfCorners(scvfLocalIdx);
414 const auto area = Dumux::convexPolytopeVolume<dim-1>(
415 geometryHelper.getInteriorScvfGeometryType(scvfLocalIdx),
416 [&](unsigned int i){ return corners[i]; }
417 );
418
419 cache_.scvfs_[eIdx][scvfLocalIdx] = SubControlVolumeFace(
420 Dumux::center(corners),
421 area,
422 geometryHelper.normal(corners, scvPair),
423 std::move(scvPair),
424 scvfLocalIdx,
425 geometryHelper.isOverlappingScvf(scvfLocalIdx)
426 );
427 }
428
429 // construct the sub control volume faces on the domain boundary
430 LocalIndexType numBoundaryFaces = 0;
431 for (const auto& intersection : intersections(this->gridView(), element))
432 {
433 if (intersection.boundary() && !intersection.neighbor())
434 {
435 cache_.hasBoundaryScvf_[eIdx] = true;
436
437 // add one boundary face per boundary intersection
438 const auto isGeometry = intersection.geometry();
439 cache_.boundaryFaces_[eIdx].push_back(BoundaryFace{
440 isGeometry.center(),
441 isGeometry.volume(),
442 intersection.centerUnitOuterNormal(),
443 numBoundaryFaces++,
444 static_cast<LocalIndexType>(intersection.indexInInside()),
445 typename BoundaryFace::Traits::BoundaryFlag{intersection}
446 });
447
448 const auto localFacetIndex = intersection.indexInInside();
449 const auto numBoundaryScvf = GeometryHelper::numBoundaryScvf(elementGeometry.type(), localFacetIndex);
450 numScvf_ += numBoundaryScvf;
451 numBoundaryScvf_ += numBoundaryScvf;
452
453 // record the scvf subrange for this boundary face: {offset, count}
454 cache_.boundaryFaceScvfRanges_[eIdx].push_back(std::array<LocalIndexType, 2>{{
455 scvfLocalIdx,
456 static_cast<LocalIndexType>(numBoundaryScvf)
457 }});
458
459 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < numBoundaryScvf; ++isScvfLocalIdx)
460 {
461 // find the scvs this scvf is belonging to
462 const auto scvPair = geometryHelper.getScvPairForBoundaryScvf(localFacetIndex, isScvfLocalIdx);
463 const auto corners = geometryHelper.getBoundaryScvfCorners(localFacetIndex, isScvfLocalIdx);
464 const auto area = Dumux::convexPolytopeVolume<dim-1>(
465 geometryHelper.getBoundaryScvfGeometryType(isScvfLocalIdx),
466 [&](unsigned int i){ return corners[i]; }
467 );
468 cache_.scvfs_[eIdx].emplace_back(
469 Dumux::center(corners),
470 area,
471 intersection.centerUnitOuterNormal(),
472 std::move(scvPair),
473 scvfLocalIdx,
474 typename SubControlVolumeFace::Traits::BoundaryFlag{ intersection },
475 geometryHelper.isOverlappingBoundaryScvf(localFacetIndex)
476 );
477
478 // store look-up map to construct boundary scvf geometries
479 cache_.scvfBoundaryGeometryKeys_[eIdx].emplace_back(std::array<LocalIndexType, 2>{{
480 static_cast<LocalIndexType>(localFacetIndex),
481 static_cast<LocalIndexType>(isScvfLocalIdx)
482 }});
483
484 // increment local counter
485 scvfLocalIdx++;
486 }
487
488 const auto numDofsIntersection = DofHelper::numLocalDofsIntersection(elementGeometry.type(), localFacetIndex);
489 // TODO also move this to helper class
490 // add all dofs on the intersection to the set of boundary dofs
491 for (int ilocalDofIdx = 0; ilocalDofIdx < numDofsIntersection; ++ilocalDofIdx)
492 {
493 auto localDofIdx = DofHelper::localDofIndexIntersection(elementGeometry.type(), localFacetIndex, ilocalDofIdx);
494 const auto vIdxGlobal = DofHelper::dofIndex(this->dofMapper(), element, localCoefficients.localKey(localDofIdx));
495 boundaryDofIndices_[vIdxGlobal] = true;
496 }
497 }
498
499 // inform the grid geometry if we have periodic boundaries
500 else if (periodicGridTraits_.isPeriodic(intersection))
501 {
502 this->setPeriodic();
503
504 // find the mapped periodic vertex of all vertices on periodic boundaries
505 const auto fIdx = intersection.indexInInside();
506 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
507 const auto eps = 1e-7*(elementGeometry.corner(1) - elementGeometry.corner(0)).two_norm();
508 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
509 {
510 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
511 const auto vIdxGlobal = this->dofMapper().subIndex(element, vIdx, dim);
512 const auto vPos = elementGeometry.corner(vIdx);
513
514 const auto& outside = intersection.outside();
515 const auto outsideGeometry = outside.geometry();
516 for (const auto& isOutside : intersections(this->gridView(), outside))
517 {
518 // only check periodic vertices of the periodic neighbor
519 if (periodicGridTraits_.isPeriodic(isOutside))
520 {
521 const auto fIdxOutside = isOutside.indexInInside();
522 const auto numFaceVertsOutside = refElement.size(fIdxOutside, 1, dim);
523 for (int localVIdxOutside = 0; localVIdxOutside < numFaceVertsOutside; ++localVIdxOutside)
524 {
525 const auto vIdxOutside = refElement.subEntity(fIdxOutside, 1, localVIdxOutside, dim);
526 const auto vPosOutside = outsideGeometry.corner(vIdxOutside);
527 const auto shift = std::abs((this->bBoxMax()-this->bBoxMin())*intersection.centerUnitOuterNormal());
528 if ((vPosOutside - vPos + shift*intersection.centerUnitOuterNormal()).two_norm() < eps)
529 Dumux::Detail::addPeriodicallyMappedDof(periodicDofMap_, vIdxGlobal, this->dofMapper().subIndex(outside, vIdxOutside, dim));
530 }
531 }
532 }
533 }
534 }
535 }
536 }
537
538 Dumux::Detail::closePeriodicDofMap(periodicDofMap_);
539
540 // error check: periodic boundaries currently don't work for pq1bubble in parallel
541 if (this->isPeriodic() && this->gridView().comm().size() > 1)
542 DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for pq1bubble method for parallel simulations!");
543 }
544
545 DofMapper dofMapper_;
546
547 const FeCache feCache_;
548
549 std::size_t numScv_;
550 std::size_t numScvf_;
551 std::size_t numBoundaryScvf_;
552
553 // vertices on the boundary
554 std::vector<bool> boundaryDofIndices_;
555
556 // a map for periodic boundary vertices
557 std::unordered_map<GridIndexType, std::vector<GridIndexType>> periodicDofMap_;
558
559 Cache cache_;
560
562};
563
564} // end namespace Dumux
565
566#endif
Base class for grid geometries.
Implementation of a boundary face related to primary grid elements (dune intersections).
Compute the center point of a convex polytope geometry or a random-access container of corner points.
const ElementMapper & elementMapper() const
Returns the mapper for elements to indices for constant grids.
Definition basegridgeometry.hh:112
void setPeriodic(bool value=true)
Set the periodicity of the grid geometry.
Definition basegridgeometry.hh:169
const GlobalCoordinate & bBoxMax() const
The coordinate of the corner of the GridView's bounding box with the largest values.
Definition basegridgeometry.hh:156
Element element(GridIndexType eIdx) const
Definition basegridgeometry.hh:142
const GridView & gridView() const
Definition basegridgeometry.hh:100
void update(const GridView &gridView)
Update all fvElementGeometries (call this after grid adaption).
Definition basegridgeometry.hh:88
const GlobalCoordinate & bBoxMin() const
The coordinate of the corner of the GridView's bounding box with the smallest values.
Definition basegridgeometry.hh:149
bool isPeriodic() const
Returns if the grid geometry is periodic (at all).
Definition basegridgeometry.hh:162
Class for a boundary face related to primary grid elements (dune intersections).
Definition boundaryface.hh:69
Definition discretization/pq1bubble/geometryhelper.hh:461
Definition pq1bubblefecache.hh:29
const FiniteElementType & get(const Dune::GeometryType &gt) const
Get local finite element for given GeometryType.
Definition pq1bubblefecache.hh:48
Base class for the finite volume geometry vector for pq1bubble models This builds up the sub control ...
Definition discretization/pq1bubble/fvelementgeometry.hh:44
Base class for the finite volume geometry vector for pq1bubble schemes This builds up the sub control...
Definition discretization/pq1bubble/fvgridgeometry.hh:147
void update(const GridView &gridView)
update all geometries (call this after grid adaption)
Definition discretization/pq1bubble/fvgridgeometry.hh:236
friend LocalView localView(const PQ1BubbleFVGridGeometry &gg)
local view of this object (constructed with the internal cache)
Definition discretization/pq1bubble/fvgridgeometry.hh:275
PQ1BubbleGridGeometryCache Cache
Definition discretization/pq1bubble/fvgridgeometry.hh:347
PQ1BubbleFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg)
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition discretization/pq1bubble/fvgridgeometry.hh:201
const std::unordered_map< GridIndexType, std::vector< GridIndexType > > & periodicDofMap() const
Returns the map between dofs across periodic boundaries.
Definition discretization/pq1bubble/fvgridgeometry.hh:271
static constexpr DiscretizationMethod discMethod
Definition discretization/pq1bubble/fvgridgeometry.hh:163
std::size_t numBoundaryScvf() const
The total number of boundary sub control volume faces.
Definition discretization/pq1bubble/fvgridgeometry.hh:228
Dumux::PQ1BubbleFECache< CoordScalar, Scalar, dim, PQ1BubbleDefaultGridGeometryTraits< GridView >::numCubeBubbleDofs > FeCache
Definition discretization/pq1bubble/fvgridgeometry.hh:184
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::ElementQuadratureRule ElementQuadratureRule
Definition discretization/pq1bubble/fvgridgeometry.hh:194
PQ1BubbleFVGridGeometry(const GridView &gridView)
Constructor.
Definition discretization/pq1bubble/fvgridgeometry.hh:211
BasicGridGeometry_t< GridView, PQ1BubbleDefaultGridGeometryTraits< GridView > > BasicGridGeometry
Definition discretization/pq1bubble/fvgridgeometry.hh:170
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/pq1bubble/fvgridgeometry.hh:220
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/pq1bubble/fvgridgeometry.hh:224
static constexpr std::size_t maxNumElementDofs
Definition discretization/pq1bubble/fvgridgeometry.hh:167
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition discretization/pq1bubble/fvgridgeometry.hh:250
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition discretization/pq1bubble/fvgridgeometry.hh:263
DiscretizationMethods::PQ1Bubble DiscretizationMethod
Definition discretization/pq1bubble/fvgridgeometry.hh:162
const std::ranges::range auto periodicallyMappedDofs(GridIndexType dofIdx) const
The indices of the vertices / d.o.f. on the other side of the periodic boundary.
Definition discretization/pq1bubble/fvgridgeometry.hh:267
Extrusion_t< PQ1BubbleDefaultGridGeometryTraits< GridView > > Extrusion
Definition discretization/pq1bubble/fvgridgeometry.hh:180
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::BoundaryFaceQuadratureRule BoundaryFaceQuadratureRule
Definition discretization/pq1bubble/fvgridgeometry.hh:198
static constexpr bool enableHybridCVFE
Definition discretization/pq1bubble/fvgridgeometry.hh:165
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::SubControlVolumeFace SubControlVolumeFace
Definition discretization/pq1bubble/fvgridgeometry.hh:176
std::size_t numDofs() const
The total number of degrees of freedom.
Definition discretization/pq1bubble/fvgridgeometry.hh:232
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition discretization/pq1bubble/fvgridgeometry.hh:254
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::DofMapper DofMapper
Definition discretization/pq1bubble/fvgridgeometry.hh:182
const DofMapper & dofMapper() const
The dofMapper.
Definition discretization/pq1bubble/fvgridgeometry.hh:216
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::ScvfQuadratureRule ScvfQuadratureRule
Definition discretization/pq1bubble/fvgridgeometry.hh:192
GridView GridView
Definition discretization/pq1bubble/fvgridgeometry.hh:186
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition discretization/pq1bubble/fvgridgeometry.hh:258
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::template LocalView< ThisType, true > LocalView
Definition discretization/pq1bubble/fvgridgeometry.hh:172
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::SubControlVolume SubControlVolume
Definition discretization/pq1bubble/fvgridgeometry.hh:174
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::ScvQuadratureRule ScvQuadratureRule
Definition discretization/pq1bubble/fvgridgeometry.hh:190
typename PeriodicGridTraits< typename GridView::Grid >::SupportsPeriodicity SupportsPeriodicity
Definition discretization/pq1bubble/fvgridgeometry.hh:188
void update(GridView &&gridView)
update all geometries (call this after grid adaption)
Definition discretization/pq1bubble/fvgridgeometry.hh:243
Experimental::BoundaryFace< GridView > BoundaryFace
Definition discretization/pq1bubble/fvgridgeometry.hh:178
typename PQ1BubbleDefaultGridGeometryTraits< GridView >::IntersectionQuadratureRule IntersectionQuadratureRule
Definition discretization/pq1bubble/fvgridgeometry.hh:196
A class to create sub control volume and sub control volume face geometries per element.
Definition discretization/pq1bubble/geometryhelper.hh:176
Class for a sub control volume face in the cvfe method, i.e a part of the boundary of a sub control v...
Definition discretization/pq1bubble/subcontrolvolumeface.hh:58
the sub control volume for the pq1bubble scheme
Definition discretization/pq1bubble/subcontrolvolume.hh:55
Defines the default element and vertex mapper types.
Base class for the local finite volume geometry for the pq1bubble method This builds up the sub contr...
Helper class constructing the dual grid finite volume geometries for the cvfe discretizazion method.
the sub control volume for the cvfe scheme
Base class for a sub control volume face.
Helper classes to compute the integration elements.
void closePeriodicDofMap(std::unordered_map< Index, std::vector< Index > > &periodicDofMap)
Map every degree of freedom to all others it is identified with.
Definition periodicdofmap.hh:48
Dune::Std::detected_or_t< Dumux::BasicGridGeometry< GV, typename T::ElementMapper, typename T::VertexMapper >, Detail::SpecifiesBaseGridGeometry, T > BasicGridGeometry_t
Type of the basic grid geometry implementation used as backend.
Definition basegridgeometry.hh:38
void addPeriodicallyMappedDof(std::unordered_map< Index, std::vector< Index > > &periodicDofMap, std::type_identity_t< Index > dofIdx, std::type_identity_t< Index > periodicDofIdx)
Register a degree of freedom as periodically mapped to another one.
Definition periodicdofmap.hh:29
BaseGridGeometry(std::shared_ptr< BaseImplementation > impl)
Constructor from a BaseImplementation.
Definition basegridgeometry.hh:72
auto convexPolytopeVolume(Dune::GeometryType type, const CornerF &c)
Compute the volume of several common geometry types.
Definition volume.hh:41
Corners::value_type center(const Corners &corners)
The center of a given list of corners.
Definition center.hh:24
CVFE::DefaultQuadratureTraits< GridView, ScvRule, ScvfRule, ElementRule, IntersectionRule, BoundaryFaceRule > PQ1BubbleQuadratureTraits
Quadrature rule traits for PQ1Bubble discretization.
Definition discretization/pq1bubble/fvgridgeometry.hh:102
Defines the index types used for grid and local indices.
The available discretization methods in Dumux.
Definition cvfelocalresidual.hh:25
Dune::Std::detected_or_t< std::conditional_t< enablesHybridCVFE< T >, Dumux::HybridPQ1BubbleGeometryHelper< GV, typename T::SubControlVolume, typename T::SubControlVolumeFace, T::numCubeBubbleDofs >, Dumux::PQ1BubbleGeometryHelper< GV, typename T::SubControlVolume, typename T::SubControlVolumeFace > >, SpecifiesGeometryHelper, T > PQ1BubbleGeometryHelper_t
Definition discretization/pq1bubble/fvgridgeometry.hh:56
static constexpr bool enablesHybridCVFE
Definition discretization/pq1bubble/fvgridgeometry.hh:53
typename T::GeometryHelper SpecifiesGeometryHelper
Definition basegridgeometry.hh:30
typename T::EnableHybridCVFE EnableHybridCVFE
Definition discretization/pq1bubble/fvgridgeometry.hh:49
CVFE< CVFEMethods::PQ1Bubble > PQ1Bubble
Definition method.hh:126
Definition adapt.hh:17
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition extrusion.hh:257
Helpers for maps between degrees of freedom identified across periodic boundaries.
Grid properties related to periodicity.
A finite element cache for P1/Q1 function with bubble.
Quadrature rule traits for discretization schemes.
Definition quadraturerules.hh:86
Definition defaultmappertraits.hh:23
The default traits for the hybrid pq1bubble finite volume grid geometry Defines the scv and scvf type...
Definition discretization/pq1bubble/fvgridgeometry.hh:133
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
unsigned int LocalIndex
Definition indextraits.hh:28
The default traits for the pq1bubble finite volume grid geometry Defines the scv and scvf types and t...
Definition discretization/pq1bubble/fvgridgeometry.hh:113
PQ1BubbleSubControlVolumeFace< GridView > SubControlVolumeFace
Definition discretization/pq1bubble/fvgridgeometry.hh:115
PQ1BubbleFVElementGeometry< GridGeometry, enableCache > LocalView
Definition discretization/pq1bubble/fvgridgeometry.hh:118
static constexpr std::size_t maxNumElementDofs
Definition discretization/pq1bubble/fvgridgeometry.hh:120
PQ1BubbleSubControlVolume< GridView > SubControlVolume
Definition discretization/pq1bubble/fvgridgeometry.hh:114
Definition discretization/pq1bubble/fvgridgeometry.hh:69
static constexpr std::size_t numCubeBubbleDofs
Definition discretization/pq1bubble/fvgridgeometry.hh:73
static Dune::MCMGLayout layout()
Layout for elements (numCubeBubbleDofs) and vertices.
Definition discretization/pq1bubble/fvgridgeometry.hh:78
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > DofMapper
Definition discretization/pq1bubble/fvgridgeometry.hh:70
Definition periodicgridtraits.hh:24
Definition periodicgridtraits.hh:23
Dune-based quadrature rule with specified order.
Definition quadraturerules.hh:67
Midpoint quadrature rule that uses scv/scvf centers.
Definition quadraturerules.hh:59
Compute the volume of several common geometry types.