From efeb71bab574565197730c762f742d45b39dc67f Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Sat, 4 Aug 2018 18:51:51 +0200 Subject: [PATCH] Replace invalid_manifold_id by flat_manifold_id --- doc/doxygen/headers/glossary.h | 2 +- examples/step-1/step-1.cc | 2 +- include/deal.II/base/types.h | 3 +++ include/deal.II/grid/grid_tools.h | 4 ++-- include/deal.II/grid/tria.h | 4 ++-- include/deal.II/grid/tria_accessor.h | 2 +- include/deal.II/grid/tria_accessor.templates.h | 4 ++-- include/deal.II/grid/tria_objects.h | 2 +- source/fe/mapping_q_generic.cc | 4 ++-- source/grid/grid_tools.cc | 6 +++--- source/grid/manifold_lib.cc | 10 +++++----- source/grid/tria.cc | 12 ++++++------ tests/fail/arclength_boundary_02.cc | 2 +- tests/mpi/fe_field_function_02.cc | 2 +- 14 files changed, 31 insertions(+), 28 deletions(-) diff --git a/doc/doxygen/headers/glossary.h b/doc/doxygen/headers/glossary.h index 3a4d72740a..a9fb7e8eec 100644 --- a/doc/doxygen/headers/glossary.h +++ b/doc/doxygen/headers/glossary.h @@ -1188,7 +1188,7 @@ * is responsible to generate new points when the mesh is refined. * * By default, all manifold indicators of a mesh are set to - * numbers::invalid_manifold_id. A typical piece of code that sets the + * numbers::flat_manifold_id. A typical piece of code that sets the * manifold indicator on a object to something else would look like * this, here setting the manifold indicator to 42 for all cells whose * center has an $x$ component less than zero: diff --git a/examples/step-1/step-1.cc b/examples/step-1/step-1.cc index dbf94ccb07..3c29516d88 100644 --- a/examples/step-1/step-1.cc +++ b/examples/step-1/step-1.cc @@ -124,7 +124,7 @@ void second_grid() // By default (i.e., for a Triangulation created by hand or without a // call to a GridGenerator function like GridGenerator::hyper_shell or // GridGenerator::hyper_ball), all cells and faces of the Triangulation - // have their manifold_id set to numbers::invalid_manifold_id, which is + // have their manifold_id set to numbers::flat_manifold_id, which is // the default if you want a manifold that produces straight edges, but // you can change this number for individual cells and faces. In that // case, the curved manifold thus associated with number zero will not diff --git a/include/deal.II/base/types.h b/include/deal.II/base/types.h index f925945292..a6724db133 100644 --- a/include/deal.II/base/types.h +++ b/include/deal.II/base/types.h @@ -228,9 +228,12 @@ namespace numbers * We assume that all valid manifold_ids lie in the range [0, * invalid_manifold_id). * + * @deprecated Use flat_manifold_id instead. + * * @see * @ref GlossManifoldIndicator "Glossary entry on manifold indicators" */ + DEAL_II_DEPRECATED const types::manifold_id invalid_manifold_id = static_cast(-1); diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index f21a8ba5ff..0322381f38 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -2454,7 +2454,7 @@ namespace GridTools /** * Copy boundary ids to manifold ids on faces and edges at the boundary. The * default manifold_id for new Triangulation objects is - * numbers::invalid_manifold_id. This function copies the boundary_ids of + * numbers::flat_manifold_id. This function copies the boundary_ids of * the boundary faces and edges to the manifold_ids of the same faces and * edges, allowing the user to change the boundary_ids and use them for * boundary conditions regardless of the geometry, which will use @@ -2511,7 +2511,7 @@ namespace GridTools /** * Copy material ids to manifold ids. The default manifold_id for new - * Triangulation objects is numbers::invalid_manifold_id. When refinements + * Triangulation objects is numbers::flat_manifold_id. When refinements * occurs, the Triangulation asks where to locate new points to the * underlying manifold. * diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index bbba763462..91c7d3e284 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -186,7 +186,7 @@ struct CellData * * - vertex indices to invalid values * - boundary or material id zero (the default for boundary or material ids) - * - manifold id to numbers::invalid_manifold_id + * - manifold id to numbers::flat_manifold_id */ CellData(); }; @@ -3776,7 +3776,7 @@ inline CellData::CellData() material_id = 0; // And the manifold to be invalid - manifold_id = numbers::invalid_manifold_id; + manifold_id = numbers::flat_manifold_id; } diff --git a/include/deal.II/grid/tria_accessor.h b/include/deal.II/grid/tria_accessor.h index e609989151..40ee283c6e 100644 --- a/include/deal.II/grid/tria_accessor.h +++ b/include/deal.II/grid/tria_accessor.h @@ -623,7 +623,7 @@ public: has_children() const; /** - * Dummy function that always returns numbers::invalid_manifold_id. + * Dummy function that always returns numbers::flat_manifold_id. */ types::manifold_id manifold_id() const; diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index 768bae31e0..45898346c6 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -516,7 +516,7 @@ template types::manifold_id InvalidAccessor::manifold_id() const { - return numbers::invalid_manifold_id; + return numbers::flat_manifold_id; } @@ -2861,7 +2861,7 @@ TriaAccessor<0, 1, spacedim>::manifold_id() const tria->vertex_to_manifold_id_map_1d->end()) return (*tria->vertex_to_manifold_id_map_1d)[this->vertex_index()]; else - return numbers::invalid_manifold_id; + return numbers::flat_manifold_id; } diff --git a/include/deal.II/grid/tria_objects.h b/include/deal.II/grid/tria_objects.h index f9d003291e..0a70fb9c55 100644 --- a/include/deal.II/grid/tria_objects.h +++ b/include/deal.II/grid/tria_objects.h @@ -170,7 +170,7 @@ namespace internal /** * Store manifold ids. This field stores the manifold id of each object, - * which is a number between 0 and numbers::invalid_manifold_id-1. + * which is a number between 0 and numbers::flat_manifold_id-1. */ std::vector manifold_id; diff --git a/source/fe/mapping_q_generic.cc b/source/fe/mapping_q_generic.cc index e2f08ad7cb..73a6b8ecfc 100644 --- a/source/fe/mapping_q_generic.cc +++ b/source/fe/mapping_q_generic.cc @@ -3885,7 +3885,7 @@ MappingQGeneric::add_line_support_points( cell->line(line_no)); const Manifold &manifold = - ((line->manifold_id() == numbers::invalid_manifold_id) && + ((line->manifold_id() == numbers::flat_manifold_id) && (dim < spacedim) ? cell->get_manifold() : line->get_manifold()); @@ -3908,7 +3908,7 @@ MappingQGeneric::add_line_support_points( cell->line(line_no)); const Manifold &manifold = - ((line->manifold_id() == numbers::invalid_manifold_id) && + ((line->manifold_id() == numbers::flat_manifold_id) && (dim < spacedim) ? cell->get_manifold() : line->get_manifold()); diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 1b886afc14..9b26f8f52e 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -3924,7 +3924,7 @@ namespace GridTools endf = tria.end_face(); for (; face != endf; ++face) if ((face->at_boundary() || - face->manifold_id() != numbers::invalid_manifold_id) && + face->manifold_id() != numbers::flat_manifold_id) && faces_to_remove[face->index()] == false) { for (unsigned int l = 0; l < GeometryInfo::lines_per_face; ++l) @@ -3972,7 +3972,7 @@ namespace GridTools manifolds; // Set manifolds in new Triangulation for (auto manifold_id : manifold_ids) - if (manifold_id != numbers::invalid_manifold_id) + if (manifold_id != numbers::flat_manifold_id) manifolds[manifold_id] = tria.get_manifold(manifold_id).clone(); tria.clear(); @@ -3981,7 +3981,7 @@ namespace GridTools // Restore manifolds for (auto manifold_id : manifold_ids) - if (manifold_id != numbers::invalid_manifold_id) + if (manifold_id != numbers::flat_manifold_id) tria.set_manifold(manifold_id, *manifolds[manifold_id]); } diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index af6d2834ea..bcce5668d8 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -1455,12 +1455,12 @@ TransfiniteInterpolationManifold::initialize( bool cell_is_flat = true; for (unsigned int l = 0; l < GeometryInfo::lines_per_cell; ++l) if (cell->line(l)->manifold_id() != cell->manifold_id() && - cell->line(l)->manifold_id() != numbers::invalid_manifold_id) + cell->line(l)->manifold_id() != numbers::flat_manifold_id) cell_is_flat = false; if (dim > 2) for (unsigned int q = 0; q < GeometryInfo::quads_per_cell; ++q) if (cell->quad(q)->manifold_id() != cell->manifold_id() && - cell->quad(q)->manifold_id() != numbers::invalid_manifold_id) + cell->quad(q)->manifold_id() != numbers::flat_manifold_id) cell_is_flat = false; AssertIndexRange(static_cast(cell->index()), coarse_cell_is_flat.size()); @@ -1547,7 +1547,7 @@ namespace const types::manifold_id line_manifold_id = cell.line(line)->manifold_id(); if (line_manifold_id == my_manifold_id || - line_manifold_id == numbers::invalid_manifold_id) + line_manifold_id == numbers::flat_manifold_id) { weights_vertices[GeometryInfo<2>::line_to_cell_vertices(line, 0)] -= @@ -1678,7 +1678,7 @@ namespace const types::manifold_id face_manifold_id = cell.face(face)->manifold_id(); if (face_manifold_id == my_manifold_id || - face_manifold_id == numbers::invalid_manifold_id) + face_manifold_id == numbers::flat_manifold_id) { for (unsigned int line = 0; line < GeometryInfo<2>::lines_per_cell; @@ -1752,7 +1752,7 @@ namespace const types::manifold_id line_manifold_id = cell.line(line)->manifold_id(); if (line_manifold_id == my_manifold_id || - line_manifold_id == numbers::invalid_manifold_id) + line_manifold_id == numbers::flat_manifold_id) { weights_vertices[GeometryInfo<3>::line_to_cell_vertices(line, 0)] -= diff --git a/source/grid/tria.cc b/source/grid/tria.cc index e2325b8b61..aec3fee2aa 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -1854,7 +1854,7 @@ namespace internal for (unsigned int f = 0; f < GeometryInfo::faces_per_cell; ++f) { (*triangulation.vertex_to_manifold_id_map_1d) - [cell->face(f)->vertex_index()] = numbers::invalid_manifold_id; + [cell->face(f)->vertex_index()] = numbers::flat_manifold_id; if (cell->at_boundary(f)) (*triangulation.vertex_to_boundary_id_map_1d) @@ -5112,7 +5112,7 @@ namespace internal // same object of the cell (which was stored in // line->user_index() before) unless a manifold_id // has been set on this very line. - if (line->manifold_id() == numbers::invalid_manifold_id) + if (line->manifold_id() == numbers::flat_manifold_id) triangulation.vertices[next_unused_vertex] = triangulation.get_manifold(line->user_index()) .get_new_point_on_line(line); @@ -10269,8 +10269,8 @@ Triangulation::set_manifold( const types::manifold_id m_number, const Manifold &manifold_object) { - Assert(m_number < numbers::invalid_manifold_id, - ExcIndexRange(m_number, 0, numbers::invalid_manifold_id)); + Assert(m_number < numbers::flat_manifold_id, + ExcIndexRange(m_number, 0, numbers::flat_manifold_id)); manifold[m_number] = manifold_object.clone(); } @@ -10289,8 +10289,8 @@ template void Triangulation::reset_manifold(const types::manifold_id m_number) { - Assert(m_number < numbers::invalid_manifold_id, - ExcIndexRange(m_number, 0, numbers::invalid_manifold_id)); + Assert(m_number < numbers::flat_manifold_id, + ExcIndexRange(m_number, 0, numbers::flat_manifold_id)); // delete the entry located at number. manifold.erase(m_number); diff --git a/tests/fail/arclength_boundary_02.cc b/tests/fail/arclength_boundary_02.cc index 89e183a16b..0fd4c2c83a 100644 --- a/tests/fail/arclength_boundary_02.cc +++ b/tests/fail/arclength_boundary_02.cc @@ -51,7 +51,7 @@ main() GridGenerator::hyper_cube(tria); tria.set_all_manifold_ids_on_boundary(1); - tria.begin_active()->face(2)->set_manifold_id(numbers::invalid_manifold_id); + tria.begin_active()->face(2)->set_manifold_id(numbers::flat_manifold_id); tria.set_manifold(1, manifold); tria.refine_global(3); diff --git a/tests/mpi/fe_field_function_02.cc b/tests/mpi/fe_field_function_02.cc index fe53a1c73a..6722fef8ba 100644 --- a/tests/mpi/fe_field_function_02.cc +++ b/tests/mpi/fe_field_function_02.cc @@ -84,7 +84,7 @@ test() ++cell) for (unsigned int f = 0; f < GeometryInfo::faces_per_cell; ++f) if (cell->at_boundary(f)) - cell->face(f)->set_all_manifold_ids(numbers::invalid_manifold_id); + cell->face(f)->set_all_manifold_ids(numbers::flat_manifold_id); // static const SphericalManifold boundary_shell; // tr.set_manifold (0, boundary_shell); // tr.set_manifold (1, boundary_shell); -- 2.39.5