From cec5ff8230eec11339233c8d6ffc02a9cdc16f8d Mon Sep 17 00:00:00 2001
From: DennisGlaeser <dennis.glaeser@iws.uni-stuttgart.de>
Date: Tue, 5 Jul 2016 11:09:15 +0200
Subject: [PATCH] [tpfa][fvgeomvec] return fvgeoms only for elements

---
 dumux/implicit/cellcentered/localjacobian.hh           | 10 ++--------
 .../cellcentered/tpfa/fvelementgeometryvector.hh       |  9 ++-------
 dumux/implicit/model.hh                                |  5 +----
 3 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/dumux/implicit/cellcentered/localjacobian.hh b/dumux/implicit/cellcentered/localjacobian.hh
index 0cf4858490..41b4709569 100644
--- a/dumux/implicit/cellcentered/localjacobian.hh
+++ b/dumux/implicit/cellcentered/localjacobian.hh
@@ -124,8 +124,8 @@ public:
             assemblyMap_[globalI].reserve(neighborStencil.size());
             for (auto globalJ : neighborStencil)
             {
-                const auto& fvGeometry = this->model_().fvGeometries(globalJ);
                 const auto& elementJ = this->model_().fvGeometries().element(globalJ);
+                const auto& fvGeometry = this->model_().fvGeometries(elementJ);
 
                 // find the flux vars needed for the calculation of the flux into element
                 std::vector<IndexType> fluxVarIndices;
@@ -166,7 +166,7 @@ public:
         // finite volume geometry
         globalI_ = this->problem_().elementMapper().index(element);
 
-        const auto& fvGeometry = fvElemGeom_();
+        const auto& fvGeometry = this->model_().fvGeometries(element);
         bcTypes_.update(this->problem_(), element, fvGeometry);
 
         // calculate the local residual
@@ -339,12 +339,6 @@ public:
         }
     }
 
-
-    const FVElementGeometry& fvElemGeom_() const
-    {
-        return this->model_().fvGeometries(globalI_);
-    }
-
     IndexType globalI_;
     ElementBoundaryTypes bcTypes_;
 
diff --git a/dumux/implicit/cellcentered/tpfa/fvelementgeometryvector.hh b/dumux/implicit/cellcentered/tpfa/fvelementgeometryvector.hh
index a705b9b4c3..d088663ff8 100644
--- a/dumux/implicit/cellcentered/tpfa/fvelementgeometryvector.hh
+++ b/dumux/implicit/cellcentered/tpfa/fvelementgeometryvector.hh
@@ -64,9 +64,9 @@ public:
      * \note The finite volume geometry offers iterators over the sub control volumes
      *       and the sub control volume faces of an element.
      */
-    const FVElementGeometry& fvGeometry(IndexType eIdx) const
+    const FVElementGeometry& fvGeometry(const Element& element) const
     {
-        return fvGeometries_[eIdx];
+        return fvGeometries_[problem_().elementMapper().index(element)];
     }
 
     //! Get a sub control volume with a global scv index
@@ -197,11 +197,6 @@ public:
      * \note The finite volume geometry offers iterators over the sub control volumes
      *       and the sub control volume faces of an element.
      */
-    const FVElementGeometry& fvGeometry(IndexType eIdx) const
-    {
-        return fvGeometries_[getStencilScvIdx_(eIdx)];
-    }
-
     const FVElementGeometry& fvGeometry(const Element& element) const
     {
         return fvGeometries_[getStencilScvIdx_(problem_().elementMapper().index(element))];
diff --git a/dumux/implicit/model.hh b/dumux/implicit/model.hh
index e7577e0757..d51bfdbf20 100644
--- a/dumux/implicit/model.hh
+++ b/dumux/implicit/model.hh
@@ -793,10 +793,7 @@ public:
     { return *fvGeometryVector_; }
 
     const FVElementGeometry& fvGeometries(const Element& element) const
-    { return fvGeometryVector_->fvGeometry(elementMapper().index(element)); }
-
-    const FVElementGeometry& fvGeometries(unsigned int eIdx) const
-    { return fvGeometryVector_->fvGeometry(eIdx); }
+    { return fvGeometryVector_->fvGeometry(element); }
 
 protected:
 
-- 
GitLab