Commit 730f89dc authored by Henry Weller's avatar Henry Weller
Browse files

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

parent aa89254c
......@@ -122,7 +122,7 @@ Foam::tmp<Foam::volScalarField> Foam::XiEqModels::basicSubGrid::XiEq() const
(
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
Zero
)
);
ns.internalField() = nsv.internalField()*Cw;
......
......@@ -108,7 +108,7 @@ Foam::tmp<Foam::volSymmTensorField> Foam::PDRDragModels::basic::Dcu() const
(
"zero",
dimMass/dimTime/pow(dimLength, 3),
pTraits<symmTensor>::zero
Zero
)
)
);
......
......@@ -131,7 +131,7 @@ Foam::XiEqModel::calculateSchelkinEffect(const scalar uPrimeCoef) const
(
"zero",
nsv.dimensions(),
pTraits<symmTensor>::zero
Zero
)
);
ns.internalField() = nsv.internalField()*pow(mesh.V(), 2.0/3.0);
......
......@@ -60,7 +60,7 @@ void zeroCells
{
forAll(cells, i)
{
vf[cells[i]] = pTraits<Type>::zero;
vf[cells[i]] = Zero;
}
}
......
......@@ -47,7 +47,7 @@ void Foam::BlendedInterfacialModel<ModelType>::correctFixedFluxBCs
)
{
field.boundaryField()[patchI]
= pTraits<typename GeometricField::value_type>::zero;
= Zero;
}
}
}
......@@ -382,7 +382,7 @@ Foam::BlendedInterfacialModel<ModelType>::F() const
false
),
phase1_.mesh(),
dimensioned<Type>("zero", ModelType::dimF, pTraits<Type>::zero)
dimensioned<Type>("zero", ModelType::dimF, Zero)
)
);
......
......@@ -47,7 +47,7 @@ void Foam::BlendedInterfacialModel<modelType>::correctFixedFluxBCs
)
{
field.boundaryField()[patchI]
= pTraits<typename GeometricField::value_type>::zero;
= Zero;
}
}
}
......@@ -280,7 +280,7 @@ Foam::BlendedInterfacialModel<modelType>::F() const
false
),
pair_.phase1().mesh(),
dimensioned<Type>("zero", modelType::dimF, pTraits<Type>::zero)
dimensioned<Type>("zero", modelType::dimF, Zero)
)
);
......
......@@ -147,7 +147,7 @@ int main(int argc, char *argv[])
const volVectorField& fld = mesh.C();
// 1. Construct cell data in compact addressing
List<point> compactFld(map.constructSize(), pTraits<point>::zero);
List<point> compactFld(map.constructSize(), Zero);
// Insert my internal values
forAll(fld, cellI)
......
......@@ -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());
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -34,8 +34,8 @@ namespace Foam
atmBoundaryLayer::atmBoundaryLayer()
:
flowDir_(pTraits<vector>::zero),
zDir_(pTraits<vector>::zero),
flowDir_(Zero),
zDir_(Zero),
kappa_(0.41),
Cmu_(0.09),
Uref_(0),
......
......@@ -209,9 +209,9 @@ nutURoughWallFunctionFvPatchScalarField::nutURoughWallFunctionFvPatchScalarField
)
:
nutWallFunctionFvPatchScalarField(p, iF),
roughnessHeight_(pTraits<scalar>::zero),
roughnessConstant_(pTraits<scalar>::zero),
roughnessFactor_(pTraits<scalar>::zero)
roughnessHeight_(Zero),
roughnessConstant_(Zero),
roughnessFactor_(Zero)
{}
......
......@@ -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
);
......
......@@ -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);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment