From 676a0704d41af942101694a998e7c2ade7d7d226 Mon Sep 17 00:00:00 2001
From: Bernd Flemisch <bernd@iws.uni-stuttgart.de>
Date: Thu, 29 Nov 2012 09:06:39 +0000
Subject: [PATCH] implicit branch: get rid of the extra
 elementIntrinsicPermeability function again, at the expense of more
 complicated code in the flux variables. Works now for both scalar and
 tensorial perms.

git-svn-id: svn://svn.iws.uni-stuttgart.de/DUMUX/dumux/branches/implicit@9713 2fb0f335-1f38-0410-981e-8018bf24f1b0
---
 dumux/implicit/1p2c/1p2cfluxvariables.hh            | 12 ++++++++++--
 dumux/implicit/box/boxforchheimerfluxvariables.hh   | 12 ++++++++++--
 dumux/implicit/common/implicitdarcyfluxvariables.hh | 12 ++++++++++--
 dumux/material/spatialparams/boxspatialparams1p.hh  |  7 -------
 4 files changed, 30 insertions(+), 13 deletions(-)

diff --git a/dumux/implicit/1p2c/1p2cfluxvariables.hh b/dumux/implicit/1p2c/1p2cfluxvariables.hh
index 9dd73c1563..eca03684d0 100644
--- a/dumux/implicit/1p2c/1p2cfluxvariables.hh
+++ b/dumux/implicit/1p2c/1p2cfluxvariables.hh
@@ -363,9 +363,17 @@ protected:
         }
         else
         {
+            const Element& elementI = *fvGeometry_.neighbors[face().i];
+            FVElementGeometry fvGeometryI;
+            fvGeometryI.subContVol[0].global = elementI.geometry().center();
+            
+            const Element& elementJ = *fvGeometry_.neighbors[face().j];
+            FVElementGeometry fvGeometryJ;
+            fvGeometryJ.subContVol[0].global = elementJ.geometry().center();
+            
             sp.meanK(K_,
-                     sp.elementIntrinsicPermeability(*fvGeometry_.neighbors[face().i]),
-                     sp.elementIntrinsicPermeability(*fvGeometry_.neighbors[face().j]));
+                     sp.intrinsicPermeability(elementI, fvGeometryI, 0),
+                     sp.intrinsicPermeability(elementJ, fvGeometryJ, 0));
         }
     }
 
diff --git a/dumux/implicit/box/boxforchheimerfluxvariables.hh b/dumux/implicit/box/boxforchheimerfluxvariables.hh
index 6fc90ca614..184289b240 100644
--- a/dumux/implicit/box/boxforchheimerfluxvariables.hh
+++ b/dumux/implicit/box/boxforchheimerfluxvariables.hh
@@ -145,9 +145,17 @@ protected:
         }
         else
         {
+            const Element& elementI = *this->fvGeometry_.neighbors[this->face().i];
+            FVElementGeometry fvGeometryI;
+            fvGeometryI.subContVol[0].global = elementI.geometry().center();
+            
+            const Element& elementJ = *this->fvGeometry_.neighbors[this->face().j];
+            FVElementGeometry fvGeometryJ;
+            fvGeometryJ.subContVol[0].global = elementJ.geometry().center();
+            
             spatialParams.meanK(K,
-                                spatialParams.elementIntrinsicPermeability(*this->fvGeometry_.neighbors[this->face().i]),
-                                spatialParams.elementIntrinsicPermeability(*this->fvGeometry_.neighbors[this->face().j]));
+                                spatialParams.intrinsicPermeability(elementI, fvGeometryI, 0),
+                                spatialParams.intrinsicPermeability(elementJ, fvGeometryJ, 0));
         }
         
         // obtain the Forchheimer coefficient from the spatial parameters
diff --git a/dumux/implicit/common/implicitdarcyfluxvariables.hh b/dumux/implicit/common/implicitdarcyfluxvariables.hh
index d529fce5e4..9507d03a89 100644
--- a/dumux/implicit/common/implicitdarcyfluxvariables.hh
+++ b/dumux/implicit/common/implicitdarcyfluxvariables.hh
@@ -257,9 +257,17 @@ protected:
         }
         else
         {
+            const Element& elementI = *fvGeometry_.neighbors[face().i];
+            FVElementGeometry fvGeometryI;
+            fvGeometryI.subContVol[0].global = elementI.geometry().center();
+            
+            const Element& elementJ = *fvGeometry_.neighbors[face().j];
+            FVElementGeometry fvGeometryJ;
+            fvGeometryJ.subContVol[0].global = elementJ.geometry().center();
+            
             spatialParams.meanK(K,
-                                spatialParams.elementIntrinsicPermeability(*fvGeometry_.neighbors[face().i]),
-                                spatialParams.elementIntrinsicPermeability(*fvGeometry_.neighbors[face().j]));
+                                spatialParams.intrinsicPermeability(elementI, fvGeometryI, 0),
+                                spatialParams.intrinsicPermeability(elementJ, fvGeometryJ, 0));
         }
         
         // loop over all phases
diff --git a/dumux/material/spatialparams/boxspatialparams1p.hh b/dumux/material/spatialparams/boxspatialparams1p.hh
index b1c6e0e706..bb73bcfd7b 100644
--- a/dumux/material/spatialparams/boxspatialparams1p.hh
+++ b/dumux/material/spatialparams/boxspatialparams1p.hh
@@ -107,13 +107,6 @@ public:
                 result[i][j] = harmonicMean(K1[i][j], K2[i][j]);
     }
 
-    Scalar elementIntrinsicPermeability (const Element &element) const
-    {
-        FVElementGeometry fvGeometry;
-        fvGeometry.subContVol[0].global = element.geometry().center();
-        return asImp_().intrinsicPermeability(element, fvGeometry, /*scvIdx=*/0);
-    }
-    
     /*!
      * \brief Function for defining the intrinsic (absolute) permeability.
      *
-- 
GitLab