version 3.11-dev
Loading...
Searching...
No Matches
discretization/pq2/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_PQ2_GRID_GEOMETRY_HH
15#define DUMUX_DISCRETIZATION_PQ2_GRID_GEOMETRY_HH
16
17#include <array>
18#include <cstddef>
19#include <memory>
20#include <vector>
21#include <utility>
22#include <unordered_map>
23#include <type_traits>
24#include <span>
25#include <ranges>
26
27#include <dune/grid/common/mcmgmapper.hh>
28#include <dune/geometry/type.hh>
29#include <dune/localfunctions/lagrange/lagrangelfecache.hh>
30
32
35
38
47
50
51namespace Dumux {
52
53namespace Detail {
54
55template<class GV, class T>
56using PQ2GeometryHelper_t = Dune::Std::detected_or_t<
57 std::conditional_t<enablesHybridCVFE<T>,
59 void // we currently only support hybrid schemes
60 >,
62 T
63>;
64} // end namespace Detail
65
66template <class GridView>
67struct PQ2MapperTraits :public DefaultMapperTraits<GridView>
68{
69 using DofMapper = Dune::MultipleCodimMultipleGeomTypeMapper<GridView>;
70
75 static Dune::MCMGLayout layout()
76 {
77 return [](Dune::GeometryType gt, int dimgrid) {
78 return (gt.dim() == 0) || (gt.dim() == 1)
79 || (gt.dim() == dimgrid && gt == Dune::GeometryTypes::cube(dimgrid))
80 || (dimgrid == 3 && gt == Dune::GeometryTypes::cube(dimgrid-1));
81 };
82 }
83};
84
89template<class GridView,
93 class IntersectionRule = Dumux::QuadratureRules::DuneQuadrature<4>,
94 class BoundaryFaceRule = Dumux::QuadratureRules::DuneQuadrature<4>>
96
103template<class GridView, class MapperTraits = PQ2MapperTraits<GridView>, class QuadratureTraits = PQ2QuadratureTraits<GridView>>
105: public MapperTraits, public QuadratureTraits
106{
109
110 template<class GridGeometry, bool enableCache>
112
113 using EnableHybridCVFE = std::true_type;
114
115 // The maximum values correspond to cubes
116 // This can be overwritten by the user when knowing the grid entity types
117 static constexpr std::size_t maxNumElementDofs = []()
118 {
119 if constexpr (GridView::dimension == 1)
120 return 3;
121 else if constexpr (GridView::dimension == 2)
122 return 9;
123 else if constexpr (GridView::dimension == 3)
124 return 27;
125 }();
126};
127
134template<class Scalar,
135 class GV,
136 bool enableCaching = true,
137 class Traits = PQ2DefaultGridGeometryTraits<GV>>
139: public BaseGridGeometry<GV, Traits>
140{
142 using ParentType = BaseGridGeometry<GV, Traits>;
143 using GridIndexType = typename IndexTraits<GV>::GridIndex;
144 using LocalIndexType = typename IndexTraits<GV>::LocalIndex;
145
146 using Element = typename GV::template Codim<0>::Entity;
147 using CoordScalar = typename GV::ctype;
148 static const int dim = GV::dimension;
149 static const int dimWorld = GV::dimensionworld;
150
151public:
155
157 static_assert(enableHybridCVFE, "Only hybrid scheme implemented for pq2");
158
159 static constexpr std::size_t maxNumElementDofs = Traits::maxNumElementDofs;
160
164 using LocalView = typename Traits::template LocalView<ThisType, true>;
166 using SubControlVolume = typename Traits::SubControlVolume;
168 using SubControlVolumeFace = typename Traits::SubControlVolumeFace;
174 using DofMapper = typename Traits::DofMapper;
176 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 2>;
178 using GridView = GV;
182 using ScvQuadratureRule = typename Traits::ScvQuadratureRule;
184 using ScvfQuadratureRule = typename Traits::ScvfQuadratureRule;
186 using ElementQuadratureRule = typename Traits::ElementQuadratureRule;
188 using IntersectionQuadratureRule = typename Traits::IntersectionQuadratureRule;
190 using BoundaryFaceQuadratureRule = typename Traits::BoundaryFaceQuadratureRule;
191
193 PQ2FVGridGeometry(std::shared_ptr<BasicGridGeometry> gg)
194 : ParentType(std::move(gg))
195 , dofMapper_(this->gridView(), Traits::layout())
196 , cache_(*this)
197 , periodicGridTraits_(this->gridView().grid())
198 {
199 update_();
200 }
201
206
208 const DofMapper& dofMapper() const
209 { return dofMapper_; }
210
212 std::size_t numScv() const
213 { return numScv_; }
214
216 std::size_t numScvf() const
217 { return numScvf_; }
218
220 std::size_t numBoundaryScvf() const
221 { return numBoundaryScvf_; }
222
224 std::size_t numDofs() const
225 { return this->dofMapper().size(); }
226
229 {
231 update_();
232 }
233
236 {
237 ParentType::update(std::move(gridView));
238 update_();
239 }
240
242 const FeCache& feCache() const
243 { return feCache_; }
244
246 bool dofOnBoundary(GridIndexType dofIdx) const
247 { return boundaryDofIndices_[dofIdx]; }
248
250 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
251 { return periodicDofMap_.count(dofIdx); }
252
254 [[deprecated("Will be removed after release 3.11. Use periodicallyMappedDofs, returning a range of dofs")]]
255 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
256 { return periodicDofMap_.at(dofIdx)[0]; }
257
259 const std::ranges::range auto periodicallyMappedDofs(GridIndexType dofIdx) const
260 { return std::views::all(periodicDofMap_.at(dofIdx)); }
261
263 const std::unordered_map<GridIndexType, std::vector<GridIndexType>>& periodicDofMap() const
264 { return periodicDofMap_; }
265
267 friend inline LocalView localView(const PQ2FVGridGeometry& gg)
268 { return { gg.cache_ }; }
269
270private:
271
272 class PQ2GridGeometryCache
273 {
274 friend class PQ2FVGridGeometry;
275 public:
277 using GeometryHelper = Detail::PQ2GeometryHelper_t<GV, Traits>;
279 using DofHelper = typename GeometryHelper::DofHelper;
280
281 explicit PQ2GridGeometryCache(const PQ2FVGridGeometry& gg)
282 : gridGeometry_(&gg)
283 {}
284
285 const PQ2FVGridGeometry& gridGeometry() const
286 { return *gridGeometry_; }
287
289 const std::vector<SubControlVolume>& scvs(GridIndexType eIdx) const
290 { return scvs_[eIdx]; }
291
293 const std::vector<SubControlVolumeFace>& scvfs(GridIndexType eIdx) const
294 { return scvfs_[eIdx]; }
295
297 bool hasBoundaryScvf(GridIndexType eIdx) const
298 { return hasBoundaryScvf_[eIdx]; }
299
301 const std::vector<std::array<LocalIndexType, 2>>& scvfBoundaryGeometryKeys(GridIndexType eIdx) const
302 { return scvfBoundaryGeometryKeys_.at(eIdx); }
303
305 auto boundaryFaces(GridIndexType eIdx) const -> std::span<const BoundaryFace>
306 {
307 if (auto it = boundaryFaces_.find(eIdx); it != boundaryFaces_.end())
308 return {it->second};
309 return {};
310 }
311
313 const auto& boundaryFaceScvfRanges(GridIndexType eIdx) const
314 { return boundaryFaceScvfRanges_.at(eIdx); }
315
316 private:
317 void clear_()
318 {
319 scvs_.clear();
320 scvfs_.clear();
321 hasBoundaryScvf_.clear();
322 scvfBoundaryGeometryKeys_.clear();
323 boundaryFaces_.clear();
324 boundaryFaceScvfRanges_.clear();
325 }
326
327 std::vector<std::vector<SubControlVolume>> scvs_;
328 std::vector<std::vector<SubControlVolumeFace>> scvfs_;
329 std::vector<bool> hasBoundaryScvf_;
330 std::unordered_map<GridIndexType, std::vector<std::array<LocalIndexType, 2>>> scvfBoundaryGeometryKeys_;
331 std::unordered_map<GridIndexType, Dune::ReservedVector<typename PQ2FVGridGeometry::BoundaryFace, 2*dim>> boundaryFaces_;
332 std::unordered_map<GridIndexType, Dune::ReservedVector<std::array<LocalIndexType, 2>, 2*dim>> boundaryFaceScvfRanges_;
333
334 const PQ2FVGridGeometry* gridGeometry_;
335 };
336
337public:
340 using Cache = PQ2GridGeometryCache;
341
342private:
343 using GeometryHelper = typename Cache::GeometryHelper;
344 using DofHelper = typename GeometryHelper::DofHelper;
345
346 void update_()
347 {
348 cache_.clear_();
349 dofMapper_.update(this->gridView());
350
351 auto numElements = this->gridView().size(0);
352 cache_.scvs_.resize(numElements);
353 cache_.scvfs_.resize(numElements);
354 cache_.hasBoundaryScvf_.resize(numElements, false);
355
356 boundaryDofIndices_.assign(numDofs(), false);
357 periodicDofMap_.clear();
358
359 numScv_ = 0;
360 numScvf_ = 0;
361 numBoundaryScvf_ = 0;
362
363 // Build the scvs and scv faces
364 for (const auto& element : elements(this->gridView()))
365 {
366 auto eIdx = this->elementMapper().index(element);
367
368 // get the element geometry
369 auto elementGeometry = element.geometry();
370
371 const auto& localCoefficients = this->feCache().get(element.type()).localCoefficients();
372
373 // instantiate the geometry helper
374 GeometryHelper geometryHelper(elementGeometry);
375
376 numScv_ += geometryHelper.numScv();
377 // construct the sub control volumes
378 cache_.scvs_[eIdx].resize(geometryHelper.numScv());
379
380 for (LocalIndexType keyIdx = 0; keyIdx < localCoefficients.size(); ++keyIdx)
381 {
382 const auto& localKey = localCoefficients.localKey(keyIdx);
383 // If the dof is a vertex, we construct scvs
384 if(localKey.codim() == dim)
385 {
386 const auto localIdx = localKey.subEntity();
387 // With the new localIdx, scvs can be constructed as for the Box method
388 auto corners = geometryHelper.getScvCorners(localIdx);
389 cache_.scvs_[eIdx][localIdx] = SubControlVolume(
390 geometryHelper.scvVolume(localIdx, corners),
391 DofHelper::dofPosition(elementGeometry, localKey),
392 Dumux::center(corners),
393 localIdx,
394 keyIdx,
395 eIdx,
396 DofHelper::dofIndex(this->dofMapper(), element, localKey),
397 false
398 );
399 }
400 }
401
402 // construct the sub control volume faces, this is the same as for the Box method
403 const auto numInteriorScvfs = GeometryHelper::numInteriorScvf(elementGeometry.type());
404 numScvf_ += numInteriorScvfs;
405 cache_.scvfs_[eIdx].resize(numInteriorScvfs);
406 LocalIndexType scvfLocalIdx = 0;
407 for (; scvfLocalIdx < numInteriorScvfs; ++scvfLocalIdx)
408 {
409 const auto scvPair = geometryHelper.getScvPairForScvf(scvfLocalIdx);
410 const auto corners = geometryHelper.getScvfCorners(scvfLocalIdx);
411 const auto area = Dumux::convexPolytopeVolume<dim-1>(
412 geometryHelper.getInteriorScvfGeometryType(scvfLocalIdx),
413 [&](unsigned int i){ return corners[i]; }
414 );
415
416 cache_.scvfs_[eIdx][scvfLocalIdx] = SubControlVolumeFace(
417 Dumux::center(corners),
418 area,
419 geometryHelper.normal(corners, scvPair),
420 std::move(scvPair),
421 scvfLocalIdx,
422 geometryHelper.isOverlappingScvf(scvfLocalIdx)
423 );
424 }
425
426 // construct the sub control volume faces on the domain boundary
427 LocalIndexType numBoundaryFaces = 0;
428 for (const auto& intersection : intersections(this->gridView(), element))
429 {
430 if (intersection.boundary() && !intersection.neighbor())
431 {
432 cache_.hasBoundaryScvf_[eIdx] = true;
433
434 // add one boundary face per boundary intersection
435 const auto isGeometry = intersection.geometry();
436 cache_.boundaryFaces_[eIdx].push_back(BoundaryFace{
437 isGeometry.center(),
438 isGeometry.volume(),
439 intersection.centerUnitOuterNormal(),
440 numBoundaryFaces++,
441 static_cast<LocalIndexType>(intersection.indexInInside()),
442 typename BoundaryFace::Traits::BoundaryFlag{intersection}
443 });
444
445 const auto localFacetIndex = intersection.indexInInside();
446 const auto numBoundaryScvf = GeometryHelper::numBoundaryScvf(elementGeometry.type(), localFacetIndex);
447 numScvf_ += numBoundaryScvf;
448 numBoundaryScvf_ += numBoundaryScvf;
449
450 // record the scvf subrange for this boundary face: {offset, count}
451 cache_.boundaryFaceScvfRanges_[eIdx].push_back(std::array<LocalIndexType, 2>{{
452 scvfLocalIdx,
453 static_cast<LocalIndexType>(numBoundaryScvf)
454 }});
455
456 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < numBoundaryScvf; ++isScvfLocalIdx)
457 {
458 // find the scvs this scvf is belonging to
459 const auto scvPair = geometryHelper.getScvPairForBoundaryScvf(localFacetIndex, isScvfLocalIdx);
460 const auto corners = geometryHelper.getBoundaryScvfCorners(localFacetIndex, isScvfLocalIdx);
461 const auto area = Dumux::convexPolytopeVolume<dim-1>(
462 geometryHelper.getBoundaryScvfGeometryType(isScvfLocalIdx),
463 [&](unsigned int i){ return corners[i]; }
464 );
465 cache_.scvfs_[eIdx].emplace_back(
466 Dumux::center(corners),
467 area,
468 intersection.centerUnitOuterNormal(),
469 std::move(scvPair),
470 scvfLocalIdx,
471 typename SubControlVolumeFace::Traits::BoundaryFlag{ intersection },
472 geometryHelper.isOverlappingBoundaryScvf(localFacetIndex)
473 );
474
475 // store look-up map to construct boundary scvf geometries
476 cache_.scvfBoundaryGeometryKeys_[eIdx].emplace_back(std::array<LocalIndexType, 2>{{
477 static_cast<LocalIndexType>(localFacetIndex),
478 static_cast<LocalIndexType>(isScvfLocalIdx)
479 }});
480
481 // increment local counter
482 scvfLocalIdx++;
483 }
484
485 for (LocalIndexType keyIdx = 0; keyIdx < localCoefficients.size(); ++keyIdx)
486 {
487 if(DofHelper::localDofOnIntersection(elementGeometry.type(), intersection.indexInInside(), localCoefficients.localKey(keyIdx)))
488 {
489 const auto dofIdxGlobal = DofHelper::dofIndex(this->dofMapper(), element, localCoefficients.localKey(keyIdx));
490 boundaryDofIndices_[dofIdxGlobal] = true;
491 }
492 }
493 }
494
495 // inform the grid geometry if we have periodic boundaries
496 else if (periodicGridTraits_.isPeriodic(intersection))
497 {
498 this->setPeriodic();
499
500 // find the mapped periodic vertex of all vertices on periodic boundaries
501 const auto eps = 1e-7*(elementGeometry.corner(1) - elementGeometry.corner(0)).two_norm();
502 for (int localDofIdx = 0; localDofIdx < localCoefficients.size(); ++localDofIdx)
503 {
504 if(!DofHelper::localDofOnIntersection(elementGeometry.type(), intersection.indexInInside(), localCoefficients.localKey(localDofIdx)))
505 continue;
506
507 const auto dofIdxGlobal = DofHelper::dofIndex(this->dofMapper(), element, localCoefficients.localKey(localDofIdx));
508 const auto dofPos = DofHelper::dofPosition(elementGeometry, localCoefficients.localKey(localDofIdx));
509
510 const auto& outside = intersection.outside();
511 const auto outsideGeometry = outside.geometry();
512 const auto& localCoefficientsOut = this->feCache().get(outsideGeometry.type()).localCoefficients();
513 for (const auto& isOutside : intersections(this->gridView(), outside))
514 {
515 // only check periodic vertices of the periodic neighbor
516 if (periodicGridTraits_.isPeriodic(isOutside))
517 {
518 for (int localDofIdxOut = 0; localDofIdxOut < localCoefficientsOut.size(); ++localDofIdxOut)
519 {
520 const auto& localKeyOut = localCoefficientsOut.localKey(localDofIdxOut);
521 if(!DofHelper::localDofOnIntersection(outsideGeometry.type(), isOutside.indexInInside(), localKeyOut))
522 continue;
523
524 const auto dofIdxGlobalOut = DofHelper::dofIndex(this->dofMapper(), outside, localKeyOut);
525 const auto dofPosOutside = DofHelper::dofPosition(outsideGeometry, localKeyOut);
526 const auto shift = std::abs((this->bBoxMax()-this->bBoxMin())*intersection.centerUnitOuterNormal());
527 if ((dofPosOutside - dofPos + shift*intersection.centerUnitOuterNormal()).two_norm() < eps)
528 Dumux::Detail::addPeriodicallyMappedDof(periodicDofMap_, dofIdxGlobal, dofIdxGlobalOut);
529 }
530 }
531 }
532 }
533 }
534 }
535 }
536
537 Dumux::Detail::closePeriodicDofMap(periodicDofMap_);
538
539 // error check: periodic boundaries currently don't work for pq2 in parallel
540 if (this->isPeriodic() && this->gridView().comm().size() > 1)
541 DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for pq2 method for parallel simulations!");
542 }
543
544 DofMapper dofMapper_;
545
546 const FeCache feCache_;
547
548 std::size_t numScv_;
549 std::size_t numScvf_;
550 std::size_t numBoundaryScvf_;
551
552 // dofs on the boundary
553 std::vector<bool> boundaryDofIndices_;
554
555 // a map for periodic boundary dofs
556 std::unordered_map<GridIndexType, std::vector<GridIndexType>> periodicDofMap_;
557
558 Cache cache_;
559
561};
562
563} // end namespace Dumux
564
565#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
A class to create sub control volume and sub control volume face geometries per element.
Definition discretization/pq2/geometryhelper.hh:56
Base class for the finite volume geometry vector for pq2 models This builds up the sub control volume...
Definition discretization/pq2/fvelementgeometry.hh:49
Base class for the finite volume geometry vector for pq2 schemes This builds up the sub control volum...
Definition discretization/pq2/fvgridgeometry.hh:140
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 2 > FeCache
Definition discretization/pq2/fvgridgeometry.hh:176
typename PQ2DefaultGridGeometryTraits< GridView >::DofMapper DofMapper
Definition discretization/pq2/fvgridgeometry.hh:174
PQ2FVGridGeometry(const GridView &gridView)
Constructor.
Definition discretization/pq2/fvgridgeometry.hh:203
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/pq2/fvgridgeometry.hh:216
const DofMapper & dofMapper() const
The dofMapper.
Definition discretization/pq2/fvgridgeometry.hh:208
typename PQ2DefaultGridGeometryTraits< GridView >::IntersectionQuadratureRule IntersectionQuadratureRule
Definition discretization/pq2/fvgridgeometry.hh:188
const std::unordered_map< GridIndexType, std::vector< GridIndexType > > & periodicDofMap() const
Returns the map between dofs across periodic boundaries.
Definition discretization/pq2/fvgridgeometry.hh:263
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition discretization/pq2/fvgridgeometry.hh:246
typename PQ2DefaultGridGeometryTraits< GridView >::BoundaryFaceQuadratureRule BoundaryFaceQuadratureRule
Definition discretization/pq2/fvgridgeometry.hh:190
typename PQ2DefaultGridGeometryTraits< GridView >::ScvQuadratureRule ScvQuadratureRule
Definition discretization/pq2/fvgridgeometry.hh:182
const std::ranges::range auto periodicallyMappedDofs(GridIndexType dofIdx) const
The indices of the vertices / d.o.f.s on the other side of the periodic boundaries.
Definition discretization/pq2/fvgridgeometry.hh:259
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition discretization/pq2/fvgridgeometry.hh:242
Experimental::BoundaryFace< GridView > BoundaryFace
Definition discretization/pq2/fvgridgeometry.hh:170
void update(const GridView &gridView)
update all geometries (call this after grid adaption)
Definition discretization/pq2/fvgridgeometry.hh:228
friend LocalView localView(const PQ2FVGridGeometry &gg)
local view of this object (constructed with the internal cache)
Definition discretization/pq2/fvgridgeometry.hh:267
typename PQ2DefaultGridGeometryTraits< GridView >::ElementQuadratureRule ElementQuadratureRule
Definition discretization/pq2/fvgridgeometry.hh:186
static constexpr bool enableHybridCVFE
Definition discretization/pq2/fvgridgeometry.hh:156
std::size_t numBoundaryScvf() const
The total number of boundary sub control volume faces.
Definition discretization/pq2/fvgridgeometry.hh:220
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/pq2/fvgridgeometry.hh:212
PQ2GridGeometryCache Cache
Definition discretization/pq2/fvgridgeometry.hh:340
PQ2FVGridGeometry(std::shared_ptr< BasicGridGeometry > gg)
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition discretization/pq2/fvgridgeometry.hh:193
typename PQ2DefaultGridGeometryTraits< GridView >::ScvfQuadratureRule ScvfQuadratureRule
Definition discretization/pq2/fvgridgeometry.hh:184
typename PQ2DefaultGridGeometryTraits< GridView >::SubControlVolumeFace SubControlVolumeFace
Definition discretization/pq2/fvgridgeometry.hh:168
void update(GridView &&gridView)
update all geometries (call this after grid adaption)
Definition discretization/pq2/fvgridgeometry.hh:235
typename PQ2DefaultGridGeometryTraits< GridView >::template LocalView< ThisType, true > LocalView
Definition discretization/pq2/fvgridgeometry.hh:164
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition discretization/pq2/fvgridgeometry.hh:255
static constexpr std::size_t maxNumElementDofs
Definition discretization/pq2/fvgridgeometry.hh:159
static constexpr DiscretizationMethod discMethod
Definition discretization/pq2/fvgridgeometry.hh:154
BasicGridGeometry_t< GridView, PQ2DefaultGridGeometryTraits< GridView > > BasicGridGeometry
Definition discretization/pq2/fvgridgeometry.hh:162
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition discretization/pq2/fvgridgeometry.hh:250
GridView GridView
Definition discretization/pq2/fvgridgeometry.hh:178
typename PeriodicGridTraits< typename GridView::Grid >::SupportsPeriodicity SupportsPeriodicity
Definition discretization/pq2/fvgridgeometry.hh:180
typename PQ2DefaultGridGeometryTraits< GridView >::SubControlVolume SubControlVolume
Definition discretization/pq2/fvgridgeometry.hh:166
DiscretizationMethods::PQ2 DiscretizationMethod
Definition discretization/pq2/fvgridgeometry.hh:153
std::size_t numDofs() const
The total number of degrees of freedom.
Definition discretization/pq2/fvgridgeometry.hh:224
Extrusion_t< PQ2DefaultGridGeometryTraits< GridView > > Extrusion
Definition discretization/pq2/fvgridgeometry.hh:172
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/pq2/subcontrolvolumeface.hh:58
the sub control volume for the pq2 scheme
Definition discretization/pq2/subcontrolvolume.hh:55
Defines the default element and vertex mapper types.
Base class for the finite volume geometry vector for the pq1bubble method This builds up the sub cont...
Base class for the local finite volume geometry for the pq2 method This builds up the sub control vol...
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 > PQ2QuadratureTraits
Quadrature rule traits for PQ2 discretization.
Definition discretization/pq2/fvgridgeometry.hh:95
Defines the index types used for grid and local indices.
The available discretization methods in Dumux.
Definition cvfelocalresidual.hh:25
static constexpr bool enablesHybridCVFE
Definition discretization/pq1bubble/fvgridgeometry.hh:53
typename T::GeometryHelper SpecifiesGeometryHelper
Definition basegridgeometry.hh:30
Dune::Std::detected_or_t< std::conditional_t< enablesHybridCVFE< T >, Dumux::HybridPQ2GeometryHelper< GV, typename T::SubControlVolume, typename T::SubControlVolumeFace >, void >, SpecifiesGeometryHelper, T > PQ2GeometryHelper_t
Definition discretization/pq2/fvgridgeometry.hh:56
CVFE< CVFEMethods::PQ2 > PQ2
Definition method.hh:132
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.
Quadrature rule traits for discretization schemes.
Definition quadraturerules.hh:86
Definition defaultmappertraits.hh:23
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
unsigned int LocalIndex
Definition indextraits.hh:28
The default traits for the pq2 finite volume grid geometry Defines the scv and scvf types and the map...
Definition discretization/pq2/fvgridgeometry.hh:106
PQ2FVElementGeometry< GridGeometry, enableCache > LocalView
Definition discretization/pq2/fvgridgeometry.hh:111
PQ2SubControlVolumeFace< GridView > SubControlVolumeFace
Definition discretization/pq2/fvgridgeometry.hh:108
PQ2SubControlVolume< GridView > SubControlVolume
Definition discretization/pq2/fvgridgeometry.hh:107
static constexpr std::size_t maxNumElementDofs
Definition discretization/pq2/fvgridgeometry.hh:117
std::true_type EnableHybridCVFE
Definition discretization/pq2/fvgridgeometry.hh:113
Definition discretization/pq2/fvgridgeometry.hh:68
Dune::MultipleCodimMultipleGeomTypeMapper< GridView > DofMapper
Definition discretization/pq2/fvgridgeometry.hh:69
static Dune::MCMGLayout layout()
layout for vertices and edges and elements (and faces in 3D) for the case of cubes
Definition discretization/pq2/fvgridgeometry.hh:75
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.