version 3.11-dev
discretization/cellcentered/tpfa/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_CCTPFA_FV_ELEMENT_GEOMETRY_HH
15#define DUMUX_DISCRETIZATION_CCTPFA_FV_ELEMENT_GEOMETRY_HH
16
17#include <optional>
18#include <algorithm>
19#include <array>
20#include <vector>
21#include <utility>
22
23#include <dune/common/exceptions.hh>
25#include <dune/common/iteratorrange.hh>
26#include <dune/geometry/referenceelements.hh>
29
30namespace Dumux {
31
32namespace Detail::Tpfa {
33
34template<class GridIndexType>
35auto findLocalIndex(const GridIndexType idx,
36 const std::vector<GridIndexType>& indices)
37{
38 auto it = std::find(indices.begin(), indices.end(), idx);
39 assert(it != indices.end() && "Could not find the scv/scvf! Make sure to properly bind this class!");
40 return std::distance(indices.begin(), it);
41}
42
43} // end namespace Detail::Tpfa
44
54template<class GG, bool enableGridGeometryCache>
56
63template<class GG>
65{
67 using GridView = typename GG::GridView;
68 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
69 using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
70
71public:
73 using Element = typename GridView::template Codim<0>::Entity;
75 using SubControlVolume = typename GG::SubControlVolume;
77 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
79 using GridGeometry = GG;
80
82 static constexpr std::size_t maxNumElementScvs = 1;
84 static constexpr std::size_t maxNumElementScvfs = 2*GridView::dimension;
85
88 : gridGeometryPtr_(&gridGeometry) {}
89
92 const SubControlVolume& scv(GridIndexType scvIdx) const
93 {
94 return gridGeometry().scv(scvIdx);
95 }
96
99 const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const
100 {
101 return gridGeometry().scvf(scvfIdx);
102 }
103
106 const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx = 0) const
107 {
108 return gridGeometry().flipScvf(scvfIdx, outsideScvIdx);
109 }
110
116 friend inline Dune::IteratorRange< ScvIterator<SubControlVolume, std::array<GridIndexType, 1>, ThisType> >
117 scvs(const CCTpfaFVElementGeometry& fvGeometry)
118 {
120 return Dune::IteratorRange<ScvIterator>(ScvIterator(fvGeometry.scvIndices_.begin(), fvGeometry),
121 ScvIterator(fvGeometry.scvIndices_.end(), fvGeometry));
122 }
123
125 template<class LocalDof>
126 friend inline auto ipData(const CCTpfaFVElementGeometry& fvGeometry, const LocalDof& localDof)
127 {
128 using Geometry = typename Element::Geometry;
129 using Scalar = typename Geometry::ctype;
130 static constexpr int dim = Geometry::mydimension;
131 const auto& scv = fvGeometry.scv(fvGeometry.scvIndices_[localDof.index()]);
132 const auto& globalPos = scv.dofPosition();
133 const auto localPos = Dune::referenceElement<Scalar, dim>(fvGeometry.element().type()).position(0, 0);
134 return CVFE::LocalDofInterpolationPointData{ localPos, globalPos, localDof.index() };
135 }
136
142 friend inline Dune::IteratorRange< ScvfIterator<SubControlVolumeFace, std::vector<GridIndexType>, ThisType> >
144 {
145 const auto& g = fvGeometry.gridGeometry();
146 const auto scvIdx = fvGeometry.scvIndices_[0];
148 return Dune::IteratorRange<ScvfIterator>(ScvfIterator(g.scvfIndicesOfScv(scvIdx).begin(), fvGeometry),
149 ScvfIterator(g.scvfIndicesOfScv(scvIdx).end(), fvGeometry));
150 }
151
153 std::size_t numScv() const
154 {
155 return scvIndices_.size();
156 }
157
159 std::size_t numScvf() const
160 {
161 return gridGeometry().scvfIndicesOfScv(scvIndices_[0]).size();
162 }
163
170 {
171 this->bindElement(element);
172 return std::move(*this);
173 }
174
175 void bind(const Element& element) &
176 {
177 this->bindElement(element);
178 }
179
186 {
187 this->bindElement(element);
188 return std::move(*this);
189 }
190
192 void bindElement(const Element& element) &
193 {
194 element_ = element;
195 scvIndices_[0] = gridGeometry().elementMapper().index(*element_);
196 }
197
199 bool isBound() const
200 { return static_cast<bool>(element_); }
201
203 const Element& element() const
204 { return *element_; }
205
208 { return *gridGeometryPtr_; }
209
211 bool hasBoundaryScvf() const
212 { return gridGeometry().hasBoundaryScvf(scvIndices_[0]); }
213
214 typename Element::Geometry geometry(const SubControlVolume& scv) const
215 { return gridGeometryPtr_->element(scv.dofIndex()).geometry(); }
216
217 typename GridView::Intersection::Geometry geometry(const SubControlVolumeFace& scvf) const
218 {
219 const auto element = gridGeometryPtr_->element(scvf.insideScvIdx());
220 const auto& scvfIndices = gridGeometryPtr_->scvfIndicesOfScv(scvf.insideScvIdx());
221 const LocalIndexType localScvfIdx = Detail::Tpfa::findLocalIndex(scvf.index(), scvfIndices);
222 LocalIndexType localIdx = 0;
223 for (const auto& intersection : intersections(gridGeometryPtr_->gridView(), element))
224 {
225 if (intersection.neighbor() || intersection.boundary())
226 {
227 if (localIdx == localScvfIdx)
228 return intersection.geometry();
229 else
230 ++localIdx;
231 }
232 }
233
234 DUNE_THROW(Dune::InvalidStateException, "Could not find scvf geometry");
235 }
236
237private:
238
239 std::optional<Element> element_;
240 std::array<GridIndexType, 1> scvIndices_;
241 const GridGeometry* gridGeometryPtr_;
242};
243
249template<class GG>
251{
253 using GridView = typename GG::GridView;
254 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
255 using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
256
257 static const int dim = GridView::dimension;
258 static const int dimWorld = GridView::dimensionworld;
259
260public:
262 using Element = typename GridView::template Codim<0>::Entity;
264 using SubControlVolume = typename GG::SubControlVolume;
266 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
268 using GridGeometry = GG;
270 static constexpr std::size_t maxNumElementScvs = 1;
272 static constexpr std::size_t maxNumElementScvfs = 2*dim;
273
276 : gridGeometryPtr_(&gridGeometry) {}
277
280 const SubControlVolume& scv(GridIndexType scvIdx) const
281 {
282 if (scvIdx == scvIndices_[0])
283 return scvs_[0];
284 else
285 return neighborScvs_[Detail::Tpfa::findLocalIndex(scvIdx, neighborScvIndices_)];
286 }
287
290 const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const
291 {
292 auto it = std::find(scvfIndices_.begin(), scvfIndices_.end(), scvfIdx);
293 if (it != scvfIndices_.end())
294 return scvfs_[std::distance(scvfIndices_.begin(), it)];
295 else
296 return neighborScvfs_[Detail::Tpfa::findLocalIndex(scvfIdx, neighborScvfIndices_)];
297 }
298
301 const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx = 0) const
302 {
303 auto it = std::find(scvfIndices_.begin(), scvfIndices_.end(), scvfIdx);
304 if (it != scvfIndices_.end())
305 {
306 const auto localScvfIdx = std::distance(scvfIndices_.begin(), it);
307 return neighborScvfs_[flippedScvfIndices_[localScvfIdx][outsideScvIdx]];
308 }
309 else
310 {
311 const auto localScvfIdx = Detail::Tpfa::findLocalIndex(scvfIdx, neighborScvfIndices_);
312 const auto localFlippedIndex = flippedNeighborScvfIndices_[localScvfIdx][outsideScvIdx];
313 if (localFlippedIndex < scvfs_.size())
314 return scvfs_[localFlippedIndex];
315 else
316 return neighborScvfs_[localFlippedIndex - scvfs_.size()];
317 }
318 }
319
325 friend inline Dune::IteratorRange<typename std::array<SubControlVolume, 1>::const_iterator>
326 scvs(const ThisType& g)
327 {
328 using IteratorType = typename std::array<SubControlVolume, 1>::const_iterator;
329 return Dune::IteratorRange<IteratorType>(g.scvs_.begin(), g.scvs_.end());
330 }
331
333 template<class LocalDof>
334 friend inline auto ipData(const ThisType& fvGeometry, const LocalDof& localDof)
335 {
336 using Geometry = typename Element::Geometry;
337 using Scalar = typename Geometry::ctype;
338 static constexpr int dim = Geometry::mydimension;
339 const auto& globalPos = fvGeometry.scvs_[localDof.index()].dofPosition();
340 const auto localPos = Dune::referenceElement<Scalar, dim>(fvGeometry.element().type()).position(0, 0);
341 return CVFE::LocalDofInterpolationPointData{ localPos, globalPos, localDof.index() };
342 }
343
349 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
350 scvfs(const ThisType& g)
351 {
352 using IteratorType = typename std::vector<SubControlVolumeFace>::const_iterator;
353 return Dune::IteratorRange<IteratorType>(g.scvfs_.begin(), g.scvfs_.end());
354 }
355
357 std::size_t numScv() const
358 { return scvs_.size(); }
359
361 std::size_t numScvf() const
362 { return scvfs_.size(); }
363
370 {
371 this->bind_(element);
372 return std::move(*this);
373 }
374
375 void bind(const Element& element) &
376 {
377 this->bind_(element);
378 }
379
386 {
387 this->bindElement_(element);
388 return std::move(*this);
389 }
390
391 void bindElement(const Element& element) &
392 {
393 this->bindElement_(element);
394 }
395
397 bool isBound() const
398 { return static_cast<bool>(element_); }
399
401 const Element& element() const
402 { return *element_; }
403
406 { return *gridGeometryPtr_; }
407
409 bool hasBoundaryScvf() const
410 { return hasBoundaryScvf_; }
411
412 typename Element::Geometry geometry(const SubControlVolume& scv) const
413 { return gridGeometryPtr_->element(scv.dofIndex()).geometry(); }
414
415 typename GridView::Intersection::Geometry geometry(const SubControlVolumeFace& scvf) const
416 {
417 const auto element = gridGeometryPtr_->element(scvf.insideScvIdx());
418 const auto& scvfIndices = gridGeometryPtr_->scvfIndicesOfScv(scvf.insideScvIdx());
419 const LocalIndexType localScvfIdx = Detail::Tpfa::findLocalIndex(scvf.index(), scvfIndices);
420 LocalIndexType localIdx = 0;
421 for (const auto& intersection : intersections(gridGeometryPtr_->gridView(), element))
422 {
423 if (intersection.neighbor() || intersection.boundary())
424 {
425 if (localIdx == localScvfIdx)
426 return intersection.geometry();
427 else
428 ++localIdx;
429 }
430 }
431
432 DUNE_THROW(Dune::InvalidStateException, "Could not find scvf geometry");
433 }
434
435private:
438 void bind_(const Element& element)
439 {
440 bindElement_(element);
441
442 neighborScvs_.reserve(element.subEntities(1));
443 neighborScvfIndices_.reserve(element.subEntities(1));
444 neighborScvfs_.reserve(element.subEntities(1));
445
446 std::vector<GridIndexType> handledNeighbors;
447 handledNeighbors.reserve(element.subEntities(1));
448
449 for (const auto& intersection : intersections(gridGeometry().gridView(), element))
450 {
451 // for inner intersections and periodic (according to grid interface) intersections make neighbor geometry
452 if (intersection.neighbor())
453 {
454 const auto outside = intersection.outside();
455 const auto outsideIdx = gridGeometry().elementMapper().index(outside);
456
457 // make outside geometries only if not done yet (could happen on non-conforming grids)
458 if ( std::find(handledNeighbors.begin(), handledNeighbors.end(), outsideIdx) == handledNeighbors.end() )
459 {
460 makeNeighborGeometries(outside, outsideIdx);
461 handledNeighbors.push_back(outsideIdx);
462 }
463 }
464 }
465
466 // build flip index set for network, surface, and periodic grids
467 if (dim < dimWorld || gridGeometry().isPeriodic())
468 {
469 flippedScvfIndices_.resize(scvfs_.size());
470 for (unsigned int localScvfIdx = 0; localScvfIdx < scvfs_.size(); ++localScvfIdx)
471 {
472 const auto& scvf = scvfs_[localScvfIdx];
473 if (scvf.boundary())
474 continue;
475
476 flippedScvfIndices_[localScvfIdx].resize(scvf.numOutsideScvs());
477 for (unsigned int localOutsideScvIdx = 0; localOutsideScvIdx < scvf.numOutsideScvs(); ++localOutsideScvIdx)
478 {
479 const auto globalOutsideScvIdx = scvf.outsideScvIdx(localOutsideScvIdx);
480 for (unsigned int localNeighborScvfIdx = 0; localNeighborScvfIdx < neighborScvfs_.size(); ++localNeighborScvfIdx)
481 {
482 if (neighborScvfs_[localNeighborScvfIdx].insideScvIdx() == globalOutsideScvIdx)
483 {
484 flippedScvfIndices_[localScvfIdx][localOutsideScvIdx] = localNeighborScvfIdx;
485 break;
486 }
487 }
488 }
489 }
490
491 flippedNeighborScvfIndices_.resize(neighborScvfs_.size());
492 for (unsigned int localScvfIdx = 0; localScvfIdx < neighborScvfs_.size(); ++localScvfIdx)
493 {
494 const auto& neighborScvf = neighborScvfs_[localScvfIdx];
495 flippedNeighborScvfIndices_[localScvfIdx].resize(neighborScvf.numOutsideScvs());
496 for (unsigned int localOutsideScvIdx = 0; localOutsideScvIdx < neighborScvf.numOutsideScvs(); ++localOutsideScvIdx)
497 {
498 flippedNeighborScvfIndices_[localScvfIdx][localOutsideScvIdx] = findFlippedScvfIndex_(neighborScvf.insideScvIdx(), neighborScvf.outsideScvIdx(localOutsideScvIdx));
499 }
500 }
501 }
502 }
503
505 void bindElement_(const Element& element)
506 {
507 clear();
508 element_ = element;
509 scvfs_.reserve(element.subEntities(1));
510 scvfIndices_.reserve(element.subEntities(1));
511 makeElementGeometries(element);
512 }
513
514 GridIndexType findFlippedScvfIndex_(GridIndexType insideScvIdx, GridIndexType globalOutsideScvIdx)
515 {
516 for (unsigned int localNeighborScvfIdx = 0; localNeighborScvfIdx < neighborScvfs_.size(); ++localNeighborScvfIdx)
517 {
518 if (neighborScvfs_[localNeighborScvfIdx].insideScvIdx() == globalOutsideScvIdx)
519 {
520 return scvfs_.size() + localNeighborScvfIdx;
521 }
522 }
523
524 // go over all potential scvfs of the outside scv
525 for (unsigned int localOutsideScvfIdx = 0; localOutsideScvfIdx < scvfs_.size(); ++localOutsideScvfIdx)
526 {
527 const auto& outsideScvf = scvfs_[localOutsideScvfIdx];
528 for (unsigned int j = 0; j < outsideScvf.numOutsideScvs(); ++j)
529 {
530 if (outsideScvf.outsideScvIdx(j) == insideScvIdx)
531 {
532 return localOutsideScvfIdx;
533 }
534 }
535 }
536
537 DUNE_THROW(Dune::InvalidStateException, "No flipped version of this scvf found!");
538 }
539
541 void makeElementGeometries(const Element& element)
542 {
543 using ScvfGridIndexStorage = typename SubControlVolumeFace::Traits::GridIndexStorage;
544
545 const auto eIdx = gridGeometry().elementMapper().index(element);
546 scvs_[0] = SubControlVolume(element.geometry(), eIdx);
547 scvIndices_[0] = eIdx;
548
549 const auto& scvFaceIndices = gridGeometry().scvfIndicesOfScv(eIdx);
550 const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdx);
551
552 // for network grids there might be multiple intersection with the same geometryInInside
553 // we identify those by the indexInInside for now (assumes conforming grids at branching facets)
554 // here we keep track of them
555 std::vector<bool> handledScvf;
556 if (dim < dimWorld)
557 handledScvf.resize(element.subEntities(1), false);
558
559 int scvfCounter = 0;
560 for (const auto& intersection : intersections(gridGeometry().gridView(), element))
561 {
562 if (dim < dimWorld)
563 if (handledScvf[intersection.indexInInside()])
564 continue;
565
566 const auto& scvfNeighborVolVarIndices = neighborVolVarIndices[scvfCounter];
567 if (intersection.neighbor() || intersection.boundary())
568 {
569 ScvfGridIndexStorage scvIndices;
570 scvIndices.resize(scvfNeighborVolVarIndices.size() + 1);
571 scvIndices[0] = eIdx;
572 std::copy(scvfNeighborVolVarIndices.begin(), scvfNeighborVolVarIndices.end(), scvIndices.begin()+1);
573
574 const bool onBoundary = intersection.boundary() && !intersection.neighbor();
575 hasBoundaryScvf_ = (hasBoundaryScvf_ || onBoundary);
576
577 scvfs_.emplace_back(intersection,
578 intersection.geometry(),
579 scvFaceIndices[scvfCounter],
580 scvIndices,
581 onBoundary);
582 scvfIndices_.emplace_back(scvFaceIndices[scvfCounter]);
583 scvfCounter++;
584
585 // for surface and network grids mark that we handled this face
586 if (dim < dimWorld)
587 handledScvf[intersection.indexInInside()] = true;
588 }
589 }
590 }
591
593 void makeNeighborGeometries(const Element& element, const GridIndexType eIdx)
594 {
595 using ScvfGridIndexStorage = typename SubControlVolumeFace::Traits::GridIndexStorage;
596
597 // create the neighbor scv
598 neighborScvs_.emplace_back(element.geometry(), eIdx);
599 neighborScvIndices_.push_back(eIdx);
600
601 const auto& scvFaceIndices = gridGeometry().scvfIndicesOfScv(eIdx);
602 const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdx);
603
604 // for network grids there might be multiple intersection with the same geometryInInside
605 // we identify those by the indexInInside for now (assumes conforming grids at branching facets)
606 // here we keep track of them
607 std::vector<bool> handledScvf;
608 if (dim < dimWorld)
609 handledScvf.resize(element.subEntities(1), false);
610
611 int scvfCounter = 0;
612 for (const auto& intersection : intersections(gridGeometry().gridView(), element))
613 {
614 if (dim < dimWorld)
615 if (handledScvf[intersection.indexInInside()])
616 continue;
617
618 if (intersection.neighbor())
619 {
620 // this catches inner and periodic scvfs
621 const auto& scvfNeighborVolVarIndices = neighborVolVarIndices[scvfCounter];
622 if (scvfNeighborVolVarIndices[0] < gridGeometry().gridView().size(0))
623 {
624 // only create subcontrol faces where the outside element is the bound element
625 if (dim == dimWorld)
626 {
627 if (scvfNeighborVolVarIndices[0] == gridGeometry().elementMapper().index(*element_))
628 {
629 ScvfGridIndexStorage scvIndices({eIdx, scvfNeighborVolVarIndices[0]});
630 neighborScvfs_.emplace_back(intersection,
631 intersection.geometry(),
632 scvFaceIndices[scvfCounter],
633 scvIndices,
634 false);
635
636 neighborScvfIndices_.push_back(scvFaceIndices[scvfCounter]);
637 }
638 }
639 // for network grids we can't use the intersection.outside() index as we can't assure that the
640 // first intersection with this indexInInside is the one that has our bound element as outside
641 // instead we check if the bound element's index is in the outsideScvIndices of the candidate scvf
642 // (will be optimized away for dim == dimWorld)
643 else
644 {
645 for (unsigned outsideScvIdx = 0; outsideScvIdx < scvfNeighborVolVarIndices.size(); ++outsideScvIdx)
646 {
647 if (scvfNeighborVolVarIndices[outsideScvIdx] == gridGeometry().elementMapper().index(*element_))
648 {
649 ScvfGridIndexStorage scvIndices;
650 scvIndices.resize(scvfNeighborVolVarIndices.size() + 1);
651 scvIndices[0] = eIdx;
652 std::copy(scvfNeighborVolVarIndices.begin(), scvfNeighborVolVarIndices.end(), scvIndices.begin()+1);
653 neighborScvfs_.emplace_back(intersection,
654 intersection.geometry(),
655 scvFaceIndices[scvfCounter],
656 scvIndices,
657 false);
658
659 neighborScvfIndices_.push_back(scvFaceIndices[scvfCounter]);
660 break;
661 }
662 }
663 }
664
665 // for surface and network grids mark that we handled this face
666 if (dim < dimWorld)
667 handledScvf[intersection.indexInInside()] = true;
668 scvfCounter++;
669 }
670 }
671
672 // only increase counter for boundary intersections
673 // (exclude periodic boundaries according to dune grid interface, they have been handled in neighbor==true)
674 else if (intersection.boundary())
675 {
676 if (dim < dimWorld)
677 handledScvf[intersection.indexInInside()] = true;
678 scvfCounter++;
679 }
680 }
681 }
682
684 void clear()
685 {
686 scvfIndices_.clear();
687 scvfs_.clear();
688 flippedScvfIndices_.clear();
689
690 neighborScvIndices_.clear();
691 neighborScvfIndices_.clear();
692 neighborScvs_.clear();
693 neighborScvfs_.clear();
694 flippedNeighborScvfIndices_.clear();
695
696 hasBoundaryScvf_ = false;
697 }
698
699 std::optional<Element> element_;
700 const GridGeometry* gridGeometryPtr_;
701
702 // local storage after binding an element
703 std::array<GridIndexType, 1> scvIndices_;
704 std::array<SubControlVolume, 1> scvs_;
705
706 std::vector<GridIndexType> scvfIndices_;
707 std::vector<SubControlVolumeFace> scvfs_;
708 std::vector<std::vector<GridIndexType>> flippedScvfIndices_;
709
710 std::vector<GridIndexType> neighborScvIndices_;
711 std::vector<SubControlVolume> neighborScvs_;
712
713 std::vector<GridIndexType> neighborScvfIndices_;
714 std::vector<SubControlVolumeFace> neighborScvfs_;
715 std::vector<std::vector<GridIndexType>> flippedNeighborScvfIndices_;
716
717 bool hasBoundaryScvf_ = false;
718};
719
720} // end namespace Dumux
721
722#endif
Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models Specialization fo...
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:251
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:397
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const ThisType &g)
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:350
const Element & element() const
The bound element.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:401
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:266
const SubControlVolume & scv(GridIndexType scvIdx) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:280
Element::Geometry geometry(const SubControlVolume &scv) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:412
std::size_t numScv() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:357
CCTpfaFVElementGeometry(const GridGeometry &gridGeometry)
Constructor.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:275
GridView::Intersection::Geometry geometry(const SubControlVolumeFace &scvf) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:415
std::size_t numScvf() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:361
void bindElement(const Element &element) &
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:391
typename GridView::template Codim< 0 >::Entity Element
export type of the element
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:262
CCTpfaFVElementGeometry 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/cellcentered/tpfa/fvelementgeometry.hh:369
friend auto ipData(const ThisType &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:334
const GridGeometry & gridGeometry() const
The global finite volume geometry we are a restriction of.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:405
void bind(const Element &element) &
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:375
const SubControlVolumeFace & flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx=0) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:301
const SubControlVolumeFace & scvf(GridIndexType scvfIdx) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:290
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:264
friend Dune::IteratorRange< typename std::array< SubControlVolume, 1 >::const_iterator > scvs(const ThisType &g)
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:326
CCTpfaFVElementGeometry 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/cellcentered/tpfa/fvelementgeometry.hh:385
GG GridGeometry
export type of finite volume grid geometry
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:268
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:409
Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models Specialization fo...
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:65
GridView::Intersection::Geometry geometry(const SubControlVolumeFace &scvf) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:217
CCTpfaFVElementGeometry 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/cellcentered/tpfa/fvelementgeometry.hh:185
Element::Geometry geometry(const SubControlVolume &scv) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:214
typename GridView::template Codim< 0 >::Entity Element
export type of the element
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:73
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:77
const Element & element() const
The bound element.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:203
void bind(const Element &element) &
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:175
CCTpfaFVElementGeometry(const GridGeometry &gridGeometry)
Constructor.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:87
friend auto ipData(const CCTpfaFVElementGeometry &fvGeometry, const LocalDof &localDof)
Interpolation point data for a localDof.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:126
friend Dune::IteratorRange< ScvfIterator< SubControlVolumeFace, std::vector< GridIndexType >, ThisType > > scvfs(const CCTpfaFVElementGeometry &fvGeometry)
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:143
std::size_t numScv() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:153
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:211
GG GridGeometry
export type of finite volume grid geometry
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:79
const GridGeometry & gridGeometry() const
The global finite volume geometry we are a restriction of.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:207
std::size_t numScvf() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:159
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:199
CCTpfaFVElementGeometry 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/cellcentered/tpfa/fvelementgeometry.hh:169
const SubControlVolume & scv(GridIndexType scvIdx) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:92
const SubControlVolumeFace & scvf(GridIndexType scvfIdx) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:99
const SubControlVolumeFace & flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx=0) const
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:106
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:75
void bindElement(const Element &element) &
Bind only element-local.
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:192
friend Dune::IteratorRange< ScvIterator< SubControlVolume, std::array< GridIndexType, 1 >, ThisType > > scvs(const CCTpfaFVElementGeometry &fvGeometry)
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:117
Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models This builds up th...
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:55
An interpolation point related to a localDof of an element, giving its global and local positions.
Definition: cvfe/interpolationpointdata.hh:60
Iterators over sub control volumes.
Definition: scvandscvfiterators.hh:30
Iterators over sub control volume faces of an fv geometry.
Definition: scvandscvfiterators.hh:70
Classes representing interpolation point data for control-volume finite element schemes.
static ctype distance(const Dune::FieldVector< ctype, dimWorld > &a, const Dune::FieldVector< ctype, dimWorld > &b)
Compute the shortest distance between two points.
Definition: distance.hh:282
Defines the index types used for grid and local indices.
auto findLocalIndex(const GridIndexType idx, const std::vector< GridIndexType > &indices)
Definition: discretization/cellcentered/tpfa/fvelementgeometry.hh:35
Definition: adapt.hh:17
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