Replacing const_cast lookupObject to lookupObjectRef
This commit is contained in:
@ -117,9 +117,7 @@ bool Foam::dynamicInkJetFvMesh::update()
|
|||||||
|
|
||||||
fvMesh::movePoints(newPoints);
|
fvMesh::movePoints(newPoints);
|
||||||
|
|
||||||
volVectorField& U =
|
lookupObjectRef<volVectorField>("U").correctBoundaryConditions();
|
||||||
const_cast<volVectorField&>(lookupObject<volVectorField>("U"));
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -65,9 +65,7 @@ bool Foam::dynamicMotionSolverFvMesh::update()
|
|||||||
|
|
||||||
if (foundObject<volVectorField>("U"))
|
if (foundObject<volVectorField>("U"))
|
||||||
{
|
{
|
||||||
volVectorField& U =
|
lookupObjectRef<volVectorField>("U").correctBoundaryConditions();
|
||||||
const_cast<volVectorField&>(lookupObject<volVectorField>("U"));
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2016-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -93,8 +93,7 @@ bool Foam::dynamicMotionSolverListFvMesh::update()
|
|||||||
|
|
||||||
if (foundObject<volVectorField>("U"))
|
if (foundObject<volVectorField>("U"))
|
||||||
{
|
{
|
||||||
const_cast<volVectorField&>(lookupObject<volVectorField>("U"))
|
lookupObjectRef<volVectorField>("U").correctBoundaryConditions();
|
||||||
.correctBoundaryConditions();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -40,9 +40,7 @@ void Foam::functionObjects::turbulenceFields::processField
|
|||||||
|
|
||||||
if (obr_.foundObject<FieldType>(scopedName))
|
if (obr_.foundObject<FieldType>(scopedName))
|
||||||
{
|
{
|
||||||
FieldType& fld =
|
obr_.lookupObjectRef<FieldType>(scopedName) == tvalue();
|
||||||
const_cast<FieldType&>(obr_.lookupObject<FieldType>(scopedName));
|
|
||||||
fld == tvalue();
|
|
||||||
}
|
}
|
||||||
else if (obr_.found(scopedName))
|
else if (obr_.found(scopedName))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user