Use Zero rather than pTraits<Type>::zero unless a static typed '0' is required

This commit is contained in:
Henry Weller
2016-03-22 17:46:52 +00:00
parent aa89254c79
commit 730f89dc9d
82 changed files with 224 additions and 224 deletions

View File

@ -75,7 +75,7 @@ Type Foam::fieldValues::cellSource::processValues
const scalarField& weightField
) const
{
Type result = pTraits<Type>::zero;
Type result = Zero;
switch (operation_)
{
case opSum:

View File

@ -81,7 +81,7 @@ Foam::tmp<Foam::Field<Type>> Foam::fieldValues::faceSource::getFieldValues
const faceList& faces = surfacePtr_().faces();
tmp<Field<Type>> tavg
(
new Field<Type>(faces.size(), pTraits<Type>::zero)
new Field<Type>(faces.size(), Zero)
);
Field<Type>& avg = tavg.ref();
@ -127,7 +127,7 @@ Type Foam::fieldValues::faceSource::processSameTypeValues
const scalarField& weightField
) const
{
Type result = pTraits<Type>::zero;
Type result = Zero;
switch (operation_)
{
case opSum:
@ -148,7 +148,7 @@ Type Foam::fieldValues::faceSource::processSameTypeValues
<< pTraits<Type>::typeName
<< exit(FatalError);
result = pTraits<Type>::zero;
result = Zero;
break;
}
case opSumDirectionBalance:
@ -159,7 +159,7 @@ Type Foam::fieldValues::faceSource::processSameTypeValues
<< pTraits<Type>::typeName
<< exit(FatalError);
result = pTraits<Type>::zero;
result = Zero;
break;
}
case opAverage:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,7 +36,7 @@ Type Foam::fieldValues::fieldValueDelta::applyOperation
const Type& value2
) const
{
Type result = pTraits<Type>::zero;
Type result = Zero;
switch (operation_)
{
@ -89,8 +89,8 @@ void Foam::fieldValues::fieldValueDelta::processFields(bool& found)
const dictionary& results1 = source1Ptr_->resultDict();
const dictionary& results2 = source2Ptr_->resultDict();
Type r1(pTraits<Type>::zero);
Type r2(pTraits<Type>::zero);
Type r1(Zero);
Type r2(Zero);
forAll(fields1, i)
{