Commit 5184f9ad authored by Bernd Flemisch's avatar Bernd Flemisch
Browse files

[fvvelocity1p] store geometry reference

Without storing the geometry, the call
  const JacobianTransposed& jacT = eIt->geometry().jacobianTransposed()
effectively resulted in an all-zero matrix, once optimization >=-O1 is
turned on.

This is very disturbing, since such code might be in quite some places.
We have to investigate this thoroughly.

Discussed with and reviewed by Martin S.

git-svn-id: svn:// 2fb0f335-1f38-0410-981e-8018bf24f1b0
parent d0984d04
...@@ -141,19 +141,20 @@ public: ...@@ -141,19 +141,20 @@ public:
for (int i = 0; i < dim; i++) for (int i = 0; i < dim; i++)
refVelocity[i] = 0.5 * (flux[2*i + 1] - flux[2*i]); refVelocity[i] = 0.5 * (flux[2*i + 1] - flux[2*i]);
typedef Dune::ReferenceElements<Scalar, dim> ReferenceElements; const typename Element::Geometry& geometry = eIt->geometry();
const Dune::FieldVector<Scalar, dim>& localPos = ReferenceElements::general(eIt->geometry().type()).position(0, typedef Dune::ReferenceElements<Scalar, dim> ReferenceElements;
0); const Dune::FieldVector<Scalar, dim>& localPos
= ReferenceElements::general(geometry.type()).position(0, 0);
// get the transposed Jacobian of the element mapping // get the transposed Jacobian of the element mapping
const typename Element::Geometry::JacobianTransposed& jacobianT = const typename Element::Geometry::JacobianTransposed& jacobianT =
eIt->geometry().jacobianTransposed(localPos); geometry.jacobianTransposed(localPos);
// calculate the element velocity by the Piola transformation // calculate the element velocity by the Piola transformation
Dune::FieldVector<Scalar, dim> elementVelocity(0); Dune::FieldVector<Scalar, dim> elementVelocity(0);
jacobianT.umtv(refVelocity, elementVelocity); jacobianT.umtv(refVelocity, elementVelocity);
elementVelocity /= eIt->geometry().integrationElement(localPos); elementVelocity /= geometry.integrationElement(localPos);
velocity[globalIdx] = elementVelocity; velocity[globalIdx] = elementVelocity;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment