From: Luca Heltai Date: Thu, 21 Mar 2019 23:44:29 +0000 (+0100) Subject: Make sure we only change manifold ids once per face/edge. X-Git-Tag: v9.1.0-rc1~250^2~3 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a2b402e80275c22411733c2bfcaf9d271d214fc;p=dealii.git Make sure we only change manifold ids once per face/edge. --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 7aa180cbff..32c252689d 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -3813,21 +3813,31 @@ namespace GridTools for (unsigned int l = 0; l < GeometryInfo::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::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);