Commit 20e7c629 authored by Kilian Weishaupt's avatar Kilian Weishaupt
Browse files

[staggered][fvElementGeometry] Use info from traits

parent e4ba9e28
...@@ -51,10 +51,7 @@ class FaceCenteredStaggeredFVElementGeometry<GG, /*cachingEnabled*/true> ...@@ -51,10 +51,7 @@ class FaceCenteredStaggeredFVElementGeometry<GG, /*cachingEnabled*/true>
using ThisType = FaceCenteredStaggeredFVElementGeometry<GG, /*cachingEnabled*/true>; using ThisType = FaceCenteredStaggeredFVElementGeometry<GG, /*cachingEnabled*/true>;
using GridView = typename GG::GridView; using GridView = typename GG::GridView;
using GridIndexType = typename IndexTraits<GridView>::GridIndex; using GridIndexType = typename IndexTraits<GridView>::GridIndex;
static constexpr auto numScvsPerElement = GG::StaticInformation::numScvsPerElement;
static constexpr auto dim = GridView::dimension;
static constexpr auto numFacesPerElement = dim * 2;
static constexpr auto numScvsPerElement = numFacesPerElement;
public: public:
//! export type of subcontrol volume face //! export type of subcontrol volume face
...@@ -64,9 +61,7 @@ public: ...@@ -64,9 +61,7 @@ public:
using GridGeometry = GG; using GridGeometry = GG;
//! the maximum number of scvs per element //! the maximum number of scvs per element
static constexpr std::size_t maxNumElementScvs = 2*GridView::dimension; static constexpr std::size_t maxNumElementScvs = numScvsPerElement;
// //! the maximum number of scvfs per element (use cubes for maximum)
// static constexpr std::size_t maxNumElementScvfs = 2*GridView::dimension;
FaceCenteredStaggeredFVElementGeometry(const GridGeometry& gridGeometry) FaceCenteredStaggeredFVElementGeometry(const GridGeometry& gridGeometry)
: gridGeometry_(&gridGeometry) : gridGeometry_(&gridGeometry)
...@@ -239,20 +234,15 @@ class FaceCenteredStaggeredFVElementGeometry<GG, /*cachingEnabled*/false> ...@@ -239,20 +234,15 @@ class FaceCenteredStaggeredFVElementGeometry<GG, /*cachingEnabled*/false>
using GridView = typename GG::GridView; using GridView = typename GG::GridView;
using GridIndexType = typename IndexTraits<GridView>::GridIndex; using GridIndexType = typename IndexTraits<GridView>::GridIndex;
static constexpr std::size_t maxNumScvfs = 16; // TODO 3D
//TODO include assert that checks for quad geometry //TODO include assert that checks for quad geometry
static constexpr auto codimIntersection = 1;
static constexpr auto dim = GridView::dimension; using StaticInfo = typename GG::StaticInformation;
static constexpr auto numFacesPerElement = dim * 2; static constexpr auto dim = StaticInfo::dim;
static constexpr auto numScvsPerElement = numFacesPerElement; static constexpr auto numScvsPerElement = StaticInfo::numScvsPerElement;
static constexpr auto numLateralScvfsPerScv = 2 * (dim - 1); static constexpr auto numLateralScvfsPerScv = StaticInfo::numLateralScvfsPerScv;
static constexpr auto numLateralScvfsPerElement = numFacesPerElement*numLateralScvfsPerScv; static constexpr auto numLateralScvfsPerElement = StaticInfo::numLateralScvfsPerElement;
static constexpr auto minNumScvfsPerElement = StaticInfo::minNumScvfsPerElement;
static constexpr auto maxNumScvfsPerElement = numLateralScvfsPerElement // number of lateral faces static constexpr auto maxNumScvfsPerElement = StaticInfo::maxNumScvfsPerElement;
+ numFacesPerElement // number of central frontal faces
+ numFacesPerElement; // number of potential frontal faces on boundary
using LocalIndexType = typename IndexTraits<GridView>::LocalIndex; using LocalIndexType = typename IndexTraits<GridView>::LocalIndex;
...@@ -353,15 +343,11 @@ public: ...@@ -353,15 +343,11 @@ public:
//! number of sub control volumes in this fv element geometry //! number of sub control volumes in this fv element geometry
std::size_t numScv() const std::size_t numScv() const
{ { return numScvsPerElement; }
return numScvsPerElement;
}
//! number of sub control volumes in this fv element geometry //! number of sub control volumes in this fv element geometry
std::size_t numScvf() const std::size_t numScvf() const
{ { return scvfIndices_().size(); }
return scvfIndices_().size();
}
/*! /*!
* \brief bind the local view (r-value overload) * \brief bind the local view (r-value overload)
...@@ -592,7 +578,7 @@ private: ...@@ -592,7 +578,7 @@ private:
return !intersection.neighbor() && intersection.boundary(); return !intersection.neighbor() && intersection.boundary();
} }
Dune::ReservedVector<SubControlVolumeFace, maxNumScvfs> scvfs_; Dune::ReservedVector<SubControlVolumeFace, maxNumScvfsPerElement> scvfs_;
Dune::ReservedVector<SubControlVolume, numLateralScvfsPerElement> neighborScvs_; Dune::ReservedVector<SubControlVolume, numLateralScvfsPerElement> neighborScvs_;
Dune::ReservedVector<GridIndexType, numLateralScvfsPerElement> neighborScvIndices_; Dune::ReservedVector<GridIndexType, numLateralScvfsPerElement> neighborScvIndices_;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment