mapFieldsPar: Corrected handling of argList and reverted change to createTimes.H

This commit is contained in:
Henry Weller
2021-09-02 19:45:14 +01:00
parent 3554f2140e
commit e6fdd180e8
2 changed files with 14 additions and 20 deletions

View File

@ -1,21 +1,15 @@
Info<< "\nCreate databases as time" << endl;
const string caseDirOrig = getEnv("FOAM_CASE");
const string caseNameOrig = getEnv("FOAM_CASENAME");
setEnv("FOAM_CASE", rootDirSource/caseDirSource, true);
setEnv("FOAM_CASENAME", caseDirSource, true);
Time runTimeSource
(
Time::controlDictName,
rootDirSource,
caseDirSource
);
setEnv("FOAM_CASE", caseDirOrig, true);
setEnv("FOAM_CASENAME", caseNameOrig, true);
HashTable<string> srcOptions(args.options());
srcOptions.erase("case");
srcOptions.insert("case", fileName(rootDirSource/caseDirSource));
Time runTimeTarget
(
Time::controlDictName,
rootDirTarget,
caseDirTarget
);
argList argsSrc(args, srcOptions, false, false, false);
if (!argsSrc.checkRootCase())
{
FatalError.exit();
}
Time runTimeSource(Time::controlDictName, argsSrc);
Time runTimeTarget(Time::controlDictName, args);

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-2018 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
"skip mapping lagrangian positions and fields"
);
argList args(argc, argv);
#include "setRootCase.H"
fileName rootDirTarget(args.rootPath());
fileName caseDirTarget(args.globalCaseName());