Skip to content
Snippets Groups Projects
Commit 31a13688 authored by oliver.sander_at_tu-dresden.de's avatar oliver.sander_at_tu-dresden.de
Browse files

Fix evil bug in output code

The computation of element centers was wrong (it was in global
coordinates rather than in local ones).  This did not matter
for quasiconvexity-test.cc (because there all shape function
derivatives are constant, and it doesn't matter where you
evaluate them).  But it lead to wrong results in
quasiconvexity-test-micromorphic.cc.
parent c985cd28
No related branches found
No related tags found
No related merge requests found
...@@ -76,7 +76,7 @@ void writeDisplacement(const Basis& basis, const Vector& deformation, const Fiel ...@@ -76,7 +76,7 @@ void writeDisplacement(const Basis& basis, const Vector& deformation, const Fiel
// store values of shape functions // store values of shape functions
std::vector<Dune::FieldVector<double,dim> > shapeFunctionValues(localFiniteElement.size()); std::vector<Dune::FieldVector<double,dim> > shapeFunctionValues(localFiniteElement.size());
auto p = element.geometry().center(); auto p = referenceElement(element).position(0,0); // Element center in local coordinates
// get gradients of shape functions // get gradients of shape functions
localFiniteElement.localBasis().evaluateFunction(p, shapeFunctionValues); localFiniteElement.localBasis().evaluateFunction(p, shapeFunctionValues);
......
...@@ -139,7 +139,7 @@ void writeDisplacement(const Basis& basis, const Vector& periodicX, const FieldM ...@@ -139,7 +139,7 @@ void writeDisplacement(const Basis& basis, const Vector& periodicX, const FieldM
std::vector<Dune::FieldMatrix<double,1,dim> > referenceGradients(localFiniteElement.size()); std::vector<Dune::FieldMatrix<double,1,dim> > referenceGradients(localFiniteElement.size());
std::vector<Dune::FieldVector<double,dim> > gradients(localFiniteElement.size()); std::vector<Dune::FieldVector<double,dim> > gradients(localFiniteElement.size());
auto p = element.geometry().center(); auto p = referenceElement(element).position(0,0); // Element center in local coordinates
const auto jacobianInverseTransposed = element.geometry().jacobianInverseTransposed(p); const auto jacobianInverseTransposed = element.geometry().jacobianInverseTransposed(p);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment