Skip to content
Snippets Groups Projects

Fix error in nonplanarcosseratshellenergy

1 file
+ 5
2
Compare changes
  • Side-by-side
  • Inline
  • d9e66115
    The contravariant base vectors were not calculated correctly.
    The contravariant base vectors are the *columns* of the inverse of the covariant matrix, not the rows.
    To fix this, take the rows of the transpose of inverse of the covariant matrix.
@@ -228,8 +228,11 @@ energy(const typename Basis::LocalView& localView,
aCovariant[2] = Dune::MatrixVector::crossProduct(aCovariant[0], aCovariant[1]);
aCovariant[2] /= aCovariant[2].two_norm();
auto aContravariant = aCovariant;
aContravariant.invert();
auto aCovariantInv = aCovariant;
aCovariantInv.invert();
// The contravariant base vectors are the *columns* of the inverse of the covariant matrix
// To get an easier access to the columns, we use the transpose of the contravariant matrix
auto aContravariant = Dune::GFE::transpose(aCovariantInv);
Dune::FieldMatrix<double,3,3> a(0);
for (int alpha=0; alpha<gridDim; alpha++)
Loading