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:
@ -109,19 +109,16 @@ bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
||||
//
|
||||
writeOpts_.noPatches(dict.lookupOrDefault("noPatches", false));
|
||||
|
||||
if (dict.found("patches"))
|
||||
wordRes list;
|
||||
if (dict.readIfPresent("patches", list))
|
||||
{
|
||||
wordRes list(dict.lookup("patches"));
|
||||
list.uniq();
|
||||
|
||||
writeOpts_.patchSelection(list);
|
||||
}
|
||||
|
||||
if (dict.found("faceZones"))
|
||||
if (dict.readIfPresent("faceZones", list))
|
||||
{
|
||||
wordRes list(dict.lookup("faceZones"));
|
||||
list.uniq();
|
||||
|
||||
writeOpts_.faceZoneSelection(list);
|
||||
}
|
||||
|
||||
@ -147,7 +144,7 @@ bool Foam::functionObjects::ensightWrite::read(const dictionary& dict)
|
||||
//
|
||||
// output fields
|
||||
//
|
||||
dict.lookup("fields") >> selectFields_;
|
||||
dict.readEntry("fields", selectFields_);
|
||||
selectFields_.uniq();
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user