From 377e965a1a7003003cbc52c9e2cc04feee703ffd Mon Sep 17 00:00:00 2001
From: Andreas Lauser <and@poware.org>
Date: Fri, 2 Sep 2011 11:54:49 +0000
Subject: [PATCH] 2pni box model: make it compile with Scalar != double

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/trunk@6572 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/boxmodels/2pni/2pnilocalresidual.hh         | 5 ++++-
 test/boxmodels/2p2c/injectionspatialparameters.hh | 4 ++--
 test/boxmodels/2pni/injectionproblem2pni.hh       | 4 ++--
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dumux/boxmodels/2pni/2pnilocalresidual.hh b/dumux/boxmodels/2pni/2pnilocalresidual.hh
index 222336999c..82d787599c 100644
--- a/dumux/boxmodels/2pni/2pnilocalresidual.hh
+++ b/dumux/boxmodels/2pni/2pnilocalresidual.hh
@@ -153,7 +153,10 @@ public:
             // current sub control volume face
             fluxVars.intrinsicPermeability().mv(fluxVars.potentialGrad(phaseIdx),
                                                 tmpVec);
-            Scalar normalFlux = - (tmpVec*fluxVars.face().normal);
+            Scalar normalFlux = 0;
+            for (int i = 0; i < Vector::size; ++i)
+                normalFlux += tmpVec[i]*fluxVars.face().normal[i];
+            normalFlux *= -1;
 
             // data attached to upstream and the downstream vertices
             // of the current phase
diff --git a/test/boxmodels/2p2c/injectionspatialparameters.hh b/test/boxmodels/2p2c/injectionspatialparameters.hh
index 820ca1a329..47258404d1 100644
--- a/test/boxmodels/2p2c/injectionspatialparameters.hh
+++ b/test/boxmodels/2p2c/injectionspatialparameters.hh
@@ -253,8 +253,8 @@ public:
         // arithmetic mean of the liquid saturation and the porosity
         const int i = fvElemGeom.subContVolFace[scvfIdx].i;
         const int j = fvElemGeom.subContVolFace[scvfIdx].j;
-        Scalar Sl = std::max(0.0, (vDat[i].saturation(lPhaseIdx) +
-                                     vDat[j].saturation(lPhaseIdx)) / 2);
+        Scalar Sl = std::max<Scalar>(0.0, (vDat[i].saturation(lPhaseIdx) +
+                                           vDat[j].saturation(lPhaseIdx)) / 2);
         Scalar poro = (porosity(element, fvElemGeom, i) +
                        porosity(element, fvElemGeom, j)) / 2;
 
diff --git a/test/boxmodels/2pni/injectionproblem2pni.hh b/test/boxmodels/2pni/injectionproblem2pni.hh
index 6f8b92f894..7e6f82c5ca 100644
--- a/test/boxmodels/2pni/injectionproblem2pni.hh
+++ b/test/boxmodels/2pni/injectionproblem2pni.hh
@@ -26,8 +26,8 @@
  *        passes a high temperature area.
  */
 
-#ifndef DUMUX_INJECTIONPROBLEM2PNI_HH
-#define DUMUX_INJECTIONPROBLEM2PNI_HH
+#ifndef DUMUX_INJECTION_PROBLEM_2PNI_HH
+#define DUMUX_INJECTION_PROBLEM_2PNI_HH
 
 #include <dune/grid/io/file/dgfparser/dgfug.hh>
 #include <dune/grid/io/file/dgfparser/dgfs.hh>
-- 
GitLab