From: Timo Heister Date: Wed, 22 Apr 2015 13:24:33 +0000 (-0400) Subject: add check in interpolate_to_different_mesh X-Git-Tag: v8.3.0-rc1~220^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F860%2Fhead;p=dealii.git add check in interpolate_to_different_mesh --- diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 71efeb6d14..faf4ccc3d7 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -585,6 +585,24 @@ namespace VectorTools interpolate_to_different_mesh(intergridmap, u1, constraints, u2); } + namespace internal + { + /** + * Returns whether the cell and all of its descendants are locally owned. + */ + template + bool is_locally_owned(const cell_iterator &cell) + { + if (cell->active()) + return cell->is_locally_owned(); + + for (unsigned int c=0; cn_children(); ++c) + if (!is_locally_owned(cell->child(c))) + return false; + + return true; + } + } template active() && !cell2->active()) continue; - // skip foreign cells + Assert(internal::is_locally_owned(cell1) == internal::is_locally_owned(cell2), + ExcMessage("The two Triangulations are required to have the same parallel partitioning.")); + + // Skip foreign cells. if (cell1->active() && !cell1->is_locally_owned()) continue; if (cell2->active() && !cell2->is_locally_owned())