diff --git a/dumux/discretization/facecentered/diamond/fvgridgeometry.hh b/dumux/discretization/facecentered/diamond/fvgridgeometry.hh index 378f0c4b3996f4edef74b6f6c10bb9223e010070..3cc239b5e4a4e899b039b5cea2e7fc02f6cfa4e2 100644 --- a/dumux/discretization/facecentered/diamond/fvgridgeometry.hh +++ b/dumux/discretization/facecentered/diamond/fvgridgeometry.hh @@ -153,6 +153,10 @@ public: const FeCache& feCache() const { return feCache_; } + //! If a face / d.o.f. is on the boundary + bool dofOnBoundary(GridIndexType dofIdx) const + { return boundaryDofIndices_[dofIdx]; } + //! Return a reference to the dof mapper const DofMapper& dofMapper() const { return dofMapper_; } @@ -232,6 +236,8 @@ private: cache_.scvfs_.resize(numElements); cache_.hasBoundaryScvf_.resize(numElements, false); + boundaryDofIndices_.assign(numDofs(), false); + numScv_ = 0; numScvf_ = 0; numBoundaryScvf_ = 0; @@ -293,9 +299,15 @@ private: { if (onDomainBoundary_(intersection)) { + // store information that the face dof is on a boundary + const LocalIndexType localFacetIndex = intersection.indexInInside(); + const auto dofIndex = dofMapper().subIndex(element, localFacetIndex, 1); + boundaryDofIndices_[dofIndex] = true; + + // and that the element has a boundary face cache_.hasBoundaryScvf_[eIdx] = true; - const LocalIndexType localFacetIndex = intersection.indexInInside(); + // add boundary scvf const auto geo = intersection.geometry(); cache_.scvfs_[eIdx].emplace_back( geo.center(), @@ -359,6 +371,9 @@ private: return intersection.boundary() && intersection.neighbor(); } + // faces on the boundary + std::vector<bool> boundaryDofIndices_; + DofMapper dofMapper_; std::size_t numScv_;