mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Use Zero rather than pTraits<Type>::zero unless a static typed '0' is required
This commit is contained in:
@ -781,7 +781,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<scalar>::zero,
|
||||
scalar(Zero),
|
||||
volScalarField::typeName,
|
||||
scalarFlds
|
||||
);
|
||||
@ -793,7 +793,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<vector>::zero,
|
||||
vector(Zero),
|
||||
volVectorField::typeName,
|
||||
vectorFlds
|
||||
);
|
||||
@ -811,7 +811,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<sphericalTensor>::zero,
|
||||
sphericalTensor(Zero),
|
||||
volSphericalTensorField::typeName,
|
||||
sphericalTensorFlds
|
||||
);
|
||||
@ -823,7 +823,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<symmTensor>::zero,
|
||||
symmTensor(Zero),
|
||||
volSymmTensorField::typeName,
|
||||
symmTensorFlds
|
||||
);
|
||||
@ -835,7 +835,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<tensor>::zero,
|
||||
tensor(Zero),
|
||||
volTensorField::typeName,
|
||||
tensorFlds
|
||||
);
|
||||
@ -849,7 +849,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<scalar>::zero,
|
||||
scalar(Zero),
|
||||
surfaceScalarField::typeName,
|
||||
surfScalarFlds
|
||||
);
|
||||
@ -861,7 +861,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<vector>::zero,
|
||||
vector(Zero),
|
||||
surfaceVectorField::typeName,
|
||||
surfVectorFlds
|
||||
);
|
||||
@ -879,7 +879,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<sphericalTensor>::zero,
|
||||
sphericalTensor(Zero),
|
||||
surfaceSphericalTensorField::typeName,
|
||||
surfSphericalTensorFlds
|
||||
);
|
||||
@ -899,7 +899,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<symmTensor>::zero,
|
||||
symmTensor(Zero),
|
||||
surfaceSymmTensorField::typeName,
|
||||
surfSymmTensorFlds
|
||||
);
|
||||
@ -911,7 +911,7 @@ int main(int argc, char *argv[])
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
pTraits<tensor>::zero,
|
||||
tensor(Zero),
|
||||
surfaceTensorField::typeName,
|
||||
surfTensorFlds
|
||||
);
|
||||
|
||||
@ -182,7 +182,7 @@ void subsetVolFields
|
||||
if (addedPatches.found(patchI))
|
||||
{
|
||||
tSubFld.ref().boundaryField()[patchI] ==
|
||||
pTraits<typename GeoField::value_type>::zero;
|
||||
typename GeoField::value_type(Zero);
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,7 +234,7 @@ void subsetSurfaceFields
|
||||
if (addedPatches.found(patchI))
|
||||
{
|
||||
tSubFld.ref().boundaryField()[patchI] ==
|
||||
pTraits<typename GeoField::value_type>::zero;
|
||||
typename GeoField::value_type(Zero);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ void Foam::helpTypes::helpBoundary::fixedValueFieldConditions
|
||||
false
|
||||
),
|
||||
mesh,
|
||||
dimensioned<Type>("zero", dimless, pTraits<Type>::zero)
|
||||
dimensioned<Type>("zero", dimless, Zero)
|
||||
);
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -102,7 +102,7 @@ void ensightCloudField
|
||||
|
||||
if (mag(v) < 1.0e-90)
|
||||
{
|
||||
v = pTraits<Type>::zero;
|
||||
v = Zero;
|
||||
}
|
||||
|
||||
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
|
||||
|
||||
@ -182,7 +182,7 @@ void Foam::ensightLagrangianField
|
||||
|
||||
if (mag(val) < 1.0e-90)
|
||||
{
|
||||
val = pTraits<Type>::zero;
|
||||
val = Zero;
|
||||
}
|
||||
|
||||
for (direction cmpt=0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -86,7 +86,7 @@ void ReadAndMapFields
|
||||
(
|
||||
"zero",
|
||||
readField.dimensions(),
|
||||
pTraits<Type>::zero
|
||||
Zero
|
||||
)
|
||||
)
|
||||
);
|
||||
@ -252,7 +252,7 @@ int main(int argc, char *argv[])
|
||||
objects,
|
||||
tetDualMesh,
|
||||
pointDualAddressing,
|
||||
pTraits<scalar>::zero, // nullValue
|
||||
Zero, // nullValue
|
||||
psFlds
|
||||
);
|
||||
|
||||
@ -263,7 +263,7 @@ int main(int argc, char *argv[])
|
||||
objects,
|
||||
tetDualMesh,
|
||||
pointDualAddressing,
|
||||
pTraits<vector>::zero, // nullValue
|
||||
Zero, // nullValue
|
||||
pvFlds
|
||||
);
|
||||
|
||||
@ -274,7 +274,7 @@ int main(int argc, char *argv[])
|
||||
objects,
|
||||
tetDualMesh,
|
||||
pointDualAddressing,
|
||||
pTraits<sphericalTensor>::zero, // nullValue
|
||||
Zero, // nullValue
|
||||
pstFlds
|
||||
);
|
||||
|
||||
@ -285,7 +285,7 @@ int main(int argc, char *argv[])
|
||||
objects,
|
||||
tetDualMesh,
|
||||
pointDualAddressing,
|
||||
pTraits<symmTensor>::zero, // nullValue
|
||||
Zero, // nullValue
|
||||
psymmtFlds
|
||||
);
|
||||
|
||||
@ -296,7 +296,7 @@ int main(int argc, char *argv[])
|
||||
objects,
|
||||
tetDualMesh,
|
||||
pointDualAddressing,
|
||||
pTraits<tensor>::zero, // nullValue
|
||||
Zero, // nullValue
|
||||
ptFlds
|
||||
);
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -30,7 +30,7 @@ License
|
||||
template<class T>
|
||||
Foam::Field<T> Foam::channelIndex::regionSum(const Field<T>& cellField) const
|
||||
{
|
||||
Field<T> regionField(cellRegion_().nRegions(), pTraits<T>::zero);
|
||||
Field<T> regionField(cellRegion_().nRegions(), Zero);
|
||||
|
||||
forAll(cellRegion_(), cellI)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -51,7 +51,7 @@ void printAverage
|
||||
FieldType field(fieldHeader, mesh);
|
||||
|
||||
typename FieldType::value_type sumField =
|
||||
pTraits<typename FieldType::value_type>::zero;
|
||||
Zero;
|
||||
|
||||
if (area > 0)
|
||||
{
|
||||
|
||||
@ -584,8 +584,8 @@ int main(int argc, char *argv[])
|
||||
// I need coarse Sf (Ai), fine Sf (dAi) and fine Cf(r) to calculate Fij
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
pointField compactCoarseCf(map.constructSize(), pTraits<vector>::zero);
|
||||
pointField compactCoarseSf(map.constructSize(), pTraits<vector>::zero);
|
||||
pointField compactCoarseCf(map.constructSize(), Zero);
|
||||
pointField compactCoarseSf(map.constructSize(), Zero);
|
||||
List<List<point>> compactFineSf(map.constructSize());
|
||||
List<List<point>> compactFineCf(map.constructSize());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user