12#ifndef DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_FV_GRID_GEOMETRY
13#define DUMUX_DISCRETIZATION_FACECENTERED_STAGGERED_FV_GRID_GEOMETRY
17#include <dune/common/rangeutilities.hh>
18#include <dune/grid/common/scsgmapper.hh>
48template<
class Gr
idView>
57 template<
class Gr
idGeometry>
60 template<
class Gr
idGeometry,
bool enableCache>
65 static constexpr auto dim = GridView::Grid::dimension;
83template<
class GridView,
84 bool cachingEnabled =
false,
94template<
class GV,
class Traits>
103 using Element =
typename GV::template Codim<0>::Entity;
105 using IntersectionMapper =
typename Traits::IntersectionMapper;
106 using ConnectivityMap =
typename Traits::template ConnectivityMap<ThisType>;
108 using Scalar =
typename GV::ctype;
110 static constexpr auto dim = Traits::StaticInfo::dim;
111 static constexpr auto numScvsPerElement = Traits::StaticInfo::numScvsPerElement;
112 static constexpr auto numLateralScvfsPerScv = Traits::StaticInfo::numLateralScvfsPerScv;
113 static constexpr auto numLateralScvfsPerElement = Traits::StaticInfo::numLateralScvfsPerElement;
114 static constexpr auto minNumScvfsPerElement = Traits::StaticInfo::minNumScvfsPerElement;
115 static constexpr auto maxNumScvfsPerElement = Traits::StaticInfo::maxNumScvfsPerElement;
117 using ScvfCornerStorage =
typename Traits::SubControlVolumeFace::Traits::CornerStorage;
118 using ScvCornerStorage =
typename Traits::SubControlVolume::Traits::CornerStorage;
150 : ParentType(std::move(gg))
151 , intersectionMapper_(this->
gridView())
152 , periodicGridTraits_(this->
gridView().grid())
156 DUNE_THROW(Dune::InvalidStateException,
"The staggered discretization method needs overlap of exactly 1 for parallel computations. "
157 <<
" Set the parameter \"Grid.Overlap\" in the input file.");
169 {
return scvs_.size(); }
173 {
return scvfs_.size(); }
177 {
return numBoundaryScv_; }
181 {
return numBoundaryScvf_; }
185 {
return intersectionMapper_.numIntersections(); }
189 {
return this->
gridView().size(1); }
207 {
return scvs_[scvIdx]; }
213 auto begin = scvs_.cbegin() + numScvsPerElement*fvGeometry.elementIndex();
214 const auto end = begin + numScvsPerElement;
215 return Dune::IteratorRange<std::decay_t<
decltype(begin)>>(begin, end);
220 {
return scvfs_[scvfIdx]; }
224 {
return scvfIndicesOfElement_[eIdx]; }
231 {
return connectivityMap_; }
235 {
return hasBoundaryScvf_[eIdx]; }
239 {
return intersectionMapper_; }
243 {
return periodicFaceMap_.count(dofIdx); }
247 {
return periodicFaceMap_.at(dofIdx); }
251 {
return periodicFaceMap_; }
261 scvfIndicesOfElement_.clear();
262 intersectionMapper_.update(this->gridView());
265 const auto numElements = this->gridView().size(0);
266 scvfIndicesOfElement_.resize(numElements);
267 hasBoundaryScvf_.resize(numElements,
false);
269 outSideBoundaryVolVarIdx_ = 0;
271 numBoundaryScvf_ = 0;
273 GeometryHelper geometryHelper(this->gridView());
276 GridIndexType numScvfs = 0;
277 for (
const auto& element : elements(this->gridView()))
279 assert(numScvsPerElement == element.subEntities(1));
281 for (
const auto& intersection : intersections(this->gridView(), element))
287 numScvfs += numLateralScvfsPerScv;
290 if (onDomainBoundary_(intersection))
293 numBoundaryScv_ += numLateralScvfsPerScv;
302 const auto numScvs = numElements*numScvsPerElement;
303 scvs_.resize(numScvs);
304 scvfs_.reserve(numScvfs);
307 std::size_t globalScvfIdx = 0;
308 for (
const auto& element : elements(this->gridView()))
310 const auto eIdx = this->elementMapper().index(element);
311 auto& globalScvfIndices = scvfIndicesOfElement_[eIdx];
312 globalScvfIndices.resize(minNumScvfsPerElement);
313 globalScvfIndices.reserve(maxNumScvfsPerElement);
315 auto getGlobalScvIdx = [&](
const auto elementIdx,
const auto localScvIdx)
316 {
return numScvsPerElement*elementIdx + localScvIdx; };
318 LocalIntersectionMapper localIsMapper;
319 localIsMapper.update(this->gridView(), element);
321 for (
const auto& intersection : intersections(this->gridView(), element))
323 const auto& intersectionUnitOuterNormal = intersection.centerUnitOuterNormal();
324 const auto localScvIdx = localIsMapper.realToRefIdx(intersection.indexInInside());
325 auto localScvfIdx = localScvIdx*(1 + numLateralScvfsPerScv);
327 const auto globalScvIdx = getGlobalScvIdx(eIdx, localScvIdx);
328 const auto dofIndex = intersectionMapper().globalIntersectionIndex(element, intersection.indexInInside());
329 const auto localOppositeScvIdx = geometryHelper.localOppositeIdx(localScvIdx);
330 const auto& intersectionGeometry = intersection.geometry();
331 const auto& elementGeometry =
element.geometry();
333 assert(localIsMapper.refToRealIdx(localScvIdx) == intersection.indexInInside());
336 if (onPeriodicBoundary_(intersection))
340 const auto& otherElement = intersection.outside();
342 SmallLocalIndexType otherIntersectionLocalIdx = 0;
343 bool periodicFaceFound =
false;
345 for (
const auto& otherIntersection : intersections(this->gridView(), otherElement))
347 if (periodicFaceFound)
350 if (Dune::FloatCmp::eq(intersectionUnitOuterNormal*otherIntersection.centerUnitOuterNormal(), -1.0, 1e-7))
352 const auto periodicDofIdx = intersectionMapper().globalIntersectionIndex(otherElement, otherIntersectionLocalIdx);
353 periodicFaceMap_[dofIndex] = periodicDofIdx;
354 periodicFaceFound =
true;
357 ++otherIntersectionLocalIdx;
362 scvs_[globalScvIdx] = SubControlVolume(
364 intersectionGeometry,
369 this->elementMapper().index(element),
370 onDomainBoundary_(intersection)
374 scvfs_.emplace_back(elementGeometry,
375 intersectionGeometry,
376 std::array{globalScvIdx, getGlobalScvIdx(eIdx, localOppositeScvIdx)},
379 intersectionUnitOuterNormal,
380 SubControlVolumeFace::FaceType::frontal,
381 SubControlVolumeFace::BoundaryType::interior
384 globalScvfIndices[localScvfIdx] = globalScvfIdx++;
388 for (
const auto lateralFacetIndex : Dune::transformedRangeView(geometryHelper.localLaterFaceIndices(localScvIdx),
389 [&](
auto&& idx) { return localIsMapper.refToRealIdx(idx) ;})
392 const auto& lateralIntersection = geometryHelper.intersection(lateralFacetIndex, element);
395 const auto globalScvIndicesForLateralFace = [&]
397 const auto globalOutsideScvIdx = [&]
399 if (lateralIntersection.neighbor())
401 const auto parallelElemIdx = this->elementMapper().index(lateralIntersection.outside());
402 return getGlobalScvIdx(parallelElemIdx, localScvIdx);
404 else if (onDomainBoundary_(lateralIntersection))
405 return numScvs + outSideBoundaryVolVarIdx_++;
410 return std::array{globalScvIdx, globalOutsideScvIdx};
413 const auto boundaryType = [&]
415 if (onProcessorBoundary_(lateralIntersection))
416 return SubControlVolumeFace::BoundaryType::processorBoundary;
417 else if (onDomainBoundary_(lateralIntersection))
418 return SubControlVolumeFace::BoundaryType::physicalBoundary;
420 return SubControlVolumeFace::BoundaryType::interior;
425 intersectionGeometry,
426 geometryHelper.facet(lateralFacetIndex, element).geometry(),
427 globalScvIndicesForLateralFace,
430 lateralIntersection.centerUnitOuterNormal(),
431 SubControlVolumeFace::FaceType::lateral,
435 globalScvfIndices[localScvfIdx] = globalScvfIdx++;
438 if (onDomainBoundary_(lateralIntersection))
441 hasBoundaryScvf_[eIdx] =
true;
448 int localScvfIdx = minNumScvfsPerElement;
449 for (
const auto& intersection : intersections(this->gridView(), element))
452 if (onDomainBoundary_(intersection))
454 const auto localScvIdx = localIsMapper.realToRefIdx(intersection.indexInInside());
455 const auto globalScvIdx = getGlobalScvIdx(eIdx, localScvIdx);
461 intersection.geometry(),
462 std::array{globalScvIdx, globalScvIdx},
465 intersection.centerUnitOuterNormal(),
466 SubControlVolumeFace::FaceType::frontal,
467 SubControlVolumeFace::BoundaryType::physicalBoundary
470 globalScvfIndices.push_back(globalScvfIdx);
473 hasBoundaryScvf_[eIdx] =
true;
478 connectivityMap_.update(*
this);
481 bool onDomainBoundary_(
const typename GridView::Intersection& intersection)
const
483 return !intersection.neighbor() && intersection.boundary();
486 bool onProcessorBoundary_(
const typename GridView::Intersection& intersection)
const
488 return !intersection.neighbor() && !intersection.boundary();
491 bool onPeriodicBoundary_(
const typename GridView::Intersection& intersection)
const
493 return periodicGridTraits_.isPeriodic(intersection);
497 ConnectivityMap connectivityMap_;
498 IntersectionMapper intersectionMapper_;
500 std::vector<SubControlVolume> scvs_;
501 std::vector<SubControlVolumeFace> scvfs_;
502 GridIndexType numBoundaryScv_;
503 GridIndexType numBoundaryScvf_;
504 GridIndexType outSideBoundaryVolVarIdx_;
505 std::vector<bool> hasBoundaryScvf_;
507 std::vector<std::vector<GridIndexType>> scvfIndicesOfElement_;
510 std::unordered_map<GridIndexType, GridIndexType> periodicFaceMap_;
512 PeriodicGridTraits<typename GridView::Grid> periodicGridTraits_;
521template<
class GV,
class Traits>
530 using Element =
typename GV::template Codim<0>::Entity;
532 using IntersectionMapper =
typename Traits::IntersectionMapper;
533 using ConnectivityMap =
typename Traits::template ConnectivityMap<ThisType>;
535 static constexpr auto dim = Traits::StaticInfo::dim;
536 static constexpr auto numScvsPerElement = Traits::StaticInfo::numScvsPerElement;
537 static constexpr auto numLateralScvfsPerScv = Traits::StaticInfo::numLateralScvfsPerScv;
538 static constexpr auto numLateralScvfsPerElement = Traits::StaticInfo::numLateralScvfsPerElement;
539 static constexpr auto minNumScvfsPerElement = Traits::StaticInfo::minNumScvfsPerElement;
540 static constexpr auto maxNumScvfsPerElement = Traits::StaticInfo::maxNumScvfsPerElement;
572 : ParentType(std::move(gg))
573 , intersectionMapper_(this->
gridView())
574 , periodicGridTraits_(this->
gridView().grid())
578 DUNE_THROW(Dune::InvalidStateException,
"The staggered discretization method needs at least an overlap of 1 for parallel computations. "
579 <<
" Set the parameter \"Grid.Overlap\" in the input file.");
599 {
return numBoundaryScv_; }
603 {
return numBoundaryScvf_; }
607 {
return intersectionMapper_.numIntersections(); }
611 {
return this->
gridView().size(1); }
618 {
return connectivityMap_; }
622 {
return hasBoundaryScvf_[eIdx]; }
626 {
return intersectionMapper_; }
630 {
return scvfIndicesOfElement_[eIdx]; }
634 {
return outsideVolVarIndices_.at(scvfIdx); }
652 {
return periodicFaceMap_.count(dofIdx); }
656 {
return periodicFaceMap_.at(dofIdx); }
660 {
return periodicFaceMap_; }
666 intersectionMapper_.update(this->gridView());
671 numBoundaryScvf_ = 0;
672 hasBoundaryScvf_.clear();
673 scvfIndicesOfElement_.clear();
674 outsideVolVarIndices_.clear();
677 const auto numElements = this->gridView().size(0);
678 scvfIndicesOfElement_.resize(numElements);
679 hasBoundaryScvf_.resize(numElements,
false);
680 numScvs_ = numElements*numScvsPerElement;
682 GeometryHelper geometryHelper(this->gridView());
685 GridIndexType scvfIdx = 0;
687 GridIndexType neighborVolVarIdx = numScvs_;
689 for (
const auto& element : elements(this->gridView()))
691 const auto eIdx = this->elementMapper().index(element);
692 assert(numScvsPerElement == element.subEntities(1));
695 auto& globalScvfIndices = scvfIndicesOfElement_[eIdx];
696 globalScvfIndices.reserve(maxNumScvfsPerElement);
697 globalScvfIndices.resize(minNumScvfsPerElement);
700 std::size_t numFrontalBoundaryScvfs = 0;
703 LocalIntersectionIndexMapper localIsMapper;
704 localIsMapper.update(this->gridView(), element);
706 for (
const auto& intersection : intersections(this->gridView(), element))
708 const auto localScvIdx = localIsMapper.realToRefIdx(intersection.indexInInside());
709 auto localScvfIdx = localScvIdx*(1 + numLateralScvfsPerScv);
711 assert(localIsMapper.refToRealIdx(localScvIdx) == intersection.indexInInside());
713 globalScvfIndices[localScvfIdx] = scvfIdx++;
716 if constexpr(dim > 1)
719 for (
const auto lateralFacetIndex : Dune::transformedRangeView(geometryHelper.localLaterFaceIndices(localScvIdx),
720 [&](
auto idx) { return localIsMapper.refToRealIdx(idx) ;})
723 if (onDomainBoundary_(geometryHelper.intersection(lateralFacetIndex, element)))
725 outsideVolVarIndices_[scvfIdx] = neighborVolVarIdx++;
727 hasBoundaryScvf_[eIdx] =
true;
730 globalScvfIndices[localScvfIdx] = scvfIdx++;
736 if (onDomainBoundary_(intersection))
739 numBoundaryScv_ += numLateralScvfsPerScv;
740 ++numFrontalBoundaryScvfs;
742 hasBoundaryScvf_[eIdx] =
true;
746 if (onPeriodicBoundary_(intersection))
750 const auto& otherElement = intersection.outside();
752 SmallLocalIndexType otherIntersectionLocalIdx = 0;
753 bool periodicFaceFound =
false;
755 for (
const auto& otherIntersection : intersections(this->gridView(), otherElement))
757 if (periodicFaceFound)
760 if (Dune::FloatCmp::eq(intersection.centerUnitOuterNormal()*otherIntersection.centerUnitOuterNormal(), -1.0, 1e-7))
762 const auto periodicDofIdx = intersectionMapper().globalIntersectionIndex(otherElement, otherIntersectionLocalIdx);
763 const auto dofIndex = intersectionMapper().globalIntersectionIndex(element, localScvIdx);
764 periodicFaceMap_[dofIndex] = periodicDofIdx;
765 periodicFaceFound =
true;
768 ++otherIntersectionLocalIdx;
774 for (std::size_t i = 0; i < numFrontalBoundaryScvfs; ++i)
775 globalScvfIndices.push_back(scvfIdx++);
781 connectivityMap_.update(*
this);
784 bool onDomainBoundary_(
const typename GridView::Intersection& intersection)
const
786 return !intersection.neighbor() && intersection.boundary();
789 bool onProcessorBoundary_(
const typename GridView::Intersection& intersection)
const
791 return !intersection.neighbor() && !intersection.boundary();
794 bool onPeriodicBoundary_(
const typename GridView::Intersection& intersection)
const
796 return periodicGridTraits_.isPeriodic(intersection);
800 ConnectivityMap connectivityMap_;
801 IntersectionMapper intersectionMapper_;
804 std::size_t numScvs_;
805 std::size_t numScvf_;
806 std::size_t numBoundaryScv_;
807 std::size_t numBoundaryScvf_;
808 std::vector<bool> hasBoundaryScvf_;
810 std::vector<std::vector<GridIndexType>> scvfIndicesOfElement_;
813 std::unordered_map<GridIndexType, GridIndexType> periodicFaceMap_;
814 std::unordered_map<GridIndexType, GridIndexType> outsideVolVarIndices_;
816 PeriodicGridTraits<typename GridView::Grid> periodicGridTraits_;
Base class for grid geometries.
Check the overlap size for different discretization methods.
const GridView & gridView() const
Return the gridView this grid geometry object lives on.
Definition basegridgeometry.hh:100
void update(const GridView &gridView)
Update all fvElementGeometries (call this after grid adaption).
Definition basegridgeometry.hh:88
Stores the dof indices corresponding to the neighboring scvs that contribute to the derivative calcul...
Definition facecentered/staggered/connectivitymap.hh:30
Definition discretization/facecentered/staggered/fvelementgeometry.hh:124
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition discretization/facecentered/staggered/fvgridgeometry.hh:556
typename Traits::GeometryHelper GeometryHelper
export the geometry helper type
Definition discretization/facecentered/staggered/fvgridgeometry.hh:560
FaceCenteredStaggeredFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg, const std::string ¶mGroup="")
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition discretization/facecentered/staggered/fvgridgeometry.hh:571
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition discretization/facecentered/staggered/fvgridgeometry.hh:554
std::size_t numDofs() const
the total number of dofs
Definition discretization/facecentered/staggered/fvgridgeometry.hh:610
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the d.o.f. on the other side of the periodic boundary.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:655
const ConnectivityMap & connectivityMap() const
Returns the connectivity map of which dofs have derivatives with respect to a given dof.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:617
std::size_t numBoundaryScv() const
The total number of boundary sub control volumes.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:598
const IntersectionMapper & intersectionMapper() const
Return a reference to the intersection mapper.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:625
void update(GridView &&gridView)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/facecentered/staggered/fvgridgeometry.hh:644
FaceCenteredStaggeredFVGridGeometry(const GridView &gridView, const std::string ¶mGroup="")
Constructor from gridView.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:585
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a d.o.f. is on a periodic boundary.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:651
typename Traits::StaticInfo StaticInformation
export static information
Definition discretization/facecentered/staggered/fvgridgeometry.hh:564
const std::vector< GridIndexType > & scvfIndicesOfElement(GridIndexType eIdx) const
Get the global sub control volume face indices of an element.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:629
bool hasBoundaryScvf(GridIndexType eIdx) const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:621
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:594
BasicGridGeometry_t< GV, Traits > BasicGridGeometry
export basic grid geometry type for the alternative constructor
Definition discretization/facecentered/staggered/fvgridgeometry.hh:550
std::size_t numBoundaryScvf() const
The total number of boundary sub control volume faces.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:602
const std::unordered_map< GridIndexType, GridIndexType > & periodicDofMap() const
Returns the map between dofs across periodic boundaries.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:659
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:590
GV GridView
export the grid view type
Definition discretization/facecentered/staggered/fvgridgeometry.hh:558
typename Traits::LocalIntersectionMapper LocalIntersectionMapper
export the local intersection mapper
Definition discretization/facecentered/staggered/fvgridgeometry.hh:562
GridIndexType outsideVolVarIndex(GridIndexType scvfIdx) const
Get the global sub control volume face indices of an element.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:633
static constexpr DiscretizationMethod discMethod
Definition discretization/facecentered/staggered/fvgridgeometry.hh:545
DiscretizationMethods::FCStaggered DiscretizationMethod
export the discretization method this geometry belongs to
Definition discretization/facecentered/staggered/fvgridgeometry.hh:544
void update(const GridView &gridView)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/facecentered/staggered/fvgridgeometry.hh:637
std::size_t numIntersections() const
The total number of intersections.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:606
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition discretization/facecentered/staggered/fvgridgeometry.hh:566
typename PeriodicGridTraits< typename GV::Grid >::SupportsPeriodicity SupportsPeriodicity
export whether the grid(geometry) supports periodicity
Definition discretization/facecentered/staggered/fvgridgeometry.hh:568
static constexpr bool cachingEnabled
Definition discretization/facecentered/staggered/fvgridgeometry.hh:547
typename Traits::template LocalView< ThisType, false > LocalView
export the type of the fv element geometry (the local view type)
Definition discretization/facecentered/staggered/fvgridgeometry.hh:552
const ConnectivityMap & connectivityMap() const
Returns the connectivity map of which dofs have derivatives with respect to a given dof.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:230
typename PeriodicGridTraits< typename GV::Grid >::SupportsPeriodicity SupportsPeriodicity
export whether the grid(geometry) supports periodicity
Definition discretization/facecentered/staggered/fvgridgeometry.hh:146
std::size_t numScvf() const
The total number of sub control volume faces.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:172
const IntersectionMapper & intersectionMapper() const
Return a reference to the intersection mapper.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:238
bool hasBoundaryScvf(GridIndexType eIdx) const
Returns whether one of the geometry's scvfs lies on a boundary.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:234
void update(const GridView &gridView)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/facecentered/staggered/fvgridgeometry.hh:192
typename Traits::SubControlVolumeFace SubControlVolumeFace
export the type of sub control volume
Definition discretization/facecentered/staggered/fvgridgeometry.hh:134
typename Traits::LocalIntersectionMapper LocalIntersectionMapper
export the local intersection mapper
Definition discretization/facecentered/staggered/fvgridgeometry.hh:140
typename Traits::GeometryHelper GeometryHelper
export the geometry helper type
Definition discretization/facecentered/staggered/fvgridgeometry.hh:138
const std::vector< GridIndexType > & scvfIndicesOfElement(GridIndexType eIdx) const
Get the global sub control volume face indices of an element.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:223
FaceCenteredStaggeredFVGridGeometry(std::shared_ptr< BasicGridGeometry > gg, const std::string ¶mGroup="")
Constructor with basic grid geometry used to share state with another grid geometry on the same grid ...
Definition discretization/facecentered/staggered/fvgridgeometry.hh:149
typename Traits::StaticInfo StaticInformation
export static information
Definition discretization/facecentered/staggered/fvgridgeometry.hh:142
static constexpr bool cachingEnabled
Definition discretization/facecentered/staggered/fvgridgeometry.hh:125
std::size_t numDofs() const
the total number of dofs
Definition discretization/facecentered/staggered/fvgridgeometry.hh:188
std::size_t numBoundaryScv() const
The total number of boundary sub control volumes.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:176
FaceCenteredStaggeredFVGridGeometry(const GridView &gridView, const std::string ¶mGroup="")
Constructor from gridView.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:163
GridIndexType periodicallyMappedDof(GridIndexType dofIdx) const
The index of the d.o.f. on the other side of the periodic boundary.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:246
GV GridView
export the grid view type
Definition discretization/facecentered/staggered/fvgridgeometry.hh:136
static constexpr DiscretizationMethod discMethod
Definition discretization/facecentered/staggered/fvgridgeometry.hh:123
const SubControlVolume & scv(GridIndexType scvIdx) const
Get a sub control volume with a global scv index.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:206
typename Traits::SubControlVolume SubControlVolume
export the type of sub control volume
Definition discretization/facecentered/staggered/fvgridgeometry.hh:132
typename Traits::template LocalView< ThisType, true > LocalView
export the type of the fv element geometry (the local view type)
Definition discretization/facecentered/staggered/fvgridgeometry.hh:130
void update(GridView &&gridView)
update all fvElementGeometries (call this after grid adaption)
Definition discretization/facecentered/staggered/fvgridgeometry.hh:199
BasicGridGeometry_t< GV, Traits > BasicGridGeometry
export basic grid geometry type for the alternative constructor
Definition discretization/facecentered/staggered/fvgridgeometry.hh:128
Extrusion_t< Traits > Extrusion
export the type of extrusion
Definition discretization/facecentered/staggered/fvgridgeometry.hh:144
std::size_t numBoundaryScvf() const
The total number of boundary sub control volume faces.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:180
std::size_t numIntersections() const
The total number of intersections.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:184
const SubControlVolumeFace & scvf(GridIndexType scvfIdx) const
Get a sub control volume face with a global scvf index.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:219
const std::unordered_map< GridIndexType, GridIndexType > & periodicDofMap() const
Returns the map between dofs across periodic boundaries.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:250
bool dofOnPeriodicBoundary(GridIndexType dofIdx) const
If a d.o.f. is on a periodic boundary.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:242
std::size_t numScv() const
The total number of sub control volumes.
Definition discretization/facecentered/staggered/fvgridgeometry.hh:168
auto scvs(const LocalView &fvGeometry) const
Definition discretization/facecentered/staggered/fvgridgeometry.hh:211
DiscretizationMethods::FCStaggered DiscretizationMethod
export the discretization method this geometry belongs to
Definition discretization/facecentered/staggered/fvgridgeometry.hh:122
Base class for the finite volume geometry vector for face-centered staggered models This builds up th...
Definition discretization/facecentered/staggered/fvgridgeometry.hh:86
Face centered staggered geometry helper.
Definition discretization/facecentered/staggered/geometryhelper.hh:28
Face centered staggered sub control volume face.
Definition discretization/facecentered/staggered/subcontrolvolumeface.hh:54
Face centered staggered sub control volume.
Definition discretization/facecentered/staggered/subcontrolvolume.hh:52
Defines the default element and vertex mapper types.
Geometry helper for face-centered staggered scheme.
Face centered staggered sub control volume.
Face centered staggered sub control volume face.
Helper classes to compute the integration elements.
Stores the dof indices corresponding to the neighboring scvs that contribute to the derivative calcul...
BaseGridGeometry(std::shared_ptr< BaseImplementation > impl)
Constructor from a BaseImplementation.
Definition basegridgeometry.hh:72
Dune::Std::detected_or_t< Dumux::BasicGridGeometry< GV, typename T::ElementMapper, typename T::VertexMapper >, Detail::SpecifiesBaseGridGeometry, T > BasicGridGeometry_t
Type of the basic grid geometry implementation used as backend.
Definition basegridgeometry.hh:38
Detail::FaceCenteredStaggeredLocalIntersectionIndexMapper< GridView, ConsistentlyOrientedGrid< typename GridView::Grid >{}> FaceCenteredStaggeredLocalIntersectionIndexMapper
Provides a mapping of local intersection indices (indexInInside) such that the local indices always f...
Definition localintersectionindexmapper.hh:116
static std::size_t normalAxis(const Vector &v)
Returns the normal axis index of a unit vector (0 = x, 1 = y, 2 = z).
Definition normalaxis.hh:26
defines intersection mappers.
Provides a mapping of local intersection indices (indexInInside) such that the local indices always f...
Define some often used mathematical functions.
The available discretization methods in Dumux.
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition extrusion.hh:166
Base class for the finite volume geometry vector for face-centered staggered models This builds up th...
Grid properties related to periodicity.
static bool isValid(const GridView &gridView) noexcept
Definition checkoverlapsize.hh:30
Definition defaultmappertraits.hh:23
Definition discretization/facecentered/staggered/fvgridgeometry.hh:64
static constexpr auto numLateralScvfsPerElement
Definition discretization/facecentered/staggered/fvgridgeometry.hh:69
static constexpr auto maxNumScvfsPerElement
Definition discretization/facecentered/staggered/fvgridgeometry.hh:72
static constexpr auto numScvsPerElement
Definition discretization/facecentered/staggered/fvgridgeometry.hh:67
static constexpr auto numFacesPerElement
Definition discretization/facecentered/staggered/fvgridgeometry.hh:66
static constexpr auto dim
Definition discretization/facecentered/staggered/fvgridgeometry.hh:65
static constexpr auto numLateralScvfsPerScv
Definition discretization/facecentered/staggered/fvgridgeometry.hh:68
static constexpr auto minNumScvfsPerElement
Definition discretization/facecentered/staggered/fvgridgeometry.hh:70
The default traits for the face-center staggered finite volume grid geometry Defines the scv and scvf...
Definition discretization/facecentered/staggered/fvgridgeometry.hh:50
ConformingGridIntersectionMapper< GridView > IntersectionMapper
Definition discretization/facecentered/staggered/fvgridgeometry.hh:53
FaceCenteredStaggeredGeometryHelper< GridView > GeometryHelper
Definition discretization/facecentered/staggered/fvgridgeometry.hh:55
FaceCenteredStaggeredFVElementGeometry< GridGeometry, enableCache > LocalView
Definition discretization/facecentered/staggered/fvgridgeometry.hh:61
FaceCenteredStaggeredSubControlVolumeFace< GridView > SubControlVolumeFace
Definition discretization/facecentered/staggered/fvgridgeometry.hh:52
FaceCenteredStaggeredConnectivityMap< GridGeometry > ConnectivityMap
Definition discretization/facecentered/staggered/fvgridgeometry.hh:58
FaceCenteredStaggeredSubControlVolume< GridView > SubControlVolume
Definition discretization/facecentered/staggered/fvgridgeometry.hh:51
FaceCenteredStaggeredLocalIntersectionIndexMapper< GridView > LocalIntersectionMapper
Definition discretization/facecentered/staggered/fvgridgeometry.hh:54
typename GridView::IndexSet::IndexType GridIndex
Definition indextraits.hh:27
std::uint_least8_t SmallLocalIndex
Definition indextraits.hh:29
unsigned int LocalIndex
Definition indextraits.hh:28
Definition periodicgridtraits.hh:34