]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Allow detecting mutiple duplicates in GridTools::delete_duplicated_vertices
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 1 Aug 2018 18:26:25 +0000 (20:26 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 1 Aug 2018 18:39:22 +0000 (20:39 +0200)
include/deal.II/grid/grid_tools.h
source/grid/grid_generator.cc
source/grid/grid_tools.cc

index e87b016dcfa2d5744284108294604bcfdfa96a0c..f21a8ba5ff893a2fa3ee407fcb1351a3aaa17897 100644 (file)
@@ -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.
index 50d0cb86fc1f14ef76414ccd572f26ffd81cee6a..89aec1b3579f0a69651e5eff944e3e00975eb92a 100644 (file)
@@ -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<unsigned int> considered_vertices;
-        GridTools::delete_duplicated_vertices(vertices,
-                                              cells,
-                                              subcell_data,
-                                              considered_vertices,
-                                              duplicated_vertex_tolerance);
-      }
+    std::vector<unsigned int> 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
index 248998f535ff1b5760d565b8f4bafc0bd4bc9718..1b886afc14cdbdb749e556130e9073bea708f51d 100644 (file)
@@ -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;
               }
           }
       }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.