Fixed storing every residual in solvePerformance (increasing solverPerformance list size). Significant influence on speed when running with large number of correctors (i.e. solidMechanics)
This commit is contained in:
parent
f500917045
commit
889b8dcd4c
1 changed files with 12 additions and 2 deletions
|
@ -442,8 +442,18 @@ void Foam::solution::setSolverPerformance
|
||||||
solverPerformance_.readIfPresent(name, perfs);
|
solverPerformance_.readIfPresent(name, perfs);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append to list
|
// Only the first iteration and the current iteration residuals are
|
||||||
perfs.setSize(perfs.size() + 1, sp);
|
// required, so the current iteration residual replaces the previous one and
|
||||||
|
// only the first iteration is always present, VS 2017-11-27
|
||||||
|
if (perfs.size() < 2)
|
||||||
|
{
|
||||||
|
// Append to list
|
||||||
|
perfs.setSize(perfs.size() + 1, sp);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
perfs.last() = sp;
|
||||||
|
}
|
||||||
|
|
||||||
solverPerformance_.set(name, perfs);
|
solverPerformance_.set(name, perfs);
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue