mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: simplify objectRegistry access names (issue #322)
New name: findObject(), cfindObject()
Old name: lookupObjectPtr()
Return a const pointer or nullptr on failure.
New name: findObject()
Old name: --
Return a non-const pointer or nullptr on failure.
New name: getObjectPtr()
Old name: lookupObjectRefPtr()
Return a non-const pointer or nullptr on failure.
Can be called on a const object and it will perform a
const_cast.
- use these updated names and functionality in more places
NB: The older methods names are deprecated, but continue to be defined.
This commit is contained in:
@ -91,8 +91,7 @@ void Foam::fvMotionSolverEngineMesh::move()
|
||||
if (engineDB_.foundObject<surfaceScalarField>("phi"))
|
||||
{
|
||||
surfaceScalarField& phi =
|
||||
const_cast<surfaceScalarField&>
|
||||
(engineDB_.lookupObject<surfaceScalarField>("phi"));
|
||||
engineDB_.lookupObjectRef<surfaceScalarField>("phi");
|
||||
|
||||
const volScalarField& rho =
|
||||
engineDB_.lookupObject<volScalarField>("rho");
|
||||
|
||||
@ -86,8 +86,7 @@ void Foam::layeredEngineMesh::move()
|
||||
if (engineDB_.foundObject<surfaceScalarField>("phi"))
|
||||
{
|
||||
surfaceScalarField& phi =
|
||||
const_cast<surfaceScalarField&>
|
||||
(engineDB_.lookupObject<surfaceScalarField>("phi"));
|
||||
engineDB_.lookupObjectRef<surfaceScalarField>("phi");
|
||||
|
||||
const volScalarField& rho =
|
||||
engineDB_.lookupObject<volScalarField>("rho");
|
||||
|
||||
Reference in New Issue
Block a user