From c1e55147e65495b8a3db925f12b5ddac294f88c9 Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Fri, 16 Dec 2011 13:24:07 +0000
Subject: [PATCH] make it compile on newer systems and systems with MPI enabled
 again

"newer" means opensuse 11.4 with GCC 4.6.1

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@7089 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/common/fixedlengthspline_.hh           |  8 ++++----
 dumux/common/splinecommon_.hh                |  6 ++++++
 dumux/common/variablelengthspline_.hh        |  8 ++++----
 dumux/linear/foreignoverlapfrombcrsmatrix.hh |  1 +
 dumux/linear/overlappingbcrsmatrix.hh        |  4 ++--
 dumux/linear/overlappingblockvector.hh       | 12 ++++++------
 6 files changed, 23 insertions(+), 16 deletions(-)

diff --git a/dumux/common/fixedlengthspline_.hh b/dumux/common/fixedlengthspline_.hh
index 886ea68149..eccb78d139 100644
--- a/dumux/common/fixedlengthspline_.hh
+++ b/dumux/common/fixedlengthspline_.hh
@@ -228,8 +228,8 @@ public:
         typename XYContainer::const_iterator it = points.begin();
         typename XYContainer::const_iterator endIt = points.end();
         for (int i = 0; it != endIt; ++i, ++it) {
-            xPos_[i] = std::tr1::get<0>(*it);
-            yPos_[i] = std::tr1::get<1>(*it);
+            xPos_[i] = std::get<0>(*it);
+            yPos_[i] = std::get<1>(*it);
         }
 
         // make a full spline
@@ -392,8 +392,8 @@ public:
         typename XYContainer::const_iterator it = points.begin();
         typename XYContainer::const_iterator endIt = points.end();
         for (int i = 0; it != endIt; ++i, ++it) {
-            xPos_[i] = std::tr1::get<0>(*it);
-            yPos_[i] = std::tr1::get<1>(*it);
+            xPos_[i] = std::get<0>(*it);
+            yPos_[i] = std::get<1>(*it);
         }
 
         // make a natural spline
diff --git a/dumux/common/splinecommon_.hh b/dumux/common/splinecommon_.hh
index aebcff7055..634d07b9d3 100644
--- a/dumux/common/splinecommon_.hh
+++ b/dumux/common/splinecommon_.hh
@@ -34,6 +34,12 @@
 #include <iostream>
 #include <assert.h>
 
+#if __GNUC__ <= 4 &&  __GNUC_MINOR__ < 5
+namespace std {
+using tr1::get;
+};
+#endif
+
 namespace Dumux
 {
 //! \cond INTERNAL
diff --git a/dumux/common/variablelengthspline_.hh b/dumux/common/variablelengthspline_.hh
index 8a9ac906e9..d0f9a7d5c8 100644
--- a/dumux/common/variablelengthspline_.hh
+++ b/dumux/common/variablelengthspline_.hh
@@ -238,8 +238,8 @@ public:
         typename XYContainer::const_iterator it = points.begin();
         typename XYContainer::const_iterator endIt = points.end();
         for (int i = 0; it != endIt; ++i, ++it) {
-            xPos_[i] = std::tr1::get<0>(*it);
-            yPos_[i] = std::tr1::get<1>(*it);
+            xPos_[i] = std::get<0>(*it);
+            yPos_[i] = std::get<1>(*it);
         }
 
         // make a full spline
@@ -409,8 +409,8 @@ public:
         typename XYContainer::const_iterator it = points.begin();
         typename XYContainer::const_iterator endIt = points.end();
         for (int i = 0; it != endIt; ++i, ++it) {
-            xPos_[i] = std::tr1::get<0>(*it);
-            yPos_[i] = std::tr1::get<1>(*it);
+            xPos_[i] = std::get<0>(*it);
+            yPos_[i] = std::get<1>(*it);
         }
 
         // make a natural spline
diff --git a/dumux/linear/foreignoverlapfrombcrsmatrix.hh b/dumux/linear/foreignoverlapfrombcrsmatrix.hh
index 4ba0988fa2..ad7c47536e 100644
--- a/dumux/linear/foreignoverlapfrombcrsmatrix.hh
+++ b/dumux/linear/foreignoverlapfrombcrsmatrix.hh
@@ -41,6 +41,7 @@
 #include <list>
 #include <set>
 #include <map>
+#include <tr1/tuple>
 
 #if HAVE_MPI
 #include <mpi.h>
diff --git a/dumux/linear/overlappingbcrsmatrix.hh b/dumux/linear/overlappingbcrsmatrix.hh
index 08d9186e4a..2e4662ba64 100644
--- a/dumux/linear/overlappingbcrsmatrix.hh
+++ b/dumux/linear/overlappingbcrsmatrix.hh
@@ -346,7 +346,7 @@ private:
         typename ForeignOverlapWithPeer::const_iterator endIt = peerOverlap.end();
         int i = 0;
         for (; it != endIt; ++it, ++i) {
-            int rowIdx = std::get<0>(*it);
+            int rowIdx = std::tr1::get<0>(*it);
             assert(overlap_->isDomesticIndexFor(peerRank, rowIdx));
 
             typedef typename BCRSMatrix::ConstColIterator ColIt;
@@ -374,7 +374,7 @@ private:
         i = 0;
         it = peerOverlap.begin();
         for (; it != endIt; ++it) {
-            int rowIdx = std::get<0>(*it);
+            int rowIdx = std::tr1::get<0>(*it);
             assert(overlap_->isDomesticIndexFor(peerRank, rowIdx));
 
             typedef typename BCRSMatrix::ConstColIterator ColIt;
diff --git a/dumux/linear/overlappingblockvector.hh b/dumux/linear/overlappingblockvector.hh
index 850bdf8100..6d4e848550 100644
--- a/dumux/linear/overlappingblockvector.hh
+++ b/dumux/linear/overlappingblockvector.hh
@@ -282,7 +282,7 @@ private:
 #if HAVE_MPI
         // create array for the front indices
         int numDomestic = overlap_->numDomestic();
-        frontMaster_ = std::shared_ptr<std::vector<ProcessRank> >(new std::vector<ProcessRank>(numDomestic, -1));
+        frontMaster_ = std::tr1::shared_ptr<std::vector<ProcessRank> >(new std::vector<ProcessRank>(numDomestic, -1));
 
         typename PeerSet::const_iterator peerIt;
         typename PeerSet::const_iterator peerEndIt = overlap_->peerSet().end();
@@ -294,9 +294,9 @@ private:
 
             const DomesticOverlapWithPeer &domesticOverlap = overlap_->domesticOverlapWithPeer(peerRank);
             int numEntries = domesticOverlap.size();
-            numIndicesSendBuff_[peerRank] = std::shared_ptr<MpiBuffer<int> >(new MpiBuffer<int>(1));
-            indicesSendBuff_[peerRank] = std::shared_ptr<MpiBuffer<RowIndex> >(new MpiBuffer<RowIndex>(numEntries));
-            valuesSendBuff_[peerRank] = std::shared_ptr<MpiBuffer<FieldVector> >(new MpiBuffer<FieldVector>(numEntries));
+            numIndicesSendBuff_[peerRank] = std::tr1::shared_ptr<MpiBuffer<int> >(new MpiBuffer<int>(1));
+            indicesSendBuff_[peerRank] = std::tr1::shared_ptr<MpiBuffer<RowIndex> >(new MpiBuffer<RowIndex>(numEntries));
+            valuesSendBuff_[peerRank] = std::tr1::shared_ptr<MpiBuffer<FieldVector> >(new MpiBuffer<FieldVector>(numEntries));
 
             // fill the indices buffer with global indices
             MpiBuffer<RowIndex> &indicesSendBuff = *indicesSendBuff_[peerRank];
@@ -327,8 +327,8 @@ private:
             numRows = numRowsRecvBuff[0];
 
             // then, create the MPI buffers
-            indicesRecvBuff_[peerRank] = std::shared_ptr<MpiBuffer<RowIndex> >(new MpiBuffer<RowIndex>(numRows));
-            valuesRecvBuff_[peerRank] = std::shared_ptr<MpiBuffer<FieldVector> >(new MpiBuffer<FieldVector>(numRows));
+            indicesRecvBuff_[peerRank] = std::tr1::shared_ptr<MpiBuffer<RowIndex> >(new MpiBuffer<RowIndex>(numRows));
+            valuesRecvBuff_[peerRank] = std::tr1::shared_ptr<MpiBuffer<FieldVector> >(new MpiBuffer<FieldVector>(numRows));
             MpiBuffer<RowIndex> &indicesRecvBuff = *indicesRecvBuff_[peerRank];
 
             // next, receive the actual indices
-- 
GitLab