version 3.8
discretization/cellcentered/mpfa/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-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
14#ifndef DUMUX_DISCRETIZATION_CCMPFA_FV_ELEMENT_GEOMETRY_HH
15#define DUMUX_DISCRETIZATION_CCMPFA_FV_ELEMENT_GEOMETRY_HH
16
17#include <optional>
18#include <utility>
19
20#include <dune/common/exceptions.hh>
21#include <dune/common/iteratorrange.hh>
22#include <dune/geometry/type.hh>
23
27
28namespace Dumux {
29
30#ifndef DOXYGEN
31namespace Detail::Mpfa {
32
33template<typename GridGeometry, typename SubControlVolumeFace>
34typename SubControlVolumeFace::Traits::Geometry makeScvfGeometry(const GridGeometry& gridGeometry,
35 const SubControlVolumeFace& scvf)
36{
37 static constexpr int dim = GridGeometry::GridView::dimension;
38
39 const auto& facetInfo = scvf.facetInfo();
40 const auto element = gridGeometry.element(facetInfo.elementIndex);
41 const auto elemGeo = element.geometry();
42 const auto refElement = referenceElement(elemGeo);
43 for (const auto& is : intersections(gridGeometry.gridView(), element))
44 {
45 if (is.indexInInside() == facetInfo.facetIndex)
46 {
47 const auto numCorners = is.geometry().corners();
48 const auto isPositions = GridGeometry::MpfaHelper::computeScvfCornersOnIntersection(
49 elemGeo, refElement, facetInfo.facetIndex, numCorners
50 );
51 return {
52 Dune::GeometryTypes::cube(dim-1),
53 GridGeometry::MpfaHelper::getScvfCorners(
54 isPositions, numCorners, facetInfo.facetCornerIndex
55 )
56 };
57 }
58 }
59 DUNE_THROW(Dune::InvalidStateException, "Could not construct scvf geometry");
60}
61
62template<typename GridGeometry, typename SubControlVolumeFace>
63auto getVertexCorner(const GridGeometry& gridGeometry, const SubControlVolumeFace& scvf)
64{
65 static constexpr int dim = GridGeometry::GridView::dimension;
66
67 const auto& facetInfo = scvf.facetInfo();
68 const auto element = gridGeometry.element(facetInfo.elementIndex);
69 const auto elemGeo = element.geometry();
70 const auto refElement = referenceElement(elemGeo);
71 return elemGeo.global(refElement.position(
72 refElement.subEntity(facetInfo.facetIndex, 1, facetInfo.facetCornerIndex, dim),
73 dim
74 ));
75}
76
77template<typename GridGeometry, typename SubControlVolumeFace>
78auto getFacetCorner(const GridGeometry& gridGeometry, const SubControlVolumeFace& scvf)
79{
80 const auto& facetInfo = scvf.facetInfo();
81 const auto element = gridGeometry.element(facetInfo.elementIndex);
82 const auto elemGeo = element.geometry();
83 const auto refElement = referenceElement(elemGeo);
84 return elemGeo.global(refElement.position(facetInfo.facetIndex, 1));
85}
86
87} // namespace Detail::Mpfa
88#endif // DOXYGEN
89
99template<class GG, bool enableGridGeometryCache>
101
108template<class GG>
110{
112 using GridView = typename GG::GridView;
113 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
114
115 static constexpr int dim = GridView::dimension;
116 static constexpr int dimWorld = GridView::dimensionworld;
117
118public:
120 using Element = typename GridView::template Codim<0>::Entity;
122 using SubControlVolume = typename GG::SubControlVolume;
124 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
126 using GridGeometry = GG;
128 static constexpr std::size_t maxNumElementScvs = 1;
130 static constexpr std::size_t maxNumElementScvfs = dim == 3 ? 24 : 8;
131
134 : gridGeometryPtr_(&gridGeometry) {}
135
137 const SubControlVolume& scv(GridIndexType scvIdx) const
138 {
139 return gridGeometry().scv(scvIdx);
140 }
141
143 const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const
144 {
145 return gridGeometry().scvf(scvfIdx);
146 }
147
150 const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx = 0) const
151 {
152 return gridGeometry().flipScvf(scvfIdx, outsideScvIdx);
153 }
154
160 friend inline Dune::IteratorRange< ScvIterator<SubControlVolume, std::array<GridIndexType, 1>, ThisType> >
161 scvs(const CCMpfaFVElementGeometry& fvGeometry)
162 {
164 return Dune::IteratorRange<ScvIterator>(ScvIterator(fvGeometry.scvIndices_.begin(), fvGeometry),
165 ScvIterator(fvGeometry.scvIndices_.end(), fvGeometry));
166 }
167
173 friend inline Dune::IteratorRange< ScvfIterator<SubControlVolumeFace, std::vector<GridIndexType>, ThisType> >
175 {
176 const auto& g = fvGeometry.gridGeometry();
177 const auto scvIdx = fvGeometry.scvIndices_[0];
179 return Dune::IteratorRange<ScvfIterator>(ScvfIterator(g.scvfIndicesOfScv(scvIdx).begin(), fvGeometry),
180 ScvfIterator(g.scvfIndicesOfScv(scvIdx).end(), fvGeometry));
181 }
182
184 std::size_t numScv() const
185 {
186 return scvIndices_.size();
187 }
188
190 std::size_t numScvf() const
191 {
192 return gridGeometry().scvfIndicesOfScv(scvIndices_[0]).size();
193 }
194
201 {
202 this->bindElement(element);
203 return std::move(*this);
204 }
205
206 void bind(const Element& element) &
207 {
208 this->bindElement(element);
209 }
210
217 {
218 this->bindElement(element);
219 return std::move(*this);
220 }
221
223 void bindElement(const Element& element) &
224 {
225 element_ = element;
226 scvIndices_[0] = gridGeometry().elementMapper().index(element);
227 }
228
230 bool isBound() const
231 { return static_cast<bool>(element_); }
232
234 const Element& element() const
235 { return *element_; }
236
239 { return *gridGeometryPtr_; }
240
242 bool hasBoundaryScvf() const
243 { return gridGeometry().hasBoundaryScvf(scvIndices_[0]); }
244
246 typename Element::Geometry geometry(const SubControlVolume& scv) const
247 { return gridGeometryPtr_->element(scv.dofIndex()).geometry(); }
248
250 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
251 { return Detail::Mpfa::makeScvfGeometry(gridGeometry(), scvf); }
252
254 typename SubControlVolumeFace::Traits::GlobalPosition vertexCorner(const SubControlVolumeFace& scvf) const
255 { return Detail::Mpfa::getVertexCorner(gridGeometry(), scvf); }
256
258 typename SubControlVolumeFace::Traits::GlobalPosition facetCorner(const SubControlVolumeFace& scvf) const
259 { return Detail::Mpfa::getFacetCorner(gridGeometry(), scvf); }
260
261private:
262
263 std::optional<Element> element_;
264 std::array<GridIndexType, 1> scvIndices_;
265 const GridGeometry* gridGeometryPtr_;
266};
267
273template<class GG>
275{
277 using GridView = typename GG::GridView;
278 using GridIndexType = typename IndexTraits<GridView>::GridIndex;
279 using MpfaHelper = typename GG::MpfaHelper;
280
281 static constexpr int dim = GridView::dimension;
282 static constexpr int dimWorld = GridView::dimensionworld;
283 using CoordScalar = typename GridView::ctype;
284
285public:
287 using Element = typename GridView::template Codim<0>::Entity;
289 using SubControlVolume = typename GG::SubControlVolume;
291 using SubControlVolumeFace = typename GG::SubControlVolumeFace;
293 using GridGeometry = GG;
295 static constexpr std::size_t maxNumElementScvs = 1;
297 static constexpr std::size_t maxNumElementScvfs = dim == 3 ? 24 : 8;
298
301 : gridGeometryPtr_(&gridGeometry) {}
302
305 const SubControlVolume& scv(GridIndexType scvIdx) const
306 {
307 if (scvIdx == scvIndices_[0])
308 return scvs_[0];
309 else
310 return neighborScvs_[findLocalIndex(scvIdx, neighborScvIndices_)];
311 }
312
315 const SubControlVolumeFace& scvf(GridIndexType scvfIdx) const
316 {
317 auto it = std::find(scvfIndices_.begin(), scvfIndices_.end(), scvfIdx);
318 if (it != scvfIndices_.end())
319 return scvfs_[std::distance(scvfIndices_.begin(), it)];
320 else
321 return neighborScvfs_[findLocalIndex(scvfIdx, neighborScvfIndices_)];
322 }
323
326 const SubControlVolumeFace& flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx = 0) const
327 {
328 return scvf( gridGeometry().flipScvfIdx(scvfIdx, outsideScvIdx) );
329 }
330
336 friend inline Dune::IteratorRange<typename std::array<SubControlVolume, 1>::const_iterator>
337 scvs(const ThisType& g)
338 {
339 using IteratorType = typename std::array<SubControlVolume, 1>::const_iterator;
340 return Dune::IteratorRange<IteratorType>(g.scvs_.begin(), g.scvs_.end());
341 }
342
348 friend inline Dune::IteratorRange<typename std::vector<SubControlVolumeFace>::const_iterator>
349 scvfs(const ThisType& g)
350 {
351 using IteratorType = typename std::vector<SubControlVolumeFace>::const_iterator;
352 return Dune::IteratorRange<IteratorType>(g.scvfs_.begin(), g.scvfs_.end());
353 }
354
356 std::size_t numScv() const
357 { return scvs_.size(); }
358
360 std::size_t numScvf() const
361 { return scvfs_.size(); }
362
369 {
370 this->bindElement_(element);
371 return std::move(*this);
372 }
373
374 void bindElement(const Element& element) &
375 {
376 this->bindElement_(element);
377 }
378
385 {
386 this->bind_(element);
387 return std::move(*this);
388 }
389
390 void bind(const Element& element) &
391 {
392 this->bind_(element);
393 }
394
396 bool isBound() const
397 { return static_cast<bool>(element_); }
398
400 const Element& element() const
401 { return *element_; }
402
405 { return *gridGeometryPtr_; }
406
408 bool hasBoundaryScvf() const
409 { return hasBoundaryScvf_; }
410
412 typename SubControlVolume::Traits::Geometry geometry(const SubControlVolume& scv) const
413 { return gridGeometryPtr_->element(scv.dofIndex()).geometry(); }
414
416 typename SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace& scvf) const
417 { return Detail::Mpfa::makeScvfGeometry(gridGeometry(), scvf); }
418
420 typename SubControlVolumeFace::Traits::GlobalPosition vertexCorner(const SubControlVolumeFace& scvf) const
421 { return Detail::Mpfa::getVertexCorner(gridGeometry(), scvf); }
422
424 typename SubControlVolumeFace::Traits::GlobalPosition facetCorner(const SubControlVolumeFace& scvf) const
425 { return Detail::Mpfa::getFacetCorner(gridGeometry(), scvf); }
426
427private:
428
431 void bind_(const Element& element)
432 {
433 // make inside geometries
434 bindElement_(element);
435
436 // get some references for convenience
437 const auto globalI = gridGeometry().elementMapper().index(element);
438 const auto& assemblyMapI = gridGeometry().connectivityMap()[globalI];
439
440 // reserve memory
441 const auto numNeighbors = assemblyMapI.size();
442 const auto numNeighborScvfs = numNeighborScvfs_(assemblyMapI);
443 neighborScvs_.reserve(numNeighbors);
444 neighborScvIndices_.reserve(numNeighbors);
445 neighborScvfIndices_.reserve(numNeighborScvfs);
446 neighborScvfs_.reserve(numNeighborScvfs);
447
448 // make neighbor geometries
449 // use the assembly map to determine which faces are necessary
450 for (const auto& dataJ : assemblyMapI)
451 makeNeighborGeometries(gridGeometry().element(dataJ.globalJ),
452 dataJ.globalJ,
453 dataJ.scvfsJ,
454 dataJ.additionalScvfs);
455
456 // //! TODO Check if user added additional DOF dependencies, i.e. the residual of DOF globalI depends
457 // //! on additional DOFs not included in the discretization schemes' occupation pattern
458 // const auto& additionalDofDependencies = problem.getAdditionalDofDependencies(globalI);
459 // if (!additionalDofDependencies.empty())
460 // {
461 // const auto newNumNeighbors = neighborScvs_.size() + additionalDofDependencies.size();
462 // neighborScvs_.reserve(newNumNeighbors);
463 // neighborScvIndices_.reserve(newNumNeighbors);
464 // for (auto globalJ : additionalDofDependencies)
465 // {
466 // neighborScvs_.emplace_back(gridGeometry().element(globalJ).geometry(), globalJ);
467 // neighborScvIndices_.emplace_back(globalJ);
468 // }
469 // }
470 }
471
473 void bindElement_(const Element& element)
474 {
475 clear();
476 element_ = element;
477 makeElementGeometries(element);
478 }
479
481 template<class DataJContainer>
482 std::size_t numNeighborScvfs_(const DataJContainer& dataJContainer)
483 {
484 std::size_t numNeighborScvfs = 0;
485 for (const auto& dataJ : dataJContainer)
486 numNeighborScvfs += dataJ.scvfsJ.size() + dataJ.additionalScvfs.size();
487 return numNeighborScvfs;
488 }
489
491 void makeElementGeometries(const Element& element)
492 {
493 // make the scv
494 const auto eIdx = gridGeometry().elementMapper().index(element);
495 scvs_[0] = SubControlVolume(element.geometry(), eIdx);
496 scvIndices_[0] = eIdx;
497
498 // get data on the scv faces
499 const auto& scvFaceIndices = gridGeometry().scvfIndicesOfScv(eIdx);
500 const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdx);
501
502 // the quadrature point parameterizaion to be used on scvfs
503 static const auto q = getParam<CoordScalar>("MPFA.Q");
504
505 // reserve memory for the scv faces
506 const auto numLocalScvf = scvFaceIndices.size();
507 scvfIndices_.reserve(numLocalScvf);
508 scvfs_.reserve(numLocalScvf);
509
510 // for network grids we only want to do one scvf per half facet
511 // this approach assumes conforming grids at branching facets
512 std::vector<bool> finishedFacets;
513 if (dim < dimWorld)
514 finishedFacets.resize(element.subEntities(1), false);
515
516 int scvfCounter = 0;
517 for (const auto& is : intersections(gridGeometry().gridView(), element))
518 {
519 // if we are dealing with a lower dimensional network
520 // only make a new scvf if we haven't handled it yet
521 if (dim < dimWorld)
522 {
523 const auto indexInInside = is.indexInInside();
524 if (finishedFacets[indexInInside])
525 continue;
526 else
527 finishedFacets[indexInInside] = true;
528 }
529
530 // if outside level > inside level, use the outside element in the following
531 bool useNeighbor = is.neighbor() && is.outside().level() > element.level();
532 const auto& e = useNeighbor ? is.outside() : element;
533 const auto indexInElement = useNeighbor ? is.indexInOutside() : is.indexInInside();
534 const auto eg = e.geometry();
535 const auto refElement = referenceElement(eg);
536
537 // Set up a container with all relevant positions for scvf corner computation
538 const auto numCorners = is.geometry().corners();
539 const auto isPositions = MpfaHelper::computeScvfCornersOnIntersection(eg,
540 refElement,
541 indexInElement,
542 numCorners);
543
544 // make the scv faces belonging to each corner of the intersection
545 for (int c = 0; c < numCorners; ++c)
546 {
547 // get the global vertex index the scv face is connected to
548 auto vIdxLocal = refElement.subEntity(indexInElement, 1, c, dim);
549 auto vIdxGlobal = gridGeometry().vertexMapper().subIndex(e, vIdxLocal, dim);
550
551 // do not build scvfs connected to a processor boundary
552 if (gridGeometry().isGhostVertex(vIdxGlobal))
553 continue;
554
555 hasBoundaryScvf_ = (hasBoundaryScvf_ || is.boundary());
556 typename SubControlVolumeFace::FacetInfo facetInfo{
557 gridGeometry().elementMapper().index(e),
558 useNeighbor ? is.indexInOutside() : is.indexInInside(),
559 c
560 };
561 scvfs_.emplace_back(MpfaHelper(),
562 MpfaHelper::getScvfCorners(isPositions, numCorners, c),
563 is,
564 std::move(facetInfo),
565 vIdxGlobal,
566 vIdxLocal,
567 scvFaceIndices[scvfCounter],
568 eIdx,
569 neighborVolVarIndices[scvfCounter],
570 q,
571 is.boundary());
572
573 scvfIndices_.emplace_back(scvFaceIndices[scvfCounter]);
574 scvfCounter++;
575 }
576 }
577 }
578
580 template<typename IndexVector>
581 void makeNeighborGeometries(const Element& element,
582 GridIndexType eIdxGlobal,
583 const IndexVector& scvfIndices,
584 const IndexVector& additionalScvfs)
585 {
586 // create the neighbor scv if it doesn't exist yet
587 neighborScvs_.emplace_back(element.geometry(), eIdxGlobal);
588 neighborScvIndices_.push_back(eIdxGlobal);
589
590 // get data on the scv faces
591 const auto& scvFaceIndices = gridGeometry().scvfIndicesOfScv(eIdxGlobal);
592 const auto& neighborVolVarIndices = gridGeometry().neighborVolVarIndices(eIdxGlobal);
593
594 // the quadrature point parameterizaion to be used on scvfs
595 static const auto q = getParam<CoordScalar>("MPFA.Q");
596
597 // for network grids we only want to do one scvf per half facet
598 // this approach assumes conforming grids at branching facets
599 std::vector<bool> finishedFacets;
600 if (dim < dimWorld)
601 finishedFacets.resize(element.subEntities(1), false);
602
603 int scvfCounter = 0;
604 for (const auto& is : intersections(gridGeometry().gridView(), element))
605 {
606 // if we are dealing with a lower dimensional network
607 // only make a new scvf if we haven't handled it yet
608 if (dim < dimWorld)
609 {
610 auto indexInInside = is.indexInInside();
611 if(finishedFacets[indexInInside])
612 continue;
613 else
614 finishedFacets[indexInInside] = true;
615 }
616
617 // if outside level > inside level, use the outside element in the following
618 bool useNeighbor = is.neighbor() && is.outside().level() > element.level();
619 const auto& e = useNeighbor ? is.outside() : element;
620 const auto indexInElement = useNeighbor ? is.indexInOutside() : is.indexInInside();
621 const auto eg = e.geometry();
622 const auto refElement = referenceElement(eg);
623
624 // Set up a container with all relevant positions for scvf corner computation
625 const auto numCorners = is.geometry().corners();
626 const auto isPositions = MpfaHelper::computeScvfCornersOnIntersection(eg,
627 refElement,
628 indexInElement,
629 numCorners);
630
631 // make the scv faces belonging to each corner of the intersection
632 for (int c = 0; c < numCorners; ++c)
633 {
634 // get the global vertex index the scv face is connected to
635 auto vIdxLocal = refElement.subEntity(indexInElement, 1, c, dim);
636 auto vIdxGlobal = gridGeometry().vertexMapper().subIndex(e, vIdxLocal, dim);
637
638 // do not build scvfs connected to a processor boundary
639 if (gridGeometry().isGhostVertex(vIdxGlobal))
640 continue;
641
642 // only build the scvf if it is in the list of necessary indices
643 if (!MpfaHelper::vectorContainsValue(scvfIndices, scvFaceIndices[scvfCounter])
644 && !MpfaHelper::vectorContainsValue(additionalScvfs, scvFaceIndices[scvfCounter]))
645 {
646 // increment counter either way
647 scvfCounter++;
648 continue;
649 }
650
651 // build scvf
652 typename SubControlVolumeFace::FacetInfo facetInfo{
653 gridGeometry().elementMapper().index(e),
654 useNeighbor ? is.indexInOutside() : is.indexInInside(),
655 c
656 };
657 neighborScvfs_.emplace_back(MpfaHelper(),
658 MpfaHelper::getScvfCorners(isPositions, numCorners, c),
659 is,
660 std::move(facetInfo),
661 vIdxGlobal,
662 vIdxLocal,
663 scvFaceIndices[scvfCounter],
664 eIdxGlobal,
665 neighborVolVarIndices[scvfCounter],
666 q,
667 is.boundary());
668
669 neighborScvfIndices_.emplace_back(scvFaceIndices[scvfCounter]);
670
671 // increment counter
672 scvfCounter++;
673 }
674 }
675 }
676
678 unsigned int findLocalIndex(const GridIndexType idx,
679 const std::vector<GridIndexType>& indices) const
680 {
681 auto it = std::find(indices.begin(), indices.end(), idx);
682 assert(it != indices.end() && "Could not find the scv/scvf! Make sure to properly bind this class!");
683 return std::distance(indices.begin(), it);
684 }
685
687 void clear()
688 {
689 scvfIndices_.clear();
690 scvfs_.clear();
691
692 neighborScvIndices_.clear();
693 neighborScvfIndices_.clear();
694 neighborScvs_.clear();
695 neighborScvfs_.clear();
696
697 hasBoundaryScvf_ = false;
698 }
699
700 const GridGeometry* gridGeometryPtr_;
701 std::optional<Element> element_;
702
703 // local storage after binding an element
704 std::array<GridIndexType, 1> scvIndices_;
705 std::vector<GridIndexType> scvfIndices_;
706 std::array<SubControlVolume, 1> scvs_;
707 std::vector<SubControlVolumeFace> scvfs_;
708
709 std::vector<GridIndexType> neighborScvIndices_;
710 std::vector<GridIndexType> neighborScvfIndices_;
711 std::vector<SubControlVolume> neighborScvs_;
712 std::vector<SubControlVolumeFace> neighborScvfs_;
713
714 bool hasBoundaryScvf_ = false;
715};
716
717} // end namespace
718
719#endif
Stencil-local finite volume geometry (scvs and scvfs) for cell-centered TPFA models Specialization fo...
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:275
const SubControlVolumeFace & scvf(GridIndexType scvfIdx) const
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:315
const SubControlVolume & scv(GridIndexType scvIdx) const
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:305
friend Dune::IteratorRange< typename std::vector< SubControlVolumeFace >::const_iterator > scvfs(const ThisType &g)
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:349
SubControlVolume::Traits::Geometry geometry(const SubControlVolume &scv) const
Create the geometry of a given sub control volume.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:412
void bindElement(const Element &element) &
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:374
const GridGeometry & gridGeometry() const
The global finite volume geometry we are a restriction of.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:404
CCMpfaFVElementGeometry 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/mpfa/fvelementgeometry.hh:384
SubControlVolumeFace::Traits::GlobalPosition vertexCorner(const SubControlVolumeFace &scvf) const
Return the position of the scvf corner that coincides with an element vertex.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:420
const SubControlVolumeFace & flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx=0) const
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:326
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:289
typename GridView::template Codim< 0 >::Entity Element
export type of the element
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:287
std::size_t numScv() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:356
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:291
SubControlVolumeFace::Traits::GlobalPosition facetCorner(const SubControlVolumeFace &scvf) const
Return the corner of the scvf that is inside the facet the scvf is embedded in.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:424
const Element & element() const
The bound element.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:400
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:396
void bind(const Element &element) &
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:390
CCMpfaFVElementGeometry 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/mpfa/fvelementgeometry.hh:368
std::size_t numScvf() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:360
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:408
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Create the geometry of a given sub control volume face.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:416
GG GridGeometry
export type of finite volume grid geometries
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:293
friend Dune::IteratorRange< typename std::array< SubControlVolume, 1 >::const_iterator > scvs(const ThisType &g)
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:337
CCMpfaFVElementGeometry(const GridGeometry &gridGeometry)
Constructor.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:300
Stencil-local finite volume geometry (scvs and scvfs) for cell-centered mpfa models Specialization fo...
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:110
const SubControlVolume & scv(GridIndexType scvIdx) const
Get an element sub control volume with a global scv index.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:137
CCMpfaFVElementGeometry 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/mpfa/fvelementgeometry.hh:216
SubControlVolumeFace::Traits::Geometry geometry(const SubControlVolumeFace &scvf) const
Create the geometry of a given sub control volume face.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:250
Element::Geometry geometry(const SubControlVolume &scv) const
Create the geometry of a given sub control volume.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:246
void bindElement(const Element &element) &
Bind only element-local.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:223
std::size_t numScvf() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:190
CCMpfaFVElementGeometry(const GridGeometry &gridGeometry)
Constructor.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:133
const Element & element() const
The bound element.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:234
CCMpfaFVElementGeometry 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/mpfa/fvelementgeometry.hh:200
bool isBound() const
Returns true if bind/bindElement has already been called.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:230
friend Dune::IteratorRange< ScvIterator< SubControlVolume, std::array< GridIndexType, 1 >, ThisType > > scvs(const CCMpfaFVElementGeometry &fvGeometry)
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:161
void bind(const Element &element) &
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:206
bool hasBoundaryScvf() const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:242
typename GG::SubControlVolumeFace SubControlVolumeFace
export type of subcontrol volume face
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:124
friend Dune::IteratorRange< ScvfIterator< SubControlVolumeFace, std::vector< GridIndexType >, ThisType > > scvfs(const CCMpfaFVElementGeometry &fvGeometry)
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:174
const SubControlVolumeFace & scvf(GridIndexType scvfIdx) const
Get an element sub control volume face with a global scvf index.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:143
const SubControlVolumeFace & flipScvf(GridIndexType scvfIdx, unsigned int outsideScvIdx=0) const
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:150
SubControlVolumeFace::Traits::GlobalPosition vertexCorner(const SubControlVolumeFace &scvf) const
Return the position of the scvf corner that coincides with an element vertex.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:254
const GridGeometry & gridGeometry() const
The global finite volume geometry we are a restriction of.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:238
std::size_t numScv() const
number of sub control volumes in this fv element geometry
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:184
typename GridView::template Codim< 0 >::Entity Element
export type of the element
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:120
typename GG::SubControlVolume SubControlVolume
export type of subcontrol volume
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:122
SubControlVolumeFace::Traits::GlobalPosition facetCorner(const SubControlVolumeFace &scvf) const
Return the corner of the scvf that is inside the facet the scvf is embedded in.
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:258
GG GridGeometry
export type of finite volume grid geometry
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:126
Stencil-local finite volume geometry (scvs and scvfs) for cell-centered mpfa models This builds up th...
Definition: discretization/cellcentered/mpfa/fvelementgeometry.hh:100
Iterators over sub control volumes.
Definition: scvandscvfiterators.hh:30
Iterators over sub control volume faces of an fv geometry.
Definition: scvandscvfiterators.hh:70
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:33
std::size_t numCorners(Shape shape)
Returns the number of corners of a given geometry.
Definition: throatproperties.hh:220
Definition: adapt.hh:17
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
Class providing iterators over sub control volumes and sub control volume faces of an element.
typename GridView::IndexSet::IndexType GridIndex
Definition: indextraits.hh:27