mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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)
|
||||
);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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)
|
||||
);
|
||||
|
||||
@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user