From: Daniel Arndt Date: Wed, 1 Aug 2018 18:26:25 +0000 (+0200) Subject: Allow detecting mutiple duplicates in GridTools::delete_duplicated_vertices X-Git-Tag: v9.1.0-rc1~851^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=725257f8e7f94bc46aa3d24d0659870ca9722050;p=dealii.git Allow detecting mutiple duplicates in GridTools::delete_duplicated_vertices --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index e87b016dcf..f21a8ba5ff 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -301,7 +301,8 @@ namespace GridTools * the vertices with indices in @p considered_vertices are tested for * equality. This speeds up the algorithm, which is quadratic and thus quite * slow to begin with. However, if you wish to consider all vertices, simply - * pass an empty vector. + * pass an empty vector. In that case, the function fills + * @p considered_vertices with all vertices. * * Two vertices are considered equal if their difference in each coordinate * direction is less than @p tol. diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 50d0cb86fc..89aec1b357 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -4304,18 +4304,12 @@ namespace GridGenerator } // throw out duplicated vertices - // since GridTools::delete_duplicated_vertices can only consider - // one duplications at once, we have to call the function one time less - // than the number of Triangulation objects to be merged. - for (unsigned int i = 0; i < triangulations.size(); ++i) - { - std::vector considered_vertices; - GridTools::delete_duplicated_vertices(vertices, - cells, - subcell_data, - considered_vertices, - duplicated_vertex_tolerance); - } + std::vector considered_vertices; + GridTools::delete_duplicated_vertices(vertices, + cells, + subcell_data, + considered_vertices, + duplicated_vertex_tolerance); // reorder the cells to ensure that they satisfy the convention for // edge and face directions diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 248998f535..1b886afc14 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -579,9 +579,6 @@ namespace GridTools { new_vertex_numbers[considered_vertices[j]] = considered_vertices[i]; - // we do not suppose, that there might be another duplicate - // vertex, so break here - break; } } }