From: Peter Munch Date: Mon, 8 Mar 2021 16:59:23 +0000 (+0100) Subject: Add assert to exchange_cell_data for p:s:T (without artifical cell) X-Git-Tag: v9.3.0-rc1~361^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae261241a9c4f6b96118bb081b66b1d7de4e4e99;p=dealii.git Add assert to exchange_cell_data for p:s:T (without artifical cell) --- diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index 970819d4d9..e81903665c 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -25,6 +25,8 @@ # include +# include + # include # include @@ -4114,8 +4116,7 @@ namespace GridTools (void)cell_filter; (void)process_cells; (void)compute_ghost_owners; - Assert(false, - ExcMessage("GridTools::exchange_cell_data() requires MPI.")); + Assert(false, ExcNeedsMPI()); # else constexpr int dim = MeshType::dimension; constexpr int spacedim = MeshType::space_dimension; @@ -4127,6 +4128,21 @@ namespace GridTools ExcMessage( "The function exchange_cell_data_to_ghosts() only works with parallel triangulations.")); + if (const auto tria = dynamic_cast< + const parallel::shared::Triangulation *>( + &mesh.get_triangulation())) + { + Assert( + tria->with_artificial_cells(), + ExcMessage( + "The functions GridTools::exchange_cell_data_to_ghosts() and " + "GridTools::exchange_cell_data_to_level_ghosts() can only " + "operate on a single layer ghost cells. However, you have " + "given a Triangulation object of type " + "parallel::shared::Triangulation without artificial cells " + "resulting in arbitrary numbers of ghost layers.")); + } + // build list of cells to request for each neighbor std::set ghost_owners = compute_ghost_owners(*tria); @@ -4344,9 +4360,7 @@ namespace GridTools (void)pack; (void)unpack; (void)cell_filter; - Assert(false, - ExcMessage( - "GridTools::exchange_cell_data_to_ghosts() requires MPI.")); + Assert(false, ExcNeedsMPI()); # else internal::exchange_cell_data