mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: use autoPtr::New and tmp::New for simple return types
This commit is contained in:
@ -136,7 +136,7 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::getFieldValues
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return tmp<Field<Type>>(new Field<Type>(0));
|
||||
return tmp<Field<Type>>::New();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -67,7 +67,7 @@ Foam::functionObjects::fieldValues::volFieldValue::getFieldValues
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return tmp<Field<Type>>(new Field<Type>(0.0));
|
||||
return tmp<Field<Type>>::New(Zero);
|
||||
}
|
||||
|
||||
|
||||
@ -266,7 +266,7 @@ Foam::functionObjects::fieldValues::volFieldValue::filterField
|
||||
}
|
||||
else
|
||||
{
|
||||
return tmp<Field<Type>>(new Field<Type>(field, cellIDs()));
|
||||
return tmp<Field<Type>>::New(field, cellIDs());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@ Foam::heatTransferCoeffModels::ReynoldsAnalogy::rho(const label patchi) const
|
||||
if (rhoName_ == "rhoInf")
|
||||
{
|
||||
const label n = mesh_.boundary()[patchi].size();
|
||||
return tmp<Field<scalar>>(new Field<scalar>(n, rhoRef_));
|
||||
return tmp<Field<scalar>>::New(n, rhoRef_);
|
||||
}
|
||||
else if (mesh_.foundObject<volScalarField>(rhoName_, false))
|
||||
{
|
||||
@ -77,7 +77,7 @@ Foam::heatTransferCoeffModels::ReynoldsAnalogy::Cp(const label patchi) const
|
||||
if (CpName_ == "CpInf")
|
||||
{
|
||||
const label n = mesh_.boundary()[patchi].size();
|
||||
return tmp<Field<scalar>>(new Field<scalar>(n, CpRef_));
|
||||
return tmp<Field<scalar>>::New(n, CpRef_);
|
||||
}
|
||||
else if (mesh_.foundObject<fluidThermo>(fluidThermo::typeName))
|
||||
{
|
||||
|
||||
@ -111,17 +111,14 @@ Foam::functionObjects::streamLineBase::wallPatch() const
|
||||
}
|
||||
}
|
||||
|
||||
return autoPtr<indirectPrimitivePatch>
|
||||
return autoPtr<indirectPrimitivePatch>::New
|
||||
(
|
||||
new indirectPrimitivePatch
|
||||
IndirectList<face>
|
||||
(
|
||||
IndirectList<face>
|
||||
(
|
||||
mesh_.faces(),
|
||||
addressing
|
||||
),
|
||||
mesh_.points()
|
||||
)
|
||||
mesh_.faces(),
|
||||
addressing
|
||||
),
|
||||
mesh_.points()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user