mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: consistent lookupOrDefault template parameters
- in many cases can just use lookupOrDefault("key", bool) instead of
lookupOrDefault<bool> or lookupOrDefault<Switch> since reading a
bool from an Istream uses the Switch(Istream&) anyhow
STYLE: relocated Switch string names into file-local scope
This commit is contained in:
@ -136,7 +136,7 @@ bool Foam::functionObjects::fieldMinMax::read(const dictionary& dict)
|
||||
fvMeshFunctionObject::read(dict);
|
||||
writeFile::read(dict);
|
||||
|
||||
location_ = dict.lookupOrDefault<Switch>("location", true);
|
||||
location_ = dict.lookupOrDefault("location", true);
|
||||
|
||||
mode_ = modeTypeNames_.lookupOrDefault("mode", dict, modeType::mdMag);
|
||||
|
||||
|
||||
@ -118,8 +118,8 @@ protected:
|
||||
//- Mode type names
|
||||
static const Enum<modeType> modeTypeNames_;
|
||||
|
||||
//- Switch to write location of min/max values
|
||||
Switch location_;
|
||||
//- Write location of min/max values?
|
||||
bool location_;
|
||||
|
||||
//- Mode for min/max - only applicable for ranks > 0
|
||||
modeType mode_;
|
||||
|
||||
@ -319,7 +319,7 @@ Foam::functionObjects::regionSizeDistribution::regionSizeDistribution
|
||||
writeFile(obr_, name),
|
||||
alphaName_(dict.lookup("field")),
|
||||
patchNames_(dict.lookup("patches")),
|
||||
isoPlanes_(dict.lookupOrDefault<bool>("isoPlanes", false))
|
||||
isoPlanes_(dict.lookupOrDefault("isoPlanes", false))
|
||||
{
|
||||
read(dict);
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ Foam::functionObjects::runTimePostPro::functionObjectBase::functionObjectBase
|
||||
fieldVisualisationBase(dict, colours),
|
||||
state_(state),
|
||||
functionObjectName_(""),
|
||||
clearObjects_(dict.lookupOrDefault<bool>("clearObjects", false))
|
||||
clearObjects_(dict.lookupOrDefault("clearObjects", false))
|
||||
{
|
||||
dict.lookup("functionObject") >> functionObjectName_;
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ Foam::functionObjects::runTimePostPro::text::text
|
||||
size_(readScalar(dict.lookup("size"))),
|
||||
colour_(nullptr),
|
||||
bold_(readBool(dict.lookup("bold"))),
|
||||
timeStamp_(dict.lookupOrDefault<bool>("timeStamp", false))
|
||||
timeStamp_(dict.lookupOrDefault("timeStamp", false))
|
||||
{
|
||||
if (dict.found("colour"))
|
||||
{
|
||||
|
||||
@ -209,7 +209,7 @@ Foam::functionObjects::scalarTransport::scalarTransport
|
||||
resetOnStartUp_(false),
|
||||
schemesField_("unknown-schemesField"),
|
||||
fvOptions_(mesh_),
|
||||
bounded01_(dict.lookupOrDefault<Switch>("bounded01", true))
|
||||
bounded01_(dict.lookupOrDefault("bounded01", true))
|
||||
{
|
||||
read(dict);
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ Foam::functionObjects::runTimeControls::runTimeCondition::runTimeCondition
|
||||
name_(name),
|
||||
obr_(obr),
|
||||
state_(state),
|
||||
active_(dict.lookupOrDefault<bool>("active", true)),
|
||||
active_(dict.lookupOrDefault("active", true)),
|
||||
conditionDict_(setConditionDict()),
|
||||
log_(dict.lookupOrDefault("log", true)),
|
||||
groupID_(dict.lookupOrDefault("groupID", -1))
|
||||
|
||||
@ -70,7 +70,7 @@ bool Foam::functionObjects::vtkWrite::read(const dictionary& dict)
|
||||
// writer options - default is xml base64
|
||||
//
|
||||
writeOpts_ = vtk::formatType::INLINE_BASE64;
|
||||
if (dict.lookupOrDefault<bool>("legacy", false))
|
||||
if (dict.lookupOrDefault("legacy", false))
|
||||
{
|
||||
writeOpts_.legacy(true);
|
||||
}
|
||||
@ -99,7 +99,7 @@ bool Foam::functionObjects::vtkWrite::read(const dictionary& dict)
|
||||
//
|
||||
dict.readIfPresent("directory", dirName_);
|
||||
|
||||
writeIds_ = dict.lookupOrDefault<bool>("writeIds", false);
|
||||
writeIds_ = dict.lookupOrDefault("writeIds", false);
|
||||
|
||||
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user