diff --git a/dune/elasticity/common/elasticityhelpers.hh b/dune/elasticity/common/elasticityhelpers.hh index 10d7881bd8f04e3b0cfc7dd57df9f6c3be623779..960d4a163b4ffb49dc975e71ecbf14c559b40282 100644 --- a/dune/elasticity/common/elasticityhelpers.hh +++ b/dune/elasticity/common/elasticityhelpers.hh @@ -140,7 +140,7 @@ namespace Dune { - (Delta<(p+1)%3,(q-1)%3>::delta+u[(p+1)%3][(q-1)%3]) * (Delta<(p+2)%3,(q-2)%3>::delta+u[(p+2)%3][(q-2)%3]); } - + /** \brief Compute linearization of the determinant of a deformation gradient. Multiplication with a test function(scalar) gradient, gives the linearization in the direction of the test function. * * \param u The displacement gradient(!) at which the determinant is evaluated @@ -148,18 +148,18 @@ namespace Dune { void linearisedDefDet(const Dune::FieldMatrix<double,3,3>& u, Dune::FieldMatrix<double,3,3>& linDet) { linDet = 0; - for (int i=0; i<2; i++) + for (int i=0; i<2; i++) for (int j=i+1; j<3; j++) { int k=(3-(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]); - } + } // the diagonal parts for (int i=0; i<3; i++) linDet[i][i] = (u[(i+1)%3][(i+1)%3]+1)*(u[(i+2)%3][(i+2)%3]+1)-u[(i+1)%3][(i+2)%3]*u[(i+2)%3][(i+1)%3]; } - + /** \brief Compute linearization of the determinant of a deformation gradient. Multiplication with a test function(scalar) gradient, gives the linearization in the direction of the test function. * * \param u The displacement gradient(!) at which the determinant is evaluated