From: Peter Munch Date: Sat, 16 Jan 2021 08:16:28 +0000 (+0100) Subject: Triangulation::get_manifold(): asset that manifold has been attached X-Git-Tag: relicensing~263^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F11566%2Fhead;p=dealii.git Triangulation::get_manifold(): asset that manifold has been attached --- diff --git a/doc/news/changes/incompatibilities/20221209Munch b/doc/news/changes/incompatibilities/20221209Munch new file mode 100644 index 0000000000..cc2c8f4394 --- /dev/null +++ b/doc/news/changes/incompatibilities/20221209Munch @@ -0,0 +1,8 @@ +Changed: When calling Triangulation::get_manifold(manifold_id) for +a non-existing manifold_id, the function returned a flat manifold. +This behaviour has been changed and an assert is thrown in this case. +Furthermore, the functions Triangulation::reset_manifold() and +Triangulation::reset_all_manifolds() do not actually remove the manifolds +but make them flat. +
+(Peter Munch, 2022/12/09) diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index b5d1fe8191..1183900c22 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -1893,6 +1893,10 @@ public: * assignment of a different Manifold object by the function * Triangulation::set_manifold(). * + * @note Geometric objects with the manifold ID @p manifold_number will + * still have the same ID after calling this function so that the function + * get_manifold_ids() will still return the same set of IDs. + * * @ingroup manifold * * @see @@ -1907,6 +1911,11 @@ public: * of all Manifold objects by the function * Triangulation::set_manifold(). * + * @note Geometric objects not having numbers::flat_manifold_id as manifold ID + * will after calling this function still have the same IDs. Their IDs are + * not replaced by numbers::flat_manifold_id so that the function + * get_manifold_ids() will still return the same set of IDs. + * * @ingroup manifold * * @see diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index d02d13c3bf..1dadc41314 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -2109,6 +2109,8 @@ namespace GridGenerator tria.set_manifold(2, CylindricalManifold<3>(Tensor<1, 3>({0., 1., 0.}), Point<3>())); + + tria.set_manifold(0, FlatManifold<3>()); TransfiniteInterpolationManifold<3> transfinite; transfinite.initialize(tria); tria.set_manifold(0, transfinite); @@ -3492,6 +3494,7 @@ namespace GridGenerator PolarManifold<2> polar_manifold(new_center); tria.set_manifold(polar_manifold_id, polar_manifold); + tria.set_manifold(tfi_manifold_id, FlatManifold<2>()); TransfiniteInterpolationManifold<2> inner_manifold; inner_manifold.initialize(tria); tria.set_manifold(tfi_manifold_id, inner_manifold); @@ -3541,8 +3544,11 @@ namespace GridGenerator const CylindricalManifold<3> cylindrical_manifold( direction, /*axial_point*/ new_center); + tria.set_manifold(polar_manifold_id, FlatManifold<3>()); + tria.set_manifold(tfi_manifold_id, FlatManifold<3>()); TransfiniteInterpolationManifold<3> inner_manifold; inner_manifold.initialize(tria); + tria.set_manifold(polar_manifold_id, cylindrical_manifold); tria.set_manifold(tfi_manifold_id, inner_manifold); } @@ -3748,6 +3754,8 @@ namespace GridGenerator // attach manifolds PolarManifold<2> polar_manifold(Point<2>(0.2, 0.2)); tria.set_manifold(polar_manifold_id, polar_manifold); + + tria.set_manifold(tfi_manifold_id, FlatManifold<2>()); TransfiniteInterpolationManifold<2> inner_manifold; inner_manifold.initialize(tria); tria.set_manifold(tfi_manifold_id, inner_manifold); @@ -3802,6 +3810,8 @@ namespace GridGenerator const Point<3> axial_point(m_ptr->center[0], m_ptr->center[1], 0.0); const Tensor<1, 3> direction{{0.0, 0.0, 1.0}}; + tria.set_manifold(cylindrical_manifold_id, FlatManifold<3>()); + tria.set_manifold(tfi_manifold_id, FlatManifold<3>()); const CylindricalManifold<3> cylindrical_manifold(direction, axial_point); TransfiniteInterpolationManifold<3> inner_manifold; inner_manifold.initialize(tria); @@ -4327,6 +4337,8 @@ namespace GridGenerator tria.set_manifold(0, SphericalManifold<2>(p)); if (internal_manifolds) tria.set_manifold(1, SphericalManifold<2>(p)); + else + tria.set_manifold(1, FlatManifold<2>()); } @@ -4443,6 +4455,9 @@ namespace GridGenerator SphericalManifold inner_manifold(inner_center); SphericalManifold outer_manifold(outer_center); + tria.set_manifold(0, FlatManifold()); + tria.set_manifold(1, FlatManifold()); + tria.set_manifold(2, FlatManifold()); TransfiniteInterpolationManifold transfinite; transfinite.initialize(tria); @@ -5103,6 +5118,8 @@ namespace GridGenerator tria.set_manifold(0, SphericalManifold<3>(p)); if (internal_manifold) tria.set_manifold(1, SphericalManifold<3>(p)); + else + tria.set_manifold(1, FlatManifold<3>()); } @@ -5915,6 +5932,8 @@ namespace GridGenerator cell->set_all_manifold_ids(numbers::flat_manifold_id); GridTools::shift(p, tria); + tria.set_manifold(1, FlatManifold()); + tria.set_all_manifold_ids_on_boundary(0); tria.set_manifold(0, SphericalManifold(p)); } @@ -7798,6 +7817,10 @@ namespace GridGenerator } out_tria.create_triangulation(v, cells, subcelldata); + + for (const auto i : out_tria.get_manifold_ids()) + if (i != numbers::flat_manifold_id) + out_tria.set_manifold(i, FlatManifold()); } @@ -8207,7 +8230,12 @@ namespace GridGenerator } } + out_tria.clear(); out_tria.create_triangulation(vertices, cells, subcell_data); + + for (const auto i : out_tria.get_manifold_ids()) + if (i != numbers::flat_manifold_id) + out_tria.set_manifold(i, FlatManifold()); } @@ -8508,6 +8536,17 @@ namespace GridGenerator surface_to_volume_mapping[temporary_map_boundary_cell_face[i].first] = temporary_map_boundary_cell_face[i].second.first; + // TODO: we attach flat manifolds here; one should attach submanifolds here + const auto attached_mids = + surface_mesh.get_triangulation().get_manifold_ids(); + for (const auto i : volume_mesh.get_triangulation().get_manifold_ids()) + if (i != numbers::flat_manifold_id && + std::find(attached_mids.begin(), attached_mids.end(), i) == + attached_mids.end()) + const_cast &>( + surface_mesh.get_triangulation()) + .set_manifold(i, FlatManifold()); + return surface_to_volume_mapping; } diff --git a/source/grid/grid_generator_pipe_junction.cc b/source/grid/grid_generator_pipe_junction.cc index 5108cfcda2..f5ba8d62c9 100644 --- a/source/grid/grid_generator_pipe_junction.cc +++ b/source/grid/grid_generator_pipe_junction.cc @@ -614,6 +614,7 @@ namespace GridGenerator for (unsigned int p = 0; p < n_pipes; ++p) tria.set_manifold(p, manifolds[p]); + tria.set_manifold(n_pipes, FlatManifold<3>()); // Since GridGenerator::merge_triangulations() does not copy boundary IDs // either, we need to set them after the final geometry is created. Luckily, diff --git a/source/grid/tria.cc b/source/grid/tria.cc index f8914c93c7..de285dca22 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -12294,7 +12294,10 @@ void Triangulation::reset_manifold( AssertIndexRange(m_number, numbers::flat_manifold_id); // delete the entry located at number. - manifolds.erase(m_number); + manifolds[m_number] = + internal::TriangulationImplementation::get_default_flat_manifold() + .clone(); } @@ -12302,7 +12305,10 @@ template DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) void Triangulation::reset_all_manifolds() { - manifolds.clear(); + for (auto &m : manifolds) + m.second = internal::TriangulationImplementation:: + get_default_flat_manifold() + .clone(); } @@ -12384,6 +12390,11 @@ DEAL_II_CXX20_REQUIRES((concepts::is_valid_dim_spacedim)) const Manifold &Triangulation::get_manifold( const types::manifold_id m_number) const { + // check if flat manifold has been queried + if (m_number == numbers::flat_manifold_id) + return internal::TriangulationImplementation:: + get_default_flat_manifold(); + // look, if there is a manifold stored at // manifold_id number. const auto it = manifolds.find(m_number); @@ -12394,10 +12405,15 @@ const Manifold &Triangulation::get_manifold( return *(it->second); } - // if we have not found an entry connected with number, we return - // the default (flat) manifold + Assert( + false, + ExcMessage( + "No manifold of the manifold id " + std::to_string(m_number) + + " has been attached to the triangulation. " + "Please attach the right manifold with Triangulation::set_manifold().")); + return internal::TriangulationImplementation:: - get_default_flat_manifold(); + get_default_flat_manifold(); // never reached } diff --git a/tests/codim_one/boundary_indicator_01.cc b/tests/codim_one/boundary_indicator_01.cc index a898a62e3a..0624ba8133 100644 --- a/tests/codim_one/boundary_indicator_01.cc +++ b/tests/codim_one/boundary_indicator_01.cc @@ -92,6 +92,7 @@ main() GridGenerator::extract_boundary_mesh(volume_mesh, boundary_mesh, boundary_ids); + boundary_mesh.set_manifold(1, FlatManifold()); deallog << volume_mesh.n_active_cells() << std::endl; deallog << boundary_mesh.n_active_cells() << std::endl; diff --git a/tests/codim_one/extract_boundary_mesh_01.cc b/tests/codim_one/extract_boundary_mesh_01.cc index 38a65ef1a0..18479f5a23 100644 --- a/tests/codim_one/extract_boundary_mesh_01.cc +++ b/tests/codim_one/extract_boundary_mesh_01.cc @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -116,6 +117,10 @@ main() Triangulation boundary_mesh; + for (const auto bid : volume_mesh.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + boundary_mesh.set_manifold(bid, FlatManifold<2, 3>()); + surface_to_volume_mapping = GridGenerator::extract_boundary_mesh(volume_mesh, boundary_mesh); diff --git a/tests/codim_one/extract_boundary_mesh_08.cc b/tests/codim_one/extract_boundary_mesh_08.cc index ba3dfc76f0..6039a5e653 100644 --- a/tests/codim_one/extract_boundary_mesh_08.cc +++ b/tests/codim_one/extract_boundary_mesh_08.cc @@ -18,6 +18,7 @@ #include #include +#include #include #include "../tests.h" @@ -35,6 +36,11 @@ test() GridOut().write_gnuplot(triangulation, deallog.get_file_stream()); Triangulation triangulation_surface; + + for (const auto bid : triangulation.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + triangulation_surface.set_manifold(bid, FlatManifold<2, 3>()); + GridGenerator::extract_boundary_mesh(triangulation, triangulation_surface); triangulation_surface.refine_global(2); diff --git a/tests/codim_one/extract_boundary_mesh_11.cc b/tests/codim_one/extract_boundary_mesh_11.cc index 7ac14e48b1..bd4df02b41 100644 --- a/tests/codim_one/extract_boundary_mesh_11.cc +++ b/tests/codim_one/extract_boundary_mesh_11.cc @@ -59,6 +59,10 @@ test() // now extract the surface mesh Triangulation triangulation_surface; + for (const auto bid : triangulation.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + triangulation_surface.set_manifold(bid, FlatManifold<2, 3>()); + static const CylindricalManifold surface_cyl(0); triangulation_surface.set_manifold(0, surface_cyl); diff --git a/tests/codim_one/extract_boundary_mesh_12.cc b/tests/codim_one/extract_boundary_mesh_12.cc index 4c8efbe9c9..cde714fa3f 100644 --- a/tests/codim_one/extract_boundary_mesh_12.cc +++ b/tests/codim_one/extract_boundary_mesh_12.cc @@ -44,6 +44,10 @@ test() // now extract the surface mesh Triangulation triangulation_surface; + for (const auto bid : triangulation.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + triangulation_surface.set_manifold(bid, FlatManifold<2, 3>()); + static const CylindricalManifold surface_cyl(0); triangulation_surface.set_manifold(0, surface_cyl); diff --git a/tests/codim_one/extract_boundary_mesh_13.cc b/tests/codim_one/extract_boundary_mesh_13.cc index 84e66c166a..c3a6ca4659 100644 --- a/tests/codim_one/extract_boundary_mesh_13.cc +++ b/tests/codim_one/extract_boundary_mesh_13.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include @@ -53,6 +54,10 @@ test() cell->face(f)->set_manifold_id(cell->face(f)->boundary_id()); } + for (const auto bid : triangulation.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + triangulation.set_manifold(bid, FlatManifold<3>()); + static const CylindricalManifold outer_cylinder(0); triangulation.set_manifold(0, outer_cylinder); @@ -63,6 +68,10 @@ test() // now extract the surface mesh Triangulation triangulation_surface; + for (const auto bid : triangulation.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + triangulation_surface.set_manifold(bid, FlatManifold<2, 3>()); + static const CylindricalManifold surface_cyl(0); triangulation_surface.set_manifold(0, surface_cyl); diff --git a/tests/fe/cell_similarity_08.cc b/tests/fe/cell_similarity_08.cc index cdab926c1e..f0e17bfc3d 100644 --- a/tests/fe/cell_similarity_08.cc +++ b/tests/fe/cell_similarity_08.cc @@ -155,6 +155,9 @@ test() GridGenerator::subdivided_hyper_rectangle(tr, subdivisions, p1, p2); GridTools::copy_boundary_to_manifold_id(tr); + for (const auto bid : tr.get_boundary_ids()) + tr.set_manifold(bid, FlatManifold()); + static const SphericalManifold boundary(tr.begin_active()->center()); tr.set_manifold(1, boundary); diff --git a/tests/grid/extrude_copy_manifold.cc b/tests/grid/extrude_copy_manifold.cc index 3c171519cb..eeaa626640 100644 --- a/tests/grid/extrude_copy_manifold.cc +++ b/tests/grid/extrude_copy_manifold.cc @@ -19,6 +19,7 @@ #include #include +#include #include #include @@ -47,6 +48,8 @@ test() Triangulation<3> triangulation_3; GridGenerator::extrude_triangulation( triangulation_2, 3, 1.0, triangulation_3, true); + triangulation_3.set_manifold(0, FlatManifold<3>()); + triangulation_3.set_manifold(1, FlatManifold<3>()); TransfiniteInterpolationManifold<3> tfi_manifold; tfi_manifold.initialize(triangulation_3); CylindricalManifold<3> cylinder_manifold(2); diff --git a/tests/grid/get_coarse_mesh_description_01.cc b/tests/grid/get_coarse_mesh_description_01.cc index 6fe909fb6f..41cd70f69e 100644 --- a/tests/grid/get_coarse_mesh_description_01.cc +++ b/tests/grid/get_coarse_mesh_description_01.cc @@ -18,6 +18,7 @@ #include #include #include +#include #include #include "../tests.h" @@ -34,10 +35,17 @@ setup_tria(Triangulation<1> &tria) static_cast(10.0 * (3.0 + cell->center()[0]))); for (auto face : tria.active_face_iterators()) if (0.5 < face->center()[0]) - face->set_all_manifold_ids(42); + { + face->set_all_manifold_ids(42); + tria.set_manifold(42, FlatManifold<1>()); + } for (auto &cell : tria.active_cell_iterators()) - cell->set_manifold_id( - static_cast(10.0 * (2.0 + cell->center()[0]))); + { + const auto bid = + static_cast(10.0 * (2.0 + cell->center()[0])); + cell->set_manifold_id(bid); + tria.set_manifold(bid, FlatManifold<1>()); + } } @@ -63,13 +71,19 @@ setup_tria(Triangulation &tria) // detail that unassigned manifolds are flat. for (auto face : tria.active_face_iterators()) if (-0.1 < face->center()[0]) - face->set_all_manifold_ids(42); + { + face->set_all_manifold_ids(42); + tria.set_manifold(42, FlatManifold()); + } for (auto &cell : tria.active_cell_iterators()) if (cell->center() != Point()) { const double angle = std::atan2(cell->center()[0], cell->center()[1]); - cell->set_manifold_id( - static_cast(361 - angle * 180.0 / numbers::PI)); + + const auto bid = + static_cast(361 - angle * 180.0 / numbers::PI); + cell->set_manifold_id(bid); + tria.set_manifold(bid, FlatManifold()); } } @@ -93,6 +107,10 @@ test() tria_2.create_triangulation(vertices, cells, subcell_data); Assert(GridTools::have_same_coarse_mesh(tria, tria_2), ExcInternalError()); + for (const auto bid : tria_2.get_manifold_ids()) + if (bid != numbers::flat_manifold_id) + tria_2.set_manifold(bid, FlatManifold()); + GridOut grid_out; deallog << "Original Triangulation:" << std::endl; grid_out.write_vtk(tria, deallog.get_file_stream()); diff --git a/tests/grid/grid_hyper_shell.cc b/tests/grid/grid_hyper_shell.cc index 17ce245e1a..81d7b0a3ac 100644 --- a/tests/grid/grid_hyper_shell.cc +++ b/tests/grid/grid_hyper_shell.cc @@ -47,6 +47,10 @@ check(double r1, double r2, unsigned int n) tria.reset_manifold(0); tria.set_all_manifold_ids(numbers::flat_manifold_id); GridTools::copy_boundary_to_manifold_id(tria); + + for (const auto bid : tria.get_boundary_ids()) + tria.set_manifold(bid, FlatManifold()); + if (dim == 3) for (typename Triangulation::active_cell_iterator c = tria.begin_active(); diff --git a/tests/grid/grid_tools_regularize_02.cc b/tests/grid/grid_tools_regularize_02.cc index c74ae29d0a..632356139a 100644 --- a/tests/grid/grid_tools_regularize_02.cc +++ b/tests/grid/grid_tools_regularize_02.cc @@ -42,6 +42,9 @@ main() GridTools::copy_boundary_to_manifold_id(tria); + for (const auto bid : tria.get_boundary_ids()) + tria.set_manifold(bid, FlatManifold<2>()); + tria.set_manifold(0, m0); tria.set_manifold(1, m1); diff --git a/tests/grid/merge_triangulations_04.cc b/tests/grid/merge_triangulations_04.cc index f133bfa488..59be64f491 100644 --- a/tests/grid/merge_triangulations_04.cc +++ b/tests/grid/merge_triangulations_04.cc @@ -115,6 +115,7 @@ main() PolarManifold<2> polar_manifold(Point<2>(0.2, 0.2)); result_2.set_manifold(polar_id, polar_manifold); + result_2.set_manifold(tfi_id, FlatManifold<2>()); TransfiniteInterpolationManifold<2> inner_manifold; inner_manifold.initialize(result_2); result_2.set_manifold(tfi_id, inner_manifold); diff --git a/tests/grid/move_constructor.cc b/tests/grid/move_constructor.cc index 82f0f3f1b8..23e2ad920d 100644 --- a/tests/grid/move_constructor.cc +++ b/tests/grid/move_constructor.cc @@ -28,8 +28,14 @@ template void print_tria_info(const Triangulation &tria) { + const std::vector bids = + tria.n_active_cells() == 0 ? std::vector() : + tria.get_manifold_ids(); + const bool manifold_0_is_flat = + (std::find(bids.begin(), bids.end(), 0) == bids.end()) || dynamic_cast *>(&tria.get_manifold(0)) != nullptr; + deallog << (tria.n_active_cells() != 0) << ", " << (tria.n_active_hexs() != 0) << ", " << (tria.n_active_quads() != 0) << ", " << (tria.n_active_lines() != 0) << ", " << (tria.n_levels() != 0) diff --git a/tests/hp/distribute_dofs_linear_time.cc b/tests/hp/distribute_dofs_linear_time.cc index b85072fabd..7ebae4183b 100644 --- a/tests/hp/distribute_dofs_linear_time.cc +++ b/tests/hp/distribute_dofs_linear_time.cc @@ -72,6 +72,7 @@ ladutenko_circle(Triangulation &triangulation, GridGenerator::hyper_ball(triangulation, center, radius); triangulation.set_all_manifold_ids(circular_manifold_id); triangulation.set_manifold(circular_manifold_id, *boundary); + triangulation.set_manifold(straight_manifold_id, FlatManifold()); const double core_radius = 1.0 / 4.8 * radius; const double inner_radius = 1.0 / 2.4 * radius; diff --git a/tests/manifold/manifold_id_02.cc b/tests/manifold/manifold_id_02.cc index b155dd3b2d..d89b979cd5 100644 --- a/tests/manifold/manifold_id_02.cc +++ b/tests/manifold/manifold_id_02.cc @@ -48,6 +48,8 @@ test(unsigned int ref = 1) typename Triangulation::active_cell_iterator cell; tria.begin_active()->set_all_manifold_ids(1); + tria.set_manifold(1, FlatManifold()); + tria.refine_global(ref); for (cell = tria.begin_active(); cell != tria.end(); ++cell) diff --git a/tests/manifold/manifold_id_03.cc b/tests/manifold/manifold_id_03.cc index dcc9fed3c6..51ff52050a 100644 --- a/tests/manifold/manifold_id_03.cc +++ b/tests/manifold/manifold_id_03.cc @@ -44,6 +44,7 @@ test(unsigned int ref = 1) tria.begin_active()->set_manifold_id(1); + tria.set_manifold(1, FlatManifold()); tria.refine_global(1); diff --git a/tests/manifold/manifold_id_04.cc b/tests/manifold/manifold_id_04.cc index c151f1622c..49e8612f3b 100644 --- a/tests/manifold/manifold_id_04.cc +++ b/tests/manifold/manifold_id_04.cc @@ -45,6 +45,10 @@ test(unsigned int ref = 1) for (const unsigned int f : GeometryInfo::face_indices()) tria.begin_active()->face(f)->set_manifold_id(2); + tria.set_manifold(1, FlatManifold()); + tria.set_manifold(2, FlatManifold()); + tria.set_manifold(3, FlatManifold()); + tria.refine_global(1); for (cell = tria.begin_active(); cell != tria.end(); ++cell) diff --git a/tests/manifold/manifold_id_08.cc b/tests/manifold/manifold_id_08.cc index 6b300feebc..83ac2c6b84 100644 --- a/tests/manifold/manifold_id_08.cc +++ b/tests/manifold/manifold_id_08.cc @@ -16,6 +16,7 @@ // Make sure that Triangulation::get_manifold_ids() work correctly #include +#include #include #include "../tests.h" @@ -37,6 +38,10 @@ test(unsigned int ref = 1) tria.begin_active()->line(0)->set_manifold_id(3); + tria.set_manifold(1, FlatManifold()); + tria.set_manifold(2, FlatManifold()); + tria.set_manifold(3, FlatManifold()); + tria.refine_global(ref); for (cell = tria.begin_active(); cell != tria.end(); ++cell) diff --git a/tests/manifold/polar_manifold_04.cc b/tests/manifold/polar_manifold_04.cc index 39a94b77e0..49df373e1b 100644 --- a/tests/manifold/polar_manifold_04.cc +++ b/tests/manifold/polar_manifold_04.cc @@ -53,6 +53,7 @@ test(unsigned int ref = 1) cell->set_all_manifold_ids(0); } + tria.set_manifold(0, FlatManifold()); tria.set_manifold(1, manifold); tria.refine_global(2); diff --git a/tests/mappings/mapping_q_mixed_manifolds_02.cc b/tests/mappings/mapping_q_mixed_manifolds_02.cc index 9a1d3029a9..080084e712 100644 --- a/tests/mappings/mapping_q_mixed_manifolds_02.cc +++ b/tests/mappings/mapping_q_mixed_manifolds_02.cc @@ -164,6 +164,7 @@ create_triangulation(Triangulation<2> &tria) if (Point<2>(X_C, Y_C).distance(cell->center()) <= R_2) cell->set_all_manifold_ids(MANIFOLD_ID); } + tria.set_manifold(MANIFOLD_ID, FlatManifold<2>()); } void @@ -182,6 +183,8 @@ create_triangulation(Triangulation<3> &tria) if (Point<3>(X_C, Y_C, cell->center()[2]).distance(cell->center()) <= R_2) cell->set_all_manifold_ids(MANIFOLD_ID); } + tria.set_manifold(0, FlatManifold<3>()); + tria.set_manifold(MANIFOLD_ID, FlatManifold<3>()); } template diff --git a/tests/mpi/periodicity_02.cc b/tests/mpi/periodicity_02.cc index 72225a23ce..f07e865ca7 100644 --- a/tests/mpi/periodicity_02.cc +++ b/tests/mpi/periodicity_02.cc @@ -35,6 +35,7 @@ #include #include +#include #include #include @@ -760,6 +761,9 @@ namespace Step22 triangulation.set_all_manifold_ids(numbers::flat_manifold_id); GridTools::copy_boundary_to_manifold_id(triangulation); + for (const auto bid : triangulation.get_boundary_ids()) + triangulation.set_manifold(bid, FlatManifold()); + #ifdef PERIODIC std::vector::cell_iterator>> diff --git a/tests/numerics/no_flux_10.cc b/tests/numerics/no_flux_10.cc index f75ecd8ab6..8dbac5e982 100644 --- a/tests/numerics/no_flux_10.cc +++ b/tests/numerics/no_flux_10.cc @@ -42,6 +42,7 @@ #include #include #include +#include #include #include @@ -207,6 +208,9 @@ run() sixty_deg_hyper_shell(triangulation, Point(), 0.5, 1.0); GridTools::copy_boundary_to_manifold_id(triangulation); + for (unsigned int d = 0; d < 2 * dim; ++d) + triangulation.set_manifold(d, FlatManifold()); + static SphericalManifold boundary((Point())); triangulation.set_manifold(0, boundary); diff --git a/tests/opencascade/circle_normal_projection.cc b/tests/opencascade/circle_normal_projection.cc index aa508f3b9b..af4ae58fac 100644 --- a/tests/opencascade/circle_normal_projection.cc +++ b/tests/opencascade/circle_normal_projection.cc @@ -79,6 +79,7 @@ main() // points created in the interior // of the face. tria.begin()->set_manifold_id(1); + tria.set_manifold(1, FlatManifold<2, 3>()); // We refine twice, and expect the // outer points to end up on the diff --git a/tests/opencascade/interpolation_curve_boundary.cc b/tests/opencascade/interpolation_curve_boundary.cc index 19bcbab15e..f874e8edda 100644 --- a/tests/opencascade/interpolation_curve_boundary.cc +++ b/tests/opencascade/interpolation_curve_boundary.cc @@ -68,6 +68,7 @@ main() // This is here to ignore the points created in the interior of the // face. tria.begin()->set_manifold_id(1); + tria.set_manifold(1, FlatManifold<2, 3>()); // We refine twice, and expect the outer points to end up on a // smooth curve interpolating the square vertices. diff --git a/tests/opencascade/interpolation_curve_boundary_02.cc b/tests/opencascade/interpolation_curve_boundary_02.cc index 32929253bb..7f52ac5e87 100644 --- a/tests/opencascade/interpolation_curve_boundary_02.cc +++ b/tests/opencascade/interpolation_curve_boundary_02.cc @@ -69,6 +69,7 @@ main() // This is here to ignore the points created in the interior of the // face. tria.begin()->set_manifold_id(1); + tria.set_manifold(1, FlatManifold<2, 3>()); // We refine twice, and expect the outer points to end up on a // smooth curve interpolating the square vertices. diff --git a/tests/opencascade/normal_projection_01.cc b/tests/opencascade/normal_projection_01.cc index 4957d2f2ec..6eddae9ba5 100644 --- a/tests/opencascade/normal_projection_01.cc +++ b/tests/opencascade/normal_projection_01.cc @@ -69,6 +69,7 @@ main() // of the face. tria.begin()->set_all_manifold_ids(1); tria.begin()->set_manifold_id(0); + tria.set_manifold(0, FlatManifold<3>()); tria.refine_global(2); diff --git a/tests/simplex/mapping_transformations_01.cc b/tests/simplex/mapping_transformations_01.cc index c0719dae99..6e080c6f8a 100644 --- a/tests/simplex/mapping_transformations_01.cc +++ b/tests/simplex/mapping_transformations_01.cc @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -47,6 +48,7 @@ make_grid(Triangulation<2> &triangulation) GridGenerator::convert_hypercube_to_simplex_mesh(triangulation_temp, triangulation); + triangulation.set_manifold(0, FlatManifold<2>()); } int diff --git a/tests/simplex/step-02.cc b/tests/simplex/step-02.cc index 526f6230eb..e6073281f4 100644 --- a/tests/simplex/step-02.cc +++ b/tests/simplex/step-02.cc @@ -57,6 +57,9 @@ make_grid(Triangulation<2> &triangulation) GridGenerator::convert_hypercube_to_simplex_mesh(triangulation_temp, triangulation); + for (const auto i : triangulation_temp.get_manifold_ids()) + if (i != numbers::flat_manifold_id) + triangulation.set_manifold(i, triangulation_temp.get_manifold(i)); triangulation.refine_global(); // WARNING: no local refinement is performed } diff --git a/tests/simplex/step-68.cc b/tests/simplex/step-68.cc index 5b65bfeb57..71853c3b4b 100644 --- a/tests/simplex/step-68.cc +++ b/tests/simplex/step-68.cc @@ -234,6 +234,7 @@ namespace Step68 GridGenerator::convert_hypercube_to_simplex_mesh( temporary_quad_particle_triangulation, temporary_tri_particle_triangulation); + temporary_tri_particle_triangulation.set_manifold(0, FlatManifold()); // extract relevant information from distributed triangulation @@ -246,6 +247,7 @@ namespace Step68 parallel::fullydistributed::Triangulation particle_triangulation( mpi_communicator); particle_triangulation.create_triangulation(particle_construction_data); + particle_triangulation.set_manifold(0, FlatManifold()); // We generate the necessary bounding boxes for the particles generator. // These bounding boxes are required to quickly identify in which