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

@ -1149,7 +1149,7 @@ label findCorrespondingRegion
)
{
// Per region the number of cells in zoneI
labelList cellsInZone(nCellRegions, 0);
labelList cellsInZone(nCellRegions, Zero);
forAll(cellRegion, celli)
{
@ -1267,7 +1267,7 @@ void matchRegions
getZoneID(mesh, cellZones, zoneID, neiZoneID);
// Sizes per cellzone
labelList zoneSizes(cellZones.size(), 0);
labelList zoneSizes(cellZones.size(), Zero);
{
List<wordList> zoneNames(Pstream::nProcs());
zoneNames[Pstream::myProcNo()] = cellZones.names();
@ -1753,7 +1753,7 @@ int main(int argc, char *argv[])
// Sizes per region
// ~~~~~~~~~~~~~~~~
labelList regionSizes(nCellRegions, 0);
labelList regionSizes(nCellRegions, Zero);
forAll(cellRegion, celli)
{