From 2b720aad6407e145c18486f374a5437d2f473e4e Mon Sep 17 00:00:00 2001
From: Oliver Sander <sander@igpm.rwth-aachen.de>
Date: Sun, 7 Mar 2010 20:41:31 +0000
Subject: [PATCH] use the shape functions from dune-localfunctions instead of
 the ones from dune-disc

[[Imported from SVN: r5675]]
---
 src/rodlocalstiffness.hh | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/rodlocalstiffness.hh b/src/rodlocalstiffness.hh
index 7b026094..53ef0879 100644
--- a/src/rodlocalstiffness.hh
+++ b/src/rodlocalstiffness.hh
@@ -4,7 +4,7 @@
 #include <dune/common/fmatrix.hh>
 #include <dune/istl/matrix.hh>
 #include <dune/grid/common/quadraturerules.hh>
-#include <dune/disc/shapefunctions/lagrangeshapefunctions.hh>
+#include <dune/localfunctions/lagrange/p1.hh>
 
 #include "localgeodesicfestiffness.hh"
 #include "rigidbodymotion.hh"
@@ -430,25 +430,23 @@ getStrain(const std::vector<RigidBodyMotion<3> >& localSolution,
     Dune::FieldVector<double, 6> strain(0);
 
     // Extract local solution on this element
-    const Dune::LagrangeShapeFunctionSet<double, double, 1> & baseSet 
-        = Dune::LagrangeShapeFunctions<double, double, 1>::general(element.type(), 1);
-    int numOfBaseFct = baseSet.size();
+    Dune::P1LocalFiniteElement<double,double,1> localFiniteElement;
+    int numOfBaseFct = localFiniteElement.localCoefficients().size();
     
     const Dune::FieldMatrix<double,1,1>& inv = element.geometry().jacobianInverseTransposed(pos);
     
     // ///////////////////////////////////////
     //   Compute deformation gradient
     // ///////////////////////////////////////
-    Dune::FieldVector<double,1> shapeGrad[numOfBaseFct];
+    std::vector<Dune::FieldMatrix<double,1,1> > shapeGrad;
+
+    localFiniteElement.localBasis().evaluateJacobian(pos, shapeGrad);
         
     for (int dof=0; dof<numOfBaseFct; dof++) {
             
-        for (int i=0; i<1; i++)
-            shapeGrad[dof][i] = baseSet[dof].evaluateDerivative(0,i,pos);
-        
         // multiply with jacobian inverse 
         Dune::FieldVector<double,1> tmp(0);
-        inv.umv(shapeGrad[dof], tmp);
+        inv.umv(shapeGrad[dof][0], tmp);
         shapeGrad[dof] = tmp;
         
     }
-- 
GitLab