Commit 67de20df authored by Henry Weller's avatar Henry Weller
Browse files

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

parent ac632e79
......@@ -89,16 +89,16 @@ using namespace Foam;
// {
// const vectorField& faceAreas = mesh.faceAreas();
//
// forAll(meshPoints, patchPointI)
// forAll(meshPoints, patchPointi)
// {
// label meshPointI = meshPoints[patchPointI];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI);
// label meshPointi = meshPoints[patchPointi];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
// if (fnd != coupledPatchMP.end())
// {
// label coupledPointI = fnd();
// label coupledPointi = fnd();
//
// List<point>& pNormals = pointFaceNormals[coupledPointI];
// const labelList& pFaces = p.pointFaces()[patchPointI];
// List<point>& pNormals = pointFaceNormals[coupledPointi];
// const labelList& pFaces = p.pointFaces()[patchPointi];
// pNormals.setSize(pFaces.size());
// forAll(pFaces, i)
// {
......@@ -125,24 +125,24 @@ using namespace Foam;
//
// pointField coupledPointNormals(map.constructSize(), Zero);
//
// forAll(meshPoints, patchPointI)
// forAll(meshPoints, patchPointi)
// {
// label meshPointI = meshPoints[patchPointI];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI);
// label meshPointi = meshPoints[patchPointi];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
// if (fnd != coupledPatchMP.end())
// {
// label coupledPointI = fnd();
// const labelList& slaveSlots = slaves[coupledPointI];
// label coupledPointi = fnd();
// const labelList& slaveSlots = slaves[coupledPointi];
// const labelList& transformedSlaveSlots =
// transformedSlaves[coupledPointI];
// transformedSlaves[coupledPointi];
//
// label nFaces = slaveSlots.size()+transformedSlaveSlots.size();
// if (nFaces > 0)
// {
// // Combine
// point& n = coupledPointNormals[coupledPointI];
// point& n = coupledPointNormals[coupledPointi];
//
// n += sum(pointFaceNormals[coupledPointI]);
// n += sum(pointFaceNormals[coupledPointi]);
//
// forAll(slaveSlots, i)
// {
......@@ -178,14 +178,14 @@ using namespace Foam;
//
//
// // Override patch normals
// forAll(meshPoints, patchPointI)
// forAll(meshPoints, patchPointi)
// {
// label meshPointI = meshPoints[patchPointI];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI);
// label meshPointi = meshPoints[patchPointi];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
// if (fnd != coupledPatchMP.end())
// {
// label coupledPointI = fnd();
// extrudeN[patchPointI] = coupledPointNormals[coupledPointI];
// label coupledPointi = fnd();
// extrudeN[patchPointi] = coupledPointNormals[coupledPointi];
// }
// }
//
......@@ -242,7 +242,7 @@ int main(int argc, char *argv[])
forAll(en, patchEdgeI)
{
const edge& patchE = pp.edges()[patchEdgeI];
//str.write(pp.localPoints()[pointI], en[pointI]);
//str.write(pp.localPoints()[pointi], en[pointi]);
const point pt = patchE.centre(pp.localPoints());
str.write(linePointRef(pt, pt + 0.1*en[patchEdgeI]));
}
......@@ -264,9 +264,9 @@ int main(int argc, char *argv[])
// identity(pp.size())+pp.start()
// )
// );
// forAll(pn, pointI)
// forAll(pn, pointi)
// {
// str.write(linePointRef(pp.localPoints()[pointI], pn[pointI]));
// str.write(linePointRef(pp.localPoints()[pointi], pn[pointi]));
// }
// }
// {
......@@ -281,9 +281,9 @@ int main(int argc, char *argv[])
// identity(pp.size())+pp.start()
// )
// );
// forAll(pn, pointI)
// forAll(pn, pointi)
// {
// str.write(linePointRef(pp.localPoints()[pointI], pn[pointI]));
// str.write(linePointRef(pp.localPoints()[pointi], pn[pointi]));
// }
// }
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -81,9 +81,9 @@ int main(int argc, char *argv[])
forAll(pp.meshPoints(), ppI)
{
label meshPointI = pp.meshPoints()[ppI];
wallPoints[nPoints] = meshPointI;
wallInfo[nPoints] = pointEdgePoint(mesh.points()[meshPointI], 0.0);
label meshPointi = pp.meshPoints()[ppI];
wallPoints[nPoints] = meshPointi;
wallInfo[nPoints] = pointEdgePoint(mesh.points()[meshPointi], 0.0);
nPoints++;
}
}
......@@ -120,9 +120,9 @@ int main(int argc, char *argv[])
dimensionedScalar("wallDist", dimLength, 0.0)
);
forAll(allPointInfo, pointI)
forAll(allPointInfo, pointi)
{
psf[pointI] = Foam::sqrt(allPointInfo[pointI].distSqr());
psf[pointi] = Foam::sqrt(allPointInfo[pointi].distSqr());
}
Info<< "Writing wallDist pointScalarField to " << runTime.value()
......
......@@ -76,14 +76,14 @@ int main(int argc, char *argv[])
);
// Print
forAll(slaves, pointI)
forAll(slaves, pointi)
{
const labelList& slavePoints = slaves[pointI];
const labelList& slavePoints = slaves[pointi];
if (slavePoints.size() > 0)
{
Pout<< "Master point:" << pointI
<< " coord:" << coords[pointI]
Pout<< "Master point:" << pointi
<< " coord:" << coords[pointi]
<< " connected to untransformed slave points:" << endl;
forAll(slavePoints, i)
......@@ -92,12 +92,12 @@ int main(int argc, char *argv[])
}
}
const labelList& transformedSlavePoints = transformedSlaves[pointI];
const labelList& transformedSlavePoints = transformedSlaves[pointi];
if (transformedSlavePoints.size() > 0)
{
Pout<< "Master point:" << pointI
<< " coord:" << coords[pointI]
Pout<< "Master point:" << pointi
<< " coord:" << coords[pointi]
<< " connected to transformed slave points:" << endl;
forAll(transformedSlavePoints, i)
......@@ -204,14 +204,14 @@ int main(int argc, char *argv[])
);
// Print
forAll(slaves, pointI)
forAll(slaves, pointi)
{
const labelList& slaveFaces = slaves[pointI];
const labelList& slaveFaces = slaves[pointi];
if (slaveFaces.size() > 0)
{
Pout<< "Master point:" << pointI
<< " at:" << coupledPatch.localPoints()[pointI]
Pout<< "Master point:" << pointi
<< " at:" << coupledPatch.localPoints()[pointi]
<< " connected to " << slaveFaces.size()
<< " untransformed faces:" << endl;
......@@ -221,11 +221,11 @@ int main(int argc, char *argv[])
}
}
const labelList& transformedSlaveFaces = transformedSlaves[pointI];
const labelList& transformedSlaveFaces = transformedSlaves[pointi];
if (transformedSlaveFaces.size() > 0)
{
Pout<< "Master point:" << pointI
Pout<< "Master point:" << pointi
<< " connected to " << transformedSlaveFaces.size()
<< " transformed faces:" << endl;
......@@ -262,14 +262,14 @@ int main(int argc, char *argv[])
);
// Print
forAll(slaves, pointI)
forAll(slaves, pointi)
{
const labelList& pointCells = slaves[pointI];
const labelList& pointCells = slaves[pointi];
if (pointCells.size() > 0)
{
Pout<< "Master point:" << pointI
<< " at:" << coupledPatch.localPoints()[pointI]
Pout<< "Master point:" << pointi
<< " at:" << coupledPatch.localPoints()[pointi]
<< " connected to " << pointCells.size()
<< " untransformed boundaryCells:" << endl;
......@@ -279,11 +279,11 @@ int main(int argc, char *argv[])
}
}
const labelList& transformPointCells = transformedSlaves[pointI];
const labelList& transformPointCells = transformedSlaves[pointi];
if (transformPointCells.size() > 0)
{
Pout<< "Master point:" << pointI
Pout<< "Master point:" << pointi
<< " connected to " << transformPointCells.size()
<< " transformed boundaryCells:" << endl;
......
......@@ -125,22 +125,22 @@ int main(int argc, char *argv[])
{
label faceRegion = allFaceInfo[facei].regions()[fp];
label pointI = f[fp];
label pointi = f[fp];
if (currentRegion[pointI] == -1)
if (currentRegion[pointi] == -1)
{
currentRegion[pointI] = faceRegion;
currentRegion[pointi] = faceRegion;
}
else if (currentRegion[pointI] != faceRegion)
else if (currentRegion[pointi] != faceRegion)
{
if (duplicateRegion[pointI] == -1)
if (duplicateRegion[pointi] == -1)
{
Pout<< "Multi region point:"
<< patch.localPoints()[pointI]
<< " with region:" << currentRegion[pointI]
<< patch.localPoints()[pointi]
<< " with region:" << currentRegion[pointi]
<< " and region:" << faceRegion
<< endl;
duplicateRegion[pointI] = currentRegion[pointI];
duplicateRegion[pointi] = currentRegion[pointi];
}
}
}
......
......@@ -43,9 +43,9 @@ typedef PrimitivePatch<face, List, const pointField&> myPrimitivePatch;
void writeObj(Ostream& os,const pointField& points)
{
forAll(points, pointI)
forAll(points, pointi)
{
const point& pt = points[pointI];
const point& pt = points[pointi];
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
}
......
......@@ -215,10 +215,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{
const point pt = localPoints[i] + 1e-4*rndGen.vector01();
label meshPointI = allBoundary.meshPoints()[i];
label meshPointi = allBoundary.meshPoints()[i];
sparseData.insert(meshPointI, pt);
fullData[meshPointI] = pt;
sparseData.insert(meshPointi, pt);
fullData[meshPointi] = pt;
}
//Pout<< "sparseData:" << sparseData << endl;
......@@ -241,18 +241,18 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
// Compare.
// 1. Is all fullData also present in sparseData and same value
forAll(fullData, meshPointI)
forAll(fullData, meshPointi)
{
const point& fullPt = fullData[meshPointI];
const point& fullPt = fullData[meshPointi];
if (fullPt != point(GREAT, GREAT, GREAT))
{
const point& sparsePt = sparseData[meshPointI];
const point& sparsePt = sparseData[meshPointi];
if (fullPt != sparsePt)
{
FatalErrorInFunction
<< "point:" << meshPointI
<< "point:" << meshPointi
<< " full:" << fullPt
<< " sparse:" << sparsePt
<< exit(FatalError);
......@@ -264,13 +264,13 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
forAllConstIter(Map<point>, sparseData, iter)
{
const point& sparsePt = iter();
label meshPointI = iter.key();
const point& fullPt = fullData[meshPointI];
label meshPointi = iter.key();
const point& fullPt = fullData[meshPointi];
if (fullPt != sparsePt)
{
FatalErrorInFunction
<< "point:" << meshPointI
<< "point:" << meshPointi
<< " full:" << fullPt
<< " sparse:" << sparsePt
<< exit(FatalError);
......@@ -387,14 +387,14 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
point(GREAT, GREAT, GREAT)
);
forAll(syncedPoints, pointI)
forAll(syncedPoints, pointi)
{
if (mag(syncedPoints[pointI] - mesh.points()[pointI]) > SMALL)
if (mag(syncedPoints[pointi] - mesh.points()[pointi]) > SMALL)
{
FatalErrorInFunction
<< "Point " << pointI
<< " original location " << mesh.points()[pointI]
<< " synced location " << syncedPoints[pointI]
<< "Point " << pointi
<< " original location " << mesh.points()[pointi]
<< " synced location " << syncedPoints[pointi]
<< exit(FatalError);
}
}
......@@ -407,11 +407,11 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
PackedBoolList isMasterPoint(syncTools::getMasterPoints(mesh));
forAll(isMasterPoint, pointI)
forAll(isMasterPoint, pointi)
{
if (isMasterPoint[pointI])
if (isMasterPoint[pointi])
{
nMasters[pointI] = 1;
nMasters[pointi] = 1;
}
}
......@@ -423,14 +423,14 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
0
);
forAll(nMasters, pointI)
forAll(nMasters, pointi)
{
if (nMasters[pointI] != 1)
if (nMasters[pointi] != 1)
{
WarningInFunction
<< "Point " << pointI
<< " original location " << mesh.points()[pointI]
<< " has " << nMasters[pointI]
<< "Point " << pointi
<< " original location " << mesh.points()[pointi]
<< " has " << nMasters[pointi]
<< " masters."
<< endl;
}
......
......@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
......@@ -68,9 +68,9 @@ int main(int argc, char *argv[])
const point half(0.5*(meshBb.min() + meshBb.max()));
forAll(newPoints, pointI)
forAll(newPoints, pointi)
{
point& pt = newPoints[pointI];
point& pt = newPoints[pointi];
// expand around half
pt.y() += pt.y() - half.y();
......
......@@ -168,7 +168,7 @@ void Foam::cellSplitter::setRefinement
label anchorPoint = mesh_.cellPoints()[celli][0];
label addedPointI =
label addedPointi =
meshMod.setAction
(
polyAddPoint
......@@ -179,9 +179,9 @@ void Foam::cellSplitter::setRefinement
true // supports a cell
)
);
addedPoints_.insert(celli, addedPointI);
addedPoints_.insert(celli, addedPointi);
//Pout<< "Added point " << addedPointI
//Pout<< "Added point " << addedPointi
// << iter() << " in cell " << celli << " with centre "
// << mesh_.cellCentres()[celli] << endl;
}
......@@ -242,7 +242,7 @@ void Foam::cellSplitter::setRefinement
{
label celli = iter.key();
label midPointI = addedPoints_[celli];
label midPointi = addedPoints_[celli];
const cell& cFaces = mesh_.cells()[celli];
......@@ -283,13 +283,13 @@ void Foam::cellSplitter::setRefinement
// edge used in face order.
newF[0] = e[1];
newF[1] = e[0];
newF[2] = midPointI;
newF[2] = midPointi;
}
else
{
newF[0] = e[0];
newF[1] = e[1];
newF[2] = midPointI;
newF[2] = midPointi;
}
// Now newF points away from cell0
......@@ -329,13 +329,13 @@ void Foam::cellSplitter::setRefinement
// edge used in face order.
newF[0] = e[1];
newF[1] = e[0];
newF[2] = midPointI;
newF[2] = midPointi;
}
else
{
newF[0] = e[0];
newF[1] = e[1];
newF[2] = midPointI;
newF[2] = midPointi;
}
// Now newF points away from cell1
......@@ -473,13 +473,13 @@ void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
label newCelli = morphMap.reverseCellMap()[oldCelli];
label oldPointI = iter();
label oldPointi = iter();
label newPointI = morphMap.reversePointMap()[oldPointI];
label newPointi = morphMap.reversePointMap()[oldPointi];
if (newCelli >= 0 && newPointI >= 0)
if (newCelli >= 0 && newPointi >= 0)
{
newAddedPoints.insert(newCelli, newPointI);
newAddedPoints.insert(newCelli, newPointi);
}
}
......
......@@ -79,9 +79,9 @@ label findPoint(const primitivePatch& pp, const point& nearPoint)
forAll(meshPoints, i)
{
label pointI = meshPoints[i];
label pointi = meshPoints[i];
scalar distSqr = magSqr(nearPoint - points[pointI]);
scalar distSqr = magSqr(nearPoint - points[pointi]);
if (distSqr < minDistSqr)
{
......@@ -89,12 +89,12 @@ label findPoint(const primitivePatch& pp, const point& nearPoint)
almostMinI = minI;
minDistSqr = distSqr;
minI = pointI;
minI = pointi;
}
else if (distSqr < almostMinDistSqr)
{
almostMinDistSqr = distSqr;
almostMinI = pointI;
almostMinI = pointi;
}
}
......@@ -292,14 +292,14 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
forAll(cPoints, i)
{
label pointI = cPoints[i];
label pointi = cPoints[i];
scalar distSqr = magSqr(nearPoint - mesh.points()[pointI]);
scalar distSqr = magSqr(nearPoint - mesh.points()[pointi]);
if (distSqr < minDistSqr)
{
minDistSqr = distSqr;
minI = pointI;
minI = pointi;
}
}
......@@ -429,11 +429,11 @@ int main(int argc, char *argv[])
{
const Pair<point>& pts = pointsToMove[i];
label pointI = findPoint(allBoundary, pts.first());
label pointi = findPoint(allBoundary, pts.first());
if (pointI == -1 || !pointToPos.insert(pointI, pts.second()))
if (pointi == -1 || !pointToPos.insert(pointi, pts.second()))
{
Info<< "Could not insert mesh point " << pointI
Info<< "Could not insert mesh point " << pointi
<< " for input point " << pts.first() << nl
<< "Perhaps the point is already marked for moving?" << endl;
validInputs = false;
......
......@@ -114,11 +114,11 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, pointI)
forAll(meshPoints, pointi)
{
label meshPointI = meshPoints[pointI];
label meshPointi = meshPoints[pointi];
const labelList& pCells = mesh.pointCells()[meshPointI];
const labelList& pCells = mesh.pointCells()[meshPointi];
forAll(pCells, pCelli)
{
......@@ -156,9 +156,9 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, pointI)
forAll(meshPoints, pointi)
{
vertOnPatch[meshPoints[pointI]] = true;
vertOnPatch[meshPoints[pointi]] = true;
}
}
......@@ -167,24 +167,24 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, pointI)
forAll(meshPoints, pointi)
{
label meshPointI = meshPoints[pointI];
label meshPointi = meshPoints[pointi];
const labelList& pEdges = mesh.pointEdges()[meshPointI];
const labelList& pEdges = mesh.pointEdges()[meshPointi];
forAll(pEdges, pEdgeI)
{
const label edgeI = pEdges[pEdgeI];
const edge& e = mesh.edges()[edgeI];