| 1 |
|
| 2 |
#include <gtest/gtest.h> // for AssertHelper, EXPECT_EQ, etc |
| 3 |
#include <stddef.h> // for size_t |
| 4 |
#include <stk_mesh/base/BulkData.hpp> // for BulkData |
| 5 |
#include <stk_mesh/base/Comm.hpp> // for comm_mesh_counts |
| 6 |
#include <stk_mesh/base/MetaData.hpp> // for MetaData |
| 7 |
#include <stk_mesh/base/MeshBuilder.hpp> |
| 8 |
#include <stk_util/parallel/Parallel.hpp> // for parallel_machine_size, etc |
| 9 |
#include <vector> // for vector |
| 10 |
#include "UnitTestSkinMeshUseCaseUtils.hpp" // for get_skin_parts, etc |
| 11 |
#include "mpi.h" // for MPI_COMM_WORLD, etc |
| 12 |
#include "stk_mesh/base/Types.hpp" // for PartVector |
| 13 |
#include "stk_unit_test_utils/ElemGraphTestUtils.hpp" |
| 14 |
|
| 15 |
namespace { |
| 16 |
|
| 17 |
using namespace stk::mesh::impl; |
| 18 |
using namespace stk::mesh; |
| 19 |
|
| 20 |
TEST(ElementGraph, skin_exposed_boundary) |
| 21 |
{ |
| 22 |
stk::ParallelMachine comm = MPI_COMM_WORLD; |
| 23 |
|
| 24 |
if(stk::parallel_machine_size(comm) <= 2) |
| 25 |
{ |
| 26 |
unsigned spatialDim = 3; |
| 27 |
|
| 28 |
stk::mesh::MeshBuilder builder(comm); |
| 29 |
builder.set_spatial_dimension(spatialDim); |
| 30 |
std::shared_ptr<stk::mesh::BulkData> bulkPtr = builder.create(); |
| 31 |
stk::mesh::MetaData& meta = bulkPtr->mesh_meta_data(); |
| 32 |
make_2_hex_mesh_with_element1_inactive(*bulkPtr); |
| 33 |
stk::mesh::PartVector skin_parts = get_skin_parts(meta); |
| 34 |
ElemGraphTestUtils::skin_boundary(*bulkPtr, *meta.get_part("active"), skin_parts); |
| 35 |
ElemGraphTestUtils::test_num_faces_per_element(*bulkPtr, {5u, 0u}); |
| 36 |
std::vector<size_t> global_mesh_counts; |
| 37 |
stk::mesh::comm_mesh_counts(*bulkPtr, global_mesh_counts); |
| 38 |
EXPECT_EQ(5u, global_mesh_counts[meta.side_rank()]); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
|
| 43 |
} // namespace |