From 0a2b402e80275c22411733c2bfcaf9d271d214fc Mon Sep 17 00:00:00 2001 From: Luca Heltai Date: Fri, 22 Mar 2019 00:44:29 +0100 Subject: [PATCH] Make sure we only change manifold ids once per face/edge. --- source/grid/grid_tools.cc | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) 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); -- 2.39.5