diff --git a/src/OpenFOAM/meshes/data/dataTemplates.C b/src/OpenFOAM/meshes/data/dataTemplates.C index b8a99fff93..e27e449804 100644 --- a/src/OpenFOAM/meshes/data/dataTemplates.C +++ b/src/OpenFOAM/meshes/data/dataTemplates.C @@ -38,7 +38,8 @@ void Foam::data::setSolverPerformance { dictionary& dict = const_cast(solverPerformanceDict()); - List> perfs; + // Use a DynamicList to improve performance of the append + DynamicList> perfs; const label timeIndex = this->time().subCycling() @@ -57,7 +58,7 @@ void Foam::data::setSolverPerformance } // Append to list - perfs.setSize(perfs.size()+1, sp); + perfs.append(sp); dict.set(name, perfs); }