version 3.11-dev
discretization/box/fvelementgeometry.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_FV_ELEMENT_GEOMETRY_HH
15#define DUMUX_DISCRETIZATION_BOX_FV_ELEMENT_GEOMETRY_HH
16
17#include <optional>
18#include <span>
19#include <utility>
20#include <unordered_map>
21#include <array>
22#include <vector>
23
24#include <dune/geometry/type.hh>
25#include <dune/localfunctions/lagrange/pqkfactory.hh>
26#include <dune/common/reservedvector.hh>
27
34
35namespace Dumux {
36
45template<class GG, bool enableGridGeometryCache>
47
49template<class GG>
50class BoxFVElementGeometry<GG, true>
51{
52 using GridView = typename GG::GridView;
53 static constexpr int dim = GridView::dimension;
54 static constexpr int dimWorld = GridView::dimensionworld;
55 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
56 using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
57 using CoordScalar = typename GridView::ctype;
58 using FeLocalBasis = typename GG::FeCache::FiniteElementType::Traits::LocalBasisType;
59 using GGCache = typename GG::Cache;
60 using GeometryHelper = typename GGCache::GeometryHelper;
61
63 typename GridView::template Codim<0>::Entity::Geometry::LocalCoordinate,
64 typename GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate
65 >;
66
67public:
69 using Element = typename GridView::template Codim<0>::Entity;
71 using SubControlVolume = typename GG::SubControlVolume;
73 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
75 using GridGeometry = GG;
77 using BoundaryFace = typename GG::BoundaryFace;
79 using ScvQuadratureRule = typename GG::ScvQuadratureRule;
81 using ScvfQuadratureRule = typename GG::ScvfQuadratureRule;
83 static constexpr std::size_t maxNumElementScvs = (1<<dim);
84
89 BoxFVElementGeometry(const GGCache& ggCache)
90 : ggCache_(&ggCache) {}
91
93 const SubControlVolume& scv(LocalIndexType scvIdx) const
94 {
95 return ggCache_->scvs(eIdx_)[scvIdx];
96 }
97
99 const SubControlVolumeFace& scvf(LocalIndexType scvfIdx) const
100 {
101 return ggCache_->scvfs(eIdx_)[scvfIdx];
102 }
103
109 friend inline Dune::IteratorRange<typename std::vector<SubControlVolume>::const_iterator>
110 scvs(const BoxFVElementGeometry& fvGeometry)
111 {
112 using Iter = typename std::vector<SubControlVolume>::const_iterator;
113 const auto& s = fvGeometry.ggCache_->scvs(fvGeometry.eIdx_);
114 return Dune::IteratorRange<Iter>(s.begin(), s.end());
115 }
116
122 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
123 scvfs(const BoxFVElementGeometry& fvGeometry)
124 {
125 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
126 const auto& s = fvGeometry.ggCache_->scvfs(fvGeometry.eIdx_);
127 return Dune::IteratorRange<Iter>(s.begin(), s.end());
128 }
129
132 friend inline std::ranges::view auto
134 {
135 const auto& v = fvGeometry.ggCache_->boundaryFaces(fvGeometry.eIdx_);
136 return std::ranges::views::all(v);
137 }
138
140 friend inline auto localDofs(const BoxFVElementGeometry& fvGeometry, const BoundaryFace& boundaryFace)
141 {
142 return Dune::transformedRangeView(
143 Dune::range(Dune::referenceElement<CoordScalar, dim>(fvGeometry.element().type()).size(boundaryFace.intersectionIndex(), 1, dim)),
144 [&](const auto i)
145 {
146 auto localDofIdx = Dune::referenceElement<CoordScalar, dim>(fvGeometry.element().type()).subEntity(boundaryFace.intersectionIndex(), 1, i, dim);
147 return CVFE::LocalDof
148 {
149 static_cast<LocalIndexType>(localDofIdx),
150 fvGeometry.gridGeometry().dofMapper().subIndex(fvGeometry.element(), localDofIdx, dim),
151 static_cast<GridIndexType>(fvGeometry.elementIndex())
152 };
153 }
154 );
155 }
156
158 const FeLocalBasis& feLocalBasis() const
159 {
160 return gridGeometry().feCache().get(element_->type()).localBasis();
161 }
162
164 std::size_t numLocalDofs() const
165 {
166 return numScv();
167 }
168
170 std::size_t numScv() const
171 {
172 return ggCache_->scvs(eIdx_).size();
173 }
174
176 std::size_t numScvf() const
177 {
178 return ggCache_->scvfs(eIdx_).size();
179 }
180
187 {
188 this->bindElement(element);
189 return std::move(*this);
190 }
191
195 void bind(const Element& element) &
196 { this->bindElement(element); }
197
204 {
205 this->bindElement(element);
206 return std::move(*this);
207 }
208
212 void bindElement(const Element& element) &
213 {
214 element_ = element;
215 elementGeometry_.emplace(element.geometry());
216 // cache element index
217 eIdx_ = gridGeometry().elementMapper().index(element);
218 }
219
221 bool isBound() const
222 { return static_cast<bool>(element_); }
223
225 const Element& element() const
226 { return *element_; }
227
229 const typename Element::Geometry& elementGeometry() const
230 { return *elementGeometry_; }
231
233 GridIndexType elementIndex() const
234 { return eIdx_; }
235
237 std::size_t intersectionIndex(const SubControlVolumeFace& scvf) const
238 {
239 const auto localScvfIdx = scvf.index() - GeometryHelper::numInteriorScvf(element().type());
240 return ggCache_->scvfBoundaryGeometryKeys(eIdx_)[localScvfIdx][0];
241 }
242
245 { return ggCache_->gridGeometry(); }
246
248 bool hasBoundaryScvf() const
249 { return ggCache_->hasBoundaryScvf(eIdx_); }
250
252 bool hasBoundaryFaces() const
253 { return hasBoundaryScvf(); }
254
256 const BoundaryFace& boundaryFace(LocalIndexType bfIdx) const
257 { return ggCache_->boundaryFaces(eIdx_)[bfIdx]; }
258
260 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
261 {
262 assert(isBound());
263 return { Dune::GeometryTypes::cube(dim), GeometryHelper(*elementGeometry_).getScvCorners(scv.indexInElement()) };
264 }
265
267 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
268 {
269 assert(isBound());
270 const GeometryHelper geometryHelper(*elementGeometry_);
271 if (scvf.boundary())
272 {
273 const auto localBoundaryIndex = scvf.index() - geometryHelper.numInteriorScvf();
274 const auto& key = ggCache_->scvfBoundaryGeometryKeys(eIdx_)[localBoundaryIndex];
275 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getBoundaryScvfCorners(key[0], key[1]) };
276 }
277 else
278 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getScvfCorners(scvf.index()) };
279 }
280
282 typename BoundaryFace::Traits::Geometry geometry(const BoundaryFace& boundaryFace) const
283 {
284 assert(isBound());
285 const auto& elemGeo = elementGeometry();
286 const auto faceGeoInRef = referenceElement(elemGeo).template geometry<1>(boundaryFace.intersectionIndex());
287 typename BoundaryFace::Traits::CornerStorage corners;
288 for (int i = 0; i < faceGeoInRef.corners(); ++i)
289 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
290 return { faceGeoInRef.type(), corners };
291 }
292
294 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolume& scv)
295 {
296 const auto type = fvGeometry.element().type();
297 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(scv.localDofIndex());
298
299 return CVFE::LocalDofInterpolationPointData{ GeometryHelper::localDofPosition(type, localKey), scv.dofPosition(), scv.localDofIndex() };
300 }
301
303 template<class LocalDof>
304 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const LocalDof& localDof)
305 {
306 const auto type = fvGeometry.element().type();
307 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(localDof.index());
308 const auto& localPos = GeometryHelper::localDofPosition(type, localKey);
309
310 return CVFE::LocalDofInterpolationPointData{ localPos, fvGeometry.elementGeometry().global(localPos), localDof.index() };
311 }
312
314 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const typename Element::Geometry::GlobalCoordinate& globalPos)
315 {
316 // Create ipData that does not automatically calculate the local position but only if it is called
318 [&] (const typename Element::Geometry::GlobalCoordinate& pos)
319 { return fvGeometry.elementGeometry().local(pos); },
320 globalPos
321 };
322 }
323
325 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
326 {
328 { scvf.unitOuterNormal(), scvf.index(), fvGeometry.elementGeometry().local(scvf.ipGlobal()), scvf.ipGlobal() };
329 }
330
331private:
332 const GGCache* ggCache_;
333 GridIndexType eIdx_;
334
335 std::optional<Element> element_;
336 std::optional<typename Element::Geometry> elementGeometry_;
337};
338
340template<class GG>
341class BoxFVElementGeometry<GG, false>
342{
343 using GridView = typename GG::GridView;
344 static constexpr int dim = GridView::dimension;
345 static constexpr int dimWorld = GridView::dimensionworld;
346 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
347 using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
348 using CoordScalar = typename GridView::ctype;
349 using FeLocalBasis = typename GG::FeCache::FiniteElementType::Traits::LocalBasisType;
350 using GGCache = typename GG::Cache;
351 using GeometryHelper = typename GGCache::GeometryHelper;
352
354 typename GridView::template Codim<0>::Entity::Geometry::LocalCoordinate,
355 typename GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate
356 >;
357
358public:
360 using Element = typename GridView::template Codim<0>::Entity;
362 using SubControlVolume = typename GG::SubControlVolume;
364 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
366 using GridGeometry = GG;
368 using BoundaryFace = typename GG::BoundaryFace;
370 using ScvQuadratureRule = typename GG::ScvQuadratureRule;
372 using ScvfQuadratureRule = typename GG::ScvfQuadratureRule;
374 static constexpr std::size_t maxNumElementScvs = (1<<dim);
375
380 BoxFVElementGeometry(const GGCache& ggCache)
381 : ggCache_(&ggCache) {}
382
384 const SubControlVolume& scv(LocalIndexType scvIdx) const
385 {
386 return scvs_[scvIdx];
387 }
388
390 const SubControlVolumeFace& scvf(LocalIndexType scvfIdx) const
391 {
392 return scvfs_[scvfIdx];
393 }
394
400 friend inline Dune::IteratorRange<typename std::vector<SubControlVolume>::const_iterator>
401 scvs(const BoxFVElementGeometry& fvGeometry)
402 {
403 using Iter = typename std::vector<SubControlVolume>::const_iterator;
404 return Dune::IteratorRange<Iter>(fvGeometry.scvs_.begin(), fvGeometry.scvs_.end());
405 }
406
412 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
413 scvfs(const BoxFVElementGeometry& fvGeometry)
414 {
415 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
416 return Dune::IteratorRange<Iter>(fvGeometry.scvfs_.begin(), fvGeometry.scvfs_.end());
417 }
418
421 friend inline std::ranges::view auto
423 { return std::ranges::views::all(fvGeometry.boundaryFaces_); }
424
426 friend inline auto localDofs(const BoxFVElementGeometry& fvGeometry, const BoundaryFace& boundaryFace)
427 {
428 return Dune::transformedRangeView(
429 Dune::range(Dune::referenceElement<CoordScalar, dim>(fvGeometry.element().type()).size(boundaryFace.intersectionIndex(), 1, dim)),
430 [&](const auto i)
431 {
432 auto localDofIdx = Dune::referenceElement<CoordScalar, dim>(fvGeometry.element().type()).subEntity(boundaryFace.intersectionIndex(), 1, i, dim);
433 return CVFE::LocalDof
434 {
435 static_cast<LocalIndexType>(localDofIdx),
436 fvGeometry.gridGeometry().dofMapper().subIndex(fvGeometry.element(), localDofIdx, dim),
437 static_cast<GridIndexType>(fvGeometry.elementIndex())
438 };
439 }
440 );
441 }
442
443
445 const FeLocalBasis& feLocalBasis() const
446 {
447 return gridGeometry().feCache().get(element_->type()).localBasis();
448 }
449
451 std::size_t numLocalDofs() const
452 {
453 return numScv();
454 }
455
457 std::size_t numScv() const
458 {
459 return scvs_.size();
460 }
461
463 std::size_t numScvf() const
464 {
465 return scvfs_.size();
466 }
467
474 {
475 this->bindElement(element);
476 return std::move(*this);
477 }
478
482 void bind(const Element& element) &
483 { this->bindElement(element); }
484
491 {
492 this->bindElement(element);
493 return std::move(*this);
494 }
495
499 void bindElement(const Element& element) &
500 {
501 element_ = element;
502 eIdx_ = gridGeometry().elementMapper().index(element);
503 elementGeometry_.emplace(element.geometry());
504 makeElementGeometries_();
505 }
506
508 bool isBound() const
509 { return static_cast<bool>(element_); }
510
512 const Element& element() const
513 { return *element_; }
514
516 const typename Element::Geometry& elementGeometry() const
517 { return *elementGeometry_; }
518
520 GridIndexType elementIndex() const
521 { return eIdx_; }
522
524 std::size_t intersectionIndex(const SubControlVolumeFace& scvf) const
525 {
526 const auto localScvfIdx = scvf.index() - GeometryHelper::numInteriorScvf(element().type());
527 return scvfBoundaryGeometryKeys_[localScvfIdx][0];
528 }
529
532 { return ggCache_->gridGeometry(); }
533
535 bool hasBoundaryScvf() const
536 { return hasBoundaryScvf_; }
537
539 bool hasBoundaryFaces() const
540 { return hasBoundaryScvf(); }
541
543 const BoundaryFace& boundaryFace(LocalIndexType bfIdx) const
544 { return boundaryFaces_[bfIdx]; }
545
547 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
548 {
549 assert(isBound());
550 return { Dune::GeometryTypes::cube(dim), GeometryHelper(*elementGeometry_).getScvCorners(scv.indexInElement()) };
551 }
552
554 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
555 {
556 assert(isBound());
557 const GeometryHelper geometryHelper(*elementGeometry_);
558 if (scvf.boundary())
559 {
560 const auto localBoundaryIndex = scvf.index() - geometryHelper.numInteriorScvf();
561 const auto& key = scvfBoundaryGeometryKeys_[localBoundaryIndex];
562 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getBoundaryScvfCorners(key[0], key[1]) };
563 }
564 else
565 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getScvfCorners(scvf.index()) };
566 }
567
569 typename BoundaryFace::Traits::Geometry geometry(const BoundaryFace& boundaryFace) const
570 {
571 assert(isBound());
572 const auto& elemGeo = elementGeometry();
573 const auto faceGeoInRef = referenceElement(elemGeo).template geometry<1>(boundaryFace.intersectionIndex());
574 typename BoundaryFace::Traits::CornerStorage corners;
575 for (int i = 0; i < faceGeoInRef.corners(); ++i)
576 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
577 return { faceGeoInRef.type(), corners };
578 }
579
581 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolume& scv)
582 {
583 const auto type = fvGeometry.element().type();
584 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(scv.localDofIndex());
585
586 return CVFE::LocalDofInterpolationPointData{ GeometryHelper::localDofPosition(type, localKey), scv.dofPosition(), scv.localDofIndex() };
587 }
588
590 template<class LocalDof>
591 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const LocalDof& localDof)
592 {
593 const auto type = fvGeometry.element().type();
594 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(localDof.index());
595 const auto& localPos = GeometryHelper::localDofPosition(type, localKey);
596
597 return CVFE::LocalDofInterpolationPointData{ localPos, fvGeometry.elementGeometry().global(localPos), localDof.index() };
598 }
599
601 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const typename Element::Geometry::GlobalCoordinate& globalPos)
602 {
603 // Create ipData that does not automatically calculate the local position but only if it is called
605 [&] (const typename Element::Geometry::GlobalCoordinate& pos) { return fvGeometry.elementGeometry().local(pos); },
606 globalPos
607 };
608 }
609
611 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
612 {
614 { scvf.unitOuterNormal(), scvf.index(), fvGeometry.elementGeometry().local(scvf.ipGlobal()), scvf.ipGlobal() };
615 }
616
617private:
618 void makeElementGeometries_()
619 {
620 hasBoundaryScvf_ = false;
621 boundaryFaces_.clear();
622
623 // get the element geometry
624 const auto& element = *element_;
625 const auto& elementGeometry = *elementGeometry_;
626 const auto refElement = referenceElement(elementGeometry);
627
628 // get the sub control volume geometries of this element
629 GeometryHelper geometryHelper(elementGeometry);
630
631 // construct the sub control volumes
632 scvs_.resize(elementGeometry.corners());
633 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
634 {
635 // get associated dof index
636 const auto dofIdxGlobal = gridGeometry().vertexMapper().subIndex(element, scvLocalIdx, dim);
637
638 // add scv to the local container
639 scvs_[scvLocalIdx] = SubControlVolume(
640 geometryHelper.getScvCorners(scvLocalIdx),
641 scvLocalIdx,
642 eIdx_,
643 dofIdxGlobal
644 );
645 }
646
647 // construct the sub control volume faces
648 const auto numInnerScvf = geometryHelper.numInteriorScvf();
649 scvfs_.resize(numInnerScvf);
650 scvfBoundaryGeometryKeys_.clear();
651
652 LocalIndexType scvfLocalIdx = 0;
653 for (; scvfLocalIdx < numInnerScvf; ++scvfLocalIdx)
654 {
655 // find the local scv indices this scvf is connected to
656 std::array<LocalIndexType, 2> localScvIndices{{
657 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 0, dim)),
658 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 1, dim))
659 }};
660
661 const auto& corners = geometryHelper.getScvfCorners(scvfLocalIdx);
662 scvfs_[scvfLocalIdx] = SubControlVolumeFace(
663 corners,
664 geometryHelper.normal(corners, localScvIndices),
665 element,
666 scvfLocalIdx,
667 std::move(localScvIndices)
668 );
669 }
670
671 // construct the sub control volume faces on the domain boundary
672 LocalIndexType numBoundaryFaces = 0;
673 for (const auto& intersection : intersections(gridGeometry().gridView(), element))
674 {
675 if (intersection.boundary() && !intersection.neighbor())
676 {
677 const auto isGeometry = intersection.geometry();
678 hasBoundaryScvf_ = true;
679
680 // add one boundary face per boundary intersection
681 boundaryFaces_.push_back(BoundaryFace{
682 isGeometry.center(),
683 isGeometry.volume(),
684 intersection.centerUnitOuterNormal(),
685 numBoundaryFaces++,
686 static_cast<LocalIndexType>(intersection.indexInInside()),
687 typename BoundaryFace::Traits::BoundaryFlag{intersection}
688 });
689
690 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < isGeometry.corners(); ++isScvfLocalIdx)
691 {
692 // find the scv this scvf is connected to
693 const LocalIndexType insideScvIdx = static_cast<LocalIndexType>(refElement.subEntity(intersection.indexInInside(), 1, isScvfLocalIdx, dim));
694 std::array<LocalIndexType, 2> localScvIndices{{insideScvIdx, insideScvIdx}};
695
696 scvfs_.emplace_back(
697 geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), isScvfLocalIdx),
698 intersection.centerUnitOuterNormal(),
699 intersection,
700 isScvfLocalIdx,
701 scvfLocalIdx,
702 std::move(localScvIndices)
703 );
704
705 scvfBoundaryGeometryKeys_.emplace_back(std::array<LocalIndexType, 2>{{
706 static_cast<LocalIndexType>(intersection.indexInInside()),
707 static_cast<LocalIndexType>(isScvfLocalIdx)
708 }});
709
710 // increment local counter
711 scvfLocalIdx++;
712 }
713 }
714 }
715 }
716
718 GridIndexType eIdx_;
719 std::optional<Element> element_;
720 std::optional<typename Element::Geometry> elementGeometry_;
721
723 const GGCache* ggCache_;
724
726 std::vector<SubControlVolume> scvs_;
727 std::vector<SubControlVolumeFace> scvfs_;
728 std::vector<std::array<LocalIndexType, 2>> scvfBoundaryGeometryKeys_;
729 Dune::ReservedVector<BoundaryFace, 2*dim> boundaryFaces_;
730
731 bool hasBoundaryScvf_ = false;
732};
733
734} // end namespace Dumux
735
736#endif
Helper class constructing the dual grid finite volume geometries for the box discretizazion method.
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: discretization/box/fvelementgeometry.hh:508
std::size_t numScvf() const
The total number of sub control volume faces.
Definition: discretization/box/fvelementgeometry.hh:463
GG GridGeometry
export type of finite volume grid geometry
Definition: discretization/box/fvelementgeometry.hh:366
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Geometry of a sub control volume face.
Definition: discretization/box/fvelementgeometry.hh:554
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/box/fvelementgeometry.hh:535
friend Dune::IteratorRange< typename std::vector< SubControlVolume >::const_iterator > scvs(const BoxFVElementGeometry &fvGeometry)
Definition: discretization/box/fvelementgeometry.hh:401
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/box/fvelementgeometry.hh:457
GridIndexType elementIndex() const
The bound element's index in the grid view.
Definition: discretization/box/fvelementgeometry.hh:520
void bindElement(const Element &element) &
Definition: discretization/box/fvelementgeometry.hh:499
std::size_t intersectionIndex(const SubControlVolumeFace &scvf) const
The intersection index the scvf belongs to.
Definition: discretization/box/fvelementgeometry.hh:524
const SubControlVolumeFace & scvf(LocalIndexType scvfIdx) const
Get a sub control volume face with a local scvf index.
Definition: discretization/box/fvelementgeometry.hh:390
BoxFVElementGeometry(const GGCache &ggCache)
Constructor.
Definition: discretization/box/fvelementgeometry.hh:380
typename GG::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition: discretization/box/fvelementgeometry.hh:372
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Geometry of a sub control volume.
Definition: discretization/box/fvelementgeometry.hh:547
const GridGeometry & gridGeometry() const
The grid geometry we are a restriction of.
Definition: discretization/box/fvelementgeometry.hh:531
typename GridView::template Codim< 0 >::Entity Element
export the element type
Definition: discretization/box/fvelementgeometry.hh:360
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry)
Definition: discretization/box/fvelementgeometry.hh:413
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolume &scv)
Interpolation point data for an scv.
Definition: discretization/box/fvelementgeometry.hh:581
BoundaryFace::Traits::Geometry geometry(const BoundaryFace &boundaryFace) const
Geometry of a boundary face.
Definition: discretization/box/fvelementgeometry.hh:569
const FeLocalBasis & feLocalBasis() const
Get a local finite element basis.
Definition: discretization/box/fvelementgeometry.hh:445
const Element & element() const
The bound element.
Definition: discretization/box/fvelementgeometry.hh:512
const SubControlVolume & scv(LocalIndexType scvIdx) const
Get a sub control volume with a local scv index.
Definition: discretization/box/fvelementgeometry.hh:384
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition: discretization/box/fvelementgeometry.hh:601
BoxFVElementGeometry bind(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/fvelementgeometry.hh:473
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf)
Interpolation point data for scvf.
Definition: discretization/box/fvelementgeometry.hh:611
friend auto localDofs(const BoxFVElementGeometry &fvGeometry, const BoundaryFace &boundaryFace)
an iterator over all local dofs related to a boundary face
Definition: discretization/box/fvelementgeometry.hh:426
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition: discretization/box/fvelementgeometry.hh:591
typename GG::ScvQuadratureRule ScvQuadratureRule
the quadrature rule type for scvs
Definition: discretization/box/fvelementgeometry.hh:370
std::size_t numLocalDofs() const
The total number of element-local dofs.
Definition: discretization/box/fvelementgeometry.hh:451
typename GG::BoundaryFace BoundaryFace
export the boundary face type
Definition: discretization/box/fvelementgeometry.hh:368
friend std::ranges::view auto boundaryFaces(const BoxFVElementGeometry &fvGeometry)
Definition: discretization/box/fvelementgeometry.hh:422
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition: discretization/box/fvelementgeometry.hh:364
const BoundaryFace & boundaryFace(LocalIndexType bfIdx) const
Get a boundary face with a local boundary face index.
Definition: discretization/box/fvelementgeometry.hh:543
BoxFVElementGeometry bindElement(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/fvelementgeometry.hh:490
const Element::Geometry & elementGeometry() const
The bound element geometry.
Definition: discretization/box/fvelementgeometry.hh:516
bool hasBoundaryFaces() const
Returns whether the element has boundary faces.
Definition: discretization/box/fvelementgeometry.hh:539
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition: discretization/box/fvelementgeometry.hh:362
void bind(const Element &element) &
Definition: discretization/box/fvelementgeometry.hh:482
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: discretization/box/fvelementgeometry.hh:221
const FeLocalBasis & feLocalBasis() const
Get a local finite element basis.
Definition: discretization/box/fvelementgeometry.hh:158
BoundaryFace::Traits::Geometry geometry(const BoundaryFace &boundaryFace) const
Geometry of a boundary face.
Definition: discretization/box/fvelementgeometry.hh:282
BoxFVElementGeometry bindElement(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/fvelementgeometry.hh:203
const Element & element() const
The bound element.
Definition: discretization/box/fvelementgeometry.hh:225
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Geometry of a sub control volume.
Definition: discretization/box/fvelementgeometry.hh:260
friend Dune::IteratorRange< typename std::vector< SubControlVolume >::const_iterator > scvs(const BoxFVElementGeometry &fvGeometry)
Definition: discretization/box/fvelementgeometry.hh:110
bool hasBoundaryFaces() const
Returns whether the element has boundary faces.
Definition: discretization/box/fvelementgeometry.hh:252
std::size_t numScv() const
The total number of sub control volumes.
Definition: discretization/box/fvelementgeometry.hh:170
typename GG::BoundaryFace BoundaryFace
export the boundary face type
Definition: discretization/box/fvelementgeometry.hh:77
const SubControlVolume & scv(LocalIndexType scvIdx) const
Get a sub control volume with a local scv index.
Definition: discretization/box/fvelementgeometry.hh:93
std::size_t numLocalDofs() const
The total number of element-local dofs.
Definition: discretization/box/fvelementgeometry.hh:164
std::size_t numScvf() const
The total number of sub control volume faces.
Definition: discretization/box/fvelementgeometry.hh:176
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition: discretization/box/fvelementgeometry.hh:71
const GridGeometry & gridGeometry() const
The grid geometry we are a restriction of.
Definition: discretization/box/fvelementgeometry.hh:244
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/box/fvelementgeometry.hh:248
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry)
Definition: discretization/box/fvelementgeometry.hh:123
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolume &scv)
Interpolation point data for an scv.
Definition: discretization/box/fvelementgeometry.hh:294
typename GG::ScvQuadratureRule ScvQuadratureRule
export the scv interpolation point data type
Definition: discretization/box/fvelementgeometry.hh:79
const Element::Geometry & elementGeometry() const
The bound element geometry.
Definition: discretization/box/fvelementgeometry.hh:229
void bind(const Element &element) &
Definition: discretization/box/fvelementgeometry.hh:195
typename GG::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition: discretization/box/fvelementgeometry.hh:81
std::size_t intersectionIndex(const SubControlVolumeFace &scvf) const
The intersection index the scvf belongs to.
Definition: discretization/box/fvelementgeometry.hh:237
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Geometry of a sub control volume face.
Definition: discretization/box/fvelementgeometry.hh:267
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition: discretization/box/fvelementgeometry.hh:314
GridIndexType elementIndex() const
The bound element's index in the grid view.
Definition: discretization/box/fvelementgeometry.hh:233
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf)
Interpolation point data for scvf.
Definition: discretization/box/fvelementgeometry.hh:325
friend auto localDofs(const BoxFVElementGeometry &fvGeometry, const BoundaryFace &boundaryFace)
an iterator over all local dofs related to a boundary face
Definition: discretization/box/fvelementgeometry.hh:140
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition: discretization/box/fvelementgeometry.hh:304
friend std::ranges::view auto boundaryFaces(const BoxFVElementGeometry &fvGeometry)
Definition: discretization/box/fvelementgeometry.hh:133
const BoundaryFace & boundaryFace(LocalIndexType bfIdx) const
Get a boundary face with a local boundary face index.
Definition: discretization/box/fvelementgeometry.hh:256
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition: discretization/box/fvelementgeometry.hh:73
void bindElement(const Element &element) &
Definition: discretization/box/fvelementgeometry.hh:212
const SubControlVolumeFace & scvf(LocalIndexType scvfIdx) const
Get a sub control volume face with a local scvf index.
Definition: discretization/box/fvelementgeometry.hh:99
BoxFVElementGeometry(const GGCache &ggCache)
Constructor.
Definition: discretization/box/fvelementgeometry.hh:89
BoxFVElementGeometry bind(const Element &element) &&
bind the local view (r-value overload) This overload is called when an instance of this class is a te...
Definition: discretization/box/fvelementgeometry.hh:186
typename GridView::template Codim< 0 >::Entity Element
export the element type
Definition: discretization/box/fvelementgeometry.hh:69
GG GridGeometry
export type of finite volume grid geometry
Definition: discretization/box/fvelementgeometry.hh:75
Base class for the finite volume geometry vector for box models This builds up the sub control volume...
Definition: discretization/box/fvelementgeometry.hh:46
An interpolation point related to a face of an element.
Definition: cvfe/interpolationpointdata.hh:109
const GlobalPosition & unitOuterNormal() const
The unit outer normal vector at the quadrature point.
Definition: cvfe/interpolationpointdata.hh:123
An interpolation point related to an element that includes global and local positions.
Definition: cvfe/interpolationpointdata.hh:31
An interpolation point related to a global position of an element, giving its local positions by a ma...
Definition: cvfe/interpolationpointdata.hh:82
An interpolation point related to a localDof of an element, giving its global and local positions.
Definition: cvfe/interpolationpointdata.hh:60
LocalIndex localDofIndex() const
The local index of the corresponding dof.
Definition: cvfe/interpolationpointdata.hh:69
Classes representing interpolation point data for control-volume finite element schemes.
Defines the index types used for grid and local indices.
Class representing dofs on elements for control-volume finite element schemes.
Definition: adapt.hh:17
Quadrature rules over sub-control volumes and sub-control volume faces.
Class providing iterators over sub control volumes and sub control volume faces of an element.
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27
unsigned int LocalIndex
Definition: indextraits.hh:28