diff --git a/tests/test_ConnectivityDispatcher.cpp b/tests/test_ConnectivityDispatcher.cpp index 09ec9982e10e08d84c808f157fe4e11add3d756a..7cc747588e9004a410f2a44453374eb81d499b8a 100644 --- a/tests/test_ConnectivityDispatcher.cpp +++ b/tests/test_ConnectivityDispatcher.cpp @@ -3,6 +3,7 @@ #include <mesh/CartesianMeshBuilder.hpp> #include <mesh/Connectivity.hpp> +#include <mesh/ConnectivityDispatcher.hpp> #include <mesh/GmshReader.hpp> #include <mesh/Mesh.hpp> #include <mesh/MeshVariant.hpp> @@ -125,6 +126,14 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") } } + constexpr bool has_partitioner = []() { +#if defined(PUGS_HAS_PARMETIS) || defined(PUGS_HAS_PTSCOTCH) + return true; +#else + return false; +#endif + }(); + for (size_t nb_ghost_layers = 2; nb_ghost_layers < 5; ++nb_ghost_layers) { std::stringstream os; os << nb_ghost_layers << " layer meshes"; @@ -143,6 +152,11 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") CartesianMeshBuilder{TinyVector<1>{-1}, TinyVector<1>{3}, TinyVector<1, size_t>{23}}.mesh(); const std::shared_ptr p_mesh = cartesian_1d_mesh->get<const Mesh<1>>(); check_number_of_ghost_layers(p_mesh->connectivity(), nb_ghost_layers); + + if (has_partitioner) { + ConnectivityDispatcher cd{p_mesh->connectivity()}; + check_number_of_ghost_layers(*cd.dispatchedConnectivity(), nb_ghost_layers); + } } SECTION("Cartesian 2D mesh") @@ -151,6 +165,11 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") CartesianMeshBuilder{TinyVector<2>{0, -1}, TinyVector<2>{3, 2}, TinyVector<2, size_t>{6, 7}}.mesh(); const std::shared_ptr p_mesh = cartesian_2d_mesh->get<const Mesh<2>>(); check_number_of_ghost_layers(p_mesh->connectivity(), nb_ghost_layers); + + if (has_partitioner) { + ConnectivityDispatcher cd{p_mesh->connectivity()}; + check_number_of_ghost_layers(*cd.dispatchedConnectivity(), nb_ghost_layers); + } } SECTION("Cartesian 3D mesh") @@ -159,6 +178,11 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") CartesianMeshBuilder{TinyVector<3>{0, 1, 0}, TinyVector<3>{2, -1, 3}, TinyVector<3, size_t>{6, 7, 4}}.mesh(); const std::shared_ptr p_mesh = cartesian_3d_mesh->get<const Mesh<3>>(); check_number_of_ghost_layers(p_mesh->connectivity(), nb_ghost_layers); + + if (has_partitioner) { + ConnectivityDispatcher cd{p_mesh->connectivity()}; + check_number_of_ghost_layers(*cd.dispatchedConnectivity(), nb_ghost_layers); + } } SECTION("unordered 1d mesh") @@ -169,6 +193,11 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") const std::shared_ptr p_mesh = mesh_v->get<const Mesh<1>>(); check_number_of_ghost_layers(p_mesh->connectivity(), nb_ghost_layers); + + if (has_partitioner) { + ConnectivityDispatcher cd{p_mesh->connectivity()}; + check_number_of_ghost_layers(*cd.dispatchedConnectivity(), nb_ghost_layers); + } } SECTION("hybrid 2d mesh") @@ -179,6 +208,11 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") const std::shared_ptr p_mesh = mesh_v->get<const Mesh<2>>(); check_number_of_ghost_layers(p_mesh->connectivity(), nb_ghost_layers); + + if (has_partitioner) { + ConnectivityDispatcher cd{p_mesh->connectivity()}; + check_number_of_ghost_layers(*cd.dispatchedConnectivity(), nb_ghost_layers); + } } SECTION("hybrid 3d mesh") @@ -189,6 +223,11 @@ TEST_CASE("ConnectivityDispatcher", "[mesh]") const std::shared_ptr p_mesh = mesh_v->get<const Mesh<3>>(); check_number_of_ghost_layers(p_mesh->connectivity(), nb_ghost_layers); + + if (has_partitioner) { + ConnectivityDispatcher cd{p_mesh->connectivity()}; + check_number_of_ghost_layers(*cd.dispatchedConnectivity(), nb_ghost_layers); + } } }