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 59f7f1ef0e
commit fa8929df6d
82 changed files with 224 additions and 224 deletions

View File

@ -468,7 +468,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
(
snappedPoint[pointI] != -1
? snappedPoints[snappedPoint[pointI]]
: pTraits<Type>::zero
: Type(Zero)
),
pVals[nextPointI],
@ -477,7 +477,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
(
snappedPoint[nextPointI] != -1
? snappedPoints[snappedPoint[nextPointI]]
: pTraits<Type>::zero
: Type(Zero)
),
cVals[own],
@ -486,7 +486,7 @@ Foam::label Foam::isoSurface::generateFaceTriPoints
(
snappedCc[own] != -1
? snappedPoints[snappedCc[own]]
: pTraits<Type>::zero
: Type(Zero)
),
neiVal,
@ -582,7 +582,7 @@ void Foam::isoSurface::generateTriPoints
(
snappedCc[nei[faceI]] != -1
? snappedPoints[snappedCc[nei[faceI]]]
: pTraits<Type>::zero
: Type(Zero)
),
triPoints,
@ -594,7 +594,7 @@ void Foam::isoSurface::generateTriPoints
// Determine neighbouring snap status
boolList neiSnapped(mesh_.nFaces()-mesh_.nInternalFaces(), false);
List<Type> neiSnappedPoint(neiSnapped.size(), pTraits<Type>::zero);
List<Type> neiSnappedPoint(neiSnapped.size(), Type(Zero));
forAll(patches, patchI)
{
const polyPatch& pp = patches[patchI];
@ -680,7 +680,7 @@ void Foam::isoSurface::generateTriPoints
cVals.boundaryField()[patchI][i],
cCoords.boundaryField()[patchI][i],
false,
pTraits<Type>::zero,
Type(Zero),
triPoints,
triMeshCells
@ -713,7 +713,7 @@ void Foam::isoSurface::generateTriPoints
cVals.boundaryField()[patchI][i],
cCoords.boundaryField()[patchI][i],
false, // fc not snapped
pTraits<Type>::zero,
Type(Zero),
triPoints,
triMeshCells
@ -739,7 +739,7 @@ Foam::isoSurface::interpolate
)
{
// One value per point
tmp<Field<Type> > tvalues(new Field<Type>(nPoints, pTraits<Type>::zero));
tmp<Field<Type> > tvalues(new Field<Type>(nPoints, Type(Zero)));
Field<Type>& values = tvalues.ref();
labelList nValues(values.size(), 0);

View File

@ -49,7 +49,7 @@ bool Foam::sampledSurface::checkFieldSize(const Field<Type>& field) const
template<class Type>
Type Foam::sampledSurface::integrate(const Field<Type>& field) const
{
Type value = pTraits<Type>::zero;
Type value = Zero;
if (checkFieldSize(field))
{
@ -73,7 +73,7 @@ Type Foam::sampledSurface::integrate(const tmp<Field<Type>>& field) const
template<class Type>
Type Foam::sampledSurface::average(const Field<Type>& field) const
{
Type value = pTraits<Type>::zero;
Type value = Zero;
if (checkFieldSize(field))
{
@ -89,7 +89,7 @@ Type Foam::sampledSurface::average(const Field<Type>& field) const
}
else
{
return pTraits<Type>::zero;
return Zero;
}
}
@ -174,7 +174,7 @@ Foam::sampledSurface::pointAverage
false
),
mesh,
dimensioned<Type>("zero", dimless, pTraits<Type>::zero)
dimensioned<Type>("zero", dimless, Zero)
)
);
GeometricField<Type, fvPatchField, volMesh>& cellAvg = tcellAvg.ref();

View File

@ -56,7 +56,7 @@ Foam::sampledTriSurfaceMesh::sampleField
// Create flat boundary field
Field<Type> bVals(nBnd, pTraits<Type>::zero);
Field<Type> bVals(nBnd, Zero);
forAll(vField.boundaryField(), patchI)
{

View File

@ -181,7 +181,7 @@ void Foam::nastranSurfaceWriter::writeTemplate
const DynamicList<face>& dFaces = decomposedFaces[i];
forAll(dFaces, faceI)
{
Type v = pTraits<Type>::zero;
Type v = Zero;
const face& f = dFaces[faceI];
forAll(f, fptI)