]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add an assertion and document why the function can't work in this context.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Apr 2012 07:58:10 +0000 (07:58 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 26 Apr 2012 07:58:10 +0000 (07:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@25448 0785d39b-7218-0410-832d-ea1e28bc413d

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

index fb15726895e4147376bc503d2b83d1b4a62b160c..633d040ec494f1285ec8d3c0e1d8ba846c16a78f 100644 (file)
@@ -1114,6 +1114,22 @@ namespace DoFTools
                                     * non-zero components. Elements
                                     * in the mask corresponding to
                                     * later components are ignored.
+                                    *
+                                    * @note This function will not work
+                                    * for DoFHandler objects that are
+                                    * built on a
+                                    * parallel::distributed::Triangulation
+                                    * object. The reasons is that the
+                                    * output argument @p selected_dofs
+                                    * has to have a length equal to <i>all</i>
+                                    * global degrees of freedom.
+                                    * Consequently, this does not scale
+                                    * to very large problems. If you
+                                    * need the functionality of this
+                                    * function for parallel triangulations,
+                                    * then you need to use the other
+                                    * DoFTools::extract_boundary_dofs
+                                    * function.
                                     */
   template <class DH>
   void
index d25e6df7cb1670ffd74c1520cc92c6098f031e21..f865b18bf24b1f03233f6487cd620172d41b0018 100644 (file)
@@ -3752,9 +3752,16 @@ namespace DoFTools
                          std::vector<bool>             &selected_dofs,
                          const std::set<types::boundary_id_t> &boundary_indicators)
   {
-    AssertDimension (component_select.size(),n_components(dof_handler));
+    AssertDimension (component_select.size(), n_components(dof_handler));
     Assert (boundary_indicators.find (types::internal_face_boundary_id) == boundary_indicators.end(),
             ExcInvalidBoundaryIndicator());
+    Assert ((dynamic_cast<const parallel::distributed::Triangulation<DH::dimension,DH::space_dimension>*>
+             (&dof_handler.get_tria())
+             ==
+             0),
+            ExcMessage ("This function can not be used with distributed triangulations."
+                        "See the documentation for more information."));
+
     const unsigned int dim=DH::dimension;
 
                                      // let's see whether we have to

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.