From 6a628f293dff56df892b4e163cce1ee745ffb3b9 Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Wed, 25 Jul 2018 17:11:45 +0200
Subject: [PATCH] [parallel] specialize canCommunicate capability for UGGrid

This hasn't happened until now in dune-grid such that AMG uses
sequential traits for a parallel UGGrid. Implement this as a
temporary solution until it is fixed upstream.
---
 dumux/linear/amgtraits.hh | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/dumux/linear/amgtraits.hh b/dumux/linear/amgtraits.hh
index ea0f779c9b..6e9c815abe 100644
--- a/dumux/linear/amgtraits.hh
+++ b/dumux/linear/amgtraits.hh
@@ -34,6 +34,26 @@
 
 #include <dumux/discretization/methods.hh>
 
+// TODO: The following is a temporary solution to make the parallel AMG work
+// for UGGrid. Once it is resolved upstream
+// (https://gitlab.dune-project.org/core/dune-grid/issues/78),
+// it should be guarded by a DUNE_VERSION macro and removed later.
+#include <dune/grid/uggrid.hh>
+
+namespace Dune {
+namespace Capabilities {
+
+#if HAVE_UG
+template<int dim, int codim>
+struct canCommunicate<UGGrid<dim>, codim>
+{
+  static const bool v = true;
+};
+#endif
+
+} // namespace Capabilities
+} // namespace Dune
+
 namespace Dumux {
 
 //! The implementation is specialized for the different discretizations
-- 
GitLab