ENH: unify use of dictionary method names

- previously introduced `getOrDefault` as a dictionary _get_ method,
  now complete the transition and use it everywhere instead of
  `lookupOrDefault`. This avoids mixed usage of the two methods that
  are identical in behaviour, makes for shorter names, and promotes
  the distinction between "lookup" access (ie, return a token stream,
  locate and return an entry) and "get" access (ie, the above with
  conversion to concrete types such as scalar, label etc).
This commit is contained in:
Mark Olesen
2020-06-02 16:38:55 +02:00
parent f721b5344f
commit 3e43edf056
624 changed files with 2109 additions and 1954 deletions

View File

@ -853,12 +853,12 @@ int main(int argc, char *argv[])
dryRun
);
const bool keepPatches(meshDict.lookupOrDefault("keepPatches", false));
const bool keepPatches(meshDict.getOrDefault("keepPatches", false));
// format to be used for writing lines
const word setFormat
(
meshDict.lookupOrDefault
meshDict.getOrDefault<word>
(
"setFormat",
vtkSetWriter<scalar>::typeName
@ -871,7 +871,7 @@ int main(int argc, char *argv[])
const scalar maxSizeRatio
(
meshDict.lookupOrDefault<scalar>("maxSizeRatio", 100.0)
meshDict.getOrDefault<scalar>("maxSizeRatio", 100)
);
@ -919,7 +919,7 @@ int main(int argc, char *argv[])
// Set debug level
meshRefinement::debugType debugLevel = meshRefinement::debugType
(
meshDict.lookupOrDefault<label>
meshDict.getOrDefault<label>
(
"debug",
0
@ -1004,7 +1004,7 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE
),
geometryDict,
meshDict.lookupOrDefault("singleRegionName", true)
meshDict.getOrDefault("singleRegionName", true)
);
@ -1059,7 +1059,7 @@ int main(int argc, char *argv[])
allGeometry,
conformationDict,
shapeControlDict,
refineDict.lookupOrDefault("gapLevelIncrement", 0),
refineDict.getOrDefault("gapLevelIncrement", 0),
initialCellSize/defaultCellSize
);
@ -1078,7 +1078,7 @@ int main(int argc, char *argv[])
"refinementSurfaces",
dryRun
),
refineDict.lookupOrDefault("gapLevelIncrement", 0),
refineDict.getOrDefault("gapLevelIncrement", 0),
dryRun
)
);
@ -1714,7 +1714,7 @@ int main(int argc, char *argv[])
{
const bool mergePatchFaces
(
meshDict.lookupOrDefault("mergePatchFaces", true)
meshDict.getOrDefault("mergePatchFaces", true)
);
if (!mergePatchFaces)
@ -1728,7 +1728,7 @@ int main(int argc, char *argv[])
{
const bool mergeAcrossPatches
(
meshDict.lookupOrDefault("mergeAcrossPatches", false)
meshDict.getOrDefault("mergeAcrossPatches", false)
);
if (mergeAcrossPatches)