Time, functionObjectList: Refactored to simplify construction and switching-off functionObjects
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2021-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2021-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -39,8 +39,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 bool write = args.optionFound("write");
|
||||
|
||||
@ -41,9 +41,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validArgs.append("cloudName");
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createTimeNoFunctionObjects.H"
|
||||
#include "createMesh.H"
|
||||
runTime.functionObjects().off();
|
||||
|
||||
const word cloudName = args[1];
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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");
|
||||
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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");
|
||||
|
||||
@ -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();
|
||||
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -339,13 +339,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Make sure we do not use the master-only reading.
|
||||
regIOobject::fileModificationChecking = regIOobject::timeStamp;
|
||||
#include "createTime.H"
|
||||
#include "createTimeNoFunctionObjects.H"
|
||||
// Allow override of time
|
||||
instantList times = timeSelector::selectIfPresent(runTime, args);
|
||||
runTime.setTime(times[0], 0);
|
||||
|
||||
runTime.functionObjects().off();
|
||||
|
||||
word regionName = polyMesh::defaultRegion;
|
||||
fileName meshSubDir;
|
||||
|
||||
|
||||
@ -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
|
||||
@ -348,12 +348,11 @@ Foam::vtkPVFoam::vtkPVFoam
|
||||
(
|
||||
Time::controlDictName,
|
||||
fileName(fullCasePath.path()),
|
||||
fileName(fullCasePath.name())
|
||||
fileName(fullCasePath.name()),
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
dbPtr_().functionObjects().off();
|
||||
|
||||
fileNameList configDictFiles = findEtcFiles("paraFoam", false);
|
||||
forAllReverse(configDictFiles, cdfi)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -233,12 +233,11 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
||||
(
|
||||
Time::controlDictName,
|
||||
fileName(fullCasePath.path()),
|
||||
fileName(fullCasePath.name())
|
||||
fileName(fullCasePath.name()),
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
dbPtr_().functionObjects().off();
|
||||
|
||||
updateInfo();
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -202,8 +202,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
#include "createTimeNoFunctionObjects.H"
|
||||
|
||||
HashSet<word> selectedFields;
|
||||
if (args.optionFound("fields"))
|
||||
|
||||
@ -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
|
||||
@ -109,8 +109,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
runTime.functionObjects().off();
|
||||
#include "createTimeNoFunctionObjects.H"
|
||||
|
||||
const fileName surfFileName = args[1];
|
||||
const word distType = args[2];
|
||||
|
||||
@ -332,19 +332,16 @@ void Foam::Time::setControls()
|
||||
Foam::Time::Time
|
||||
(
|
||||
const word& controlDictName,
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName,
|
||||
const argList& args,
|
||||
const bool enableFunctionObjects
|
||||
)
|
||||
:
|
||||
TimePaths
|
||||
(
|
||||
rootPath,
|
||||
caseName,
|
||||
systemName,
|
||||
constantName
|
||||
args.parRunControl().parRun(),
|
||||
args.rootPath(),
|
||||
args.globalCaseName(),
|
||||
args.caseName()
|
||||
),
|
||||
|
||||
objectRegistry(*this),
|
||||
@ -387,6 +384,105 @@ Foam::Time::Time
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_
|
||||
(
|
||||
*this,
|
||||
enableFunctionObjects
|
||||
? argList::validOptions.found("withFunctionObjects")
|
||||
? args.optionFound("withFunctionObjects")
|
||||
: !args.optionFound("noFunctionObjects")
|
||||
: false
|
||||
)
|
||||
{
|
||||
libs.open(controlDict_, "libs");
|
||||
|
||||
// Explicitly set read flags on objectRegistry so anything constructed
|
||||
// from it reads as well (e.g. fvSolution).
|
||||
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||
|
||||
if (args.options().found("case"))
|
||||
{
|
||||
const wordList switchSets
|
||||
(
|
||||
{
|
||||
"InfoSwitches",
|
||||
"OptimisationSwitches",
|
||||
"DebugSwitches",
|
||||
"DimensionedConstants",
|
||||
"DimensionSets"
|
||||
}
|
||||
);
|
||||
|
||||
forAll(switchSets, i)
|
||||
{
|
||||
if (controlDict_.found(switchSets[i]))
|
||||
{
|
||||
IOWarningInFunction(controlDict_)
|
||||
<< switchSets[i]
|
||||
<< " in system/controlDict are only processed if "
|
||||
<< args.executable() << " is run in the "
|
||||
<< args.path() << " directory" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setControls();
|
||||
|
||||
// Add a watch on the controlDict file after runTimeModifiable_ is set
|
||||
controlDict_.addWatch();
|
||||
}
|
||||
|
||||
|
||||
Foam::Time::Time
|
||||
(
|
||||
const word& controlDictName,
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const bool enableFunctionObjects
|
||||
)
|
||||
:
|
||||
TimePaths(rootPath, caseName),
|
||||
|
||||
objectRegistry(*this),
|
||||
|
||||
runTimeModifiable_(false),
|
||||
|
||||
controlDict_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
controlDictName,
|
||||
system(),
|
||||
*this,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
|
||||
startTimeIndex_(0),
|
||||
startTime_(0),
|
||||
endTime_(0),
|
||||
beginTime_(startTime_),
|
||||
|
||||
userTime_(userTimes::userTime::New(controlDict_)),
|
||||
|
||||
stopAt_(stopAtControl::endTime),
|
||||
writeControl_(writeControl::timeStep),
|
||||
writeInterval_(great),
|
||||
purgeWrite_(0),
|
||||
writeOnce_(false),
|
||||
|
||||
subCycling_(false),
|
||||
|
||||
sigWriteNow_(writeInfoHeader, *this),
|
||||
sigStopAtWriteNow_(writeInfoHeader, *this),
|
||||
|
||||
writeFormat_(IOstream::ASCII),
|
||||
writeVersion_(IOstream::currentVersion),
|
||||
writeCompression_(IOstream::UNCOMPRESSED),
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_(*this, enableFunctionObjects)
|
||||
{
|
||||
libs.open(controlDict_, "libs");
|
||||
@ -402,128 +498,15 @@ Foam::Time::Time
|
||||
}
|
||||
|
||||
|
||||
Foam::Time::Time
|
||||
(
|
||||
const word& controlDictName,
|
||||
const argList& args,
|
||||
const word& systemName,
|
||||
const word& constantName
|
||||
)
|
||||
:
|
||||
TimePaths
|
||||
(
|
||||
args.parRunControl().parRun(),
|
||||
args.rootPath(),
|
||||
args.globalCaseName(),
|
||||
args.caseName(),
|
||||
systemName,
|
||||
constantName
|
||||
),
|
||||
|
||||
objectRegistry(*this),
|
||||
|
||||
runTimeModifiable_(false),
|
||||
|
||||
controlDict_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
controlDictName,
|
||||
system(),
|
||||
*this,
|
||||
IOobject::MUST_READ_IF_MODIFIED,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
),
|
||||
|
||||
startTimeIndex_(0),
|
||||
startTime_(0),
|
||||
endTime_(0),
|
||||
beginTime_(startTime_),
|
||||
|
||||
userTime_(userTimes::userTime::New(controlDict_)),
|
||||
|
||||
stopAt_(stopAtControl::endTime),
|
||||
writeControl_(writeControl::timeStep),
|
||||
writeInterval_(great),
|
||||
purgeWrite_(0),
|
||||
writeOnce_(false),
|
||||
|
||||
subCycling_(false),
|
||||
|
||||
sigWriteNow_(writeInfoHeader, *this),
|
||||
sigStopAtWriteNow_(writeInfoHeader, *this),
|
||||
|
||||
writeFormat_(IOstream::ASCII),
|
||||
writeVersion_(IOstream::currentVersion),
|
||||
writeCompression_(IOstream::UNCOMPRESSED),
|
||||
graphFormat_("raw"),
|
||||
cacheTemporaryObjects_(true),
|
||||
|
||||
functionObjects_
|
||||
(
|
||||
*this,
|
||||
argList::validOptions.found("withFunctionObjects")
|
||||
? args.optionFound("withFunctionObjects")
|
||||
: !args.optionFound("noFunctionObjects")
|
||||
)
|
||||
{
|
||||
libs.open(controlDict_, "libs");
|
||||
|
||||
// Explicitly set read flags on objectRegistry so anything constructed
|
||||
// from it reads as well (e.g. fvSolution).
|
||||
readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||
|
||||
if (args.options().found("case"))
|
||||
{
|
||||
const wordList switchSets
|
||||
(
|
||||
{
|
||||
"InfoSwitches",
|
||||
"OptimisationSwitches",
|
||||
"DebugSwitches",
|
||||
"DimensionedConstants",
|
||||
"DimensionSets"
|
||||
}
|
||||
);
|
||||
|
||||
forAll(switchSets, i)
|
||||
{
|
||||
if (controlDict_.found(switchSets[i]))
|
||||
{
|
||||
IOWarningInFunction(controlDict_)
|
||||
<< switchSets[i]
|
||||
<< " in system/controlDict are only processed if "
|
||||
<< args.executable() << " is run in the "
|
||||
<< args.path() << " directory" << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
setControls();
|
||||
|
||||
// Add a watch on the controlDict file after runTimeModifiable_ is set
|
||||
controlDict_.addWatch();
|
||||
}
|
||||
|
||||
|
||||
Foam::Time::Time
|
||||
(
|
||||
const dictionary& dict,
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName,
|
||||
const bool enableFunctionObjects
|
||||
)
|
||||
:
|
||||
TimePaths
|
||||
(
|
||||
rootPath,
|
||||
caseName,
|
||||
systemName,
|
||||
constantName
|
||||
),
|
||||
TimePaths(rootPath, caseName),
|
||||
|
||||
objectRegistry(*this),
|
||||
|
||||
@ -585,18 +568,10 @@ Foam::Time::Time
|
||||
(
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName,
|
||||
const bool enableFunctionObjects
|
||||
)
|
||||
:
|
||||
TimePaths
|
||||
(
|
||||
rootPath,
|
||||
caseName,
|
||||
systemName,
|
||||
constantName
|
||||
),
|
||||
TimePaths(rootPath, caseName),
|
||||
|
||||
objectRegistry(*this),
|
||||
|
||||
|
||||
@ -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 @@ public:
|
||||
(
|
||||
const word& name,
|
||||
const argList& args,
|
||||
const word& systemName = "system",
|
||||
const word& constantName = "constant"
|
||||
const bool enableFunctionObjects = true
|
||||
);
|
||||
|
||||
//- Construct given name of dictionary to read, rootPath and casePath
|
||||
@ -225,8 +224,6 @@ public:
|
||||
const word& name,
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName = "system",
|
||||
const word& constantName = "constant",
|
||||
const bool enableFunctionObjects = true
|
||||
);
|
||||
|
||||
@ -236,8 +233,6 @@ public:
|
||||
const dictionary& dict,
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName = "system",
|
||||
const word& constantName = "constant",
|
||||
const bool enableFunctionObjects = true
|
||||
);
|
||||
|
||||
@ -246,8 +241,6 @@ public:
|
||||
(
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName = "system",
|
||||
const word& constantName = "constant",
|
||||
const bool enableFunctionObjects = true
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,21 +26,26 @@ License
|
||||
#include "TimePaths.H"
|
||||
#include "IOstreams.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
const word TimePaths::systemName = "system";
|
||||
const word TimePaths::constantName = "constant";
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::TimePaths::TimePaths
|
||||
(
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName
|
||||
const fileName& caseName
|
||||
)
|
||||
:
|
||||
processorCase_(false),
|
||||
rootPath_(rootPath),
|
||||
case_(caseName),
|
||||
system_(systemName),
|
||||
constant_(constantName)
|
||||
case_(caseName)
|
||||
{
|
||||
// Find out from case name whether a processor directory
|
||||
std::string::size_type pos = caseName.find("processor");
|
||||
@ -69,17 +74,13 @@ Foam::TimePaths::TimePaths
|
||||
const bool processorCase,
|
||||
const fileName& rootPath,
|
||||
const fileName& globalCaseName,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName
|
||||
const fileName& caseName
|
||||
)
|
||||
:
|
||||
processorCase_(processorCase),
|
||||
rootPath_(rootPath),
|
||||
globalCaseName_(globalCaseName),
|
||||
case_(caseName),
|
||||
system_(systemName),
|
||||
constant_(constantName)
|
||||
case_(caseName)
|
||||
{
|
||||
if (!processorCase)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -54,21 +54,22 @@ class TimePaths
|
||||
const fileName rootPath_;
|
||||
fileName globalCaseName_;
|
||||
const fileName case_;
|
||||
const word system_;
|
||||
const word constant_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Static Data
|
||||
|
||||
static const word systemName;
|
||||
static const word constantName;
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct given database name, rootPath and casePath
|
||||
TimePaths
|
||||
(
|
||||
const fileName& rootPath,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName
|
||||
const fileName& caseName
|
||||
);
|
||||
|
||||
|
||||
@ -78,9 +79,7 @@ public:
|
||||
const bool processorCase,
|
||||
const fileName& rootPath,
|
||||
const fileName& globalCaseName,
|
||||
const fileName& caseName,
|
||||
const word& systemName,
|
||||
const word& constantName
|
||||
const fileName& caseName
|
||||
);
|
||||
|
||||
|
||||
@ -111,9 +110,9 @@ public:
|
||||
}
|
||||
|
||||
//- Return system name
|
||||
const word& system() const
|
||||
static const word& system()
|
||||
{
|
||||
return system_;
|
||||
return systemName;
|
||||
}
|
||||
|
||||
//- Return system name for the case
|
||||
@ -121,9 +120,9 @@ public:
|
||||
fileName caseSystem() const;
|
||||
|
||||
//- Return constant name
|
||||
const word& constant() const
|
||||
static const word& constant()
|
||||
{
|
||||
return constant_;
|
||||
return constantName;
|
||||
}
|
||||
|
||||
//- Return constant name for the case
|
||||
|
||||
@ -215,25 +215,6 @@ Foam::label Foam::functionObjectList::findObjectID(const word& name) const
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::on()
|
||||
{
|
||||
execution_ = true;
|
||||
}
|
||||
|
||||
|
||||
void Foam::functionObjectList::off()
|
||||
{
|
||||
// For safety, also force a read() when execution is turned back on
|
||||
updated_ = execution_ = false;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjectList::status() const
|
||||
{
|
||||
return execution_;
|
||||
}
|
||||
|
||||
|
||||
bool Foam::functionObjectList::start()
|
||||
{
|
||||
bool ok = read();
|
||||
|
||||
@ -164,15 +164,6 @@ public:
|
||||
//- Read and set the function objects if their data have changed
|
||||
bool read();
|
||||
|
||||
//- Switch the function objects on
|
||||
void on();
|
||||
|
||||
//- Switch the function objects off
|
||||
void off();
|
||||
|
||||
//- Return the execution status (on/off) of the function objects
|
||||
bool status() const;
|
||||
|
||||
//- Called at the start of the time-loop
|
||||
bool start();
|
||||
|
||||
|
||||
3
src/OpenFOAM/include/createTimeNoFunctionObjects.H
Normal file
3
src/OpenFOAM/include/createTimeNoFunctionObjects.H
Normal file
@ -0,0 +1,3 @@
|
||||
Foam::Info<< "Create time\n" << Foam::endl;
|
||||
|
||||
Foam::Time runTime(Foam::Time::controlDictName, args, false);
|
||||
@ -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
|
||||
@ -220,7 +220,6 @@ public:
|
||||
{
|
||||
return Hash<long>()(long(p));
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
@ -59,8 +59,6 @@ bool Foam::fileFormats::edgeMeshFormat::read
|
||||
(
|
||||
".", // rootPath,
|
||||
".", // caseName,
|
||||
"system", // systemName,
|
||||
"constant", // constantName,
|
||||
false // enableFunctionObjects
|
||||
);
|
||||
|
||||
@ -166,8 +164,6 @@ void Foam::fileFormats::edgeMeshFormat::write
|
||||
(
|
||||
".", // rootPath,
|
||||
".", // caseName,
|
||||
"system", // systemName,
|
||||
"constant", // constantName,
|
||||
false // enableFunctionObjects
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -105,8 +105,6 @@ bool Foam::fileFormats::VTKedgeFormat::read
|
||||
(
|
||||
"dummyRoot",
|
||||
"dummyCase",
|
||||
"system",
|
||||
"constant",
|
||||
false // enableFunctionObjects
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2013-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -57,8 +57,6 @@ bool Foam::fileFormats::extendedEdgeMeshFormat::read
|
||||
(
|
||||
".", // rootPath,
|
||||
".", // caseName,
|
||||
"system", // systemName,
|
||||
"constant", // constantName,
|
||||
false // enableFunctionObjects
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -90,8 +90,6 @@ bool Foam::fileFormats::VTKsurfaceFormat<Face>::read
|
||||
(
|
||||
"dummyRoot",
|
||||
"dummyCase",
|
||||
"system",
|
||||
"constant",
|
||||
false // enableFunctionObjects
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration | Website: https://openfoam.org
|
||||
\\ / A nd | Copyright (C) 2019-2022 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2019-2023 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -49,8 +49,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"
|
||||
|
||||
// Read objects in time directory
|
||||
|
||||
Reference in New Issue
Block a user