From 473eeb0b02e5e0f5756a57b1ab39a0eab178b704 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sat, 14 Mar 2015 23:48:07 -0500 Subject: [PATCH] Add an assertion to GridGenerator::create_union_triangulation(). --- include/deal.II/grid/grid_generator.h | 4 ++++ source/grid/grid_generator.cc | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/include/deal.II/grid/grid_generator.h b/include/deal.II/grid/grid_generator.h index 11d691e452..3e549022cc 100644 --- a/include/deal.II/grid/grid_generator.h +++ b/include/deal.II/grid/grid_generator.h @@ -698,6 +698,10 @@ namespace GridGenerator * meshes, for example in order to compose a mesh for a complicated geometry * from meshes for simpler geometries, then this is not the function for * you. Instead, consider GridGenerator::merge_triangulations(). + * + * @pre Both of the source conditions need to be available entirely + * locally. In other words, they can not be objects of type + * parallel::distributed::Triangulation. */ template void diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 6ff40765ff..e64b19fcd7 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -3397,6 +3397,12 @@ namespace GridGenerator Assert (GridTools::have_same_coarse_mesh (triangulation_1, triangulation_2), ExcMessage ("The two input triangulations are not derived from " "the same coarse mesh as required.")); + Assert ((dynamic_cast*>(&triangulation_1) == 0) + && + (dynamic_cast*>(&triangulation_2) == 0), + ExcMessage ("The source triangulations for this function must both " + "be available entirely locally, and not be distributed " + "triangulations.")); // first copy triangulation_1, and // then do as many iterations as -- 2.39.5