STYLE: more explicit use of REGISTER when storing fields

ENH: add phaseScopedName convenience method

- unites IOobject::scopedName + phasePropertyName
This commit is contained in:
Mark Olesen
2023-05-09 13:34:24 +02:00
parent 16591012e9
commit 8e32db2b5f
41 changed files with 211 additions and 177 deletions

View File

@ -404,10 +404,11 @@ Foam::tmp<Foam::pointScalarField> Foam::functionObjects::streamFunction::calc
bool Foam::functionObjects::streamFunction::calc()
{
if (foundObject<surfaceScalarField>(fieldName_))
const auto* phiPtr = findObject<surfaceScalarField>(fieldName_);
if (phiPtr)
{
const surfaceScalarField& phi =
mesh_.lookupObject<surfaceScalarField>(fieldName_);
const surfaceScalarField& phi = *phiPtr;
return store(resultName_, calc(phi));
}