]> https://gitweb.dealii.org/ - dealii.git/commitdiff
fix bug
authorTimo Heister <timo.heister@gmail.com>
Wed, 6 Oct 2021 15:04:46 +0000 (11:04 -0400)
committerTimo Heister <timo.heister@gmail.com>
Wed, 6 Oct 2021 15:04:46 +0000 (11:04 -0400)
tests/mappings/mapping_q_eulerian_14.cc
tests/mappings/mapping_q_eulerian_14.with_p4est=true.mpirun=1.output
tests/mappings/mapping_q_eulerian_14.with_p4est=true.mpirun=3.output
tests/mappings/mapping_q_eulerian_14.with_p4est=true.mpirun=4.output

index be74c4291ba773b0ab1ddf01058caaa2765ae27e..7bfe86acf75cfe058e3735d0229728677dc1d5b5 100644 (file)
@@ -15,7 +15,9 @@
 
 
 // test matrix-free Laplace and Mass operators with MappingQEulerian
-// on a refined mesh that triggered the following bug with 4 MPI ranks:
+// on a refined mesh that triggered the bug below with 4 MPI
+// ranks. This is due to a smaller set of ghost indices used by
+// interpolate_to_mg.
 
 // clang-format off
 /*
@@ -246,6 +248,20 @@ test(const unsigned int n_ref = 0)
   const unsigned int min_level = 0;
   MGLevelObject<LinearAlgebra::distributed::Vector<LevelNumberType>>
     displacement_level(min_level, max_level);
+
+  // Important! This preallocation of the displacement vectors fixes
+  // the bug observed.
+  for (unsigned int level = min_level; level <= max_level; ++level)
+    {
+      IndexSet relevant_mg_dofs;
+      DoFTools::extract_locally_relevant_level_dofs(dof_handler_euler,
+                                                    level,
+                                                    relevant_mg_dofs);
+      displacement_level[level].reinit(dof_handler_euler.locally_owned_mg_dofs(
+                                         level),
+                                       relevant_mg_dofs,
+                                       mpi_communicator);
+    }
   mg_transfer_euler.interpolate_to_mg(dof_handler_euler,
                                       displacement_level,
                                       displacement);
index 1177cf30be1494d561adafd8dc53763de81643a2..891e1627504954adbc0cc8eedb595c212baf02d9 100644 (file)
@@ -1,15 +1,8 @@
 
-DEAL:2d::refine...
-DEAL:2d::refine...
-DEAL:2d::refine...
-DEAL:2d::Checksum: 4107161474
+DEAL:0::refine...
+DEAL:0::refine...
+DEAL:0::refine...
+DEAL:0::Checksum: 4107161474
 n_active_cells: 520
 n_levels: 3
-DEAL:2d::Mass operator: 
-DEAL:2d::l2_norm:       0.00000
-DEAL:2d::l1_norm:       0.00000
-DEAL:2d::linfty_norm:   0.00000
-DEAL:2d::Laplace operator: 
-DEAL:2d::l2_norm:       0.00000
-DEAL:2d::l1_norm:       0.00000
-DEAL:2d::linfty_norm:   0.00000
+DEAL:0::Ok
index 15fea44d2a69480fe1d5de06769b5ae7ed4b4f2e..cdc5e13fd8da7982bd7184bda569337e1c8d4644 100644 (file)
@@ -1,15 +1,26 @@
 
-DEAL:2d::refine...
-DEAL:2d::refine...
-DEAL:2d::refine...
-DEAL:2d::Checksum: 4107161474
+DEAL:0::refine...
+DEAL:0::refine...
+DEAL:0::refine...
+DEAL:0::Checksum: 4107161474
 n_active_cells: 307
 n_levels: 3
-DEAL:2d::Mass operator: 
-DEAL:2d::l2_norm:       0.00000
-DEAL:2d::l1_norm:       0.00000
-DEAL:2d::linfty_norm:   0.00000
-DEAL:2d::Laplace operator: 
-DEAL:2d::l2_norm:       0.00000
-DEAL:2d::l1_norm:       0.00000
-DEAL:2d::linfty_norm:   0.00000
+DEAL:0::Ok
+
+DEAL:1::refine...
+DEAL:1::refine...
+DEAL:1::refine...
+DEAL:1::Checksum: 0
+n_active_cells: 373
+n_levels: 3
+DEAL:1::Ok
+
+
+DEAL:2::refine...
+DEAL:2::refine...
+DEAL:2::refine...
+DEAL:2::Checksum: 0
+n_active_cells: 310
+n_levels: 3
+DEAL:2::Ok
+
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a64acfa2dc2dff93d823f35885d4bf6afff4e9fa 100644 (file)
@@ -0,0 +1,35 @@
+
+DEAL:0::refine...
+DEAL:0::refine...
+DEAL:0::refine...
+DEAL:0::Checksum: 4107161474
+n_active_cells: 259
+n_levels: 3
+DEAL:0::Ok
+
+DEAL:1::refine...
+DEAL:1::refine...
+DEAL:1::refine...
+DEAL:1::Checksum: 0
+n_active_cells: 301
+n_levels: 3
+DEAL:1::Ok
+
+
+DEAL:2::refine...
+DEAL:2::refine...
+DEAL:2::refine...
+DEAL:2::Checksum: 0
+n_active_cells: 271
+n_levels: 3
+DEAL:2::Ok
+
+
+DEAL:3::refine...
+DEAL:3::refine...
+DEAL:3::refine...
+DEAL:3::Checksum: 0
+n_active_cells: 259
+n_levels: 3
+DEAL:3::Ok
+

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.