Commit ed79f282 authored by Kilian Weishaupt's avatar Kilian Weishaupt Committed by Timo Koch
Browse files

[box] Add hasBoundaryScvf() to fvGeometry

parent 40431006
......@@ -148,6 +148,10 @@ public:
const FVGridGeometry& fvGridGeometry() const
{ return *fvGridGeometryPtr_; }
//! Returns whether one of the geometry's scvfs lies on a boundary
bool hasBoundaryScvf() const
{ return fvGridGeometry().hasBoundaryScvf(eIdx_); }
private:
const Element* elementPtr_;
const FVGridGeometry* fvGridGeometryPtr_;
......@@ -263,11 +267,16 @@ public:
const FVGridGeometry& fvGridGeometry() const
{ return *fvGridGeometryPtr_; }
//! Returns whether one of the geometry's scvfs lies on a boundary
bool hasBoundaryScvf() const
{ return hasBoundaryScvf_; }
private:
void makeElementGeometries(const Element& element)
{
auto eIdx = fvGridGeometry().elementMapper().index(element);
hasBoundaryScvf_ = false;
// get the element geometry
auto elementGeometry = element.geometry();
......@@ -316,6 +325,7 @@ private:
if (intersection.boundary() && !intersection.neighbor())
{
const auto isGeometry = intersection.geometry();
hasBoundaryScvf_ = true;
for (unsigned int isScvfLocalIdx = 0; isScvfLocalIdx < isGeometry.corners(); ++isScvfLocalIdx)
{
......@@ -348,6 +358,8 @@ private:
//! vectors to store the geometries locally after binding an element
std::vector<SubControlVolume> scvs_;
std::vector<SubControlVolumeFace> scvfs_;
bool hasBoundaryScvf_ = false;
};
} // end namespace Dumux
......
......@@ -156,6 +156,7 @@ public:
auto numElements = this->gridView().size(0);
scvs_.resize(numElements);
scvfs_.resize(numElements);
hasBoundaryScvf_.resize(numElements, false);
boundaryDofIndices_.assign(numDofs(), false);
......@@ -215,6 +216,8 @@ public:
if (intersection.boundary() && !intersection.neighbor())
{
const auto isGeometry = intersection.geometry();
hasBoundaryScvf_[eIdx] = true;
// count
numScvf_ += isGeometry.corners();
numBoundaryScvf_ += isGeometry.corners();
......@@ -317,6 +320,10 @@ public:
const std::unordered_map<std::size_t, std::size_t>& periodicVertexMap() const
{ return periodicVertexMap_; }
//! Returns whether one of the geometry's scvfs lies on a boundary
bool hasBoundaryScvf(std::size_t eIdx) const
{ return hasBoundaryScvf_[eIdx]; }
private:
const FeCache feCache_;
......@@ -330,6 +337,7 @@ private:
// vertices on the boudary
std::vector<bool> boundaryDofIndices_;
std::vector<bool> hasBoundaryScvf_;
// a map for periodic boundary vertices
std::unordered_map<std::size_t, std::size_t> periodicVertexMap_;
......
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