From 54dd9874967b92c71d10e15b5956af6605f9d6f4 Mon Sep 17 00:00:00 2001
From: Felix Schindler <felix.schindler@wwu.de>
Date: Wed, 21 Nov 2018 21:44:47 +0100
Subject: [PATCH] [dd.glued] disallow UGGrid as local grid in parallel
 environments

---
 dune/xt/grid/dd/glued.hh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/dune/xt/grid/dd/glued.hh b/dune/xt/grid/dd/glued.hh
index ff231bc8d..7d1fa9784 100644
--- a/dune/xt/grid/dd/glued.hh
+++ b/dune/xt/grid/dd/glued.hh
@@ -139,6 +139,22 @@ class Glued
   };
 #endif // HAVE_DUNE_ALUGRID
 
+#if HAVE_MPI && (HAVE_DUNE_UGGRID || HAVE_UG)
+  // UGGrid does not support multiple parallel instances in parallel and we have no means yet to create multiple
+  // sequential grids once MPI was found.
+  template <bool anything>
+  struct allowed_local_grid<UGGrid<2>, anything>
+  {
+    static const bool value = false;
+  };
+
+  template <bool anything>
+  struct allowed_local_grid<UGGrid<3>, anything>
+  {
+    static const bool value = false;
+  };
+#endif
+
   static_assert(allowed_macro_grid<MacroGridImp>::value,
                 "This macro grid is known to fail, enable on your onw risk by disabling this check!");
   static_assert(allowed_local_grid<LocalGridImp>::value,
-- 
GitLab