Commit 228b4d24 authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[newton] avoid unnecessary copies

parent 704f4b27
......@@ -1104,10 +1104,11 @@ private:
const SolutionVector &deltaU)
{
Scalar lambda = 1.0;
auto uCurrentIter = Backend::dofs(vars);
while (true)
{
auto uCurrentIter = deltaU;
uCurrentIter = deltaU;
uCurrentIter *= -lambda;
uCurrentIter += uLastIter;
solutionChanged_(vars, uCurrentIter);
......
......@@ -69,8 +69,7 @@ private:
const SolutionVector &uLastIter,
const SolutionVector &deltaU) final
{
auto uCurrentIter = Backend::dofs(varsCurrentIter);
uCurrentIter = uLastIter;
auto uCurrentIter = uLastIter;
uCurrentIter -= deltaU;
// do not clamp anything after 5 iterations
......
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