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
252 bool hasBoundaryScvf() const
253 { return ggCache_->hasBoundaryScvf(eIdx_); }
254
256 bool hasBoundaryFaces() const
257 { return hasBoundaryScvf(); }
258
260 const BoundaryFace& boundaryFace(LocalIndexType bfIdx) const
261 { return ggCache_->boundaryFaces(eIdx_)[bfIdx]; }
262
264 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
265 {
266 assert(isBound());
267 return { Dune::GeometryTypes::cube(dim), GeometryHelper(*elementGeometry_).getScvCorners(scv.indexInElement()) };
268 }
269
271 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
272 {
273 assert(isBound());
274 const GeometryHelper geometryHelper(*elementGeometry_);
275 if (scvf.boundary())
276 {
277 const auto localBoundaryIndex = scvf.index() - geometryHelper.numInteriorScvf();
278 const auto& key = ggCache_->scvfBoundaryGeometryKeys(eIdx_)[localBoundaryIndex];
279 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getBoundaryScvfCorners(key[0], key[1]) };
280 }
281 else
282 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getScvfCorners(scvf.index()) };
283 }
284
286 typename BoundaryFace::Traits::Geometry geometry(const BoundaryFace& boundaryFace) const
287 {
288 assert(isBound());
289 const auto& elemGeo = elementGeometry();
290 const auto faceGeoInRef = referenceElement(elemGeo).template geometry<1>(boundaryFace.intersectionIndex());
291 typename BoundaryFace::Traits::CornerStorage corners;
292 for (int i = 0; i < faceGeoInRef.corners(); ++i)
293 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
294 return { faceGeoInRef.type(), corners };
295 }
296
298 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolume& scv)
299 {
300 const auto type = fvGeometry.element().type();
301 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(scv.localDofIndex());
302
303 return CVFE::LocalDofInterpolationPointData{ DofHelper::localDofPosition(type, localKey), scv.dofPosition(), scv.localDofIndex() };
304 }
305
307 template<class LocalDof>
308 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const LocalDof& localDof)
309 {
310 const auto type = fvGeometry.element().type();
311 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(localDof.index());
312 const auto& localPos = DofHelper::localDofPosition(type, localKey);
313
314 return CVFE::LocalDofInterpolationPointData{ localPos, fvGeometry.elementGeometry().global(localPos), localDof.index() };
315 }
316
318 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const typename Element::Geometry::GlobalCoordinate& globalPos)
319 {
320 // Create ipData that does not automatically calculate the local position but only if it is called
322 [&] (const typename Element::Geometry::GlobalCoordinate& pos)
323 { return fvGeometry.elementGeometry().local(pos); },
324 globalPos
325 };
326 }
327
329 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
330 {
332 { scvf.unitOuterNormal(), scvf.index(), fvGeometry.elementGeometry().local(scvf.ipGlobal()), scvf.ipGlobal() };
333 }
334
335private:
336 const GGCache* ggCache_;
337 GridIndexType eIdx_;
338
339 std::optional<Element> element_;
340 std::optional<typename Element::Geometry> elementGeometry_;
341};
342
344template<class GG>
345class BoxFVElementGeometry<GG, false>
346{
347 using GridView = typename GG::GridView;
348 static constexpr int dim = GridView::dimension;
349 static constexpr int dimWorld = GridView::dimensionworld;
350 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
351 using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
352 using CoordScalar = typename GridView::ctype;
353 using FeLocalBasis = typename GG::FeCache::FiniteElementType::Traits::LocalBasisType;
354 using GGCache = typename GG::Cache;
355 using GeometryHelper = typename GGCache::GeometryHelper;
356 using DofHelper = typename GGCache::DofHelper;
357
358 using BaseIpData = CVFE::InterpolationPointData<
359 typename GridView::template Codim<0>::Entity::Geometry::LocalCoordinate,
360 typename GridView::template Codim<0>::Entity::Geometry::GlobalCoordinate
361 >;
362
363public:
365 using Element = typename GridView::template Codim<0>::Entity;
367 using SubControlVolume = typename GG::SubControlVolume;
369 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
371 using GridGeometry = GG;
373 using BoundaryFace = typename GG::BoundaryFace;
375 using ScvQuadratureRule = typename GG::ScvQuadratureRule;
377 using ScvfQuadratureRule = typename GG::ScvfQuadratureRule;
379 static constexpr std::size_t maxNumElementScvs = (1<<dim);
380
385 BoxFVElementGeometry(const GGCache& ggCache)
386 : ggCache_(&ggCache) {}
387
389 const SubControlVolume& scv(LocalIndexType scvIdx) const
390 {
391 return scvs_[scvIdx];
392 }
393
395 const SubControlVolumeFace& scvf(LocalIndexType scvfIdx) const
396 {
397 return scvfs_[scvfIdx];
398 }
399
405 friend inline Dune::IteratorRange<typename std::vector<SubControlVolume>::const_iterator>
406 scvs(const BoxFVElementGeometry& fvGeometry)
407 {
408 using Iter = typename std::vector<SubControlVolume>::const_iterator;
409 return Dune::IteratorRange<Iter>(fvGeometry.scvs_.begin(), fvGeometry.scvs_.end());
410 }
411
417 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
418 scvfs(const BoxFVElementGeometry& fvGeometry)
419 {
420 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
421 return Dune::IteratorRange<Iter>(fvGeometry.scvfs_.begin(), fvGeometry.scvfs_.end());
422 }
423
426 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
428 {
429 using Iter = typename std::vector<SubControlVolumeFace>::const_iterator;
430 const auto& range = fvGeometry.boundaryFaceScvfRanges_[boundaryFace.index()];
431 return Dune::IteratorRange<Iter>(fvGeometry.scvfs_.begin() + range[0], fvGeometry.scvfs_.begin() + range[0] + range[1]);
432 }
433
436 friend inline std::ranges::view auto
438 { return std::ranges::views::all(fvGeometry.boundaryFaces_); }
439
441 friend inline auto localDofs(const BoxFVElementGeometry& fvGeometry, const BoundaryFace& boundaryFace)
442 { return DofHelper::localDofsOnBoundaryFace(fvGeometry, boundaryFace); }
443
445 const FeLocalBasis& feLocalBasis() const
446 {
447 return gridGeometry().feCache().get(element_->type()).localBasis();
448 }
449
451 const auto& feLocalCoefficients() const
452 {
453 return gridGeometry().feCache().get(element_->type()).localCoefficients();
454 }
455
457 std::size_t numLocalDofs() const
458 {
459 return numScv();
460 }
461
463 std::size_t numScv() const
464 {
465 return scvs_.size();
466 }
467
469 std::size_t numScvf() const
470 {
471 return scvfs_.size();
472 }
473
480 {
481 this->bindElement(element);
482 return std::move(*this);
483 }
484
488 void bind(const Element& element) &
489 { this->bindElement(element); }
490
497 {
498 this->bindElement(element);
499 return std::move(*this);
500 }
501
506 {
507 element_ = element;
508 eIdx_ = gridGeometry().elementMapper().index(element);
509 elementGeometry_.emplace(element.geometry());
510 makeElementGeometries_();
511 }
512
514 bool isBound() const
515 { return static_cast<bool>(element_); }
516
518 const Element& element() const
519 { return *element_; }
520
522 const typename Element::Geometry& elementGeometry() const
523 { return *elementGeometry_; }
524
526 GridIndexType elementIndex() const
527 { return eIdx_; }
528
531 {
532 const auto localScvfIdx = scvf.index() - GeometryHelper::numInteriorScvf(element().type());
533 return scvfBoundaryGeometryKeys_[localScvfIdx][0];
534 }
535
538 { return ggCache_->gridGeometry(); }
539
542 { return ggCache_->gridGeometry(); }
543
545 bool hasBoundaryScvf() const
546 { return hasBoundaryScvf_; }
547
549 bool hasBoundaryFaces() const
550 { return hasBoundaryScvf(); }
551
553 const BoundaryFace& boundaryFace(LocalIndexType bfIdx) const
554 { return boundaryFaces_[bfIdx]; }
555
557 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
558 {
559 assert(isBound());
560 return { Dune::GeometryTypes::cube(dim), GeometryHelper(*elementGeometry_).getScvCorners(scv.indexInElement()) };
561 }
562
564 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
565 {
566 assert(isBound());
567 const GeometryHelper geometryHelper(*elementGeometry_);
568 if (scvf.boundary())
569 {
570 const auto localBoundaryIndex = scvf.index() - geometryHelper.numInteriorScvf();
571 const auto& key = scvfBoundaryGeometryKeys_[localBoundaryIndex];
572 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getBoundaryScvfCorners(key[0], key[1]) };
573 }
574 else
575 return { Dune::GeometryTypes::cube(dim-1), geometryHelper.getScvfCorners(scvf.index()) };
576 }
577
579 typename BoundaryFace::Traits::Geometry geometry(const BoundaryFace& boundaryFace) const
580 {
581 assert(isBound());
582 const auto& elemGeo = elementGeometry();
583 const auto faceGeoInRef = referenceElement(elemGeo).template geometry<1>(boundaryFace.intersectionIndex());
584 typename BoundaryFace::Traits::CornerStorage corners;
585 for (int i = 0; i < faceGeoInRef.corners(); ++i)
586 corners.push_back(elemGeo.global(faceGeoInRef.corner(i)));
587 return { faceGeoInRef.type(), corners };
588 }
589
591 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolume& scv)
592 {
593 const auto type = fvGeometry.element().type();
594 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(scv.localDofIndex());
595
596 return CVFE::LocalDofInterpolationPointData{ DofHelper::localDofPosition(type, localKey), scv.dofPosition(), scv.localDofIndex() };
597 }
598
600 template<class LocalDof>
601 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const LocalDof& localDof)
602 {
603 const auto type = fvGeometry.element().type();
604 const auto& localKey = fvGeometry.gridGeometry().feCache().get(type).localCoefficients().localKey(localDof.index());
605 const auto& localPos = DofHelper::localDofPosition(type, localKey);
606
607 return CVFE::LocalDofInterpolationPointData{ localPos, fvGeometry.elementGeometry().global(localPos), localDof.index() };
608 }
609
611 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const typename Element::Geometry::GlobalCoordinate& globalPos)
612 {
613 // Create ipData that does not automatically calculate the local position but only if it is called
615 [&] (const typename Element::Geometry::GlobalCoordinate& pos) { return fvGeometry.elementGeometry().local(pos); },
616 globalPos
617 };
618 }
619
621 friend inline auto ipData(const BoxFVElementGeometry& fvGeometry, const SubControlVolumeFace& scvf)
622 {
624 { scvf.unitOuterNormal(), scvf.index(), fvGeometry.elementGeometry().local(scvf.ipGlobal()), scvf.ipGlobal() };
625 }
626
627private:
628 void makeElementGeometries_()
629 {
630 hasBoundaryScvf_ = false;
631 boundaryFaces_.clear();
632 boundaryFaceScvfRanges_.clear();
633
634 // get the element geometry
635 const auto& element = *element_;
636 const auto& elementGeometry = *elementGeometry_;
637 const auto refElement = referenceElement(elementGeometry);
638
639 // get the sub control volume geometries of this element
640 GeometryHelper geometryHelper(elementGeometry);
641
642 // construct the sub control volumes
643 scvs_.resize(elementGeometry.corners());
644 for (LocalIndexType scvLocalIdx = 0; scvLocalIdx < elementGeometry.corners(); ++scvLocalIdx)
645 {
646 // get associated dof index
647 const auto dofIdxGlobal = gridGeometry().vertexMapper().subIndex(element, scvLocalIdx, dim);
648
649 // add scv to the local container
650 scvs_[scvLocalIdx] = SubControlVolume(
651 geometryHelper.getScvCorners(scvLocalIdx),
652 scvLocalIdx,
653 eIdx_,
654 dofIdxGlobal
655 );
656 }
657
658 // construct the sub control volume faces
659 const auto numInnerScvf = geometryHelper.numInteriorScvf();
660 scvfs_.resize(numInnerScvf);
661 scvfBoundaryGeometryKeys_.clear();
662
663 LocalIndexType scvfLocalIdx = 0;
664 for (; scvfLocalIdx < numInnerScvf; ++scvfLocalIdx)
665 {
666 // find the local scv indices this scvf is connected to
667 std::array<LocalIndexType, 2> localScvIndices{{
668 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 0, dim)),
669 static_cast<LocalIndexType>(refElement.subEntity(scvfLocalIdx, dim-1, 1, dim))
670 }};
671
672 const auto& corners = geometryHelper.getScvfCorners(scvfLocalIdx);
673 scvfs_[scvfLocalIdx] = SubControlVolumeFace(
674 corners,
675 geometryHelper.normal(corners, localScvIndices),
676 element,
677 scvfLocalIdx,
678 std::move(localScvIndices)
679 );
680 }
681
682 // construct the sub control volume faces on the domain boundary
683 LocalIndexType numBoundaryFaces = 0;
684 for (const auto& intersection : intersections(gridGeometry().gridView(), element))
685 {
686 if (intersection.boundary() && !intersection.neighbor())
687 {
688 const auto isGeometry = intersection.geometry();
689 hasBoundaryScvf_ = true;
690
691 // add one boundary face per boundary intersection
692 boundaryFaces_.push_back(BoundaryFace{
693 isGeometry.center(),
694 isGeometry.volume(),
695 intersection.centerUnitOuterNormal(),
696 numBoundaryFaces++,
697 static_cast<LocalIndexType>(intersection.indexInInside()),
698 typename BoundaryFace::Traits::BoundaryFlag{intersection}
699 });
700
701 // record the scvf subrange for this boundary face: {offset, count}
702 boundaryFaceScvfRanges_.push_back(std::array<LocalIndexType, 2>{{
703 scvfLocalIdx,
704 static_cast<LocalIndexType>(isGeometry.corners())
705 }});
706
707 for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < isGeometry.corners(); ++isScvfLocalIdx)
708 {
709 // find the scv this scvf is connected to
710 const LocalIndexType insideScvIdx = static_cast<LocalIndexType>(refElement.subEntity(intersection.indexInInside(), 1, isScvfLocalIdx, dim));
711 std::array<LocalIndexType, 2> localScvIndices{{insideScvIdx, insideScvIdx}};
712
713 scvfs_.emplace_back(
714 geometryHelper.getBoundaryScvfCorners(intersection.indexInInside(), isScvfLocalIdx),
715 intersection.centerUnitOuterNormal(),
716 intersection,
717 isScvfLocalIdx,
718 scvfLocalIdx,
719 std::move(localScvIndices)
720 );
721
722 scvfBoundaryGeometryKeys_.emplace_back(std::array<LocalIndexType, 2>{{
723 static_cast<LocalIndexType>(intersection.indexInInside()),
724 static_cast<LocalIndexType>(isScvfLocalIdx)
725 }});
726
727 // increment local counter
728 scvfLocalIdx++;
729 }
730 }
731 }
732 }
733
735 GridIndexType eIdx_;
736 std::optional<Element> element_;
737 std::optional<typename Element::Geometry> elementGeometry_;
738
740 const GGCache* ggCache_;
741
743 std::vector<SubControlVolume> scvs_;
744 std::vector<SubControlVolumeFace> scvfs_;
745 std::vector<std::array<LocalIndexType, 2>> scvfBoundaryGeometryKeys_;
746 Dune::ReservedVector<BoundaryFace, 2*dim> boundaryFaces_;
747 Dune::ReservedVector<std::array<LocalIndexType, 2>, 2*dim> boundaryFaceScvfRanges_;
748
749 bool hasBoundaryScvf_ = false;
750};
751
752} // end namespace Dumux
753
754#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:514
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/box/fvelementgeometry.hh:469
GG GridGeometry
export type of finite volume grid geometry
Definition discretization/box/fvelementgeometry.hh:371
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Geometry of a sub control volume face.
Definition discretization/box/fvelementgeometry.hh:564
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition discretization/box/fvelementgeometry.hh:545
friend Dune::IteratorRange< typename std::vector< SubControlVolume >::const_iterator > scvs(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:406
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/box/fvelementgeometry.hh:463
GridIndexType elementIndex() const
The bound element's index in the grid view.
Definition discretization/box/fvelementgeometry.hh:526
void bindElement(const Element &element) &
Definition discretization/box/fvelementgeometry.hh:505
std::size_t intersectionIndex(const SubControlVolumeFace &scvf) const
The intersection index the scvf belongs to.
Definition discretization/box/fvelementgeometry.hh:530
const SubControlVolumeFace & scvf(LocalIndexType scvfIdx) const
Get a sub control volume face with a local scvf index.
Definition discretization/box/fvelementgeometry.hh:395
BoxFVElementGeometry(const GGCache &ggCache)
Constructor.
Definition discretization/box/fvelementgeometry.hh:385
typename GG::ScvfQuadratureRule ScvfQuadratureRule
the quadrature rule type for scvfs
Definition discretization/box/fvelementgeometry.hh:377
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Geometry of a sub control volume.
Definition discretization/box/fvelementgeometry.hh:557
const GridGeometry & gridGeometry() const
The grid geometry we are a restriction of.
Definition discretization/box/fvelementgeometry.hh:537
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry, const BoundaryFace &boundaryFace)
Definition discretization/box/fvelementgeometry.hh:427
typename GridView::template Codim< 0 >::Entity Element
export the element type
Definition discretization/box/fvelementgeometry.hh:365
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:418
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolume &scv)
Interpolation point data for an scv.
Definition discretization/box/fvelementgeometry.hh:591
BoundaryFace::Traits::Geometry geometry(const BoundaryFace &boundaryFace) const
Geometry of a boundary face.
Definition discretization/box/fvelementgeometry.hh:579
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:518
const SubControlVolume & scv(LocalIndexType scvIdx) const
Get a sub control volume with a local scv index.
Definition discretization/box/fvelementgeometry.hh:389
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition discretization/box/fvelementgeometry.hh:611
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:479
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const SubControlVolumeFace &scvf)
Interpolation point data for scvf.
Definition discretization/box/fvelementgeometry.hh:621
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:441
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition discretization/box/fvelementgeometry.hh:601
typename GG::ScvQuadratureRule ScvQuadratureRule
the quadrature rule type for scvs
Definition discretization/box/fvelementgeometry.hh:375
std::size_t numLocalDofs() const
The total number of element-local dofs.
Definition discretization/box/fvelementgeometry.hh:457
typename GG::BoundaryFace BoundaryFace
export the boundary face type
Definition discretization/box/fvelementgeometry.hh:373
friend std::ranges::view auto boundaryFaces(const BoxFVElementGeometry &fvGeometry)
Definition discretization/box/fvelementgeometry.hh:437
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition discretization/box/fvelementgeometry.hh:369
const BoundaryFace & boundaryFace(LocalIndexType bfIdx) const
Get a boundary face with a local boundary face index.
Definition discretization/box/fvelementgeometry.hh:553
const auto & feLocalCoefficients() const
Get the local finite element coefficients.
Definition discretization/box/fvelementgeometry.hh:451
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:496
const Element::Geometry & elementGeometry() const
The bound element geometry.
Definition discretization/box/fvelementgeometry.hh:522
bool hasBoundaryFaces() const
Returns whether the element has boundary faces.
Definition discretization/box/fvelementgeometry.hh:549
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition discretization/box/fvelementgeometry.hh:367
void bind(const Element &element) &
Definition discretization/box/fvelementgeometry.hh:488
static constexpr std::size_t maxNumElementScvs
the maximum number of scvs per element (2^dim for cubes)
Definition discretization/box/fvelementgeometry.hh:379
const GridGeometry & gridDiscretization() const
The grid discretization we are a restriction of.
Definition discretization/box/fvelementgeometry.hh:541
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:286
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
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Geometry of a sub control volume.
Definition discretization/box/fvelementgeometry.hh:264
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:256
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:252
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:298
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:271
friend auto ipData(const BoxFVElementGeometry &fvGeometry, const typename Element::Geometry::GlobalCoordinate &globalPos)
Interpolation point data for a global position.
Definition discretization/box/fvelementgeometry.hh:318
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:329
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:308
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:260
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