mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: avoid raw dictionary lookup in functionObjects (issue #762)
Style changes:
- use lookupObjectRef instead of using const_cast
- use tmp::New factory
This commit is contained in:
@ -80,10 +80,10 @@ bool Foam::functionObjects::particleDistribution::read(const dictionary& dict)
|
||||
{
|
||||
if (fvMeshFunctionObject::read(dict) && writeFile::read(dict))
|
||||
{
|
||||
dict.lookup("cloud") >> cloudName_;
|
||||
dict.lookup("nameVsBinWidth") >> nameVsBinWidth_;
|
||||
dict.readEntry("cloud", cloudName_);
|
||||
dict.readEntry("nameVsBinWidth", nameVsBinWidth_);
|
||||
dict.readIfPresent("tagField", tagFieldName_);
|
||||
word format(dict.lookup("setFormat"));
|
||||
const word format(dict.get<word>("setFormat"));
|
||||
writerPtr_ = writer<scalar>::New(format);
|
||||
|
||||
Info<< type() << " " << name() << " output:" << nl
|
||||
|
||||
Reference in New Issue
Block a user