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

@ -2,25 +2,25 @@
bool correctPhi
(
pimple.dict().lookupOrDefault("correctPhi", false)
pimple.dict().getOrDefault("correctPhi", false)
);
bool checkMeshCourantNo
(
pimple.dict().lookupOrDefault("checkMeshCourantNo", false)
pimple.dict().getOrDefault("checkMeshCourantNo", false)
);
bool massFluxInterpolation
(
pimple.dict().lookupOrDefault("massFluxInterpolation", false)
pimple.dict().getOrDefault("massFluxInterpolation", false)
);
bool adjustFringe
(
pimple.dict().lookupOrDefault("oversetAdjustPhi", false)
pimple.dict().getOrDefault("oversetAdjustPhi", false)
);
bool ddtCorr
(
pimple.dict().lookupOrDefault("ddtCorr", true)
pimple.dict().getOrDefault("ddtCorr", true)
);

View File

@ -1,10 +1,10 @@
#include "readTimeControls.H"
correctPhi = pimple.dict().lookupOrDefault("correctPhi", false);
correctPhi = pimple.dict().getOrDefault("correctPhi", false);
checkMeshCourantNo = pimple.dict().lookupOrDefault("checkMeshCourantNo", false);
checkMeshCourantNo = pimple.dict().getOrDefault("checkMeshCourantNo", false);
massFluxInterpolation =
pimple.dict().lookupOrDefault("massFluxInterpolation", false);
pimple.dict().getOrDefault("massFluxInterpolation", false);
ddtCorr = pimple.dict().lookupOrDefault("ddtCorr", true);
ddtCorr = pimple.dict().getOrDefault("ddtCorr", true);

View File

@ -22,9 +22,9 @@
bool adjustFringe
(
simple.dict().lookupOrDefault("oversetAdjustPhi", false)
simple.dict().getOrDefault("oversetAdjustPhi", false)
);
bool massFluxInterpolation
(
simple.dict().lookupOrDefault("massFluxInterpolation", false)
simple.dict().getOrDefault("massFluxInterpolation", false)
);

View File

@ -5,7 +5,7 @@ int nUCorr = 0;
if (pZones.active())
{
// nUCorrectors for pressureImplicitPorosity
nUCorr = simple.dict().lookupOrDefault<int>("nUCorrectors", 0);
nUCorr = simple.dict().getOrDefault<int>("nUCorrectors", 0);
if (nUCorr > 0)
{