From 3bc7d54ed000579b9b6f5a1e7d59724593e4672f Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Fri, 9 Oct 2015 13:57:52 +0200
Subject: [PATCH] [multidomain] Add yet another multidomaingrid patch

Apply it also in the external script. The patch
makes entities copy assignable.
---
 bin/installexternal.sh            | 16 ++++++++--------
 patches/multidomaingrid-2.3.patch | 27 +++++++++++++++++++++++++++
 2 files changed, 35 insertions(+), 8 deletions(-)
 create mode 100644 patches/multidomaingrid-2.3.patch

diff --git a/bin/installexternal.sh b/bin/installexternal.sh
index cde2d8e38d..22d4bcbe54 100755
--- a/bin/installexternal.sh
+++ b/bin/installexternal.sh
@@ -130,14 +130,14 @@ installMultidomainGrid()
         return
     fi
 
-#     # apply patch for dune versions newer than 2.3
-#     cd dune-common
-#     DUNE_VERSION=`git status | head -n 1 | awk '{ print $3 }'`
-#     if  [ "$DUNE_VERSION" == "releases/2.4" ] || [ "$DUNE_VERSION" == "master" ]; then
-#         echo "Applying patch"
-#         cd $TOPDIR/dune-multidomaingrid
-#         patch -p1 < $TOPDIR/dumux/patches/multidomaingrid-2.3.patch
-#     fi
+    # apply patch for dune versions newer than 2.3
+    cd dune-common
+    DUNE_VERSION=`git status | head -n 1 | awk '{ print $3 }'`
+    if  [ "$DUNE_VERSION" == "releases/2.4" ] || [ "$DUNE_VERSION" == "master" ]; then
+        echo "Applying patch"
+        cd $TOPDIR/dune-multidomaingrid
+        patch -p1 < $TOPDIR/dumux/patches/multidomaingrid-2.3.patch
+    fi
 
     cd $TOPDIR
 }
diff --git a/patches/multidomaingrid-2.3.patch b/patches/multidomaingrid-2.3.patch
new file mode 100644
index 0000000000..6bda5629d7
--- /dev/null
+++ b/patches/multidomaingrid-2.3.patch
@@ -0,0 +1,27 @@
+diff --git a/dune/grid/multidomaingrid/subdomaingrid/entity.hh b/dune/grid/multidomaingrid/subdomaingrid/entity.hh
+index f65c6a8..e669710 100644
+--- a/dune/grid/multidomaingrid/subdomaingrid/entity.hh
++++ b/dune/grid/multidomaingrid/subdomaingrid/entity.hh
+@@ -413,17 +413,17 @@ public:
+     return false;
+   }
+ 
+-private:
+-
+-  const GridImp& _grid;
+-  MultiDomainEntityPointer _multiDomainEntityPointer;
+-
+   const EntityWrapper& operator=(const EntityWrapper& rhs) {
+     assert(_grid == rhs._grid);
+     reset(rhs._multiDomainEntityPointer);
+     return *this;
+   }
+ 
++private:
++
++  const GridImp& _grid;
++  MultiDomainEntityPointer _multiDomainEntityPointer;
++
+   template<typename MultiDomainIteratorOrEntityPointer>
+   void reset(const MultiDomainIteratorOrEntityPointer& multiDomainEntityPointer) {
+     _multiDomainEntityPointer = multiDomainEntityPointer;
-- 
GitLab