mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
use dictionary lookupOrDefault() method instead of found() + lookup()
This commit is contained in:
@ -140,7 +140,7 @@ Foam::sampledPatch::sampledPatch
|
|||||||
patchFaceLabels_(0)
|
patchFaceLabels_(0)
|
||||||
{
|
{
|
||||||
// default: non-triangulated
|
// default: non-triangulated
|
||||||
triangulate() = getBool(dict, "triangulate", false);
|
triangulate() = dict.lookupOrDefault("triangulate", false);
|
||||||
createGeometry();
|
createGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -151,25 +151,6 @@ Foam::sampledSurface::New
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool Foam::sampledSurface::getBool
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const word& key,
|
|
||||||
const bool defaultVal
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (dict.found(key))
|
|
||||||
{
|
|
||||||
return readBool(dict.lookup(key));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return defaultVal;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::sampledSurface::sampledSurface
|
Foam::sampledSurface::sampledSurface
|
||||||
@ -200,8 +181,8 @@ Foam::sampledSurface::sampledSurface
|
|||||||
:
|
:
|
||||||
name_(name),
|
name_(name),
|
||||||
mesh_(mesh),
|
mesh_(mesh),
|
||||||
triangulate_(getBool(dict, "triangulate", true)),
|
triangulate_(dict.lookupOrDefault("triangulate", true)),
|
||||||
interpolate_(getBool(dict, "interpolate", false)),
|
interpolate_(dict.lookupOrDefault("interpolate", false)),
|
||||||
SfPtr_(NULL),
|
SfPtr_(NULL),
|
||||||
magSfPtr_(NULL),
|
magSfPtr_(NULL),
|
||||||
CfPtr_(NULL),
|
CfPtr_(NULL),
|
||||||
|
|||||||
@ -128,11 +128,6 @@ class sampledSurface
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
// Protected static functions
|
|
||||||
|
|
||||||
//- Read bool from dictionary. Return provided value if not found
|
|
||||||
static bool getBool(const dictionary&, const word&, const bool);
|
|
||||||
|
|
||||||
// Protected Member functions
|
// Protected Member functions
|
||||||
|
|
||||||
virtual void clearGeom() const;
|
virtual void clearGeom() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user