From: Wolfgang Bangerth Date: Fri, 10 Apr 2015 21:21:44 +0000 (-0500) Subject: Do not serialize active cell indices; rather, re-compute them upon loading a mesh. X-Git-Tag: v8.3.0-rc1~274^2~11 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=79bb23b3ea0411e82ed55affb7b2ea167cf95c90;p=dealii.git Do not serialize active cell indices; rather, re-compute them upon loading a mesh. --- diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 703e97698b..c6dc8f0314 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -3315,6 +3315,27 @@ Triangulation::load (Archive &ar, ar &anisotropic_refinement; ar &number_cache; + // the levels do not serialize the active_cell_indices because + // they are easy enough to rebuild upon re-loading data. do + // this here. don't forget to first resize the fields appropriately + { + for (unsigned int l=0; lactive_cell_indices.resize (levels[l]->refine_flags.size()); + + unsigned int active_cell_index = 0; + for (cell_iterator cell=begin(); cell!=end(); ++cell) + if (cell->has_children()) + cell->set_active_cell_index (numbers::invalid_unsigned_int); + else + { + cell->set_active_cell_index (active_cell_index); + ++active_cell_index; + } + + Assert (active_cell_index == n_active_cells(), ExcInternalError()); + } + + bool my_check_for_distorted_cells; ar &my_check_for_distorted_cells; diff --git a/include/deal.II/grid/tria_levels.h b/include/deal.II/grid/tria_levels.h index a29050e498..e95cf64e1c 100644 --- a/include/deal.II/grid/tria_levels.h +++ b/include/deal.II/grid/tria_levels.h @@ -274,7 +274,11 @@ namespace internal const unsigned int) { ar &refine_flags &coarsen_flags; - ar &active_cell_indices; + + // do not serialize 'active_cell_indices' here. instead of storing them + // to the stream and re-reading them again later, we just rebuild them + // in Triangulation::load() + ar &neighbors; ar &subdomain_ids; ar &level_subdomain_ids; @@ -290,7 +294,11 @@ namespace internal const unsigned int) { ar &refine_flags &coarsen_flags; - ar &active_cell_indices; + + // do not serialize 'active_cell_indices' here. instead of storing them + // to the stream and re-reading them again later, we just rebuild them + // in Triangulation::load() + ar &neighbors; ar &subdomain_ids; ar &level_subdomain_ids;