]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
another attempt to fix the bug
authordenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 26 Apr 2014 21:41:52 +0000 (21:41 +0000)
committerdenis.davydov <denis.davydov@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 26 Apr 2014 21:41:52 +0000 (21:41 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_sharedtria@32847 0785d39b-7218-0410-832d-ea1e28bc413d

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

index 3d207a3e4498dd5bfe31fc88814590a9ecf21a9c..6747ecbbc201a637d57b80533194e42a8da125f2 100644 (file)
@@ -88,10 +88,10 @@ namespace internal
          * specified by the first argument.
          */
         virtual
-        void
+        NumberCache
         renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                        dealii::DoFHandler<dim,spacedim> &dof_handler,
-                       NumberCache & number_cache) const = 0;
+                       NumberCache & number_cache_current) const = 0;
       };
 
 
@@ -127,10 +127,10 @@ namespace internal
          * specified by the first argument.
          */
         virtual
-        void
+        NumberCache
         renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers,
                        dealii::DoFHandler<dim,spacedim> &dof_handler,
-                       NumberCache & number_cache) const;
+                       NumberCache & number_cache_current) const;
       };
 
       /**
@@ -173,10 +173,10 @@ namespace internal
            * On renumbering, number_cache.locally_owned_dofs is updated consistently.
            */
          virtual
-         void
+         NumberCache
          renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers,
                         dealii::DoFHandler<dim,spacedim> &dof_handler,
-                        NumberCache & number_cache) const;
+                        NumberCache & number_cache_current) const;
       };
 
 
@@ -213,10 +213,10 @@ namespace internal
          * specified by the first argument.
          */
         virtual
-        void
+        NumberCache
         renumber_dofs (const std::vector<types::global_dof_index>  &new_numbers,
                        dealii::DoFHandler<dim,spacedim> &dof_handler,
-                       NumberCache &number_cache) const;
+                       NumberCache &number_cache_current) const;
       };
     }
   }
index 0eeea16276eaa12462f08de535dab849b2643890..2b9cc1fb0d90551ade3eb8059513943a2736c93c 100644 (file)
@@ -1286,7 +1286,7 @@ DoFHandler<dim,spacedim>::renumber_dofs (const std::vector<types::global_dof_ind
               ExcMessage ("New DoF index is not less than the total number of dofs."));
 #endif
 
-  policy->renumber_dofs (new_numbers, *this,number_cache);
+  number_cache = policy->renumber_dofs (new_numbers, *this,number_cache);
 }
 
 
index e05e78c173666c34b1fa5df53b93072e5d119053..c5370a0e5f961e5fc546a60d8dabd320aec579d1 100644 (file)
@@ -928,15 +928,12 @@ namespace internal
       }
 
       template <int dim, int spacedim>
-      void
+      NumberCache
       Sequential<dim,spacedim>::
       renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                      dealii::DoFHandler<dim,spacedim> &dof_handler,
-                     NumberCache &number_cache) const
+                     NumberCache &number_cache_current) const
       {
-        //reset number cache.
-        number_cache = NumberCache ();
-
         Implementation::renumber_dofs (new_numbers, IndexSet(0),
                                        dof_handler, true);
 
@@ -946,6 +943,7 @@ namespace internal
         // have to set the elements
         // of the structure
         // appropriately anyway
+        NumberCache number_cache;
         number_cache.n_global_dofs        = dof_handler.n_dofs();
         number_cache.n_locally_owned_dofs = number_cache.n_global_dofs;
 
@@ -962,6 +960,7 @@ namespace internal
         number_cache.locally_owned_dofs_per_processor
           = std::vector<IndexSet> (1,
                                    number_cache.locally_owned_dofs);
+        return number_cache;
       }
 
       /* --------------------- class ParallelSequential ---------------- */
@@ -992,18 +991,18 @@ namespace internal
       }
 
       template <int dim, int spacedim>
-      void
+      NumberCache
       ParallelShared<dim,spacedim>::
       renumber_dofs (const std::vector<types::global_dof_index> &new_numbers,
                      dealii::DoFHandler<dim,spacedim> &dof_handler,
-                     NumberCache &number_cache) const
+                     NumberCache &number_cache_current) const
       {
-          //reset number cache.
-          number_cache = NumberCache ();
-
-         Sequential<dim,spacedim>::renumber_dofs (new_numbers,dof_handler,number_cache);
+          NumberCache number_cache = Sequential<dim,spacedim>::renumber_dofs (new_numbers,dof_handler,number_cache_current);
+          //update current number cache
+          number_cache_current = number_cache;
          //correct number_cache:
          number_cache.locally_owned_dofs = dealii::DoFTools::locally_owned_dofs_with_subdomain(dof_handler,dof_handler.get_tria().locally_owned_subdomain() );
+         return number_cache;
       }
 
       /* --------------------- class ParallelDistributed ---------------- */
@@ -2435,17 +2434,16 @@ namespace internal
 
 
       template <int dim, int spacedim>
-      void
+      NumberCache
       ParallelDistributed<dim, spacedim>::
       renumber_dofs (const std::vector<dealii::types::global_dof_index> &new_numbers,
                      dealii::DoFHandler<dim,spacedim> &dof_handler,
-                     NumberCache &number_cache) const
+                     NumberCache &number_cache_current) const
       {
         Assert (new_numbers.size() == dof_handler.locally_owned_dofs().n_elements(),
                 ExcInternalError());
 
-        //reset number cache.
-        number_cache = NumberCache ();
+        NumberCache number_cache;
 
 #ifndef DEAL_II_WITH_P4EST
         Assert (false, ExcNotImplemented());
@@ -2689,6 +2687,7 @@ namespace internal
         }
 #endif
 
+        return number_cache;
       }
     }
   }

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.