]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make sure we only change manifold ids once per face/edge.
authorLuca Heltai <luca.heltai@sissa.it>
Thu, 21 Mar 2019 23:44:29 +0000 (00:44 +0100)
committerLuca Heltai <luca.heltai@sissa.it>
Sat, 23 Mar 2019 22:24:17 +0000 (23:24 +0100)
source/grid/grid_tools.cc

index 7aa180cbffaab34337f38b5c838efea47b603cb3..32c252689d235b2f9de7c604e5e1d37851a3a8e2 100644 (file)
@@ -3813,21 +3813,31 @@ namespace GridTools
           for (unsigned int l = 0; l < GeometryInfo<dim>::lines_per_cell; ++l)
             {
               const auto id = cell->line(l)->user_index();
-              Assert(id != 0, ExcInternalError());
-              if (cell->line(l)->manifold_id() == numbers::flat_manifold_id ||
-                  overwrite_only_flat_manifold_ids == false)
-                cell->line(l)->set_manifold_id(
-                  disambiguation_function(manifold_ids[id]));
+              // Make sure we change the manifold indicator only once
+              if (id != 0)
+                {
+                  if (cell->line(l)->manifold_id() ==
+                        numbers::flat_manifold_id ||
+                      overwrite_only_flat_manifold_ids == false)
+                    cell->line(l)->set_manifold_id(
+                      disambiguation_function(manifold_ids[id]));
+                  cell->line(l)->set_user_index(0);
+                }
             }
         if (dim > 2)
           for (unsigned int l = 0; l < GeometryInfo<dim>::quads_per_cell; ++l)
             {
               const auto id = cell->quad(l)->user_index();
-              Assert(id != 0, ExcInternalError());
-              if (cell->quad(l)->manifold_id() == numbers::flat_manifold_id ||
-                  overwrite_only_flat_manifold_ids == false)
-                cell->quad(l)->set_manifold_id(
-                  disambiguation_function(manifold_ids[id]));
+              // Make sure we change the manifold indicator only once
+              if (id != 0)
+                {
+                  if (cell->quad(l)->manifold_id() ==
+                        numbers::flat_manifold_id ||
+                      overwrite_only_flat_manifold_ids == false)
+                    cell->quad(l)->set_manifold_id(
+                      disambiguation_function(manifold_ids[id]));
+                  cell->quad(l)->set_user_index(0);
+                }
             }
       }
     tria.load_user_indices(backup);

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.