From 063843827589cbfc92bc343ca2ec08960ad94dac Mon Sep 17 00:00:00 2001
From: Jonathan Youett <youett@mi.fu-berlin.de>
Date: Wed, 17 Apr 2013 10:12:53 +0000
Subject: [PATCH] bugfix in linearisedDefDet: index was computed wrong

[[Imported from SVN: r11291]]
---
 dune/elasticity/common/elasticityhelpers.hh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/dune/elasticity/common/elasticityhelpers.hh b/dune/elasticity/common/elasticityhelpers.hh
index 279fdaf..4decd06 100644
--- a/dune/elasticity/common/elasticityhelpers.hh
+++ b/dune/elasticity/common/elasticityhelpers.hh
@@ -5,6 +5,8 @@
 
 #include <dune/common/fmatrix.hh>
 
+#include <dune/fufem/symmetrictensor.hh>
+
 namespace Dune {
 
     namespace Elasticity {
@@ -133,7 +135,7 @@ namespace Dune {
             linDet = 0;
             for (int i=0; i<2; i++)                       
                 for (int j=(i+1)%3; j<3; j++) {
-                    int k=(j+1)%3 + (j+1)/3;          
+                    int k=(-(i+j))%3;
                     linDet[i][j] = u[j][k]*u[k][i] - u[j][i]*(1+u[k][k]);
                     linDet[j][i] = u[k][j]*u[i][k] - u[i][j]*(1+u[k][k]);
             }    
@@ -213,7 +215,7 @@ namespace Dune {
             // 1 1 1 0   -->  0  - 0
             // 1 1 1 1   -->  0  - 0
         }
-        
+
         double det_val(const Dune::FieldMatrix<double,3,3>& u) {
             return (1+u[0][0])*(1+u[1][1])*(1+u[2][2])
                 + u[0][1]*u[1][2]*u[2][0]
-- 
GitLab