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:
Mark Olesen
2018-08-04 00:23:18 +02:00
parent 1c354e0906
commit 1036cf9612
81 changed files with 492 additions and 639 deletions

View File

@ -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;