Skip to content
Snippets Groups Projects
Commit 7f88294c authored by Elias Pipping's avatar Elias Pipping Committed by Elias Pipping
Browse files

Use smooth gradient at 0

parent b2c65d4f
No related branches found
No related tags found
No related merge requests found
......@@ -32,21 +32,8 @@ template <int dim> class EllipticEnergy {
void descentAtZero(SmallVector &ret) const {
SmallVector const zero(0);
// If there is a direction of descent, this is it
SmallVector d;
smoothGradient(zero, d);
d *= -1;
Interval<double> D;
phi->directionalSubDiff(zero, d, D);
double const nonlinearDecline = D[1];
double const smoothDecline = -(d * d);
double const combinedDecline = smoothDecline + nonlinearDecline;
if (combinedDecline < 0) {
ret = d;
} else {
ret = 0;
}
smoothGradient(zero, ret);
ret *= -1;
}
bool descentDirection(SmallVector const &x, SmallVector &ret) const {
......
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