Commit 0a98d2b0 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[newton] use backend's axpy in linesearch update

parent 3426178d
......@@ -1104,13 +1104,11 @@ private:
const SolutionVector &deltaU)
{
Scalar lambda = 1.0;
auto uCurrentIter = Backend::dofs(vars);
auto uCurrentIter = uLastIter;
while (true)
{
uCurrentIter = deltaU;
uCurrentIter *= -lambda;
uCurrentIter += uLastIter;
Backend::axpy(-lambda, deltaU, uCurrentIter);
solutionChanged_(vars, uCurrentIter);
computeResidualReduction_(vars);
......@@ -1120,8 +1118,8 @@ private:
return;
}
// try with a smaller update
lambda /= 2.0;
// try with a smaller update and reset solution
lambda *= 0.5;
}
}
......
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