diff --git a/cpp/dolfinx/multigrid/inclusion.h b/cpp/dolfinx/multigrid/inclusion.h index 0325ee26a7..ca7867bfcf 100644 --- a/cpp/dolfinx/multigrid/inclusion.h +++ b/cpp/dolfinx/multigrid/inclusion.h @@ -59,7 +59,7 @@ inclusion_mapping(const dolfinx::mesh::Mesh& mesh_from, { std::ranges::subrange vertex_from(std::next(x_from.begin(), 3 * i), std::next(x_from.begin(), 3 * (i + 1))); - for (std::int64_t j = 0; j < im_to.size_local() + im_to.num_ghosts(); j++) + for (std::int64_t j = 0; j < im_to.size_local(); j++) // + im_to.num_ghosts() TODO { std::ranges::subrange vertex_to(std::next(x_to.begin(), 3 * j), std::next(x_to.begin(), 3 * (j + 1))); diff --git a/cpp/test/multigrid/inclusion.cpp b/cpp/test/multigrid/inclusion.cpp index 55665bd900..fd7e767a22 100644 --- a/cpp/test/multigrid/inclusion.cpp +++ b/cpp/test/multigrid/inclusion.cpp @@ -62,6 +62,11 @@ void CHECK_inclusion_map(const dolfinx::mesh::Mesh& from, if (local[0] == -1) continue; + std::cout << "(" << from.geometry().x()[3 * local[0]] << ", " + << from.geometry().x()[3 * local[0] + 1] << ", " + << from.geometry().x()[3 * local[0] + 2] << ") == (" + << global_x_to[3 * map[i]] << ", " << global_x_to[3 * map[i] + 1] + << ", " << global_x_to[3 * map[i] + 2] << ")" << std::endl; CHECK(std::abs(from.geometry().x()[3 * local[0]] - global_x_to[3 * map[i]]) < std::numeric_limits::epsilon()); CHECK(std::abs(from.geometry().x()[3 * local[0] + 1] @@ -74,7 +79,7 @@ void CHECK_inclusion_map(const dolfinx::mesh::Mesh& from, } /// Performs one uniform refinement and checks the inclusion map between coarse -/// and fine mesh against the (provided) list. +/// and fine mesh. template void TEST_inclusion(dolfinx::mesh::Mesh&& mesh_coarse) { @@ -101,15 +106,14 @@ TEMPLATE_TEST_CASE("Inclusion (triangle)", "[multigrid][inclusion]", double, float) { TEST_inclusion(dolfinx::mesh::create_rectangle( - MPI_COMM_WORLD, {{{0, 0}, {1, 1}}}, {1, 1}, mesh::CellType::triangle)); + MPI_COMM_WORLD, {{{0, 0}, {1, 1}}}, {2, 2}, mesh::CellType::triangle)); } -// TODO: fix! -// TEMPLATE_TEST_CASE("Inclusion (tetrahedron)", "[multigrid][inclusion]", -// double, -// float) -// { -// TEST_inclusion(dolfinx::mesh::create_box( -// MPI_COMM_WORLD, {{{0, 0, 0}, {1, 1, 1}}}, {1, 1, 1}, -// mesh::CellType::tetrahedron)); -// } +TEMPLATE_TEST_CASE("Inclusion (tetrahedron)", "[multigrid][inclusion]", double, + float) +{ + // TODO: n = {2, 2, 2} fails + TEST_inclusion(dolfinx::mesh::create_box( + MPI_COMM_WORLD, {{{0, 0, 0}, {1, 1, 1}}}, {1, 1, 1}, + mesh::CellType::tetrahedron)); +}