]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a wrong data type. 4556/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 28 Jun 2017 02:14:41 +0000 (20:14 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 28 Jun 2017 02:14:41 +0000 (20:14 -0600)
When distributing MG DoF indices, we accidentally used 'unsigned int'
instead of 'types::global_dof_index'. That's a bug. We didn't notice
this because we never have more than 4B unknowns on one processor,
and the function was only called in the parallel context to enumerate
the DoFs on the *local* portion of the mesh, before indices were
shifted after communication with other processors. Regardless, it's
worth fixing.

source/dofs/dof_handler_policy.cc

index c0add2bf29b010ec178e0dba2460539eb1965aa3..c3da27fbaa06a6dc1bb833927ee05101a11efd60 100644 (file)
@@ -325,9 +325,9 @@ namespace internal
          */
         template <int dim, int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_mg_dofs_on_cell (const typename DoFHandler<dim,spacedim>::level_cell_iterator &cell,
-                                    unsigned int   next_free_dof,
+                                    types::global_dof_index   next_free_dof,
                                     const internal::int2type<1> &)
         {
           // distribute dofs of vertices
@@ -378,9 +378,9 @@ namespace internal
 
         template <int dim, int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_mg_dofs_on_cell (const typename DoFHandler<dim,spacedim>::level_cell_iterator &cell,
-                                    unsigned int   next_free_dof,
+                                    types::global_dof_index   next_free_dof,
                                     const internal::int2type<2> &)
         {
           if (cell->get_fe().dofs_per_vertex > 0)
@@ -424,9 +424,9 @@ namespace internal
 
         template <int dim, int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_mg_dofs_on_cell (const typename DoFHandler<dim,spacedim>::level_cell_iterator &cell,
-                                    unsigned int   next_free_dof,
+                                    types::global_dof_index   next_free_dof,
                                     const internal::int2type<3> &)
         {
           if (cell->get_fe().dofs_per_vertex > 0)
@@ -485,7 +485,7 @@ namespace internal
 
         template <int dim, int spacedim>
         static
-        unsigned int
+        types::global_dof_index
         distribute_dofs_on_level (const types::subdomain_id level_subdomain_id,
                                   DoFHandler<dim,spacedim> &dof_handler,
                                   const unsigned int        level)
@@ -504,7 +504,7 @@ namespace internal
           tria.save_user_flags(user_flags);
           const_cast<dealii::Triangulation<dim,spacedim> &>(tria).clear_user_flags ();
 
-          unsigned int next_free_dof = 0;
+          types::global_dof_index next_free_dof = 0;
           typename DoFHandler<dim,spacedim>::level_cell_iterator
           cell = dof_handler.begin(level),
           endc = dof_handler.end(level);

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.