Replacing const_cast lookupObject to lookupObjectRef

This commit is contained in:
Henry Weller
2017-05-11 14:42:59 +01:00
parent e8f9d6a7fe
commit 9fbe68fca6
20 changed files with 70 additions and 144 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,10 +91,7 @@ bool Foam::functionObjects::processorField::read(const dictionary& dict)
bool Foam::functionObjects::processorField::execute()
{
const volScalarField& procField =
mesh_.lookupObject<volScalarField>("processorID");
const_cast<volScalarField&>(procField) ==
mesh_.lookupObjectRef<volScalarField>("processorID") ==
dimensionedScalar("proci", dimless, Pstream::myProcNo());
return true;
@ -103,10 +100,7 @@ bool Foam::functionObjects::processorField::execute()
bool Foam::functionObjects::processorField::write()
{
const volScalarField& procField =
mesh_.lookupObject<volScalarField>("processorID");
procField.write();
mesh_.lookupObject<volScalarField>("processorID").write();
return true;
}