Bugfix: additionaArgs is no longer a reference

This commit is contained in:
Hrvoje Jasak 2019-02-14 17:13:56 +00:00
parent 1c6c10d84a
commit a9ed8c0a8f
6 changed files with 8 additions and 14 deletions

View file

@ -68,7 +68,6 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
stringList const& params = args.additionalArgs();
// default rescale from [mm] to [m]
scalar scaleFactor = 0.001;
@ -97,7 +96,7 @@ int main(int argc, char *argv[])
IOstream::defaultPrecision(10);
// remove extensions and/or trailing '.'
fileName prefix = fileName(params[0]).lessExt();
fileName prefix = fileName(args.additionalArgs()[0]).lessExt();
meshReaders::STARCD reader(prefix, runTime, scaleFactor);

View file

@ -67,7 +67,7 @@ int main(int argc, char *argv[])
argList::validOptions.insert("group", "");
argList args(argc, argv);
const stringList& params = args.additionalArgs();
const stringList params = args.additionalArgs();
fileName importName(params[0]);
fileName exportName(params[1]);

View file

@ -81,10 +81,9 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
const stringList& params = args.additionalArgs();
fileName importName(params[0]);
fileName exportName(params[1]);
fileName importName(args.additionalArgs()[0]);
fileName exportName(args.additionalArgs()[1]);
// disable inplace editing
if (importName == exportName)

View file

@ -83,13 +83,12 @@ int main(int argc, char *argv[])
argList::validOptions.insert("unsorted", "");
argList::validOptions.insert("triFace", "");
# include "setRootCase.H"
const stringList& params = args.additionalArgs();
scalar scaleFactor = 0;
args.optionReadIfPresent("scale", scaleFactor);
fileName importName(params[0]);
fileName exportName(params[1]);
fileName importName(args.additionalArgs()[0]);
fileName exportName(args.additionalArgs()[1]);
if (importName == exportName)
{

View file

@ -85,9 +85,8 @@ int main(int argc, char *argv[])
argList args(argc, argv);
Time runTime(args.rootPath(), args.caseName());
const stringList& params = args.additionalArgs();
fileName exportName(params[0]);
fileName exportName(args.additionalArgs()[0]);
word importName("default");
args.optionReadIfPresent("name", importName);

View file

@ -86,8 +86,6 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
const stringList& params = args.additionalArgs();
// try for the latestTime, but create "constant" as needed
instantList Times = runTime.times();
if (Times.size())
@ -101,7 +99,7 @@ int main(int argc, char *argv[])
}
fileName importName(params[0]);
fileName importName(args.additionalArgs()[0]);
word exportName("default");
args.optionReadIfPresent("name", exportName);