From: bangerth Date: Thu, 26 Apr 2012 07:58:10 +0000 (+0000) Subject: Add an assertion and document why the function can't work in this context. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e44161e8e65eb3c4666b82853c47b16c6aaeeaae;p=dealii-svn.git Add an assertion and document why the function can't work in this context. git-svn-id: https://svn.dealii.org/trunk@25448 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index fb15726895..633d040ec4 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -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 all + * 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 void diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index d25e6df7cb..f865b18bf2 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -3752,9 +3752,16 @@ namespace DoFTools std::vector &selected_dofs, const std::set &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*> + (&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