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 =
|
||||
|
||||
Reference in New Issue
Block a user