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

@ -244,7 +244,7 @@ void Foam::domainDecomposition::decomposeMesh()
label nInterfaces = interPatchFaces[proci].size();
subPatchIDs[proci].setSize(nInterfaces, labelList(1, label(-1)));
subPatchStarts[proci].setSize(nInterfaces, labelList(1, label(0)));
subPatchStarts[proci].setSize(nInterfaces, labelList(1, Zero));
}

View File

@ -115,7 +115,7 @@ void Foam::domainDecomposition::processInterCyclics
{
label nIntfcs = interPatchFaces[proci].size();
subPatchIDs[proci].setSize(nIntfcs, labelList(1, patchi));
subPatchStarts[proci].setSize(nIntfcs, labelList(1, label(0)));
subPatchStarts[proci].setSize(nIntfcs, labelList(1, Zero));
}
}
}

View File

@ -180,7 +180,7 @@ Foam::faMeshDecomposition::faMeshDecomposition
faceToProc_(nFaces()),
procFaceLabels_(nProcs_),
procMeshEdgesMap_(nProcs_),
procNInternalEdges_(nProcs_, 0),
procNInternalEdges_(nProcs_, Zero),
procPatchEdgeLabels_(nProcs_),
procPatchPointAddressing_(nProcs_),
procPatchEdgeAddressing_(nProcs_),
@ -991,7 +991,7 @@ void Foam::faMeshDecomposition::decomposeMesh()
// Memory management
{
labelList pointsUsage(nPoints(), 0);
labelList pointsUsage(nPoints(), Zero);
// Globally shared points are the ones used by more than 2 processors
// Size the list approximately and gather the points