Time, functionObjectList: Refactored to simplify construction and switching-off functionObjects

This commit is contained in:
Henry Weller
2023-06-06 08:17:52 +01:00
parent 6b1278b544
commit 08544446e8
45 changed files with 205 additions and 309 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -563,8 +563,7 @@ int main(int argc, char *argv[])
{
#include "addOverwriteOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createMeshNoChangers.H"
// Read control dictionary

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -84,9 +84,7 @@ int main(int argc, char *argv[])
#include "addDictOption.H"
#include "addOverwriteOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
instantList timeDirs = timeSelector::selectIfPresent(runTime, args);
#include "createMeshNoChangers.H"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -358,8 +358,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -332,8 +332,7 @@ int main(int argc, char *argv[])
#include "addOverwriteOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,8 +69,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
const bool overwrite = args.optionFound("overwrite");
const bool minSet = args.optionFound("minSet");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,8 +75,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
Foam::word meshRegionName = polyMesh::defaultRegion;
args.optionReadIfPresent("region", meshRegionName);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -59,8 +59,7 @@ int main(int argc, char *argv[])
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
const bool overwrite = args.optionFound("overwrite");
const bool fields = !args.optionFound("noFields");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -545,8 +545,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -420,8 +420,7 @@ int main(int argc, char *argv[])
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
const bool patchFaces = args.optionFound("patchFaces");
const bool patchEdges = args.optionFound("patchEdges");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -125,11 +125,10 @@ int main(int argc, char *argv[])
(
Time::controlDictName,
args.rootPath(),
args.caseName()
args.caseName(),
false
);
runTimeExtruded.functionObjects().off();
const ExtrudeMode surfaceFormat = ExtrudeModeNames[args[1]];
const bool overwrite = args.optionFound("overwrite");

View File

@ -665,8 +665,7 @@ int main(int argc, char *argv[])
#include "addDictOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
const bool overwrite = args.optionFound("overwrite");
const bool checkGeometry = args.optionFound("checkGeometry");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,8 +44,7 @@ int main(int argc, char *argv[])
argList::noParallel();
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -75,8 +75,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("feature angle[0-180]");
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -361,8 +361,7 @@ int main(int argc, char *argv[])
#include "addRegionOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createNamedMesh.H"
const polyBoundaryMesh& bMesh = mesh.boundaryMesh();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,8 +94,7 @@ int main(int argc, char *argv[])
}
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
// Flag to determine whether or not patches are added to fields
bool fields;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -468,8 +468,7 @@ int main(int argc, char *argv[])
#include "addRegionOption.H"
#include "addDictOption.H"
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
Foam::word meshRegionName = polyMesh::defaultRegion;
args.optionReadIfPresent("region", meshRegionName);

View File

@ -186,8 +186,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createNamedMesh.H"
const bool overwrite = args.optionFound("overwrite");

View File

@ -7,9 +7,9 @@
(
Time::controlDictName,
masterCasePath,
masterCaseName
masterCaseName,
false
);
runTimeMaster.functionObjects().off();
const fileName addCasePath = addCase.path();
const fileName addCaseName = addCase.name();
@ -18,6 +18,6 @@
(
Time::controlDictName,
addCasePath,
addCaseName
addCaseName,
false
);
runTimeToAdd.functionObjects().off();

View File

@ -169,8 +169,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createNamedPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -619,8 +619,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
// Force linker to include zoltan symbols. This section is only needed since
// Zoltan is a static library

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,8 +62,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createNamedMesh.H"
const bool overwrite = args.optionFound("overwrite");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -117,8 +117,7 @@ int main(int argc, char *argv[])
argList::validArgs.append("slavePatch");
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createPolyMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -1469,10 +1469,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -236,8 +236,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
#include "createNamedMesh.H"
const word oldInstance = mesh.pointsInstance();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -215,8 +215,7 @@ int main(int argc, char *argv[])
);
#include "setRootCase.H"
#include "createTime.H"
runTime.functionObjects().off();
#include "createTimeNoFunctionObjects.H"
Foam::word meshRegionName = polyMesh::defaultRegion;
args.optionReadIfPresent("region", meshRegionName);