ENH: use Zero when zero-initializing types
- makes the intent clearer and avoids the need for additional
constructor casting. Eg,
labelList(10, Zero) vs. labelList(10, 0)
scalarField(10, Zero) vs. scalarField(10, scalar(0))
vectorField(10, Zero) vs. vectorField(10, vector::zero)
This commit is contained in:
@ -113,7 +113,7 @@ Foam::zeroGradientFaPatchField<Type>::valueInternalCoeffs
|
||||
{
|
||||
return tmp<Field<Type>>
|
||||
(
|
||||
new Field<Type>(this->size(), pTraits<Type>::one)
|
||||
new Field<Type>(this->size(), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ Foam::zeroGradientFaPatchField<Type>::valueBoundaryCoeffs
|
||||
{
|
||||
return tmp<Field<Type>>
|
||||
(
|
||||
new Field<Type>(this->size(), pTraits<Type>::zero)
|
||||
new Field<Type>(this->size(), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
@ -138,7 +138,7 @@ Foam::zeroGradientFaPatchField<Type>::gradientInternalCoeffs() const
|
||||
{
|
||||
return tmp<Field<Type>>
|
||||
(
|
||||
new Field<Type>(this->size(), pTraits<Type>::zero)
|
||||
new Field<Type>(this->size(), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ Foam::zeroGradientFaPatchField<Type>::gradientBoundaryCoeffs() const
|
||||
{
|
||||
return tmp<Field<Type>>
|
||||
(
|
||||
new Field<Type>(this->size(), pTraits<Type>::zero)
|
||||
new Field<Type>(this->size(), Zero)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user