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

@ -120,10 +120,7 @@ bool Foam::functionObjects::yPlus::read(const dictionary& dict)
bool Foam::functionObjects::yPlus::execute()
{
volScalarField& yPlus =
const_cast<volScalarField&>
(
lookupObject<volScalarField>(typeName)
);
lookupObjectRef<volScalarField>(typeName);
if (foundObject<turbulenceModel>(turbulenceModel::propertiesName))
{