From 1561b2ab96e86f662bba8e44b73b865a701e20a5 Mon Sep 17 00:00:00 2001
From: Peter Munch <peterrmuench@gmail.com>
Date: Sat, 21 Sep 2019 11:20:09 +0200
Subject: [PATCH] Fix assert

---
 source/dofs/dof_handler_policy.cc | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/source/dofs/dof_handler_policy.cc b/source/dofs/dof_handler_policy.cc
index d47eda9007..27410607da 100644
--- a/source/dofs/dof_handler_policy.cc
+++ b/source/dofs/dof_handler_policy.cc
@@ -4720,11 +4720,14 @@ namespace internal
             [](const typename DoFHandlerType::active_cell_iterator &cell,
                const std::vector<types::global_dof_index> &received_dof_indices)
             -> void {
-            // this function should only be called on ghost cells, and
+            // this function should only be called on ghost cells; however, it
+            // might happen at periodic boundaries that not locally-relevant
+            // cells might have been sent: simply ignore these
+            if (!cell->is_ghost())
+              return;
+
             // on top of that, only on cells that have not been
             // completed -- which we indicate via the user flag.
-            // check both
-            Assert(cell->is_ghost(), ExcInternalError());
             Assert(cell->user_flag_set(), ExcInternalError());
 
             // if we just got an incomplete array of DoF indices, then we must
-- 
2.39.5