]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Ensure parallel::Tria can't be used with DoFRenumbering::subdomain_wise 5816/head
authorJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 27 Jan 2018 09:37:20 +0000 (10:37 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Sat, 27 Jan 2018 14:45:28 +0000 (15:45 +0100)
The documentation is also updated to reflect this point. Fixes 5763.

include/deal.II/dofs/dof_renumbering.h
source/dofs/dof_renumbering.cc

index 706ba2399572903dd7ca05f8d4e5d6d447c2f31b..9abbd21f02a88e5c981dec49024aa25a992c3a20 100644 (file)
@@ -1138,9 +1138,13 @@ namespace DoFRenumbering
    * Renumber the degrees of freedom such that they are associated with the
    * subdomain id of the cells they are living on, i.e. first all degrees of
    * freedom that belong to cells with subdomain zero, then all with subdomain
-   * one, etc. This is useful when doing parallel computations after assigning
-   * subdomain ids using a partitioner (see the
-   * GridTools::partition_triangulation function for this).
+   * one, etc. This is useful when doing parallel computations with a standard
+   * Triangulation after assigning subdomain ids using a partitioner (see the
+   * GridTools::partition_triangulation function for this). Calling this
+   * function is unnecessary when using a parallel::shared::Triangulation or
+   * parallel::distributed::Triangulation, as the degrees of freedom are
+   * already enumerated according to the MPI process id. Therefore, if the
+   * underlying triangulation is of this type then an error will be thrown.
    *
    * Note that degrees of freedom associated with faces, edges, and vertices
    * may be associated with multiple subdomains if they are sitting on
index 585739eb108c5bfb3649fad224b887e9ff3f8dbd..68bffe826d3436ab7ea4acae20dfc6573a0a3bb6 100644 (file)
@@ -2031,6 +2031,9 @@ namespace DoFRenumbering
   void
   subdomain_wise (DoFHandlerType &dof_handler)
   {
+    Assert((!dynamic_cast<const parallel::Triangulation<DoFHandlerType::dimension,DoFHandlerType::space_dimension>*> (&dof_handler.get_triangulation())),
+           ExcMessage("Parallel triangulations are already enumerated according to their MPI process id."));
+
     std::vector<types::global_dof_index> renumbering(dof_handler.n_dofs(),
                                                      numbers::invalid_dof_index);
     compute_subdomain_wise(renumbering, dof_handler);

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.