version 3.11-dev
Loading...
Searching...
No Matches
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 using DofHelper = typename GGCache::DofHelper;
62
63 using BaseIpData = CVFE::InterpolationPointData<
64 typename GridView::template Codim<0>::Entity::Geometry::LocalCoordinate,
65 typename GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate
66 >;
67
68public:
70 using Element = typename GridView::template Codim<0>::Entity;
72 using SubControlVolume = typename GG::SubControlVolume;
74 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
76 using GridGeometry = GG;
78 using BoundaryFace = typename GG::BoundaryFace;
80 using ScvQuadratureRule = typename GG::ScvQuadratureRule;
82 using ScvfQuadratureRule = typename GG::ScvfQuadratureRule;
84 static constexpr std::size_t maxNumElementScvs = (1<<dim);
85
90 BoxFVElementGeometry(const GGCache& ggCache)
91 : ggCache_(&ggCache) {}
92
94 const SubControlVolume& scv(LocalIndexType scvIdx) const
95 {
96 return ggCache_->scvs(eIdx_)[scvIdx];
97 }
98
100 const SubControlVolumeFace& scvf(LocalIndexType scvfIdx) const
101 {
102 return ggCache_->scvfs(eIdx_)[scvfIdx];
103 }
104
110 friend inline Dune::IteratorRange<typename std::vector<SubControlVolume>::const_iterator>
111 scvs(const BoxFVElementGeometry& fvGeometry)
112 {
113 using Iter = typename std::vector<SubControlVolume>::const_iterator;
114 const auto& s = fvGeometry.ggCache_->scvs(fvGeometry.eIdx_);
115 return Dune::IteratorRange<Iter>(s.begin(), s.end());
116 }
117
123 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
124 scvfs(const BoxFVElementGeometry& fvGeometry)
125 {
126 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
127 const auto& s = fvGeometry.ggCache_->scvfs(fvGeometry.eIdx_);
128 return Dune::IteratorRange<Iter>(s.begin(), s.end());
129 }
130
133 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
135 {
136 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
137 const auto& s = fvGeometry.ggCache_->scvfs(fvGeometry.eIdx_);
138 const auto& range = fvGeometry.ggCache_->boundaryFaceScvfRanges(fvGeometry.eIdx_)[boundaryFace.index()];
139 return Dune::IteratorRange<Iter>(s.begin() + range[0], s.begin() + range[0] + range[1]);
140 }
141
144 friend inline std::ranges::view auto
146 {
147 const auto& v = fvGeometry.ggCache_->boundaryFaces(fvGeometry.eIdx_);
148 return std::ranges::views::all(v);
149 }
150
152 friend inline auto localDofs(const BoxFVElementGeometry& fvGeometry, const BoundaryFace& boundaryFace)
153 { return DofHelper::localDofsOnBoundaryFace(fvGeometry, boundaryFace); }
154
156 const FeLocalBasis& feLocalBasis() const
157 {
158 return gridGeometry().feCache().get(element_->type()).localBasis();
159 }
160
162 const auto& feLocalCoefficients() const
163 {
164 return gridGeometry().feCache().get(element_->type()).localCoefficients();
165 }
166
168 std::size_t numLocalDofs() const
169 {
170 return numScv();
171 }
172
174 std::size_t numScv() const
175 {
176 return ggCache_->scvs(eIdx_).size();
177 }
178
180 std::size_t numScvf() const
181 {
182 return ggCache_->scvfs(eIdx_).size();
183 }
184
191 {
192 this->bindElement(element);
193 return std::move(*this);
194 }
195
199 void bind(const Element& element) &
200 { this->bindElement(element); }
201
208 {
209 this->bindElement(element);
210 return std::move(*this);
211 }
212
217 {
218 element_ = element;
219 elementGeometry_.emplace(element.geometry());
220 // cache element index
221 eIdx_ = gridGeometry().elementMapper().index(element);
222 }
223
225 bool isBound() const
226 { return static_cast<bool>(element_); }
227
229 const Element& element() const
230 { return *element_; }
231
233 const typename Element::Geometry& elementGeometry() const
234 { return *elementGeometry_; }
235
237 GridIndexType elementIndex() const
238 { return eIdx_; }
239
242 {
243 const auto localScvfIdx = scvf.index() - GeometryHelper::numInteriorScvf(element().type());
244 return ggCache_->scvfBoundaryGeometryKeys(eIdx_)[localScvfIdx][0];
245 }
246
249 { return ggCache_->gridGeometry(); }
250
253 { return ggCache_->gridGeometry(); }
254
256 bool hasBoundaryScvf() const
257 { return ggCache_->hasBoundaryScvf(eIdx_); }
258
260 bool hasBoundaryFaces() const
261 { return hasBoundaryScvf(); }
262
264 const BoundaryFace& boundaryFace(LocalIndexType bfIdx) const
265 { return ggCache_->boundaryFaces(eIdx_)[bfIdx]; }
266
268 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
269 {
270 assert(isBound());
271 return { Dune::GeometryTypes::cube(dim), GeometryHelper(*elementGeometry_).getScvCorners(scv.indexInElement()) };
272 }
273
275 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
276 {
277 assert(isBound());
278 const GeometryHelper geometryHelper(*elementGeometry_);
279 if (scvf.boundary())
280 {
281 const auto localBoundaryIndex = scvf.index() - geometryHelper.numInteriorScvf();
282 const auto& key = ggCache_->scvfBoundaryGeometryKeys(eIdx_)[localBoundaryIndex];
283 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getBoundaryScvfCorners(key[0], key[1]) };
284 }
285 else
286 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getScvfCorners(scvf.index()) };
287 }
288
290 typename BoundaryFace::Traits::Geometry geometry(const BoundaryFace& boundaryFace) const
291 {
292 assert(isBound());
293 const auto& elemGeo = elementGeometry();
294 const auto faceGeoInRef = referenceElement(elemGeo).template geometry<1>(boundaryFace.intersectionIndex());
295 typename BoundaryFace::Traits::CornerStorage corners;
296 for (int i = 0; i < faceGeoInRef.corners(); ++i)
297 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
298 return { faceGeoInRef.type(), corners };
299 }
300
302 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolume& scv)
303 {
304 const auto type = fvGeometry.element().type();
305 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(scv.localDofIndex());
306
307 return CVFE::LocalDofInterpolationPointData{ DofHelper::localDofPosition(type, localKey), scv.dofPosition(), scv.localDofIndex() };
308 }
309
311 template<class LocalDof>
312 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const LocalDof& localDof)
313 {
314 const auto type = fvGeometry.element().type();
315 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(localDof.index());
316 const auto& localPos = DofHelper::localDofPosition(type, localKey);
317
318 return CVFE::LocalDofInterpolationPointData{ localPos, fvGeometry.elementGeometry().global(localPos), localDof.index() };
319 }
320
322 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const typename Element::Geometry::GlobalCoordinate& globalPos)
323 {
324 // Create ipData that does not automatically calculate the local position but only if it is called
326 [&] (const typename Element::Geometry::GlobalCoordinate& pos)
327 { return fvGeometry.elementGeometry().local(pos); },
328 globalPos
329 };
330 }
331
333 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
334 {
336 { scvf.unitOuterNormal(), scvf.index(), fvGeometry.elementGeometry().local(scvf.ipGlobal()), scvf.ipGlobal() };
337 }
338
339private:
340 const GGCache* ggCache_;
341 GridIndexType eIdx_;
342
343 std::optional<Element> element_;
344 std::optional<typename Element::Geometry> elementGeometry_;
345};
346
348template<class GG>
349class BoxFVElementGeometry<GG, false>
350{
351 using GridView = typename GG::GridView;
352 static constexpr int dim = GridView::dimension;
353 static constexpr int dimWorld = GridView::dimensionworld;
354 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
355 using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
356 using CoordScalar = typename GridView::ctype;
357 using FeLocalBasis = typename GG::FeCache::FiniteElementType::Traits::LocalBasisType;
358 using GGCache = typename GG::Cache;
359 using GeometryHelper = typename GGCache::GeometryHelper;
360 using DofHelper = typename GGCache::DofHelper;
361
362 using BaseIpData = CVFE::InterpolationPointData<
363 typename GridView::template Codim<0>::Entity::Geometry::LocalCoordinate,
364 typename GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate
365 >;
366
367public:
369 using Element = typename GridView::template Codim<0>::Entity;
371 using SubControlVolume = typename GG::SubControlVolume;
373 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
375 using GridGeometry = GG;
377 using BoundaryFace = typename GG::BoundaryFace;
379 using ScvQuadratureRule = typename GG::ScvQuadratureRule;
381 using ScvfQuadratureRule = typename GG::ScvfQuadratureRule;
383 static constexpr std::size_t maxNumElementScvs = (1<<dim);
384
389 BoxFVElementGeometry(const GGCache& ggCache)
390 : ggCache_(&ggCache) {}
391
393 const SubControlVolume& scv(LocalIndexType scvIdx) const
394 {
395 return scvs_[scvIdx];
396 }
397
399 const SubControlVolumeFace& scvf(LocalIndexType scvfIdx) const
400 {
401 return scvfs_[scvfIdx];
402 }
403
409 friend inline Dune::IteratorRange<typename std::vector<SubControlVolume>::const_iterator>
410 scvs(const BoxFVElementGeometry& fvGeometry)
411 {
412 using Iter = typename std::vector<SubControlVolume>::const_iterator;
413 return Dune::IteratorRange<Iter>(fvGeometry.scvs_.begin(), fvGeometry.scvs_.end());
414 }
415
421 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
422 scvfs(const BoxFVElementGeometry& fvGeometry)
423 {
424 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
425 return Dune::IteratorRange<Iter>(fvGeometry.scvfs_.begin(), fvGeometry.scvfs_.end());
426 }
427
430 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
432 {
433 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
434 const auto& range = fvGeometry.boundaryFaceScvfRanges_[boundaryFace.index()];
435 return Dune::IteratorRange<Iter>(fvGeometry.scvfs_.begin() + range[0], fvGeometry.scvfs_.begin() + range[0] + range[1]);
436 }
437
440 friend inline std::ranges::view auto
442 { return std::ranges::views::all(fvGeometry.boundaryFaces_); }
443
445 friend inline auto localDofs(const BoxFVElementGeometry& fvGeometry, const BoundaryFace& boundaryFace)
446 { return DofHelper::localDofsOnBoundaryFace(fvGeometry, boundaryFace); }
447
449 const FeLocalBasis& feLocalBasis() const
450 {
451 return gridGeometry().feCache().get(element_->type()).localBasis();
452 }
453
455 const auto& feLocalCoefficients() const
456 {
457 return gridGeometry().feCache().get(element_->type()).localCoefficients();
458 }
459
461 std::size_t numLocalDofs() const
462 {
463 return numScv();
464 }
465
467 std::size_t numScv() const
468 {
469 return scvs_.size();
470 }
471
473 std::size_t numScvf() const
474 {
475 return scvfs_.size();
476 }
477
484 {
485 this->bindElement(element);
486 return std::move(*this);
487 }
488
492 void bind(const Element& element) &
493 { this->bindElement(element); }
494
501 {
502 this->bindElement(element);
503 return std::move(*this);
504 }
505
510 {
511 element_ = element;
512 eIdx_ = gridGeometry().elementMapper().index(element);
513 elementGeometry_.emplace(element.geometry());
514 makeElementGeometries_();
515 }
516
518 bool isBound() const
519 { return static_cast<bool>(element_); }
520
522 const Element& element() const
523 { return *element_; }
524
526 const typename Element::Geometry& elementGeometry() const
527 { return *elementGeometry_; }
528
530 GridIndexType elementIndex() const
531 { return eIdx_; }
532
535 {
536 const auto localScvfIdx = scvf.index() - GeometryHelper::numInteriorScvf(element().type());
537 return scvfBoundaryGeometryKeys_[localScvfIdx][0];
538 }
539
542 { return ggCache_->gridGeometry(); }
543
546 { return ggCache_->gridGeometry(); }
547
549 bool hasBoundaryScvf() const
550 { return hasBoundaryScvf_; }
551
553 bool hasBoundaryFaces() const
554 { return hasBoundaryScvf(); }
555
557 const BoundaryFace& boundaryFace(LocalIndexType bfIdx) const
558 { return boundaryFaces_[bfIdx]; }
559
561 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
562 {
563 assert(isBound());
564 return { Dune::GeometryTypes::cube(dim), GeometryHelper(*elementGeometry_).getScvCorners(scv.indexInElement()) };
565 }
566
568 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
569 {
570 assert(isBound());
571 const GeometryHelper geometryHelper(*elementGeometry_);
572 if (scvf.boundary())
573 {
574 const auto localBoundaryIndex = scvf.index() - geometryHelper.numInteriorScvf();
575 const auto& key = scvfBoundaryGeometryKeys_[localBoundaryIndex];
576 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getBoundaryScvfCorners(key[0], key[1]) };
577 }
578 else
579 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getScvfCorners(scvf.index()) };
580 }
581
583 typename BoundaryFace::Traits::Geometry geometry(const BoundaryFace& boundaryFace) const
584 {
585 assert(isBound());
586 const auto& elemGeo = elementGeometry();
587 const auto faceGeoInRef = referenceElement(elemGeo).template geometry<1>(boundaryFace.intersectionIndex());
588 typename BoundaryFace::Traits::CornerStorage corners;
589 for (int i = 0; i < faceGeoInRef.corners(); ++i)
590 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
591 return { faceGeoInRef.type(), corners };
592 }
593
595 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolume& scv)
596 {
597 const auto type = fvGeometry.element().type();
598 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(scv.localDofIndex());
599
600 return CVFE::LocalDofInterpolationPointData{ DofHelper::localDofPosition(type, localKey), scv.dofPosition(), scv.localDofIndex() };
601 }
602
604 template<class LocalDof>
605 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const LocalDof& localDof)
606 {
607 const auto type = fvGeometry.element().type();
608 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(localDof.index());
609 const auto& localPos = DofHelper::localDofPosition(type, localKey);
610
611 return CVFE::LocalDofInterpolationPointData{ localPos, fvGeometry.elementGeometry().global(localPos), localDof.index() };
612 }
613
615 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const typename Element::Geometry::GlobalCoordinate& globalPos)
616 {
617 // Create ipData that does not automatically calculate the local position but only if it is called
619 [&] (const typename Element::Geometry::GlobalCoordinate& pos) { return fvGeometry.elementGeometry().local(pos); },
620 globalPos
621 };
622 }
623
625 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
626 {
628 { scvf.unitOuterNormal(), scvf.index(), fvGeometry.elementGeometry().local(scvf.ipGlobal()), scvf.ipGlobal() };
629 }
630
631private:
632 void makeElementGeometries_()
633 {
634 hasBoundaryScvf_ = false;
635 boundaryFaces_.clear();
636 boundaryFaceScvfRanges_.clear();
637
638 // get the element geometry
639 const auto& element = *element_;
640 const auto& elementGeometry = *elementGeometry_;
641 const auto refElement = referenceElement(elementGeometry);
642
643 // get the sub control volume geometries of this element
644 GeometryHelper geometryHelper(elementGeometry);
645
646 // construct the sub control volumes
647 scvs_.resize(elementGeometry.corners());
648 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
649 {
650 // get associated dof index
651 const auto dofIdxGlobal = gridGeometry().vertexMapper().subIndex(element, scvLocalIdx, dim);
652
653 // add scv to the local container
654 scvs_[scvLocalIdx] = SubControlVolume(
655 geometryHelper.getScvCorners(scvLocalIdx),
656 scvLocalIdx,
657 eIdx_,
658 dofIdxGlobal
659 );
660 }
661
662 // construct the sub control volume faces
663 const auto numInnerScvf = geometryHelper.numInteriorScvf();
664 scvfs_.resize(numInnerScvf);
665 scvfBoundaryGeometryKeys_.clear();
666
667 LocalIndexType scvfLocalIdx = 0;
668 for (; scvfLocalIdx < numInnerScvf; ++scvfLocalIdx)
669 {
670 // find the local scv indices this scvf is connected to
671 std::array<LocalIndexType, 2> localScvIndices{{
672 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 0, dim)),
673 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 1, dim))
674 }};
675
676 const auto& corners = geometryHelper.getScvfCorners(scvfLocalIdx);
677 scvfs_[scvfLocalIdx] = SubControlVolumeFace(
678 corners,
679 geometryHelper.normal(corners, localScvIndices),
680 element,
681 scvfLocalIdx,
682 std::move(localScvIndices)
683 );
684 }
685
686 // construct the sub control volume faces on the domain boundary
687 LocalIndexType numBoundaryFaces = 0;
688 for (const auto& intersection : intersections(gridGeometry().gridView(), element))
689 {
690 if (intersection.boundary() && !intersection.neighbor())
691 {
692 const auto isGeometry = intersection.geometry();
693 hasBoundaryScvf_ = true;
694
695 // add one boundary face per boundary intersection
696 boundaryFaces_.push_back(BoundaryFace{
697 isGeometry.center(),
698 isGeometry.volume(),
699 intersection.centerUnitOuterNormal(),
700 numBoundaryFaces++,
701 static_cast<LocalIndexType>(intersection.indexInInside()),
702 typename BoundaryFace::Traits::BoundaryFlag{intersection}
703 });
704
705 // record the scvf subrange for this boundary face: {offset, count}
706 boundaryFaceScvfRanges_.push_back(std::array<LocalIndexType, 2>{{
707 scvfLocalIdx,
708 static_cast<LocalIndexType>(isGeometry.corners())
709 }});
710
711 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < isGeometry.corners(); ++isScvfLocalIdx)
712 {
713 // find the scv this scvf is connected to
714 const LocalIndexType insideScvIdx = static_cast<LocalIndexType>(refElement.subEntity(intersection.indexInInside(), 1, isScvfLocalIdx, dim));
715 std::array<LocalIndexType, 2> localScvIndices{{insideScvIdx, insideScvIdx}};
716
717 scvfs_.emplace_back(
718 geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), isScvfLocalIdx),
719 intersection.centerUnitOuterNormal(),
720 intersection,
721 isScvfLocalIdx,
722 scvfLocalIdx,
723 std::move(localScvIndices)
724 );
725
726 scvfBoundaryGeometryKeys_.emplace_back(std::array<LocalIndexType, 2>{{
727 static_cast<LocalIndexType>(intersection.indexInInside()),
728 static_cast<LocalIndexType>(isScvfLocalIdx)
729 }});
730
731 // increment local counter
732 scvfLocalIdx++;
733 }
734 }
735 }
736 }
737
739 GridIndexType eIdx_;
740 std::optional<Element> element_;
741 std::optional<typename Element::Geometry> elementGeometry_;
742
744 const GGCache* ggCache_;
745
747 std::vector<SubControlVolume> scvs_;
748 std::vector<SubControlVolumeFace> scvfs_;
749 std::vector<std::array<LocalIndexType, 2>> scvfBoundaryGeometryKeys_;
750 Dune::ReservedVector<BoundaryFace, 2*dim> boundaryFaces_;
751 Dune::ReservedVector<std::array<LocalIndexType, 2>, 2*dim> boundaryFaceScvfRanges_;
752
753 bool hasBoundaryScvf_ = false;
754};
755
756} // end namespace Dumux
757
758#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:518
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/box/fvelementgeometry.hh:473
GG GridGeometry
export type of finite volume grid geometry
Definition discretization/box/fvelementgeometry.hh:375
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Geometry of a sub control volume face.
Definition discretization/box/fvelementgeometry.hh:568
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition discretization/box/fvelementgeometry.hh:549
friend Dune::IteratorRange< typename std::vector< SubControlVolume >::const_iterator > scvs(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:410
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/box/fvelementgeometry.hh:467
GridIndexType elementIndex() const
The bound element's index in the grid view.
Definition discretization/box/fvelementgeometry.hh:530
void bindElement(const Element &element) &
Definition discretization/box/fvelementgeometry.hh:509
std::size_t intersectionIndex(const SubControlVolumeFace &scvf) const
The intersection index the scvf belongs to.
Definition discretization/box/fvelementgeometry.hh:534
const SubControlVolumeFace & scvf(LocalIndexType scvfIdx) const
Get a sub control volume face with a local scvf index.
Definition discretization/box/fvelementgeometry.hh:399
BoxFVElementGeometry(const GGCache &ggCache)
Constructor.
Definition discretization/box/fvelementgeometry.hh:389
typename GG::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition discretization/box/fvelementgeometry.hh:381
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Geometry of a sub control volume.
Definition discretization/box/fvelementgeometry.hh:561
const GridGeometry & gridGeometry() const
The grid geometry we are a restriction of.
Definition discretization/box/fvelementgeometry.hh:541
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry, const BoundaryFace &boundaryFace)
Definition discretization/box/fvelementgeometry.hh:431
typename GridView::template Codim< 0 >::Entity Element
export the element type
Definition discretization/box/fvelementgeometry.hh:369
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:422
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolume &scv)
Interpolation point data for an scv.
Definition discretization/box/fvelementgeometry.hh:595
BoundaryFace::Traits::Geometry geometry(const BoundaryFace &boundaryFace) const
Geometry of a boundary face.
Definition discretization/box/fvelementgeometry.hh:583
const FeLocalBasis & feLocalBasis() const
Get a local finite element basis.
Definition discretization/box/fvelementgeometry.hh:449
const Element & element() const
The bound element.
Definition discretization/box/fvelementgeometry.hh:522
const SubControlVolume & scv(LocalIndexType scvIdx) const
Get a sub control volume with a local scv index.
Definition discretization/box/fvelementgeometry.hh:393
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition discretization/box/fvelementgeometry.hh:615
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:483
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf)
Interpolation point data for scvf.
Definition discretization/box/fvelementgeometry.hh:625
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:445
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition discretization/box/fvelementgeometry.hh:605
typename GG::ScvQuadratureRule ScvQuadratureRule
the quadrature rule type for scvs
Definition discretization/box/fvelementgeometry.hh:379
std::size_t numLocalDofs() const
The total number of element-local dofs.
Definition discretization/box/fvelementgeometry.hh:461
typename GG::BoundaryFace BoundaryFace
export the boundary face type
Definition discretization/box/fvelementgeometry.hh:377
friend std::ranges::view auto boundaryFaces(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:441
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition discretization/box/fvelementgeometry.hh:373
const BoundaryFace & boundaryFace(LocalIndexType bfIdx) const
Get a boundary face with a local boundary face index.
Definition discretization/box/fvelementgeometry.hh:557
const auto & feLocalCoefficients() const
Get the local finite element coefficients.
Definition discretization/box/fvelementgeometry.hh:455
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:500
const Element::Geometry & elementGeometry() const
The bound element geometry.
Definition discretization/box/fvelementgeometry.hh:526
bool hasBoundaryFaces() const
Returns whether the element has boundary faces.
Definition discretization/box/fvelementgeometry.hh:553
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition discretization/box/fvelementgeometry.hh:371
void bind(const Element &element) &
Definition discretization/box/fvelementgeometry.hh:492
static constexpr std::size_t maxNumElementScvs
the maximum number of scvs per element (2^dim for cubes)
Definition discretization/box/fvelementgeometry.hh:383
const GridGeometry & gridDiscretization() const
The grid discretization we are a restriction of.
Definition discretization/box/fvelementgeometry.hh:545
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition discretization/box/fvelementgeometry.hh:225
const FeLocalBasis & feLocalBasis() const
Get a local finite element basis.
Definition discretization/box/fvelementgeometry.hh:156
BoundaryFace::Traits::Geometry geometry(const BoundaryFace &boundaryFace) const
Geometry of a boundary face.
Definition discretization/box/fvelementgeometry.hh:290
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:207
const Element & element() const
The bound element.
Definition discretization/box/fvelementgeometry.hh:229
const GridGeometry & gridDiscretization() const
The grid discretization we are a restriction of.
Definition discretization/box/fvelementgeometry.hh:252
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Geometry of a sub control volume.
Definition discretization/box/fvelementgeometry.hh:268
friend Dune::IteratorRange< typename std::vector< SubControlVolume >::const_iterator > scvs(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:111
bool hasBoundaryFaces() const
Returns whether the element has boundary faces.
Definition discretization/box/fvelementgeometry.hh:260
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/box/fvelementgeometry.hh:174
typename GG::BoundaryFace BoundaryFace
export the boundary face type
Definition discretization/box/fvelementgeometry.hh:78
const SubControlVolume & scv(LocalIndexType scvIdx) const
Get a sub control volume with a local scv index.
Definition discretization/box/fvelementgeometry.hh:94
std::size_t numLocalDofs() const
The total number of element-local dofs.
Definition discretization/box/fvelementgeometry.hh:168
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/box/fvelementgeometry.hh:180
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition discretization/box/fvelementgeometry.hh:72
const GridGeometry & gridGeometry() const
The grid geometry we are a restriction of.
Definition discretization/box/fvelementgeometry.hh:248
const auto & feLocalCoefficients() const
Get the local finite element coefficients.
Definition discretization/box/fvelementgeometry.hh:162
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry, const BoundaryFace &boundaryFace)
Definition discretization/box/fvelementgeometry.hh:134
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition discretization/box/fvelementgeometry.hh:256
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:124
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolume &scv)
Interpolation point data for an scv.
Definition discretization/box/fvelementgeometry.hh:302
typename GG::ScvQuadratureRule ScvQuadratureRule
export the scv interpolation point data type
Definition discretization/box/fvelementgeometry.hh:80
const Element::Geometry & elementGeometry() const
The bound element geometry.
Definition discretization/box/fvelementgeometry.hh:233
void bind(const Element &element) &
Definition discretization/box/fvelementgeometry.hh:199
typename GG::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition discretization/box/fvelementgeometry.hh:82
std::size_t intersectionIndex(const SubControlVolumeFace &scvf) const
The intersection index the scvf belongs to.
Definition discretization/box/fvelementgeometry.hh:241
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Geometry of a sub control volume face.
Definition discretization/box/fvelementgeometry.hh:275
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition discretization/box/fvelementgeometry.hh:322
GridIndexType elementIndex() const
The bound element's index in the grid view.
Definition discretization/box/fvelementgeometry.hh:237
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf)
Interpolation point data for scvf.
Definition discretization/box/fvelementgeometry.hh:333
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:152
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition discretization/box/fvelementgeometry.hh:312
friend std::ranges::view auto boundaryFaces(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:145
const BoundaryFace & boundaryFace(LocalIndexType bfIdx) const
Get a boundary face with a local boundary face index.
Definition discretization/box/fvelementgeometry.hh:264
static constexpr std::size_t maxNumElementScvs
the maximum number of scvs per element (2^dim for cubes)
Definition discretization/box/fvelementgeometry.hh:84
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition discretization/box/fvelementgeometry.hh:74
void bindElement(const Element &element) &
Definition discretization/box/fvelementgeometry.hh:216
const SubControlVolumeFace & scvf(LocalIndexType scvfIdx) const
Get a sub control volume face with a local scvf index.
Definition discretization/box/fvelementgeometry.hh:100
BoxFVElementGeometry(const GGCache &ggCache)
Constructor.
Definition discretization/box/fvelementgeometry.hh:90
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:190
typename GridView::template Codim< 0 >::Entity Element
export the element type
Definition discretization/box/fvelementgeometry.hh:70
GG GridGeometry
export type of finite volume grid geometry
Definition discretization/box/fvelementgeometry.hh:76
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
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
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