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:
@ -45,7 +45,7 @@ Foam::label Foam::meshToMesh::calcDistribution
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
List<label> cellsPresentOnProc(Pstream::nProcs(), 0);
|
||||
List<label> cellsPresentOnProc(Pstream::nProcs(), Zero);
|
||||
if ((src.nCells() > 0) || (tgt.nCells() > 0))
|
||||
{
|
||||
cellsPresentOnProc[Pstream::myProcNo()] = 1;
|
||||
@ -601,7 +601,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
|
||||
// Starting offset for points
|
||||
label nPoints = 0;
|
||||
labelList pointOffset(Pstream::nProcs(), 0);
|
||||
labelList pointOffset(Pstream::nProcs(), Zero);
|
||||
forAll(allPoints, proci)
|
||||
{
|
||||
pointOffset[proci] = nPoints;
|
||||
@ -610,7 +610,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
|
||||
// Starting offset for cells
|
||||
label nCells = 0;
|
||||
labelList cellOffset(Pstream::nProcs(), 0);
|
||||
labelList cellOffset(Pstream::nProcs(), Zero);
|
||||
forAll(allTgtCellIDs, proci)
|
||||
{
|
||||
cellOffset[proci] = nCells;
|
||||
@ -662,7 +662,7 @@ void Foam::meshToMesh::distributeAndMergeCells
|
||||
// Starting offset for internal faces
|
||||
label nIntFaces = 0;
|
||||
label nFacesTotal = 0;
|
||||
labelList internalFaceOffset(Pstream::nProcs(), 0);
|
||||
labelList internalFaceOffset(Pstream::nProcs(), Zero);
|
||||
forAll(allNIntCoupledFaces, proci)
|
||||
{
|
||||
label nCoupledFaces =
|
||||
|
||||
@ -73,7 +73,7 @@ void Foam::cellCentreSet::genSamples()
|
||||
}
|
||||
|
||||
labelList samplingFaces(selectedCells.size(), -1);
|
||||
labelList samplingSegments(selectedCells.size(), 0);
|
||||
labelList samplingSegments(selectedCells.size(), Zero);
|
||||
scalarList samplingCurveDist(selectedCells.size());
|
||||
|
||||
forAll(selectedCells, i)
|
||||
|
||||
@ -758,7 +758,7 @@ Foam::isoSurface::interpolate
|
||||
|
||||
// Pass1: unweighted average of merged point values
|
||||
{
|
||||
labelList nValues(values.size(), 0);
|
||||
labelList nValues(values.size(), Zero);
|
||||
|
||||
forAll(unmergedValues, i)
|
||||
{
|
||||
|
||||
@ -998,7 +998,7 @@ Foam::isoSurfaceTopo::isoSurfaceTopo
|
||||
DynamicList<label> cellLabels(5*nCutCells);
|
||||
|
||||
|
||||
labelList startTri(mesh_.nCells()+1, 0);
|
||||
labelList startTri(mesh_.nCells()+1, Zero);
|
||||
|
||||
for (label celli = 0; celli < mesh_.nCells(); ++celli)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user