Further standardization of loop index naming: pointI -> pointi, patchI -> patchi

This commit is contained in:
Henry Weller
2016-05-18 21:20:42 +01:00
parent ac632e7984
commit 67de20df25
365 changed files with 4877 additions and 4877 deletions

View File

@ -575,12 +575,12 @@ void Foam::globalMeshData::calcPointConnectivity
// Create field with my local data
labelPairList myData(globalPointSlavesMap().constructSize());
forAll(slaves, pointI)
forAll(slaves, pointi)
{
myData[pointI] = globalIndexAndTransform::encode
myData[pointi] = globalIndexAndTransform::encode
(
Pstream::myProcNo(),
pointI,
pointi,
transforms.nullTransformIndex()
);
}
@ -594,21 +594,21 @@ void Foam::globalMeshData::calcPointConnectivity
// Pass1: do the master points since these also update local slaves
// (e.g. from local cyclics)
forAll(slaves, pointI)
forAll(slaves, pointi)
{
// Reconstruct string of connected points
const labelList& pSlaves = slaves[pointI];
const labelList& pTransformSlaves = transformedSlaves[pointI];
const labelList& pSlaves = slaves[pointi];
const labelList& pTransformSlaves = transformedSlaves[pointi];
if (pSlaves.size()+pTransformSlaves.size())
{
labelPairList& pConnectivity = allPointConnectivity[pointI];
labelPairList& pConnectivity = allPointConnectivity[pointi];
pConnectivity.setSize(1+pSlaves.size()+pTransformSlaves.size());
label connI = 0;
// Add myself
pConnectivity[connI++] = myData[pointI];
pConnectivity[connI++] = myData[pointi];
// Add untransformed points
forAll(pSlaves, i)
{
@ -648,13 +648,13 @@ void Foam::globalMeshData::calcPointConnectivity
// Pass2: see if anything is still unset (should not be the case)
forAll(slaves, pointI)
forAll(slaves, pointi)
{
labelPairList& pConnectivity = allPointConnectivity[pointI];
labelPairList& pConnectivity = allPointConnectivity[pointi];
if (pConnectivity.size() == 0)
{
pConnectivity.setSize(1, myData[pointI]);
pConnectivity.setSize(1, myData[pointi]);
}
}
@ -682,25 +682,25 @@ void Foam::globalMeshData::calcGlobalPointEdges
// Create local version
globalPointEdges.setSize(globalPointSlavesMap().constructSize());
globalPointPoints.setSize(globalPointSlavesMap().constructSize());
forAll(pointEdges, pointI)
forAll(pointEdges, pointi)
{
const labelList& pEdges = pointEdges[pointI];
labelList& globalPEdges = globalPointEdges[pointI];
const labelList& pEdges = pointEdges[pointi];
labelList& globalPEdges = globalPointEdges[pointi];
globalPEdges.setSize(pEdges.size());
forAll(pEdges, i)
{
globalPEdges[i] = globalEdgeNumbers.toGlobal(pEdges[i]);
}
labelPairList& globalPPoints = globalPointPoints[pointI];
labelPairList& globalPPoints = globalPointPoints[pointi];
globalPPoints.setSize(pEdges.size());
forAll(pEdges, i)
{
label otherPointI = edges[pEdges[i]].otherVertex(pointI);
label otherPointi = edges[pEdges[i]].otherVertex(pointi);
globalPPoints[i] = globalIndexAndTransform::encode
(
Pstream::myProcNo(),
otherPointI,
otherPointi,
globalTransforms().nullTransformIndex()
);
}
@ -710,10 +710,10 @@ void Foam::globalMeshData::calcGlobalPointEdges
globalPointSlavesMap().distribute(globalPointEdges);
globalPointSlavesMap().distribute(globalPointPoints);
// Add all pointEdges
forAll(slaves, pointI)
forAll(slaves, pointi)
{
const labelList& pSlaves = slaves[pointI];
const labelList& pTransformSlaves = transformedSlaves[pointI];
const labelList& pSlaves = slaves[pointi];
const labelList& pTransformSlaves = transformedSlaves[pointi];
label n = 0;
forAll(pSlaves, i)
@ -727,7 +727,7 @@ void Foam::globalMeshData::calcGlobalPointEdges
// Add all the point edges of the slaves to those of the (master) point
{
labelList& globalPEdges = globalPointEdges[pointI];
labelList& globalPEdges = globalPointEdges[pointi];
label sz = globalPEdges.size();
globalPEdges.setSize(sz+n);
forAll(pSlaves, i)
@ -762,7 +762,7 @@ void Foam::globalMeshData::calcGlobalPointEdges
// Same for corresponding pointPoints
{
labelPairList& globalPPoints = globalPointPoints[pointI];
labelPairList& globalPPoints = globalPointPoints[pointi];
label sz = globalPPoints.size();
globalPPoints.setSize(sz + n);
@ -842,17 +842,17 @@ Foam::label Foam::globalMeshData::findTransform
forAll(info, i)
{
label proci = globalIndexAndTransform::processor(info[i]);
label pointI = globalIndexAndTransform::index(info[i]);
label pointi = globalIndexAndTransform::index(info[i]);
label transformI = globalIndexAndTransform::transformIndex(info[i]);
if (proci == Pstream::myProcNo() && pointI == localPoint)
if (proci == Pstream::myProcNo() && pointi == localPoint)
{
localTransformI = transformI;
//Pout<< "For local :" << localPoint
// << " found transform:" << localTransformI
// << endl;
}
if (proci == remoteProci && pointI == remoteIndex)
if (proci == remoteProci && pointi == remoteIndex)
{
remoteTransformI = transformI;
//Pout<< "For remote:" << remotePoint
@ -1116,9 +1116,9 @@ void Foam::globalMeshData::calcGlobalEdgeOrientation() const
masterPoint.setSize(map.constructSize());
masterPoint = labelMax;
for (label pointI = 0; pointI < coupledPatch().nPoints(); pointI++)
for (label pointi = 0; pointi < coupledPatch().nPoints(); pointi++)
{
masterPoint[pointI] = globalPoints.toGlobal(pointI);
masterPoint[pointi] = globalPoints.toGlobal(pointi);
}
syncData
(
@ -1259,9 +1259,9 @@ void Foam::globalMeshData::calcPointBoundaryFaces
// 2. Size
pointBoundaryFaces.setSize(coupledPatch().nPoints());
forAll(nPointFaces, pointI)
forAll(nPointFaces, pointi)
{
pointBoundaryFaces[pointI].setSize(nPointFaces[pointI]);
pointBoundaryFaces[pointi].setSize(nPointFaces[pointi]);
}
nPointFaces = 0;
@ -1326,10 +1326,10 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
);
labelListList& globalPointBoundaryFaces = globalPointBoundaryFacesPtr_();
forAll(pointBoundaryFaces, pointI)
forAll(pointBoundaryFaces, pointi)
{
const labelList& bFaces = pointBoundaryFaces[pointI];
labelList& globalFaces = globalPointBoundaryFaces[pointI];
const labelList& bFaces = pointBoundaryFaces[pointi];
labelList& globalFaces = globalPointBoundaryFaces[pointi];
globalFaces.setSize(bFaces.size());
forAll(bFaces, i)
{
@ -1357,14 +1357,14 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
List<labelPairList> transformedFaces(pointSlaves.size());
forAll(pointSlaves, pointI)
forAll(pointSlaves, pointi)
{
const labelList& slaves = pointSlaves[pointI];
const labelList& transformedSlaves = pointTransformSlaves[pointI];
const labelList& slaves = pointSlaves[pointi];
const labelList& transformedSlaves = pointTransformSlaves[pointi];
if (slaves.size() > 0)
{
labelList& myBFaces = globalPointBoundaryFaces[pointI];
labelList& myBFaces = globalPointBoundaryFaces[pointi];
label sz = myBFaces.size();
// Count
@ -1399,9 +1399,9 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
if (transformedSlaves.size() > 0)
{
const labelList& untrafoFaces = globalPointBoundaryFaces[pointI];
const labelList& untrafoFaces = globalPointBoundaryFaces[pointi];
labelPairList& myBFaces = transformedFaces[pointI];
labelPairList& myBFaces = transformedFaces[pointi];
label sz = myBFaces.size();
// Count
@ -1447,7 +1447,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryFaces() const
if (slaves.size() + transformedSlaves.size() == 0)
{
globalPointBoundaryFaces[pointI].clear();
globalPointBoundaryFaces[pointi].clear();
}
}
@ -1508,12 +1508,12 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
// Create addressing for point to boundary cells (local)
labelListList pointBoundaryCells(coupledPatch().nPoints());
forAll(coupledPatch().meshPoints(), pointI)
forAll(coupledPatch().meshPoints(), pointi)
{
label meshPointI = coupledPatch().meshPoints()[pointI];
const labelList& pCells = mesh_.pointCells(meshPointI);
label meshPointi = coupledPatch().meshPoints()[pointi];
const labelList& pCells = mesh_.pointCells(meshPointi);
labelList& bCells = pointBoundaryCells[pointI];
labelList& bCells = pointBoundaryCells[pointi];
bCells.setSize(pCells.size());
forAll(pCells, i)
@ -1557,10 +1557,10 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
);
labelListList& globalPointBoundaryCells = globalPointBoundaryCellsPtr_();
forAll(pointBoundaryCells, pointI)
forAll(pointBoundaryCells, pointi)
{
const labelList& pCells = pointBoundaryCells[pointI];
labelList& globalCells = globalPointBoundaryCells[pointI];
const labelList& pCells = pointBoundaryCells[pointi];
labelList& globalCells = globalPointBoundaryCells[pointi];
globalCells.setSize(pCells.size());
forAll(pCells, i)
{
@ -1585,14 +1585,14 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
List<labelPairList> transformedCells(pointSlaves.size());
forAll(pointSlaves, pointI)
forAll(pointSlaves, pointi)
{
const labelList& slaves = pointSlaves[pointI];
const labelList& transformedSlaves = pointTransformSlaves[pointI];
const labelList& slaves = pointSlaves[pointi];
const labelList& transformedSlaves = pointTransformSlaves[pointi];
if (slaves.size() > 0)
{
labelList& myBCells = globalPointBoundaryCells[pointI];
labelList& myBCells = globalPointBoundaryCells[pointi];
label sz = myBCells.size();
// Count
@ -1627,9 +1627,9 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
if (transformedSlaves.size() > 0)
{
const labelList& untrafoCells = globalPointBoundaryCells[pointI];
const labelList& untrafoCells = globalPointBoundaryCells[pointi];
labelPairList& myBCells = transformedCells[pointI];
labelPairList& myBCells = transformedCells[pointi];
label sz = myBCells.size();
// Count
@ -1674,7 +1674,7 @@ void Foam::globalMeshData::calcGlobalPointBoundaryCells() const
if (slaves.size() + transformedSlaves.size() == 0)
{
globalPointBoundaryCells[pointI].clear();
globalPointBoundaryCells[pointi].clear();
}
}
@ -1868,10 +1868,10 @@ const Foam::labelList& Foam::globalMeshData::sharedPointGlobalLabels() const
forAll(pointLabels, i)
{
// Get my mesh point
label pointI = pointLabels[i];
label pointi = pointLabels[i];
// Map to mesh point of original mesh
sharedPointGlobalLabels[i] = pointProcAddressing[pointI];
sharedPointGlobalLabels[i] = pointProcAddressing[pointi];
}
}
else
@ -1901,9 +1901,9 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
// insert my own data first
forAll(pointLabels, i)
{
label sharedPointI = pointAddr[i];
label sharedPointi = pointAddr[i];
sharedPoints[sharedPointI] = mesh_.points()[pointLabels[i]];
sharedPoints[sharedPointi] = mesh_.points()[pointLabels[i]];
}
// Receive data from slaves and insert
@ -1922,9 +1922,9 @@ Foam::pointField Foam::globalMeshData::sharedPoints() const
forAll(nbrSharedPointAddr, i)
{
label sharedPointI = nbrSharedPointAddr[i];
label sharedPointi = nbrSharedPointAddr[i];
sharedPoints[sharedPointI] = nbrSharedPoints[i];
sharedPoints[sharedPointi] = nbrSharedPoints[i];
}
}
@ -2402,12 +2402,12 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
// - other (since e.g. non-collocated cyclics not connected)
labelList masterGlobalPoint(cpp.nPoints(), -1);
forAll(masterGlobalPoint, pointI)
forAll(masterGlobalPoint, pointi)
{
const labelList& slavePoints = pointSlaves[pointI];
const labelList& slavePoints = pointSlaves[pointi];
if (slavePoints.size() > 0)
{
masterGlobalPoint[pointI] = globalCoupledPoints.toGlobal(pointI);
masterGlobalPoint[pointi] = globalCoupledPoints.toGlobal(pointi);
}
}
@ -2425,17 +2425,17 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
// 1. Count number of masters on my processor.
label nMaster = 0;
PackedBoolList isMaster(mesh_.nPoints(), 1);
forAll(pointSlaves, pointI)
forAll(pointSlaves, pointi)
{
if (masterGlobalPoint[pointI] == -1)
if (masterGlobalPoint[pointi] == -1)
{
// unconnected point (e.g. from separated cyclic)
nMaster++;
}
else if
(
masterGlobalPoint[pointI]
== globalCoupledPoints.toGlobal(pointI)
masterGlobalPoint[pointi]
== globalCoupledPoints.toGlobal(pointi)
)
{
// connected master
@ -2444,7 +2444,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
else
{
// connected slave point
isMaster[cpp.meshPoints()[pointI]] = 0;
isMaster[cpp.meshPoints()[pointi]] = 0;
}
}
@ -2467,12 +2467,12 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
uniquePoints.setSize(myUniquePoints);
nMaster = 0;
forAll(isMaster, meshPointI)
forAll(isMaster, meshPointi)
{
if (isMaster[meshPointI])
if (isMaster[meshPointi])
{
pointToGlobal[meshPointI] = globalPointsPtr().toGlobal(nMaster);
uniquePoints[nMaster] = meshPointI;
pointToGlobal[meshPointi] = globalPointsPtr().toGlobal(nMaster);
uniquePoints[nMaster] = meshPointi;
nMaster++;
}
}
@ -2482,18 +2482,18 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
{
labelList masterToGlobal(pointSlavesMap.constructSize(), -1);
forAll(pointSlaves, pointI)
forAll(pointSlaves, pointi)
{
const labelList& slaves = pointSlaves[pointI];
const labelList& slaves = pointSlaves[pointi];
if (slaves.size() > 0)
{
// Duplicate master globalpoint into slave slots
label meshPointI = cpp.meshPoints()[pointI];
masterToGlobal[pointI] = pointToGlobal[meshPointI];
label meshPointi = cpp.meshPoints()[pointi];
masterToGlobal[pointi] = pointToGlobal[meshPointi];
forAll(slaves, i)
{
masterToGlobal[slaves[i]] = masterToGlobal[pointI];
masterToGlobal[slaves[i]] = masterToGlobal[pointi];
}
}
}
@ -2502,13 +2502,13 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
pointSlavesMap.reverseDistribute(cpp.nPoints(), masterToGlobal);
// On slave copy master index into overal map.
forAll(pointSlaves, pointI)
forAll(pointSlaves, pointi)
{
label meshPointI = cpp.meshPoints()[pointI];
label meshPointi = cpp.meshPoints()[pointi];
if (!isMaster[meshPointI])
if (!isMaster[meshPointi])
{
pointToGlobal[meshPointI] = masterToGlobal[pointI];
pointToGlobal[meshPointi] = masterToGlobal[pointi];
}
}
}
@ -2552,16 +2552,16 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
labelList coupledToGlobalPatch(pointSlavesMap.constructSize(), -1);
// Note: loop over patch since usually smaller
forAll(meshPoints, patchPointI)
forAll(meshPoints, patchPointi)
{
label meshPointI = meshPoints[patchPointI];
label meshPointi = meshPoints[patchPointi];
Map<label>::const_iterator iter = cpp.meshPointMap().find(meshPointI);
Map<label>::const_iterator iter = cpp.meshPointMap().find(meshPointi);
if (iter != cpp.meshPointMap().end())
{
patchToCoupled[patchPointI] = iter();
coupledToGlobalPatch[iter()] = globalPPoints.toGlobal(patchPointI);
patchToCoupled[patchPointi] = iter();
coupledToGlobalPatch[iter()] = globalPPoints.toGlobal(patchPointi);
nCoupled++;
}
}
@ -2580,18 +2580,18 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
// Get all data on master
pointSlavesMap.distribute(coupledToGlobalPatch);
forAll(pointSlaves, coupledPointI)
forAll(pointSlaves, coupledPointi)
{
const labelList& slaves = pointSlaves[coupledPointI];
const labelList& slaves = pointSlaves[coupledPointi];
if (slaves.size() > 0)
{
// I am master. What is the best candidate for patch-point master
label masterI = labelMax;
if (coupledToGlobalPatch[coupledPointI] != -1)
if (coupledToGlobalPatch[coupledPointi] != -1)
{
// I am master and on the coupled patch. Use me.
masterI = coupledToGlobalPatch[coupledPointI];
masterI = coupledToGlobalPatch[coupledPointi];
}
else
{
@ -2609,7 +2609,7 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
if (masterI != labelMax)
{
// Push back
coupledToGlobalPatch[coupledPointI] = masterI;
coupledToGlobalPatch[coupledPointi] = masterI;
forAll(slaves, i)
{
coupledToGlobalPatch[slaves[i]] = masterI;
@ -2627,19 +2627,19 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
// compact numbering.
label nMasters = 0;
forAll(meshPoints, patchPointI)
forAll(meshPoints, patchPointi)
{
if (patchToCoupled[patchPointI] == -1)
if (patchToCoupled[patchPointi] == -1)
{
nMasters++;
}
else
{
label coupledPointI = patchToCoupled[patchPointI];
label coupledPointi = patchToCoupled[patchPointi];
if
(
globalPPoints.toGlobal(patchPointI)
== coupledToGlobalPatch[coupledPointI]
globalPPoints.toGlobal(patchPointi)
== coupledToGlobalPatch[coupledPointi]
)
{
// I am the master
@ -2669,24 +2669,24 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
labelList globalMaster(cpp.nPoints(), -1);
nMasters = 0;
forAll(meshPoints, patchPointI)
forAll(meshPoints, patchPointi)
{
if (patchToCoupled[patchPointI] == -1)
if (patchToCoupled[patchPointi] == -1)
{
uniqueMeshPoints[nMasters++] = meshPoints[patchPointI];
uniqueMeshPoints[nMasters++] = meshPoints[patchPointi];
}
else
{
label coupledPointI = patchToCoupled[patchPointI];
label coupledPointi = patchToCoupled[patchPointi];
if
(
globalPPoints.toGlobal(patchPointI)
== coupledToGlobalPatch[coupledPointI]
globalPPoints.toGlobal(patchPointi)
== coupledToGlobalPatch[coupledPointi]
)
{
globalMaster[coupledPointI] =
globalMaster[coupledPointi] =
globalPointsPtr().toGlobal(nMasters);
uniqueMeshPoints[nMasters++] = meshPoints[patchPointI];
uniqueMeshPoints[nMasters++] = meshPoints[patchPointi];
}
}
}
@ -2706,21 +2706,21 @@ Foam::autoPtr<Foam::globalIndex> Foam::globalMeshData::mergePoints
// Now everyone has the master point in globalPointsPtr numbering. Fill
// in the pointToGlobal map.
nMasters = 0;
forAll(meshPoints, patchPointI)
forAll(meshPoints, patchPointi)
{
if (patchToCoupled[patchPointI] == -1)
if (patchToCoupled[patchPointi] == -1)
{
pointToGlobal[patchPointI] = globalPointsPtr().toGlobal(nMasters++);
pointToGlobal[patchPointi] = globalPointsPtr().toGlobal(nMasters++);
}
else
{
label coupledPointI = patchToCoupled[patchPointI];
pointToGlobal[patchPointI] = globalMaster[coupledPointI];
label coupledPointi = patchToCoupled[patchPointi];
pointToGlobal[patchPointi] = globalMaster[coupledPointi];
if
(
globalPPoints.toGlobal(patchPointI)
== coupledToGlobalPatch[coupledPointI]
globalPPoints.toGlobal(patchPointi)
== coupledToGlobalPatch[coupledPointi]
)
{
nMasters++;