From 38e9f827e9fdf82d1af28c9ac181e520b243d7dc Mon Sep 17 00:00:00 2001 From: Daniel Schwen Date: Tue, 20 Jun 2023 16:33:05 -0600 Subject: [PATCH] Address comments, fix test (#24645) --- framework/src/markers/BoundaryMarker.C | 6 ++++++ test/tests/markers/boundary_marker/adjacent.i | 9 --------- test/tests/markers/boundary_marker/distance.i | 9 --------- test/tests/markers/boundary_marker/multiple.i | 9 --------- test/tests/userobjects/geometry_snap/tests | 4 ++-- 5 files changed, 8 insertions(+), 29 deletions(-) diff --git a/framework/src/markers/BoundaryMarker.C b/framework/src/markers/BoundaryMarker.C index 4eee96a304a0..a25e96d946dc 100644 --- a/framework/src/markers/BoundaryMarker.C +++ b/framework/src/markers/BoundaryMarker.C @@ -44,6 +44,7 @@ BoundaryMarker::computeElementMarker() { if (_distance == 0.0) { + // is the current element member of any selected boundary element set? for (const auto boundary : _boundary_ids) if (_mesh.isBoundaryElem(_current_elem->id(), boundary)) return _mark; @@ -58,6 +59,11 @@ BoundaryMarker::computeElementMarker() if (it != _bnd_elem_ids.end()) for (const auto id : it->second) { + // shortcut if we are checing the current element itself + if (id == _current_elem->id()) + return _mark; + + // otherwise compute distance to the boundary elements const auto elem = _mesh.elemPtr(id); const auto r = _current_elem->vertex_average() - elem->vertex_average(); if (r.norm() < _distance) diff --git a/test/tests/markers/boundary_marker/adjacent.i b/test/tests/markers/boundary_marker/adjacent.i index 926d7eb57b72..d0c18c915dbb 100644 --- a/test/tests/markers/boundary_marker/adjacent.i +++ b/test/tests/markers/boundary_marker/adjacent.i @@ -1,12 +1,3 @@ -########################################################### -# This is a test of the Mesh Marker System. It marks -# elements with flags indicating whether they should be -# refined, coarsened, or left alone. This system -# has the ability to use the Mesh Indicator System. -# -# @Requirement F2.50 -########################################################### - [Mesh] type = GeneratedMesh dim = 2 diff --git a/test/tests/markers/boundary_marker/distance.i b/test/tests/markers/boundary_marker/distance.i index 3907b7f3b395..c9ecce9230cc 100644 --- a/test/tests/markers/boundary_marker/distance.i +++ b/test/tests/markers/boundary_marker/distance.i @@ -1,12 +1,3 @@ -########################################################### -# This is a test of the Mesh Marker System. It marks -# elements with flags indicating whether they should be -# refined, coarsened, or left alone. This system -# has the ability to use the Mesh Indicator System. -# -# @Requirement F2.50 -########################################################### - [Mesh] type = GeneratedMesh dim = 2 diff --git a/test/tests/markers/boundary_marker/multiple.i b/test/tests/markers/boundary_marker/multiple.i index 7b6a05ad89c0..fcc1c61c257d 100644 --- a/test/tests/markers/boundary_marker/multiple.i +++ b/test/tests/markers/boundary_marker/multiple.i @@ -1,12 +1,3 @@ -########################################################### -# This is a test of the Mesh Marker System. It marks -# elements with flags indicating whether they should be -# refined, coarsened, or left alone. This system -# has the ability to use the Mesh Indicator System. -# -# @Requirement F2.50 -########################################################### - [Mesh] type = GeneratedMesh dim = 2 diff --git a/test/tests/userobjects/geometry_snap/tests b/test/tests/userobjects/geometry_snap/tests index 0688724dd2af..f0f26ecfbf5d 100644 --- a/test/tests/userobjects/geometry_snap/tests +++ b/test/tests/userobjects/geometry_snap/tests @@ -12,9 +12,9 @@ [block] type = 'Exodiff' input = 'block.i' - exodiff = 'block.e-s004' + exodiff = 'block_out.e-s004' issues = '#24645' - requirement = "The system shall support 'snapping' or moving new nodes in lower dimensioanl " + requirement = "The system shall support 'snapping' or moving new nodes in lower dimensional " "subdomains created by mesh adaptivity to the surface of a geometric sphere to " "capture high fidelity features on curved geometries." []