]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Fix an inconsistency where after calling DoFHandler::clear() it still reported n_dofs...
authorheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Nov 2012 19:06:34 +0000 (19:06 +0000)
committerheister <heister@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 1 Nov 2012 19:06:34 +0000 (19:06 +0000)
git-svn-id: https://svn.dealii.org/trunk@27291 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/dofs/number_cache.h
deal.II/source/dofs/dof_handler.cc
deal.II/source/dofs/number_cache.cc

index 623b24ba97c391c25b2534c4a6c5aeccd8b87454..670549558a55a1fcf9157abec9cb49cbd343ad0c 100644 (file)
@@ -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
index 04a0624e417c606a5f52eb83d96cb1c4a254215b..afa53fe64e312a959f22b44ceabf0c19005c6662 100644 (file)
@@ -842,6 +842,8 @@ void DoFHandler<dim,spacedim>::clear_space ()
 
   std::vector<unsigned int> tmp;
   std::swap (vertex_dofs, tmp);
+
+  number_cache.clear ();
 }
 
 
index d83663d5db9d853b1aefc1b20aca557d207ec26c..cc6e75e6e068046a9ca0df5481a2a149aa3a1358 100644 (file)
@@ -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

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.