From 0deac670cf668b616c38872c852e17a748c93e4b Mon Sep 17 00:00:00 2001 From: Timo Heister Date: Fri, 17 Apr 2015 12:31:17 -0400 Subject: [PATCH] make interpolate_to_different_mesh work in parallel --- include/deal.II/numerics/vector_tools.h | 4 ++++ include/deal.II/numerics/vector_tools.templates.h | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/include/deal.II/numerics/vector_tools.h b/include/deal.II/numerics/vector_tools.h index a35cbd384a..3ed365c84d 100644 --- a/include/deal.II/numerics/vector_tools.h +++ b/include/deal.II/numerics/vector_tools.h @@ -515,6 +515,10 @@ namespace VectorTools * ConstraintMatrix argument, see below, or make the field conforming * yourself by calling the @p ConstraintsMatrix::distribute function of your * hanging node constraints object. + * + * @note: This function works with parallel::distributed::Triangulation, but only + * if the parallel partitioning is the same for both meshes (see the + * no_automatic_repartitioning flag). */ template class DH, diff --git a/include/deal.II/numerics/vector_tools.templates.h b/include/deal.II/numerics/vector_tools.templates.h index 77e7605a48..71efeb6d14 100644 --- a/include/deal.II/numerics/vector_tools.templates.h +++ b/include/deal.II/numerics/vector_tools.templates.h @@ -631,6 +631,12 @@ namespace VectorTools if (!cell1->active() && !cell2->active()) continue; + // skip foreign cells + if (cell1->active() && !cell1->is_locally_owned()) + continue; + if (cell2->active() && !cell2->is_locally_owned()) + continue; + Assert(cell1->get_fe().get_name() == cell2->get_fe().get_name(), ExcMessage ("Source and destination cells need to use the same finite element")); -- 2.39.5