* cell ordering, this flag is
* required to get reproducible
* behaviour after snapshot/resume.
+ *
+ * The flag construct_multigrid_hierarchy
+ * needs to be set to use the geometric
+ * multigrid functionality. This option
+ * requires additional computation and
+ * communication. Note: geometric
+ * multigrid is still a work in progress.
*/
enum Settings
{
default_setting = 0x0,
- mesh_reconstruction_after_repartitioning = 0x1
+ mesh_reconstruction_after_repartitioning = 0x1,
+ construct_multigrid_hierarchy = 0x2
};
*/
std::vector<unsigned int> coarse_cell_to_p4est_tree_permutation;
std::vector<unsigned int> p4est_tree_to_coarse_cell_permutation;
+
+ /**
+ * dummy settings
+ */
+ enum Settings
+ {
+ default_setting = 0x0,
+ mesh_reconstruction_after_repartitioning = 0x1,
+ construct_multigrid_hierarchy = 0x2
+ };
+ /**
+ * dummy settings object
+ */
+ Settings settings;
+
};
}
}
// fill level_subdomain_ids for geometric multigrid
- // This is disabled for now until it works correctly.
// the level ownership of a cell is defined as the owner if the cell is active or as the owner of child(0)
// we need this information for all our ancestors and the same-level neighbors of our own cells (=level ghosts)
- if (false)
+ if (settings & construct_multigrid_hierarchy)
{
// step 1: We set our own ids all the way down and all the others to -1. Note that we do not fill
// other cells we could figure out the same way, because we might accidentally set an id for a
Assert (false, ExcNotImplemented());
#else
- // TODO: distributed geometric multigrid is not complete yet
- Assert (false, ExcNotImplemented());
- return;
-
parallel::distributed::Triangulation< dim, spacedim > *tr
= (dynamic_cast<parallel::distributed::Triangulation<dim,spacedim>*>
(const_cast<dealii::Triangulation< dim, spacedim >*>
(&dof_handler.get_tria())));
Assert (tr != 0, ExcInternalError());
+
+ AssertThrow(
+ (tr->settings & parallel::distributed::Triangulation< dim, spacedim >::construct_multigrid_hierarchy),
+ ExcMessage("Multigrid DoFs can only be distributed on a parallel Triangulation if the flag construct_multigrid_hierarchy is set in the constructor."));
+
+
const unsigned int
n_cpus = Utilities::MPI::n_mpi_processes (tr->get_communicator());