From f6cfbc498dfda9dc3456b1e25e74fad39d5c6cf4 Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@mi.fu-berlin.de>
Date: Mon, 17 Oct 2011 12:51:08 +0000
Subject: [PATCH] accidentially commited this file before finishing the whole
 adaption to the new basis structure

[[Imported from SVN: r7939]]
---
 dune/gfe/globalgfetestfunction.hh | 29 ++++++++++-------------------
 1 file changed, 10 insertions(+), 19 deletions(-)

diff --git a/dune/gfe/globalgfetestfunction.hh b/dune/gfe/globalgfetestfunction.hh
index 0062a39d..f026b6f5 100644
--- a/dune/gfe/globalgfetestfunction.hh
+++ b/dune/gfe/globalgfetestfunction.hh
@@ -77,40 +77,31 @@ void GlobalGFETestFunction<Basis,TargetSpace>::evaluateLocal(const Element& elem
     for (int i=0; i<values.size(); i++) {
         int index = basis_.index(element,i);
         for (int j=0; j<tangentDim; j++) {
-            values[i][j] *= coefficients[index][j];
+            values[i][j] *= coefficients_[index][j];
             out += values[i][j];
         }
+    }
 } 
 template<class Basis, class TargetSpace , class CoefficientType>
 void GlobalGFETestFunction<Basis,TargetSpace>::evaluateDerivativeLocal(const Element& element, 
                                             const Dune::FieldVector<gridDim,ctype>& local, 
                                             Dune::FieldMatrix<ctype, embeddedDim, gridDim>& out) const
 {
-    int numOfBasisFct = basis_.getLocalFiniteElement(element).size(); 
-
-    // Extract local base and test coefficients 
-    std::vector<TargetSpace> localBaseCoeff(numOfBaseFct);
-    std::vector<TangentVector> localTestCoeff(numOfBaseFct);
-
-    for (int i=0; i<numOfBaseFct; i++) {
-        localBaseCoeff[i] = baseCoefficients_[basis_.index(element,i)];
-        localTestCoeff[i] = testCoefficients_[basis_.index(element,i)];
-    }
-
     // jacobians of the test basis function  - a lot of dims here...
     std::vector<Dune::array<Dune::FieldMatrix<ctype, embeddedDim, gridDim>, tangentDim> > jacobians; 
 
-    // create local gfe test function
-    LocalGFETestFunction localGFE(basis_.getLocalFiniteElement(element),localBaseCoeff);
-    localGFE.evaluateJacobian(local, jacobians);
+    // evaluate local gfe test function basis
+    basis_.getLocalFiniteElement(element).localBasis().evaluateJacobian(local, jacobians);
 
-    // multiply values with the corresponding test coefficients
+    // multiply values with the corresponding test coefficients and sum them up
     out = 0;
 
-    for (int i=0; i<jacobians.size(); i++)
+    for (int i=0; i<jacobians.size(); i++) {
+        int index = basis_.index(element,i);
         for (int j=0; j<tangentDim; j++) {
-            jacobians[i][j] *= localTestCoeff[i][j];
-            out += values[i][j];
+            jacobians[i][j] *= coefficients_[index][j];
+            out += jacobians[i][j];
         }
+    }
 }
 #endif
-- 
GitLab