Skip to content
Snippets Groups Projects
Commit 30a34d27 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Weight the integral with the norm of the derivative of the previous time step

According to Hanne, this is needed to turn 1d harmonic map heat flow into true
curve-shortening flow.

Hardwiring the weighting here is very hacky.  Something more flexible and
general will need to be implemented eventually.
parent eee9342d
No related branches found
No related tags found
No related merge requests found
......@@ -57,8 +57,25 @@ public:
UnitVector<double,3> originValue;
origin_->evaluateLocal(element,quadPos, originValue);
// The derivative of the 'origin' function
// First: as function defined on the reference element
typename VirtualGridViewFunction<GridView,UnitVector<double,3> >::DerivativeType originReferenceDerivative;
origin_->evaluateDerivativeLocal(element,quadPos,originReferenceDerivative);
// The derivative of the function defined on the actual element
typename VirtualGridViewFunction<GridView,UnitVector<double,3> >::DerivativeType originDerivative(0);
auto jacobianInverseTransposed = element.geometry().jacobianInverseTransposed(quadPos);
for (size_t comp=0; comp<originReferenceDerivative.N(); comp++)
jacobianInverseTransposed.umv(originReferenceDerivative[comp], originDerivative[comp]);
double weightFactor = originDerivative.frobenius_norm();
// un-comment the following line to switch off the weight factor
//weightFactor = 1.0;
// Add the local energy density
energy += weight * TargetSpace::distanceSquared(originValue, value);
energy += weight * weightFactor * TargetSpace::distanceSquared(originValue, value);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment