mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: avoid the build-up of the background solver dictionary
The solverPerformanceDict gets larger due to the addition of a SolverPerformance data per field at every outer iteration within the same main iteration/time step. However, the subsequent functionalities seem to use only the first and last element of this dictionary per field; therefore, storing the interim values was revealed to be redundant. The change removes the interim values by transforming the `List` container into the `Pair` container, and modifying the relevant algorithms.
This commit is contained in:
@ -43,7 +43,7 @@ equationInitialResidualCondition::setResidual
|
||||
|
||||
if (canSet && mesh.foundObject<volFieldType>(fieldName))
|
||||
{
|
||||
const List<SolverPerformance<Type>> sp(dict.lookup(fieldName));
|
||||
const Pair<SolverPerformance<Type>> sp(dict.lookup(fieldName));
|
||||
const Type& allComponents = sp.first().initialResidual();
|
||||
|
||||
if (componenti != -1)
|
||||
|
||||
@ -107,7 +107,7 @@ bool Foam::functionObjects::runTimeControls::equationMaxIterCondition::apply()
|
||||
|
||||
if (solverDict.found(fieldName))
|
||||
{
|
||||
const List<solverPerformance> sp(solverDict.lookup(fieldName));
|
||||
const Pair<solverPerformance> sp(solverDict.lookup(fieldName));
|
||||
const label nIterations = sp.first().nIterations();
|
||||
result[fieldi] = nIterations;
|
||||
|
||||
|
||||
@ -119,7 +119,7 @@ void Foam::functionObjects::solverInfo::updateSolverInfo(const word& fieldName)
|
||||
|
||||
if (solverDict.found(fieldName))
|
||||
{
|
||||
const List<SolverPerformance<Type>> sp
|
||||
const Pair<SolverPerformance<Type>> sp
|
||||
(
|
||||
solverDict.lookup(fieldName)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user