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

@ -2215,11 +2215,11 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
// from nothing so explicitly reset.
initPatchFields<volScalarField, processorFvPatchField<scalar>>
(
pTraits<scalar>::zero
Zero
);
initPatchFields<volVectorField, processorFvPatchField<vector>>
(
pTraits<vector>::zero
Zero
);
initPatchFields
<
@ -2227,24 +2227,24 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
processorFvPatchField<sphericalTensor>
>
(
pTraits<sphericalTensor>::zero
Zero
);
initPatchFields<volSymmTensorField, processorFvPatchField<symmTensor>>
(
pTraits<symmTensor>::zero
Zero
);
initPatchFields<volTensorField, processorFvPatchField<tensor>>
(
pTraits<tensor>::zero
Zero
);
initPatchFields<surfaceScalarField, processorFvsPatchField<scalar>>
(
pTraits<scalar>::zero
Zero
);
initPatchFields<surfaceVectorField, processorFvsPatchField<vector>>
(
pTraits<vector>::zero
Zero
);
initPatchFields
<
@ -2252,7 +2252,7 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
processorFvsPatchField<sphericalTensor>
>
(
pTraits<sphericalTensor>::zero
Zero
);
initPatchFields
<
@ -2260,11 +2260,11 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
processorFvsPatchField<symmTensor>
>
(
pTraits<symmTensor>::zero
Zero
);
initPatchFields<surfaceTensorField, processorFvsPatchField<tensor>>
(
pTraits<tensor>::zero
Zero
);

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
@ -107,35 +107,35 @@ Foam::label Foam::fvMeshTools::addPatch
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<scalar>::zero
Zero
);
addPatchFields<volVectorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<vector>::zero
Zero
);
addPatchFields<volSphericalTensorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<sphericalTensor>::zero
Zero
);
addPatchFields<volSymmTensorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<symmTensor>::zero
Zero
);
addPatchFields<volTensorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<tensor>::zero
Zero
);
// Surface fields
@ -145,35 +145,35 @@ Foam::label Foam::fvMeshTools::addPatch
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<scalar>::zero
Zero
);
addPatchFields<surfaceVectorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<vector>::zero
Zero
);
addPatchFields<surfaceSphericalTensorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<sphericalTensor>::zero
Zero
);
addPatchFields<surfaceSymmTensorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<symmTensor>::zero
Zero
);
addPatchFields<surfaceTensorField>
(
mesh,
patchFieldDict,
defaultPatchFieldType,
pTraits<tensor>::zero
Zero
);
// Create reordering list
@ -237,36 +237,36 @@ void Foam::fvMeshTools::setPatchFields
void Foam::fvMeshTools::zeroPatchFields(fvMesh& mesh, const label patchI)
{
setPatchFields<volScalarField>(mesh, patchI, pTraits<scalar>::zero);
setPatchFields<volVectorField>(mesh, patchI, pTraits<vector>::zero);
setPatchFields<volScalarField>(mesh, patchI, Zero);
setPatchFields<volVectorField>(mesh, patchI, Zero);
setPatchFields<volSphericalTensorField>
(
mesh,
patchI,
pTraits<sphericalTensor>::zero
Zero
);
setPatchFields<volSymmTensorField>
(
mesh,
patchI,
pTraits<symmTensor>::zero
Zero
);
setPatchFields<volTensorField>(mesh, patchI, pTraits<tensor>::zero);
setPatchFields<surfaceScalarField>(mesh, patchI, pTraits<scalar>::zero);
setPatchFields<surfaceVectorField>(mesh, patchI, pTraits<vector>::zero);
setPatchFields<volTensorField>(mesh, patchI, Zero);
setPatchFields<surfaceScalarField>(mesh, patchI, Zero);
setPatchFields<surfaceVectorField>(mesh, patchI, Zero);
setPatchFields<surfaceSphericalTensorField>
(
mesh,
patchI,
pTraits<sphericalTensor>::zero
Zero
);
setPatchFields<surfaceSymmTensorField>
(
mesh,
patchI,
pTraits<symmTensor>::zero
Zero
);
setPatchFields<surfaceTensorField>(mesh, patchI, pTraits<tensor>::zero);
setPatchFields<surfaceTensorField>(mesh, patchI, Zero);
}

View File

@ -155,7 +155,7 @@ Foam::motionSmootherAlgo::avg
false
),
fld.mesh(),
dimensioned<Type>("zero", fld.dimensions(), pTraits<Type>::zero)
dimensioned<Type>("zero", fld.dimensions(), Zero)
)
);
GeometricField<Type, pointPatchField, pointMesh>& res = tres.ref();
@ -197,7 +197,7 @@ Foam::motionSmootherAlgo::avg
mesh,
res,
plusEqOp<Type>(),
pTraits<Type>::zero // null value
Type(Zero) // null value
);
syncTools::syncPointList
(