From 79b96d7fa9235d4db2d1acda62539541a826c123 Mon Sep 17 00:00:00 2001 From: maier Date: Thu, 24 Jan 2013 13:12:23 +0000 Subject: [PATCH] Allow the use of make_periodicity_constraints when running on a parallel::distributed mesh in serial Reported by Jean-Paul Pelteret git-svn-id: https://svn.dealii.org/trunk@28167 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/source/dofs/dof_tools.cc | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index 6165c9ed58..b5267c426f 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -1,8 +1,8 @@ //--------------------------------------------------------------------------- -// $Id$ +// $Id:$ // Version: $Name$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -3007,10 +3007,16 @@ namespace DoFTools static const int space_dim = DH::space_dimension; Assert (0<=direction && direction*> - (&dof_handler.get_tria()) == 0), + +#ifdef DEBUG + // Check whether we run on a non parallel mesh or on a + // parallel::distributed::Triangulation in serial + typedef parallel::distributed::Triangulation PTRIA; + const PTRIA* ptria_p = dynamic_cast (&dof_handler.get_tria()); + Assert ((ptria_p == 0 || Utilities::MPI::n_mpi_processes(ptria_p->get_communicator()) == 1), ExcMessage ("This function can not be used with distributed triangulations." "See the documentation for more information.")); +#endif Assert (b_id1 != b_id2, ExcMessage ("The boundary indicators b_id1 and b_id2 must be" @@ -3094,10 +3100,15 @@ namespace DoFTools Assert(dim == space_dim, ExcNotImplemented()); - Assert ((dynamic_cast*> - (&dof_handler.get_tria()) == 0), +#ifdef DEBUG + // Check whether we run on a non parallel mesh or on a + // parallel::distributed::Triangulation in serial + typedef typename parallel::distributed::Triangulation PTRIA; + const PTRIA* ptria_p = dynamic_cast (&dof_handler.get_tria()); + Assert ((ptria_p == 0 || Utilities::MPI::n_mpi_processes(ptria_p->get_communicator()) == 1), ExcMessage ("This function can not be used with distributed triangulations." "See the documentation for more information.")); +#endif typedef typename DH::face_iterator FaceIterator; typedef std::map FaceMap; @@ -3608,8 +3619,7 @@ namespace DoFTools { Assert ((dynamic_cast*> (&dof_handler.get_tria()) - == - 0), + == 0), ExcMessage ("This function can not be used with distributed triangulations." "See the documentation for more information.")); -- 2.39.5