mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: avoid raw dictionary lookup in functionObjects (issue #762)
Style changes:
- use lookupObjectRef instead of using const_cast
- use tmp::New factory
This commit is contained in:
@ -178,7 +178,6 @@ processSameTypeValues
|
||||
if (canWeight(weightField))
|
||||
{
|
||||
tmp<scalarField> weight(weightingFactor(weightField));
|
||||
|
||||
result = gSum(weight*values);
|
||||
}
|
||||
else
|
||||
@ -466,8 +465,8 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
|
||||
const GeometricField<Type, fvPatchField, volMesh>& field
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(faceId_.size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
auto tvalues = tmp<Field<Type>>::New(faceId_.size());
|
||||
auto& values = tvalues.ref();
|
||||
|
||||
forAll(values, i)
|
||||
{
|
||||
@ -501,8 +500,8 @@ Foam::functionObjects::fieldValues::surfaceFieldValue::filterField
|
||||
const GeometricField<Type, fvsPatchField, surfaceMesh>& field
|
||||
) const
|
||||
{
|
||||
tmp<Field<Type>> tvalues(new Field<Type>(faceId_.size()));
|
||||
Field<Type>& values = tvalues.ref();
|
||||
auto tvalues = tmp<Field<Type>>::New(faceId_.size());
|
||||
auto& values = tvalues.ref();
|
||||
|
||||
forAll(values, i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user