ENH: use Zero when zero-initializing types

- makes the intent clearer and avoids the need for additional
  constructor casting. Eg,

      labelList(10, Zero)    vs.  labelList(10, 0)
      scalarField(10, Zero)  vs.  scalarField(10, scalar(0))
      vectorField(10, Zero)  vs.  vectorField(10, vector::zero)
This commit is contained in:
Mark Olesen
2018-12-11 23:50:15 +01:00
parent 6e8cf684d1
commit 1d85fecf4d
342 changed files with 814 additions and 803 deletions

View File

@ -94,7 +94,7 @@ void Foam::combustionModels::EDC<ReactionThermo>::correct()
tmp<volScalarField> trho(this->rho());
const volScalarField& rho = trho();
scalarField tauStar(epsilon.size(), 0);
scalarField tauStar(epsilon.size(), Zero);
if (version_ == EDCversions::v2016)
{

View File

@ -113,7 +113,7 @@ void Foam::reactionRateFlameAreaModels::relaxation::correct
const volScalarField omegaInf(correlation_.omega0Sigma(sigmaTotal));
dimensionedScalar sigma0("sigma0", sigma.dimensions(), 0.0);
dimensionedScalar sigma0("sigma0", sigma.dimensions(), Zero);
const volScalarField tau(C_*mag(sigmaTotal));

View File

@ -158,7 +158,7 @@ diffusionMulticomponent
YfStream_(reactions_.size(), 1.0),
sigma_(reactions_.size(), 0.02),
oxidantRes_(this->coeffs().lookup("oxidantRes")),
ftCorr_(reactions_.size(), 0.0),
ftCorr_(reactions_.size(), Zero),
alpha_(1),
laminarIgn_(false)
{

View File

@ -36,7 +36,7 @@ Foam::combustionModels::zoneCombustion<ReactionThermo>::filter
{
fvScalarMatrix& R = tR.ref();
scalarField& Su = R.source();
scalarField filteredField(Su.size(), 0);
scalarField filteredField(Su.size(), Zero);
forAll(zoneNames_, zonei)
{
@ -80,7 +80,7 @@ Foam::combustionModels::zoneCombustion<ReactionThermo>::filter
) const
{
scalarField& S = tS.ref();
scalarField filteredField(S.size(), 0);
scalarField filteredField(S.size(), Zero);
forAll(zoneNames_, zonei)
{