version 3.11-dev
discretization/box/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_BOX_GRID_FVGEOMETRY_HH
15#define DUMUX_DISCRETIZATION_BOX_GRID_FVGEOMETRY_HH
16
17#include <utility>
18#include <unordered_map>
19#include <array>
20#include <vector>
21#include <span>
22
23#include <dune/localfunctions/lagrange/lagrangelfecache.hh>
24
35
37
38namespace Dumux {
39
40namespace Detail {
41template<class GV, class T>
42using BoxGeometryHelper_t = Dune::Std::detected_or_t<
45 T
46>;
47} // end namespace Detail
48
53template<class GridView, class ScvRule = Dumux::QuadratureRules::MidpointQuadrature, class ScvfRule = Dumux::QuadratureRules::MidpointQuadrature>
55
62template<class GridView, class MapperTraits = DefaultMapperTraits<GridView>, class QuadratureTraits = BoxQuadratureTraits<GridView>>
64: public MapperTraits, public QuadratureTraits
65{
68
69 template<class GridGeometry, bool enableCache>
71};
72
79template<class Scalar,
80 class GridView,
81 bool enableGridGeometryCache = false,
84
91template<class Scalar, class GV, class Traits>
92class BoxFVGridGeometry<Scalar, GV, true, Traits>
93: public BaseGridGeometry<GV, Traits>
94{
97 using GridIndexType = typename IndexTraits<GV>::GridIndex;
98 using LocalIndexType = typename IndexTraits<GV>::LocalIndex;
99
100 using Element = typename GV::template Codim<0>::Entity;
101 using CoordScalar = typename GV::ctype;
102 static const int dim = GV::dimension;
103 static const int dimWorld = GV::dimensionworld;
104
105public:
108 static constexpr DiscretizationMethod discMethod{};
109
113 using LocalView = typename Traits::template LocalView<ThisType, true>;
115 using SubControlVolume = typename Traits::SubControlVolume;
117 using SubControlVolumeFace = typename Traits::SubControlVolumeFace;
123 using DofMapper = typename Traits::VertexMapper;
125 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
127 using GridView = GV;
131 using ScvQuadratureRule = typename Traits::ScvQuadratureRule;
133 using ScvfQuadratureRule = typename Traits::ScvfQuadratureRule;
134
136 BoxFVGridGeometry(std::shared_ptr<BasicGridGeometry> gg)
137 : ParentType(std::move(gg))
138 , cache_(*this)
139 , periodicGridTraits_(this->gridView().grid())
140 {
141 update_();
142 }
143
146 : BoxFVGridGeometry(std::make_shared<BasicGridGeometry>(gridView))
147 {}
148
151 const DofMapper& dofMapper() const
152 { return this->vertexMapper(); }
153
155 std::size_t numScv() const
156 { return numScv_; }
157
159 std::size_t numScvf() const
160 { return numScvf_; }
161
164 std::size_t numBoundaryScvf() const
165 { return numBoundaryScvf_; }
166
168 std::size_t numDofs() const
169 { return this->vertexMapper().size(); }
170
171
173 void update(const GridView& gridView)
174 {
175 ParentType::update(gridView);
176 update_();
177 }
178
180 void update(GridView&& gridView)
181 {
182 ParentType::update(std::move(gridView));
183 update_();
184 }
185
187 const FeCache& feCache() const
188 { return feCache_; }
189
191 bool dofOnBoundary(GridIndexType dofIdx) const
192 { return boundaryDofIndices_[dofIdx]; }
193
195 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
196 { return periodicDofMap_.count(dofIdx); }
197
199 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
200 { return periodicDofMap_.at(dofIdx); }
201
203 const std::unordered_map<GridIndexType, GridIndexType>& periodicDofMap() const
204 { return periodicDofMap_; }
205
207 friend inline LocalView localView(const BoxFVGridGeometry& gg)
208 { return { gg.cache_ }; }
209
210private:
211
212 class BoxGridGeometryCache
213 {
214 friend class BoxFVGridGeometry;
215 public:
217 using GeometryHelper = Detail::BoxGeometryHelper_t<GV, Traits>;
218
219 explicit BoxGridGeometryCache(const BoxFVGridGeometry& gg)
220 : gridGeometry_(&gg)
221 {}
222
223 const BoxFVGridGeometry& gridGeometry() const
224 { return *gridGeometry_; }
225
227 const std::vector<SubControlVolume>& scvs(GridIndexType eIdx) const
228 { return scvs_[eIdx]; }
229
231 const std::vector<SubControlVolumeFace>& scvfs(GridIndexType eIdx) const
232 { return scvfs_[eIdx]; }
233
235 bool hasBoundaryScvf(GridIndexType eIdx) const
236 { return hasBoundaryScvf_[eIdx]; }
237
239 const std::vector<std::array<LocalIndexType, 2>>& scvfBoundaryGeometryKeys(GridIndexType eIdx) const
240 { return scvfBoundaryGeometryKeys_.at(eIdx); }
241
243 auto boundaryFaces(GridIndexType eIdx) const -> std::span<const BoundaryFace>
244 {
245 if (auto it = boundaryFaces_.find(eIdx); it != boundaryFaces_.end())
246 return {it->second};
247 return {};
248 }
249
250 private:
251 void clear_()
252 {
253 scvs_.clear();
254 scvfs_.clear();
255 hasBoundaryScvf_.clear();
256 scvfBoundaryGeometryKeys_.clear();
257 boundaryFaces_.clear();
258 }
259
260 std::vector<std::vector<SubControlVolume>> scvs_;
261 std::vector<std::vector<SubControlVolumeFace>> scvfs_;
262 std::vector<bool> hasBoundaryScvf_;
263 std::unordered_map<GridIndexType, std::vector<std::array<LocalIndexType, 2>>> scvfBoundaryGeometryKeys_;
264 std::unordered_map<GridIndexType, Dune::ReservedVector<typename BoxFVGridGeometry::BoundaryFace, 2*dim>> boundaryFaces_;
265
266 const BoxFVGridGeometry* gridGeometry_;
267 };
268
269public:
272 using Cache = BoxGridGeometryCache;
273
274private:
275 using GeometryHelper = typename Cache::GeometryHelper;
276
277 void update_()
278 {
279 cache_.clear_();
280
281 const auto numElements = this->gridView().size(0);
282 cache_.scvs_.resize(numElements);
283 cache_.scvfs_.resize(numElements);
284 cache_.hasBoundaryScvf_.resize(numElements, false);
285
286 boundaryDofIndices_.assign(numDofs(), false);
287
288 numScv_ = 0;
289 numScvf_ = 0;
290 numBoundaryScvf_ = 0;
291 // Build the SCV and SCV faces
292 for (const auto& element : elements(this->gridView()))
293 {
294 // fill the element map with seeds
295 const auto eIdx = this->elementMapper().index(element);
296
297 // count
298 numScv_ += element.subEntities(dim);
299 numScvf_ += element.subEntities(dim-1);
300
301 // get the element geometry
302 auto elementGeometry = element.geometry();
303 const auto refElement = referenceElement(elementGeometry);
304
305 // instantiate the geometry helper
306 GeometryHelper geometryHelper(elementGeometry);
307
308 // construct the sub control volumes
309 cache_.scvs_[eIdx].resize(elementGeometry.corners());
310 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
311 {
312 const auto dofIdxGlobal = this->vertexMapper().subIndex(element, scvLocalIdx, dim);
313
314 cache_.scvs_[eIdx][scvLocalIdx] = SubControlVolume(
315 geometryHelper.getScvCorners(scvLocalIdx),
316 scvLocalIdx,
317 eIdx,
318 dofIdxGlobal
319 );
320 }
321
322 // construct the sub control volume faces
323 LocalIndexType scvfLocalIdx = 0;
324 cache_.scvfs_[eIdx].resize(element.subEntities(dim-1));
325 for (; scvfLocalIdx < element.subEntities(dim-1); ++scvfLocalIdx)
326 {
327 // find the global and local scv indices this scvf is belonging to
328 std::array<LocalIndexType, 2> localScvIndices{{
329 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 0, dim)),
330 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 1, dim))
331 }};
332
333 const auto& corners = geometryHelper.getScvfCorners(scvfLocalIdx);
334 cache_.scvfs_[eIdx][scvfLocalIdx] = SubControlVolumeFace(
335 corners,
336 geometryHelper.normal(corners, localScvIndices),
337 element,
338 scvfLocalIdx,
339 std::move(localScvIndices)
340 );
341 }
342
343 // construct the sub control volume faces on the domain boundary
344 LocalIndexType numBoundaryFaces = 0;
345 for (const auto& intersection : intersections(this->gridView(), element))
346 {
347 if (intersection.boundary() && !intersection.neighbor())
348 {
349 const auto isGeometry = intersection.geometry();
350 cache_.hasBoundaryScvf_[eIdx] = true;
351
352 // add one boundary face per boundary intersection
353 cache_.boundaryFaces_[eIdx].push_back(BoundaryFace{
354 isGeometry.center(),
355 isGeometry.volume(),
356 intersection.centerUnitOuterNormal(),
357 numBoundaryFaces++,
358 static_cast<LocalIndexType>(intersection.indexInInside()),
359 typename BoundaryFace::Traits::BoundaryFlag{intersection}
360 });
361
362 // count
363 numScvf_ += isGeometry.corners();
364 numBoundaryScvf_ += isGeometry.corners();
365
366 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < isGeometry.corners(); ++isScvfLocalIdx)
367 {
368 // find the scvs this scvf is belonging to
369 const LocalIndexType insideScvIdx = static_cast<LocalIndexType>(refElement.subEntity(intersection.indexInInside(), 1, isScvfLocalIdx, dim));
370 std::array<LocalIndexType, 2> localScvIndices{{insideScvIdx, insideScvIdx}};
371
372 cache_.scvfs_[eIdx].emplace_back(
373 geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), isScvfLocalIdx),
374 intersection.centerUnitOuterNormal(),
375 intersection,
376 isScvfLocalIdx,
377 scvfLocalIdx,
378 std::move(localScvIndices)
379 );
380
381 cache_.scvfBoundaryGeometryKeys_[eIdx].emplace_back(std::array<LocalIndexType, 2>{{
382 static_cast<LocalIndexType>(intersection.indexInInside()),
383 static_cast<LocalIndexType>(isScvfLocalIdx)
384 }});
385
386 // increment local counter
387 scvfLocalIdx++;
388 }
389
390 // add all vertices on the intersection to the set of
391 // boundary vertices
392 const auto fIdx = intersection.indexInInside();
393 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
394 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
395 {
396 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
397 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
398 boundaryDofIndices_[vIdxGlobal] = true;
399 }
400 }
401
402 // inform the grid geometry if we have periodic boundaries
403 else if (periodicGridTraits_.isPeriodic(intersection))
404 {
405 this->setPeriodic();
406
407 // find the mapped periodic vertex of all vertices on periodic boundaries
408 const auto fIdx = intersection.indexInInside();
409 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
410 const auto eps = 1e-7*(elementGeometry.corner(1) - elementGeometry.corner(0)).two_norm();
411 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
412 {
413 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
414 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
415 const auto vPos = elementGeometry.corner(vIdx);
416
417 const auto& outside = intersection.outside();
418 const auto outsideGeometry = outside.geometry();
419 for (const auto& isOutside : intersections(this->gridView(), outside))
420 {
421 // only check periodic vertices of the periodic neighbor
422 if (periodicGridTraits_.isPeriodic(isOutside))
423 {
424 const auto fIdxOutside = isOutside.indexInInside();
425 const auto numFaceVertsOutside = refElement.size(fIdxOutside, 1, dim);
426 for (int localVIdxOutside = 0; localVIdxOutside < numFaceVertsOutside; ++localVIdxOutside)
427 {
428 const auto vIdxOutside = refElement.subEntity(fIdxOutside, 1, localVIdxOutside, dim);
429 const auto vPosOutside = outsideGeometry.corner(vIdxOutside);
430 const auto shift = std::abs((this->bBoxMax()-this->bBoxMin())*intersection.centerUnitOuterNormal());
431 if (std::abs((vPosOutside-vPos).two_norm() - shift) < eps)
432 periodicDofMap_[vIdxGlobal] = this->vertexMapper().subIndex(outside, vIdxOutside, dim);
433 }
434 }
435 }
436 }
437 }
438 }
439 }
440
441 // error check: periodic boundaries currently don't work for box in parallel
442 if (this->isPeriodic() && this->gridView().comm().size() > 1)
443 DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!");
444 }
445
446 const FeCache feCache_;
447
448 std::size_t numScv_;
449 std::size_t numScvf_;
450 std::size_t numBoundaryScvf_;
451
452 // vertices on the boundary
453 std::vector<bool> boundaryDofIndices_;
454
455 // a map for periodic boundary vertices
456 std::unordered_map<GridIndexType, GridIndexType> periodicDofMap_;
457
458 Cache cache_;
459
461};
462
470template<class Scalar, class GV, class Traits>
471class BoxFVGridGeometry<Scalar, GV, false, Traits>
472: public BaseGridGeometry<GV, Traits>
473{
476 using GridIndexType = typename IndexTraits<GV>::GridIndex;
477
478 static const int dim = GV::dimension;
479 static const int dimWorld = GV::dimensionworld;
480
481 using Element = typename GV::template Codim<0>::Entity;
482 using CoordScalar = typename GV::ctype;
483
484public:
487 static constexpr DiscretizationMethod discMethod{};
488
492 using LocalView = typename Traits::template LocalView<ThisType, false>;
494 using SubControlVolume = typename Traits::SubControlVolume;
496 using SubControlVolumeFace = typename Traits::SubControlVolumeFace;
502 using DofMapper = typename Traits::VertexMapper;
504 using FeCache = Dune::LagrangeLocalFiniteElementCache<CoordScalar, Scalar, dim, 1>;
506 using GridView = GV;
510 using ScvQuadratureRule = typename Traits::ScvQuadratureRule;
512 using ScvfQuadratureRule = typename Traits::ScvfQuadratureRule;
513
515 BoxFVGridGeometry(std::shared_ptr<BasicGridGeometry> gg)
516 : ParentType(std::move(gg))
517 , cache_(*this)
518 , periodicGridTraits_(this->gridView().grid())
519 {
520 update_();
521 }
522
525 : BoxFVGridGeometry(std::make_shared<BasicGridGeometry>(gridView))
526 {}
527
530 const DofMapper& dofMapper() const
531 { return this->vertexMapper(); }
532
534 std::size_t numScv() const
535 { return numScv_; }
536
538 std::size_t numScvf() const
539 { return numScvf_; }
540
543 std::size_t numBoundaryScvf() const
544 { return numBoundaryScvf_; }
545
547 std::size_t numDofs() const
548 { return this->vertexMapper().size(); }
549
550
552 void update(const GridView& gridView)
553 {
554 ParentType::update(gridView);
555 update_();
556 }
557
559 void update(GridView&& gridView)
560 {
561 ParentType::update(std::move(gridView));
562 update_();
563 }
564
566 const FeCache& feCache() const
567 { return feCache_; }
568
570 bool dofOnBoundary(GridIndexType dofIdx) const
571 { return boundaryDofIndices_[dofIdx]; }
572
574 bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
575 { return periodicDofMap_.count(dofIdx); }
576
578 GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
579 { return periodicDofMap_.at(dofIdx); }
580
582 const std::unordered_map<GridIndexType, GridIndexType>& periodicDofMap() const
583 { return periodicDofMap_; }
584
586 friend inline LocalView localView(const BoxFVGridGeometry& gg)
587 { return { gg.cache_ }; }
588
589private:
590
591 class BoxGridGeometryCache
592 {
593 friend class BoxFVGridGeometry;
594 public:
596 using GeometryHelper = Detail::BoxGeometryHelper_t<GV, Traits>;
597
598 explicit BoxGridGeometryCache(const BoxFVGridGeometry& gg)
599 : gridGeometry_(&gg)
600 {}
601
602 const BoxFVGridGeometry& gridGeometry() const
603 { return *gridGeometry_; }
604
605 private:
606 const BoxFVGridGeometry* gridGeometry_;
607 };
608
609public:
612 using Cache = BoxGridGeometryCache;
613
614private:
615
616 void update_()
617 {
618 boundaryDofIndices_.assign(numDofs(), false);
619
620 // save global data on the grid's scvs and scvfs
621 // TODO do we need those information?
622 numScv_ = 0;
623 numScvf_ = 0;
624 numBoundaryScvf_ = 0;
625 for (const auto& element : elements(this->gridView()))
626 {
627 numScv_ += element.subEntities(dim);
628 numScvf_ += element.subEntities(dim-1);
629
630 const auto elementGeometry = element.geometry();
631 const auto refElement = referenceElement(elementGeometry);
632
633 // store the sub control volume face indices on the domain boundary
634 for (const auto& intersection : intersections(this->gridView(), element))
635 {
636 if (intersection.boundary() && !intersection.neighbor())
637 {
638 const auto isGeometry = intersection.geometry();
639 numScvf_ += isGeometry.corners();
640 numBoundaryScvf_ += isGeometry.corners();
641
642 // add all vertices on the intersection to the set of
643 // boundary vertices
644 const auto fIdx = intersection.indexInInside();
645 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
646 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
647 {
648 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
649 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
650 boundaryDofIndices_[vIdxGlobal] = true;
651 }
652 }
653
654 // inform the grid geometry if we have periodic boundaries
655 else if (periodicGridTraits_.isPeriodic(intersection))
656 {
657 this->setPeriodic();
658
659 // find the mapped periodic vertex of all vertices on periodic boundaries
660 const auto fIdx = intersection.indexInInside();
661 const auto numFaceVerts = refElement.size(fIdx, 1, dim);
662 const auto eps = 1e-7*(elementGeometry.corner(1) - elementGeometry.corner(0)).two_norm();
663 for (int localVIdx = 0; localVIdx < numFaceVerts; ++localVIdx)
664 {
665 const auto vIdx = refElement.subEntity(fIdx, 1, localVIdx, dim);
666 const auto vIdxGlobal = this->vertexMapper().subIndex(element, vIdx, dim);
667 const auto vPos = elementGeometry.corner(vIdx);
668
669 const auto& outside = intersection.outside();
670 const auto outsideGeometry = outside.geometry();
671 for (const auto& isOutside : intersections(this->gridView(), outside))
672 {
673 // only check periodic vertices of the periodic neighbor
674 if (periodicGridTraits_.isPeriodic(isOutside))
675 {
676 const auto fIdxOutside = isOutside.indexInInside();
677 const auto numFaceVertsOutside = refElement.size(fIdxOutside, 1, dim);
678 for (int localVIdxOutside = 0; localVIdxOutside < numFaceVertsOutside; ++localVIdxOutside)
679 {
680 const auto vIdxOutside = refElement.subEntity(fIdxOutside, 1, localVIdxOutside, dim);
681 const auto vPosOutside = outsideGeometry.corner(vIdxOutside);
682 const auto shift = std::abs((this->bBoxMax()-this->bBoxMin())*intersection.centerUnitOuterNormal());
683 if (std::abs((vPosOutside-vPos).two_norm() - shift) < eps)
684 periodicDofMap_[vIdxGlobal] = this->vertexMapper().subIndex(outside, vIdxOutside, dim);
685 }
686 }
687 }
688 }
689 }
690 }
691 }
692
693 // error check: periodic boundaries currently don't work for box in parallel
694 if (this->isPeriodic() && this->gridView().comm().size() > 1)
695 DUNE_THROW(Dune::NotImplemented, "Periodic boundaries for box method for parallel simulations!");
696 }
697
698 const FeCache feCache_;
699
700 // Information on the global number of geometries
701 // TODO do we need those information?
702 std::size_t numScv_;
703 std::size_t numScvf_;
704 std::size_t numBoundaryScvf_;
705
706 // vertices on the boundary
707 std::vector<bool> boundaryDofIndices_;
708
709 // a map for periodic boundary vertices
710 std::unordered_map<GridIndexType, GridIndexType> periodicDofMap_;
711
712 Cache cache_;
713
715};
716
717} // end namespace Dumux
718
719#endif
Base class for grid geometries.
Implementation of a boundary face related to primary grid elements (dune intersections)
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
Base class for all grid geometries.
Definition: basegridgeometry.hh:52
typename BaseImplementation::GridView GridView
export the grid view type
Definition: basegridgeometry.hh:60
Base class for the finite volume geometry vector for box models This builds up the sub control volume...
Definition: discretization/box/fvelementgeometry.hh:46
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition: discretization/box/fvgridgeometry.hh:473
std::size_t numBoundaryScvf() const
Definition: discretization/box/fvgridgeometry.hh:543
friend LocalView localView(const BoxFVGridGeometry &gg)
local view of this object (constructed with the internal cache)
Definition: discretization/box/fvgridgeometry.hh:586
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:574
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/box/fvgridgeometry.hh:492
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:496
BoxFVGridGeometry(const GridView &gridView)
Constructor.
Definition: discretization/box/fvgridgeometry.hh:524
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:494
typename Traits::ScvQuadratureRule ScvQuadratureRule
export the scv interpolation point data type
Definition: discretization/box/fvgridgeometry.hh:510
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:578
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/box/fvgridgeometry.hh:566
BoxGridGeometryCache Cache
Definition: discretization/box/fvgridgeometry.hh:612
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/box/fvgridgeometry.hh:538
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/box/fvgridgeometry.hh:502
BasicGridGeometry_t< GV, Traits > BasicGridGeometry
export basic grid geometry type for the alternative constructor
Definition: discretization/box/fvgridgeometry.hh:490
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/box/fvgridgeometry.hh:570
typename Traits::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition: discretization/box/fvgridgeometry.hh:512
const DofMapper & dofMapper() const
Definition: discretization/box/fvgridgeometry.hh:530
typename PeriodicGridTraits< typename GV::Grid >::SupportsPeriodicity SupportsPeriodicity
export whether the grid(geometry) supports periodicity
Definition: discretization/box/fvgridgeometry.hh:508
void update(GridView &&gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:559
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/box/fvgridgeometry.hh:500
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/box/fvgridgeometry.hh:547
BoxFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg)
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition: discretization/box/fvgridgeometry.hh:515
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/box/fvgridgeometry.hh:534
void update(const GridView &gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:552
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/box/fvgridgeometry.hh:504
const std::unordered_map< GridIndexType, GridIndexType > & periodicDofMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/box/fvgridgeometry.hh:582
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition: discretization/box/fvgridgeometry.hh:94
friend LocalView localView(const BoxFVGridGeometry &gg)
local view of this object (constructed with the internal cache)
Definition: discretization/box/fvgridgeometry.hh:207
BoxGridGeometryCache Cache
Definition: discretization/box/fvgridgeometry.hh:272
void update(const GridView &gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:173
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the vertex / d.o.f. on the other side of the periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:199
std::size_t numDofs() const
The total number of degrees of freedom.
Definition: discretization/box/fvgridgeometry.hh:168
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/box/fvgridgeometry.hh:155
BasicGridGeometry_t< GV, Traits > BasicGridGeometry
export basic grid geometry type for the alternative constructor
Definition: discretization/box/fvgridgeometry.hh:111
typename Traits::ScvQuadratureRule ScvQuadratureRule
export the scv interpolation point data type
Definition: discretization/box/fvgridgeometry.hh:131
const FeCache & feCache() const
The finite element cache for creating local FE bases.
Definition: discretization/box/fvgridgeometry.hh:187
std::size_t numBoundaryScvf() const
Definition: discretization/box/fvgridgeometry.hh:164
typename Traits::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition: discretization/box/fvgridgeometry.hh:133
Dune::LagrangeLocalFiniteElementCache< CoordScalar, Scalar, dim, 1 > FeCache
export the finite element cache type
Definition: discretization/box/fvgridgeometry.hh:125
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:117
const DofMapper & dofMapper() const
Definition: discretization/box/fvgridgeometry.hh:151
const std::unordered_map< GridIndexType, GridIndexType > & periodicDofMap() const
Returns the map between dofs across periodic boundaries.
Definition: discretization/box/fvgridgeometry.hh:203
BoxFVGridGeometry(const GridView &gridView)
Constructor.
Definition: discretization/box/fvgridgeometry.hh:145
BoxFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg)
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition: discretization/box/fvgridgeometry.hh:136
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition: discretization/box/fvgridgeometry.hh:121
typename PeriodicGridTraits< typename GV::Grid >::SupportsPeriodicity SupportsPeriodicity
export whether the grid(geometry) supports periodicity
Definition: discretization/box/fvgridgeometry.hh:129
typename Traits::template LocalView< ThisType, true > LocalView
export the type of the fv element geometry (the local view type)
Definition: discretization/box/fvgridgeometry.hh:113
bool dofOnBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on the boundary.
Definition: discretization/box/fvgridgeometry.hh:191
std::size_t numScvf() const
The total number of sun control volume faces.
Definition: discretization/box/fvgridgeometry.hh:159
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a vertex / d.o.f. is on a periodic boundary.
Definition: discretization/box/fvgridgeometry.hh:195
void update(GridView &&gridView)
update all fvElementGeometries (call this after grid adaption)
Definition: discretization/box/fvgridgeometry.hh:180
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition: discretization/box/fvgridgeometry.hh:115
typename Traits::VertexMapper DofMapper
export dof mapper type
Definition: discretization/box/fvgridgeometry.hh:123
Base class for the finite volume geometry vector for box schemes This builds up the sub control volum...
Definition: discretization/box/fvgridgeometry.hh:83
Create sub control volumes and sub control volume face geometries.
Definition: boxgeometryhelper.hh:257
Class for a sub control volume face in the box method, i.e a part of the boundary of a sub control vo...
Definition: discretization/box/subcontrolvolumeface.hh:60
the sub control volume for the box scheme
Definition: discretization/box/subcontrolvolume.hh:58
Class for a boundary face related to primary grid elements (dune intersections)
Definition: boundaryface.hh:69
const GlobalPosition & center() const
The center of the face.
Definition: boundaryface.hh:103
Defines the default element and vertex mapper types.
Base class for the local finite volume geometry for box models This builds up the sub control volumes...
the sub control volume for the box scheme
Base class for a sub control volume face.
Helper classes to compute the integration elements.
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:42
Defines the index types used for grid and local indices.
The available discretization methods in Dumux.
Dune::Std::detected_or_t< Dumux::BoxGeometryHelper< GV, GV::dimension, typename T::SubControlVolume, typename T::SubControlVolumeFace >, SpecifiesGeometryHelper, T > BoxGeometryHelper_t
Definition: discretization/box/fvgridgeometry.hh:46
typename T::GeometryHelper SpecifiesGeometryHelper
Definition: basegridgeometry.hh:30
CVFE< CVFEMethods::PQ1 > Box
Definition: method.hh:98
Definition: adapt.hh:17
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:236
std::ranges::range auto scvs(const FVElementGeometry &fvGeometry, const LocalDof &localDof)
Definition: localdof.hh:79
Grid properties related to periodicity.
The default traits for the box finite volume grid geometry Defines the scv and scvf types and the map...
Definition: discretization/box/fvgridgeometry.hh:65
Quadrature rule traits for discretization schemes.
Definition: quadraturerules.hh:85
Definition: method.hh:46
Structure to define the index types used for grid and local indices.
Definition: indextraits.hh:26
Definition: periodicgridtraits.hh:24