mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: change argList get<> and getList<> from read<>, readList<>
- more consistent with dictionary method naming. The get<> or getList<> returns a value, doesn't read into a existing location.
This commit is contained in:
@ -51,7 +51,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
labelList patchIDs
|
||||
(
|
||||
pbm.patchSet(args.readList<wordRe>(1)).sortedToc()
|
||||
pbm.patchSet(args.getList<wordRe>(1)).sortedToc()
|
||||
);
|
||||
|
||||
Info<< "Starting walk from patches "
|
||||
|
||||
@ -108,7 +108,9 @@ int main(int argc, char *argv[])
|
||||
if (args.found("label"))
|
||||
{
|
||||
Info<< "-label = " << args.opt<label>("label")
|
||||
#ifdef Foam_argList_1712
|
||||
<< " or " << args.optionRead<label>("label") // old-compat
|
||||
#endif
|
||||
<< " or " << readLabel(args["label"]) // with function
|
||||
<< nl;
|
||||
}
|
||||
@ -116,7 +118,9 @@ int main(int argc, char *argv[])
|
||||
if (args.found("scalar"))
|
||||
{
|
||||
Info<< "-scalar = " << args.opt<scalar>("scalar")
|
||||
#ifdef Foam_argList_1712
|
||||
<< " or " << args.optionRead<scalar>("scalar") // old-compat
|
||||
#endif
|
||||
<< " or " << readScalar(args["scalar"]) // with function
|
||||
<< nl;
|
||||
}
|
||||
@ -124,7 +128,9 @@ int main(int argc, char *argv[])
|
||||
if (args.found("string"))
|
||||
{
|
||||
Info<< "-string = " << args.opt("string")
|
||||
#ifdef Foam_argList_1712
|
||||
<< " or " << args.optionRead<scalar>("string") // old-compat
|
||||
#endif
|
||||
<< nl;
|
||||
}
|
||||
|
||||
@ -133,8 +139,11 @@ int main(int argc, char *argv[])
|
||||
Info<< nl;
|
||||
for (label argi=1; argi < args.size(); ++argi)
|
||||
{
|
||||
Info<< "arg[" << argi << "] = " << args.read<string>(argi)
|
||||
Info<< "arg[" << argi << "] = " << args.get<string>(argi)
|
||||
#ifdef Foam_argList_1712
|
||||
<< " or " << args.read<label>(argi) // old-compat
|
||||
<< " or " << args.argRead<label>(argi) // old-compat
|
||||
#endif
|
||||
<< nl;
|
||||
}
|
||||
|
||||
|
||||
@ -109,12 +109,8 @@ int main(int argc, char *argv[])
|
||||
const bool allRegions = args.found("allRegions");
|
||||
const bool verbose = args.found("verbose");
|
||||
|
||||
const label numSubdomains =
|
||||
args.lookupOrDefault<label>("domains", 0);
|
||||
|
||||
const word methodName =
|
||||
args.lookupOrDefault<word>("method", word::null);
|
||||
|
||||
const label numSubdomains = args.lookupOrDefault<label>("domains", 0);
|
||||
const word methodName = args.lookupOrDefault<word>("method", word::null);
|
||||
|
||||
// Set time from database
|
||||
#include "createTime.H"
|
||||
|
||||
@ -46,7 +46,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
label nReps = 10000;
|
||||
|
||||
const point sample = args.read<point>(1);
|
||||
const point sample = args.get<point>(1);
|
||||
|
||||
const polyMesh::cellDecomposition decompMode = polyMesh::CELL_TETS;
|
||||
|
||||
|
||||
@ -101,8 +101,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
{
|
||||
label start = args.read<label>(argI);
|
||||
label size = args.read<label>(argI+1);
|
||||
label start = args.get<label>(argI);
|
||||
label size = args.get<label>(argI+1);
|
||||
++argI;
|
||||
|
||||
range.reset(start, size);
|
||||
|
||||
@ -196,7 +196,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
{
|
||||
const label celli = args.lookupOrDefault("cell", 0);
|
||||
const label celli = args.lookupOrDefault<label>("cell", 0);
|
||||
|
||||
tensorField mI(momentOfInertia::meshInertia(mesh));
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
bool useBSpline = args.found("B");
|
||||
bool useCatmullRom = args.found("CMR");
|
||||
label nSeg = args.lookupOrDefault<label>("n", 20);
|
||||
const label nSeg = args.lookupOrDefault<label>("n", 20);
|
||||
|
||||
if (!useCatmullRom && !useBSpline)
|
||||
{
|
||||
|
||||
@ -138,7 +138,7 @@ int main(int argc, char *argv[])
|
||||
#include "setRootCase.H"
|
||||
|
||||
const bool optStdout = args.found("stdout");
|
||||
const scalar scaleFactor = args.lookupOrDefault("scale", 0.0);
|
||||
const scalar scaleFactor = args.lookupOrDefault<scalar>("scale", 0);
|
||||
|
||||
const fileName importName = args[1];
|
||||
const fileName exportName = optStdout ? "-stdout" : args[2];
|
||||
|
||||
Reference in New Issue
Block a user