// 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
/*
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);
-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
-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
+