From 83c6597c0b7afd042cb510615af286e9fae30b29 Mon Sep 17 00:00:00 2001 From: "Marc T. Henry de Frahan" Date: Thu, 18 Apr 2024 12:55:02 -0600 Subject: [PATCH] Fix error in unit test from unsynched bulk (#1260) --- unit_tests/UnitTestUtils.C | 3 ++- unit_tests/matrix_free/UnitTestConductionFields.C | 3 ++- unit_tests/matrix_free/UnitTestStkSimdConnectivityMap.C | 3 ++- unit_tests/matrix_free/UnitTestStkSimdFaceConnectivityMap.C | 3 ++- unit_tests/matrix_free/UnitTestStkSimdGatheredElementData.C | 3 ++- unit_tests/matrix_free/UnitTestStkSimdNodeConnectivityMap.C | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/unit_tests/UnitTestUtils.C b/unit_tests/UnitTestUtils.C index 595933aca..64a608f8b 100644 --- a/unit_tests/UnitTestUtils.C +++ b/unit_tests/UnitTestUtils.C @@ -157,10 +157,11 @@ create_one_element( } auto elem = stk::mesh::declare_element( bulk, block_1, bulk.parallel_rank() + 1, nodeIds); - stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); bulk.modification_end(); + stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); + auto surfaceSelector = stk::mesh::selectUnion(allSurfaces); stk::mesh::EntityVector all_faces; stk::mesh::get_selected_entities( diff --git a/unit_tests/matrix_free/UnitTestConductionFields.C b/unit_tests/matrix_free/UnitTestConductionFields.C index 13130e81c..24c52796b 100644 --- a/unit_tests/matrix_free/UnitTestConductionFields.C +++ b/unit_tests/matrix_free/UnitTestConductionFields.C @@ -91,10 +91,11 @@ protected: } auto elem = stk::mesh::declare_element( *bulk, block_1, bulk->parallel_rank() + 1, nodeIds); - stk::mesh::create_all_sides(*bulk, block_1, allSurfaces, false); bulk->modification_end(); + stk::mesh::create_all_sides(*bulk, block_1, allSurfaces, false); + auto surfaceSelector = stk::mesh::selectUnion(allSurfaces); stk::mesh::EntityVector all_faces; stk::mesh::get_selected_entities( diff --git a/unit_tests/matrix_free/UnitTestStkSimdConnectivityMap.C b/unit_tests/matrix_free/UnitTestStkSimdConnectivityMap.C index b7040e3ff..088310469 100644 --- a/unit_tests/matrix_free/UnitTestStkSimdConnectivityMap.C +++ b/unit_tests/matrix_free/UnitTestStkSimdConnectivityMap.C @@ -87,10 +87,11 @@ protected: } auto elem = stk::mesh::declare_element( bulk, block_1, bulk.parallel_rank() + 1, nodeIds); - stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); bulk.modification_end(); + stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); + auto surfaceSelector = stk::mesh::selectUnion(allSurfaces); stk::mesh::EntityVector all_faces; stk::mesh::get_selected_entities( diff --git a/unit_tests/matrix_free/UnitTestStkSimdFaceConnectivityMap.C b/unit_tests/matrix_free/UnitTestStkSimdFaceConnectivityMap.C index bbd35e0f1..6bee8b1c4 100644 --- a/unit_tests/matrix_free/UnitTestStkSimdFaceConnectivityMap.C +++ b/unit_tests/matrix_free/UnitTestStkSimdFaceConnectivityMap.C @@ -98,10 +98,11 @@ protected: } auto elem = stk::mesh::declare_element( bulk, block_1, bulk.parallel_rank() + 1, nodeIds); - stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); bulk.modification_end(); + stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); + auto surfaceSelector = stk::mesh::selectUnion(allSurfaces); stk::mesh::EntityVector all_faces; stk::mesh::get_selected_entities( diff --git a/unit_tests/matrix_free/UnitTestStkSimdGatheredElementData.C b/unit_tests/matrix_free/UnitTestStkSimdGatheredElementData.C index 6b77c4c85..19f786684 100644 --- a/unit_tests/matrix_free/UnitTestStkSimdGatheredElementData.C +++ b/unit_tests/matrix_free/UnitTestStkSimdGatheredElementData.C @@ -105,10 +105,11 @@ protected: } auto elem = stk::mesh::declare_element( bulk, block_1, bulk.parallel_rank() + 1, nodeIds); - stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); bulk.modification_end(); + stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); + std::vector> nodeLocations = { {-1, -1, -1}, {+1, -1, -1}, {+1, +1, -1}, {-1, +1, -1}, {-1, -1, +1}, {+1, -1, +1}, {+1, +1, +1}, {-1, +1, +1}}; diff --git a/unit_tests/matrix_free/UnitTestStkSimdNodeConnectivityMap.C b/unit_tests/matrix_free/UnitTestStkSimdNodeConnectivityMap.C index 510694c1b..a859beae8 100644 --- a/unit_tests/matrix_free/UnitTestStkSimdNodeConnectivityMap.C +++ b/unit_tests/matrix_free/UnitTestStkSimdNodeConnectivityMap.C @@ -82,10 +82,11 @@ protected: stk::topology::NODE_RANK, id, stk::mesh::PartVector{}); } auto elem = stk::mesh::declare_element(bulk, block_1, 1, nodeIds); - stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); bulk.modification_end(); + stk::mesh::create_all_sides(bulk, block_1, allSurfaces, false); + auto surfaceSelector = stk::mesh::selectUnion(allSurfaces); stk::mesh::EntityVector all_faces; stk::mesh::get_selected_entities(