From: Wolfgang Bangerth Date: Sun, 15 Mar 2015 04:48:07 +0000 (-0500) Subject: Add an assertion to GridGenerator::create_union_triangulation(). X-Git-Tag: v8.3.0-rc1~373^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=473eeb0b02e5e0f5756a57b1ab39a0eab178b704;p=dealii.git Add an assertion to GridGenerator::create_union_triangulation(). --- 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