]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use global_active_cell_index in MatrixFree::initialize_indices 11136/head
authorPeter Munch <peterrmuench@gmail.com>
Tue, 3 Nov 2020 13:20:51 +0000 (14:20 +0100)
committerPeter Munch <peterrmuench@gmail.com>
Tue, 3 Nov 2020 13:20:51 +0000 (14:20 +0100)
include/deal.II/matrix_free/matrix_free.templates.h
source/grid/tria.cc

index 6933925da7fecf23f8e2c00fb78f4e6ad785de51..76093d8817166e5cb3ce89160bff51f3e865ebaf 100644 (file)
@@ -1552,12 +1552,16 @@ MatrixFree<dim, Number, VectorizedArrayType>::initialize_indices(
               {
                 const unsigned int index = cell * n_lanes + v;
 
+                const auto cell_iterator = get_cell_iterator(cell, v, di_index);
+
                 // determine global cell index
                 const unsigned int local_dof_index =
                   di.dof_indices_contiguous[2][index];
+
                 const types::global_cell_index global_cell_index =
-                  di.vector_partitioner->local_to_global(local_dof_index) /
-                  this->get_dofs_per_cell(di_index);
+                  (additional_data.mg_level == numbers::invalid_unsigned_int) ?
+                    cell_iterator->global_active_cell_index() :
+                    cell_iterator->global_level_cell_index();
 
                 // determine sm rank
                 unsigned int sm_rank = my_sm_pid;
@@ -1570,14 +1574,13 @@ MatrixFree<dim, Number, VectorizedArrayType>::initialize_indices(
                 else
                   {
                     // ghost cell
-                    const auto ptr = std::find(
-                      sm_procs.begin(),
-                      sm_procs.end(),
-                      additional_data.mg_level ==
-                          numbers::invalid_unsigned_int ?
-                        get_cell_iterator(cell, v, di_index)->subdomain_id() :
-                        get_cell_iterator(cell, v, di_index)
-                          ->level_subdomain_id());
+                    const auto ptr =
+                      std::find(sm_procs.begin(),
+                                sm_procs.end(),
+                                additional_data.mg_level ==
+                                    numbers::invalid_unsigned_int ?
+                                  cell_iterator->subdomain_id() :
+                                  cell_iterator->level_subdomain_id());
 
                     if (ptr != sm_procs.end())
                       {
index 13daa80bfa6cba937cfcff794960c1d8120aeaa2..a8e053e1856c16653354bdd9c6d73454eb0930d3 100644 (file)
@@ -12696,7 +12696,7 @@ Triangulation<dim, spacedim>::reset_global_cell_indices()
   {
     types::global_cell_index cell_index = 0;
     for (const auto &cell : active_cell_iterators())
-      cell->set_active_cell_index(cell_index++);
+      cell->set_global_active_cell_index(cell_index++);
   }
 
   for (unsigned int l = 0; l < levels.size(); ++l)

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.