diff --git a/dune/iga/test/testintersections.cpp b/dune/iga/test/testintersections.cpp index 194de955..38f69052 100644 --- a/dune/iga/test/testintersections.cpp +++ b/dune/iga/test/testintersections.cpp @@ -240,7 +240,7 @@ auto testInsideOutside(auto& grid) { auto testReportFullIntersections() { TestSuite t; - Preferences::getInstance().reportTrimmedIntersections(false); + Preferences::getInstance().reconstructTrimmedLocalGeometry(false); using PatchGrid = PatchGrid<2, 2, DefaultTrim::PatchGridFamily>; using GridFactory = Dune::GridFactory; @@ -266,7 +266,7 @@ auto testReportFullIntersections() { for (const auto& ele : elements(leafGridView)) t.check(count(ele, levelGridView) == 4); - Preferences::getInstance().reportTrimmedIntersections(true); + Preferences::getInstance().reconstructTrimmedLocalGeometry(true); return t; } diff --git a/dune/iga/trimmer/defaulttrimmer/createentities.hh b/dune/iga/trimmer/defaulttrimmer/createentities.hh index 977dde34..74c222fd 100644 --- a/dune/iga/trimmer/defaulttrimmer/createentities.hh +++ b/dune/iga/trimmer/defaulttrimmer/createentities.hh @@ -232,7 +232,7 @@ void TrimmerImpl::collectElementEdges(int level, cons } }; - if (eleTrimData.flag() == ElementTrimFlag::full) { + if (eleTrimData.flag() == ElementTrimFlag::full or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) { for (auto localEdgeIndex : Dune::range(ele.subEntities(1))) { addHostEdge(localEdgeIndex); } @@ -295,7 +295,7 @@ void TrimmerImpl::collectElementVertices(int level, c entityContainer_.idToVertexInfoMap.back().insert({vertexId, vertexInfo}); }; - if (eleTrimData.flag() == ElementTrimFlag::full) { + if (eleTrimData.flag() == ElementTrimFlag::full or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) { // Save eleVertices in local order for (auto localVertexIndex : Dune::range(ele.subEntities(2))) { addHostVertex(localVertexIndex); @@ -324,7 +324,7 @@ void TrimmerImpl::createElements(int level, const std for (auto& [eleId, eleInfo] : elementMap | std::ranges::views::filter([level](const auto& pair) { return pair.second.lvl == level; })) { auto ele = parameterSpaceGrid_->entity(eleInfo.hostSeed); - if (not eleInfo.trimmed) { + if (not eleInfo.trimmed or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) { elementContainer[eleInfo.indexInLvlStorage] = ElementEntity{grid_, ele, eleInfo}; } else { elementContainer[eleInfo.indexInLvlStorage] = @@ -352,7 +352,7 @@ void TrimmerImpl::createSubEntities(int level) { vertexContainer.resize(entityContainer_.vertexCount.back()); for (auto& [vertexId, vertexInfo] : vertexMap) { - if (not vertexInfo.trimmed) { + if (not vertexInfo.trimmed or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) { auto vertex = parameterSpaceGrid_->entity(vertexInfo.hostSeed); vertexContainer[vertexInfo.indexInLvlStorage] = VertexEntity{grid_, vertex, vertexInfo}; } else { @@ -363,7 +363,7 @@ void TrimmerImpl::createSubEntities(int level) { edgeContainer.resize(entityContainer_.edgeCount.back()); for (auto& [edgeId, edgeInfo] : edgeMap | std::ranges::views::filter([level](const auto& pair) { return pair.second.lvl == level; })) { - if (not edgeInfo.trimmed) { + if (not edgeInfo.trimmed or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) { auto edge = parameterSpaceGrid_->entity(edgeInfo.hostSeed); edgeContainer[edgeInfo.indexInLvlStorage] = EdgeEntity{grid_, edge, edgeInfo}; } else { diff --git a/dune/iga/trimmer/defaulttrimmer/trimmer.hh b/dune/iga/trimmer/defaulttrimmer/trimmer.hh index 5c3ec5fe..357f6837 100644 --- a/dune/iga/trimmer/defaulttrimmer/trimmer.hh +++ b/dune/iga/trimmer/defaulttrimmer/trimmer.hh @@ -307,7 +307,7 @@ namespace DefaultTrim { using IntersectionIterator = PatchGridLevelIntersectionIterator; auto& localEntity = ent.impl().getLocalEntity(); - if (not localEntity.isTrimmed() or not Preferences::getInstance().reportTrimmedIntersections()) + if (not localEntity.isTrimmed() or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) return IntersectionIterator( grid_, parameterSpaceGrid().levelGridView(ent.level()).ibegin(localEntity.getHostEntity())); return IntersectionIterator(grid_, localEntity, IntersectionIterator::PositionToken::Begin, @@ -319,7 +319,7 @@ namespace DefaultTrim { using IntersectionIterator = PatchGridLevelIntersectionIterator; auto& localEntity = ent.impl().getLocalEntity(); - if (not localEntity.isTrimmed() or not Preferences::getInstance().reportTrimmedIntersections()) + if (not localEntity.isTrimmed() or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) return IntersectionIterator(grid_, parameterSpaceGrid().levelGridView(ent.level()).iend(localEntity.getHostEntity())); return IntersectionIterator(grid_, localEntity, IntersectionIterator::PositionToken::End, @@ -331,7 +331,7 @@ namespace DefaultTrim { using IntersectionIterator = PatchGridLeafIntersectionIterator; auto& localEntity = ent.impl().getLocalEntity(); - if (not localEntity.isTrimmed() or not Preferences::getInstance().reportTrimmedIntersections()) + if (not localEntity.isTrimmed() or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) return IntersectionIterator(grid_, parameterSpaceGrid().leafGridView().ibegin(localEntity.getHostEntity())); return IntersectionIterator(grid_, localEntity, IntersectionIterator::PositionToken::Begin, parameterSpaceGrid().leafGridView().ibegin(localEntity.getHostEntity())); @@ -342,7 +342,7 @@ namespace DefaultTrim { using IntersectionIterator = PatchGridLeafIntersectionIterator; auto& localEntity = ent.impl().getLocalEntity(); - if (not localEntity.isTrimmed() or not Preferences::getInstance().reportTrimmedIntersections()) + if (not localEntity.isTrimmed() or not Preferences::getInstance().reconstructTrimmedLocalGeometry()) return IntersectionIterator(grid_, parameterSpaceGrid().leafGridView().iend(localEntity.getHostEntity())); return IntersectionIterator(grid_, localEntity, IntersectionIterator::PositionToken::End, parameterSpaceGrid().leafGridView().ibegin(localEntity.getHostEntity())); diff --git a/dune/iga/trimmer/defaulttrimmer/trimmerpreferences.hh b/dune/iga/trimmer/defaulttrimmer/trimmerpreferences.hh index bb7f8bd0..84f57f6e 100644 --- a/dune/iga/trimmer/defaulttrimmer/trimmerpreferences.hh +++ b/dune/iga/trimmer/defaulttrimmer/trimmerpreferences.hh @@ -44,13 +44,13 @@ public: this->reportTrimmedElementGeometryTypeAsNone_ = _reportTrimmedElementGeometryTypeAsNone; } - bool reportTrimmedIntersections() const { - return reportTrimmedIntersections_; + bool reconstructTrimmedLocalGeometry() const { + return reconstructTrimmedLocalGeometry_; } - void reportTrimmedIntersections(bool _reportTrimmedIntersections_) { + void reconstructTrimmedLocalGeometry(bool _reconstructTrimmedLocalGeometry) { std::lock_guard lock(mtx); - this->reportTrimmedIntersections_ = _reportTrimmedIntersections_; + this->reconstructTrimmedLocalGeometry_ = _reconstructTrimmedLocalGeometry; } private: @@ -63,5 +63,5 @@ private: int boundaryDivisions_; double targetAccuracy_; bool reportTrimmedElementGeometryTypeAsNone_{true}; - bool reportTrimmedIntersections_{true}; + bool reconstructTrimmedLocalGeometry_{true}; }; \ No newline at end of file