From: heister Date: Thu, 1 Nov 2012 19:06:34 +0000 (+0000) Subject: Fix an inconsistency where after calling DoFHandler::clear() it still reported n_dofs... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ccbf73383ad270278d969fa2054f2fb30155659;p=dealii-svn.git Fix an inconsistency where after calling DoFHandler::clear() it still reported n_dofs()>0 etc. git-svn-id: https://svn.dealii.org/trunk@27291 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/number_cache.h b/deal.II/include/deal.II/dofs/number_cache.h index 623b24ba97..670549558a 100644 --- a/deal.II/include/deal.II/dofs/number_cache.h +++ b/deal.II/include/deal.II/dofs/number_cache.h @@ -44,6 +44,11 @@ namespace internal */ std::size_t memory_consumption () const; + /** + * This function resets all the stored information. + */ + void clear (); + /** * Total number of dofs, * accumulated over all diff --git a/deal.II/source/dofs/dof_handler.cc b/deal.II/source/dofs/dof_handler.cc index 04a0624e41..afa53fe64e 100644 --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@ -842,6 +842,8 @@ void DoFHandler::clear_space () std::vector tmp; std::swap (vertex_dofs, tmp); + + number_cache.clear (); } diff --git a/deal.II/source/dofs/number_cache.cc b/deal.II/source/dofs/number_cache.cc index d83663d5db..cc6e75e6e0 100644 --- a/deal.II/source/dofs/number_cache.cc +++ b/deal.II/source/dofs/number_cache.cc @@ -28,6 +28,14 @@ namespace internal {} + void NumberCache::clear () + { + n_global_dofs = 0; + n_locally_owned_dofs = 0; + locally_owned_dofs.clear(); + n_locally_owned_dofs_per_processor.clear(); + locally_owned_dofs_per_processor.clear(); + } std::size_t NumberCache::memory_consumption () const