mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -819,7 +819,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
||||
// Find the total number of zones
|
||||
// Each zone will take the patch name
|
||||
// Number of zones per patch ... zero zones should be skipped
|
||||
labelList nZones(pbMesh.size(), 0);
|
||||
labelList nZones(pbMesh.size(), Zero);
|
||||
|
||||
// Per global zone number the average face centre position
|
||||
List<DynamicList<point>> zoneCentre(pbMesh.size());
|
||||
@ -862,7 +862,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
||||
|
||||
nZones[patchi] = pZones.nZones();
|
||||
|
||||
labelList zoneNFaces(pZones.nZones(), 0);
|
||||
labelList zoneNFaces(pZones.nZones(), Zero);
|
||||
|
||||
// Create storage for additional zone centres
|
||||
forAll(zoneNFaces, zonei)
|
||||
|
||||
@ -121,7 +121,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Calculate starting ids for particles on each processor
|
||||
List<label> startIds(numIds.size(), 0);
|
||||
labelList startIds(numIds.size(), Zero);
|
||||
for (label i = 0; i < numIds.size()-1; i++)
|
||||
{
|
||||
startIds[i+1] += startIds[i] + numIds[i];
|
||||
|
||||
@ -204,7 +204,7 @@ int main(int argc, char *argv[])
|
||||
Info<< "\n Generating " << nTracks << " tracks" << endl;
|
||||
|
||||
// Determine length of each track
|
||||
labelList trackLengths(nTracks, 0);
|
||||
labelList trackLengths(nTracks, Zero);
|
||||
forAll(particleToTrack, i)
|
||||
{
|
||||
const label trackI = particleToTrack[i];
|
||||
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const scalarField& age = tage();
|
||||
|
||||
List<label> trackSamples(nTracks, 0);
|
||||
labelList trackSamples(nTracks, Zero);
|
||||
|
||||
forAll(particleToTrack, i)
|
||||
{
|
||||
|
||||
@ -44,4 +44,4 @@
|
||||
filePtr.reset(new OFstream(fName));
|
||||
}
|
||||
|
||||
scalarField samples(nIntervals, 0);
|
||||
scalarField samples(nIntervals, Zero);
|
||||
|
||||
Reference in New Issue
Block a user