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

@ -89,16 +89,16 @@ using namespace Foam;
// { // {
// const vectorField& faceAreas = mesh.faceAreas(); // const vectorField& faceAreas = mesh.faceAreas();
// //
// forAll(meshPoints, patchPointI) // forAll(meshPoints, patchPointi)
// { // {
// label meshPointI = meshPoints[patchPointI]; // label meshPointi = meshPoints[patchPointi];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI); // Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
// if (fnd != coupledPatchMP.end()) // if (fnd != coupledPatchMP.end())
// { // {
// label coupledPointI = fnd(); // label coupledPointi = fnd();
// //
// List<point>& pNormals = pointFaceNormals[coupledPointI]; // List<point>& pNormals = pointFaceNormals[coupledPointi];
// const labelList& pFaces = p.pointFaces()[patchPointI]; // const labelList& pFaces = p.pointFaces()[patchPointi];
// pNormals.setSize(pFaces.size()); // pNormals.setSize(pFaces.size());
// forAll(pFaces, i) // forAll(pFaces, i)
// { // {
@ -125,24 +125,24 @@ using namespace Foam;
// //
// pointField coupledPointNormals(map.constructSize(), Zero); // pointField coupledPointNormals(map.constructSize(), Zero);
// //
// forAll(meshPoints, patchPointI) // forAll(meshPoints, patchPointi)
// { // {
// label meshPointI = meshPoints[patchPointI]; // label meshPointi = meshPoints[patchPointi];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI); // Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
// if (fnd != coupledPatchMP.end()) // if (fnd != coupledPatchMP.end())
// { // {
// label coupledPointI = fnd(); // label coupledPointi = fnd();
// const labelList& slaveSlots = slaves[coupledPointI]; // const labelList& slaveSlots = slaves[coupledPointi];
// const labelList& transformedSlaveSlots = // const labelList& transformedSlaveSlots =
// transformedSlaves[coupledPointI]; // transformedSlaves[coupledPointi];
// //
// label nFaces = slaveSlots.size()+transformedSlaveSlots.size(); // label nFaces = slaveSlots.size()+transformedSlaveSlots.size();
// if (nFaces > 0) // if (nFaces > 0)
// { // {
// // Combine // // Combine
// point& n = coupledPointNormals[coupledPointI]; // point& n = coupledPointNormals[coupledPointi];
// //
// n += sum(pointFaceNormals[coupledPointI]); // n += sum(pointFaceNormals[coupledPointi]);
// //
// forAll(slaveSlots, i) // forAll(slaveSlots, i)
// { // {
@ -178,14 +178,14 @@ using namespace Foam;
// //
// //
// // Override patch normals // // Override patch normals
// forAll(meshPoints, patchPointI) // forAll(meshPoints, patchPointi)
// { // {
// label meshPointI = meshPoints[patchPointI]; // label meshPointi = meshPoints[patchPointi];
// Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointI); // Map<label>::const_iterator fnd = coupledPatchMP.find(meshPointi);
// if (fnd != coupledPatchMP.end()) // if (fnd != coupledPatchMP.end())
// { // {
// label coupledPointI = fnd(); // label coupledPointi = fnd();
// extrudeN[patchPointI] = coupledPointNormals[coupledPointI]; // extrudeN[patchPointi] = coupledPointNormals[coupledPointi];
// } // }
// } // }
// //
@ -242,7 +242,7 @@ int main(int argc, char *argv[])
forAll(en, patchEdgeI) forAll(en, patchEdgeI)
{ {
const edge& patchE = pp.edges()[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()); const point pt = patchE.centre(pp.localPoints());
str.write(linePointRef(pt, pt + 0.1*en[patchEdgeI])); str.write(linePointRef(pt, pt + 0.1*en[patchEdgeI]));
} }
@ -264,9 +264,9 @@ int main(int argc, char *argv[])
// identity(pp.size())+pp.start() // 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() // 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]));
// } // }
// } // }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -81,9 +81,9 @@ int main(int argc, char *argv[])
forAll(pp.meshPoints(), ppI) forAll(pp.meshPoints(), ppI)
{ {
label meshPointI = pp.meshPoints()[ppI]; label meshPointi = pp.meshPoints()[ppI];
wallPoints[nPoints] = meshPointI; wallPoints[nPoints] = meshPointi;
wallInfo[nPoints] = pointEdgePoint(mesh.points()[meshPointI], 0.0); wallInfo[nPoints] = pointEdgePoint(mesh.points()[meshPointi], 0.0);
nPoints++; nPoints++;
} }
} }
@ -120,9 +120,9 @@ int main(int argc, char *argv[])
dimensionedScalar("wallDist", dimLength, 0.0) 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() Info<< "Writing wallDist pointScalarField to " << runTime.value()

View File

@ -76,14 +76,14 @@ int main(int argc, char *argv[])
); );
// Print // Print
forAll(slaves, pointI) forAll(slaves, pointi)
{ {
const labelList& slavePoints = slaves[pointI]; const labelList& slavePoints = slaves[pointi];
if (slavePoints.size() > 0) if (slavePoints.size() > 0)
{ {
Pout<< "Master point:" << pointI Pout<< "Master point:" << pointi
<< " coord:" << coords[pointI] << " coord:" << coords[pointi]
<< " connected to untransformed slave points:" << endl; << " connected to untransformed slave points:" << endl;
forAll(slavePoints, i) 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) if (transformedSlavePoints.size() > 0)
{ {
Pout<< "Master point:" << pointI Pout<< "Master point:" << pointi
<< " coord:" << coords[pointI] << " coord:" << coords[pointi]
<< " connected to transformed slave points:" << endl; << " connected to transformed slave points:" << endl;
forAll(transformedSlavePoints, i) forAll(transformedSlavePoints, i)
@ -204,14 +204,14 @@ int main(int argc, char *argv[])
); );
// Print // Print
forAll(slaves, pointI) forAll(slaves, pointi)
{ {
const labelList& slaveFaces = slaves[pointI]; const labelList& slaveFaces = slaves[pointi];
if (slaveFaces.size() > 0) if (slaveFaces.size() > 0)
{ {
Pout<< "Master point:" << pointI Pout<< "Master point:" << pointi
<< " at:" << coupledPatch.localPoints()[pointI] << " at:" << coupledPatch.localPoints()[pointi]
<< " connected to " << slaveFaces.size() << " connected to " << slaveFaces.size()
<< " untransformed faces:" << endl; << " 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) if (transformedSlaveFaces.size() > 0)
{ {
Pout<< "Master point:" << pointI Pout<< "Master point:" << pointi
<< " connected to " << transformedSlaveFaces.size() << " connected to " << transformedSlaveFaces.size()
<< " transformed faces:" << endl; << " transformed faces:" << endl;
@ -262,14 +262,14 @@ int main(int argc, char *argv[])
); );
// Print // Print
forAll(slaves, pointI) forAll(slaves, pointi)
{ {
const labelList& pointCells = slaves[pointI]; const labelList& pointCells = slaves[pointi];
if (pointCells.size() > 0) if (pointCells.size() > 0)
{ {
Pout<< "Master point:" << pointI Pout<< "Master point:" << pointi
<< " at:" << coupledPatch.localPoints()[pointI] << " at:" << coupledPatch.localPoints()[pointi]
<< " connected to " << pointCells.size() << " connected to " << pointCells.size()
<< " untransformed boundaryCells:" << endl; << " 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) if (transformPointCells.size() > 0)
{ {
Pout<< "Master point:" << pointI Pout<< "Master point:" << pointi
<< " connected to " << transformPointCells.size() << " connected to " << transformPointCells.size()
<< " transformed boundaryCells:" << endl; << " transformed boundaryCells:" << endl;

View File

@ -125,22 +125,22 @@ int main(int argc, char *argv[])
{ {
label faceRegion = allFaceInfo[facei].regions()[fp]; 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:" Pout<< "Multi region point:"
<< patch.localPoints()[pointI] << patch.localPoints()[pointi]
<< " with region:" << currentRegion[pointI] << " with region:" << currentRegion[pointi]
<< " and region:" << faceRegion << " and region:" << faceRegion
<< endl; << endl;
duplicateRegion[pointI] = currentRegion[pointI]; duplicateRegion[pointi] = currentRegion[pointi];
} }
} }
} }

View File

@ -43,9 +43,9 @@ typedef PrimitivePatch<face, List, const pointField&> myPrimitivePatch;
void writeObj(Ostream& os,const pointField& points) 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; os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
} }

View File

@ -215,10 +215,10 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
{ {
const point pt = localPoints[i] + 1e-4*rndGen.vector01(); const point pt = localPoints[i] + 1e-4*rndGen.vector01();
label meshPointI = allBoundary.meshPoints()[i]; label meshPointi = allBoundary.meshPoints()[i];
sparseData.insert(meshPointI, pt); sparseData.insert(meshPointi, pt);
fullData[meshPointI] = pt; fullData[meshPointi] = pt;
} }
//Pout<< "sparseData:" << sparseData << endl; //Pout<< "sparseData:" << sparseData << endl;
@ -241,18 +241,18 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
// Compare. // Compare.
// 1. Is all fullData also present in sparseData and same value // 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)) if (fullPt != point(GREAT, GREAT, GREAT))
{ {
const point& sparsePt = sparseData[meshPointI]; const point& sparsePt = sparseData[meshPointi];
if (fullPt != sparsePt) if (fullPt != sparsePt)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "point:" << meshPointI << "point:" << meshPointi
<< " full:" << fullPt << " full:" << fullPt
<< " sparse:" << sparsePt << " sparse:" << sparsePt
<< exit(FatalError); << exit(FatalError);
@ -264,13 +264,13 @@ void testSparseData(const polyMesh& mesh, Random& rndGen)
forAllConstIter(Map<point>, sparseData, iter) forAllConstIter(Map<point>, sparseData, iter)
{ {
const point& sparsePt = iter(); const point& sparsePt = iter();
label meshPointI = iter.key(); label meshPointi = iter.key();
const point& fullPt = fullData[meshPointI]; const point& fullPt = fullData[meshPointi];
if (fullPt != sparsePt) if (fullPt != sparsePt)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "point:" << meshPointI << "point:" << meshPointi
<< " full:" << fullPt << " full:" << fullPt
<< " sparse:" << sparsePt << " sparse:" << sparsePt
<< exit(FatalError); << exit(FatalError);
@ -387,14 +387,14 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
point(GREAT, GREAT, GREAT) 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 FatalErrorInFunction
<< "Point " << pointI << "Point " << pointi
<< " original location " << mesh.points()[pointI] << " original location " << mesh.points()[pointi]
<< " synced location " << syncedPoints[pointI] << " synced location " << syncedPoints[pointi]
<< exit(FatalError); << exit(FatalError);
} }
} }
@ -407,11 +407,11 @@ void testPointSync(const polyMesh& mesh, Random& rndGen)
PackedBoolList isMasterPoint(syncTools::getMasterPoints(mesh)); 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 0
); );
forAll(nMasters, pointI) forAll(nMasters, pointi)
{ {
if (nMasters[pointI] != 1) if (nMasters[pointi] != 1)
{ {
WarningInFunction WarningInFunction
<< "Point " << pointI << "Point " << pointi
<< " original location " << mesh.points()[pointI] << " original location " << mesh.points()[pointi]
<< " has " << nMasters[pointI] << " has " << nMasters[pointi]
<< " masters." << " masters."
<< endl; << endl;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -68,9 +68,9 @@ int main(int argc, char *argv[])
const point half(0.5*(meshBb.min() + meshBb.max())); 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 // expand around half
pt.y() += pt.y() - half.y(); pt.y() += pt.y() - half.y();

View File

@ -168,7 +168,7 @@ void Foam::cellSplitter::setRefinement
label anchorPoint = mesh_.cellPoints()[celli][0]; label anchorPoint = mesh_.cellPoints()[celli][0];
label addedPointI = label addedPointi =
meshMod.setAction meshMod.setAction
( (
polyAddPoint polyAddPoint
@ -179,9 +179,9 @@ void Foam::cellSplitter::setRefinement
true // supports a cell 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 " // << iter() << " in cell " << celli << " with centre "
// << mesh_.cellCentres()[celli] << endl; // << mesh_.cellCentres()[celli] << endl;
} }
@ -242,7 +242,7 @@ void Foam::cellSplitter::setRefinement
{ {
label celli = iter.key(); label celli = iter.key();
label midPointI = addedPoints_[celli]; label midPointi = addedPoints_[celli];
const cell& cFaces = mesh_.cells()[celli]; const cell& cFaces = mesh_.cells()[celli];
@ -283,13 +283,13 @@ void Foam::cellSplitter::setRefinement
// edge used in face order. // edge used in face order.
newF[0] = e[1]; newF[0] = e[1];
newF[1] = e[0]; newF[1] = e[0];
newF[2] = midPointI; newF[2] = midPointi;
} }
else else
{ {
newF[0] = e[0]; newF[0] = e[0];
newF[1] = e[1]; newF[1] = e[1];
newF[2] = midPointI; newF[2] = midPointi;
} }
// Now newF points away from cell0 // Now newF points away from cell0
@ -329,13 +329,13 @@ void Foam::cellSplitter::setRefinement
// edge used in face order. // edge used in face order.
newF[0] = e[1]; newF[0] = e[1];
newF[1] = e[0]; newF[1] = e[0];
newF[2] = midPointI; newF[2] = midPointi;
} }
else else
{ {
newF[0] = e[0]; newF[0] = e[0];
newF[1] = e[1]; newF[1] = e[1];
newF[2] = midPointI; newF[2] = midPointi;
} }
// Now newF points away from cell1 // Now newF points away from cell1
@ -473,13 +473,13 @@ void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
label newCelli = morphMap.reverseCellMap()[oldCelli]; 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);
} }
} }

View File

@ -79,9 +79,9 @@ label findPoint(const primitivePatch& pp, const point& nearPoint)
forAll(meshPoints, i) 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) if (distSqr < minDistSqr)
{ {
@ -89,12 +89,12 @@ label findPoint(const primitivePatch& pp, const point& nearPoint)
almostMinI = minI; almostMinI = minI;
minDistSqr = distSqr; minDistSqr = distSqr;
minI = pointI; minI = pointi;
} }
else if (distSqr < almostMinDistSqr) else if (distSqr < almostMinDistSqr)
{ {
almostMinDistSqr = distSqr; almostMinDistSqr = distSqr;
almostMinI = pointI; almostMinI = pointi;
} }
} }
@ -292,14 +292,14 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
forAll(cPoints, i) 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) if (distSqr < minDistSqr)
{ {
minDistSqr = distSqr; minDistSqr = distSqr;
minI = pointI; minI = pointi;
} }
} }
@ -429,11 +429,11 @@ int main(int argc, char *argv[])
{ {
const Pair<point>& pts = pointsToMove[i]; 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 << " for input point " << pts.first() << nl
<< "Perhaps the point is already marked for moving?" << endl; << "Perhaps the point is already marked for moving?" << endl;
validInputs = false; validInputs = false;

View File

@ -114,11 +114,11 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[iter.key()]; const polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints(); 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) forAll(pCells, pCelli)
{ {
@ -156,9 +156,9 @@ int main(int argc, char *argv[])
const polyPatch& pp = mesh.boundaryMesh()[iter.key()]; const polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints(); 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 polyPatch& pp = mesh.boundaryMesh()[iter.key()];
const labelList& meshPoints = pp.meshPoints(); 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) forAll(pEdges, pEdgeI)
{ {
const label edgeI = pEdges[pEdgeI]; const label edgeI = pEdges[pEdgeI];
const edge& e = mesh.edges()[edgeI]; const edge& e = mesh.edges()[edgeI];
label otherPointI = e.otherVertex(meshPointI); label otherPointi = e.otherVertex(meshPointi);
if (!vertOnPatch[otherPointI]) if (!vertOnPatch[otherPointi])
{ {
allCutEdges.append(edgeI); allCutEdges.append(edgeI);
if (e.start() == meshPointI) if (e.start() == meshPointi)
{ {
allCutEdgeWeights.append(weight); allCutEdgeWeights.append(weight);
} }

View File

@ -192,15 +192,15 @@ void cutBySurface
label nRemoved = 0; label nRemoved = 0;
forAll(pts, pointI) forAll(pts, pointi)
{ {
const point& pt = pts[pointI]; const point& pt = pts[pointi];
pointIndexHit hitInfo = tree.findNearest(pt, sqr(nearDist)); pointIndexHit hitInfo = tree.findNearest(pt, sqr(nearDist));
if (hitInfo.hit()) if (hitInfo.hit())
{ {
const labelList& pCells = mesh.pointCells()[pointI]; const labelList& pCells = mesh.pointCells()[pointi];
forAll(pCells, i) forAll(pCells, i)
{ {
@ -218,11 +218,11 @@ void cutBySurface
// //
// label nRemoved = 0; // label nRemoved = 0;
// //
// forAll(nearest, pointI) // forAll(nearest, pointi)
// { // {
// if (mag(nearest[pointI] - pts[pointI]) < nearDist) // if (mag(nearest[pointi] - pts[pointi]) < nearDist)
// { // {
// const labelList& pCells = mesh.pointCells()[pointI]; // const labelList& pCells = mesh.pointCells()[pointi];
// //
// forAll(pCells, i) // forAll(pCells, i)
// { // {

View File

@ -801,8 +801,8 @@ int main(int argc, char *argv[])
// Renumber vertex labels to Foam point labels // Renumber vertex labels to Foam point labels
{ {
label maxCCMPointI = max(foamPointMap); label maxCCMPointi = max(foamPointMap);
labelList toFoamPoints(invert(maxCCMPointI+1, foamPointMap)); labelList toFoamPoints(invert(maxCCMPointi+1, foamPointMap));
forAll(foamFaces, facei) forAll(foamFaces, facei)
{ {

View File

@ -254,11 +254,11 @@ int main(int argc, char *argv[])
const labelList& blockPFacePoints = const labelList& blockPFacePoints =
blockPFaces[blockPFaceLabel]; blockPFaces[blockPFaceLabel];
forAll(blockPFacePoints, blockPFacePointI) forAll(blockPFacePoints, blockPFacePointi)
{ {
forAll(blockPFacePoints, blockPFacePointI2) forAll(blockPFacePoints, blockPFacePointi2)
{ {
if (blockPFacePointI != blockPFacePointI2) if (blockPFacePointi != blockPFacePointi2)
{ {
sqrMergeTol = sqrMergeTol =
min min
@ -267,9 +267,9 @@ int main(int argc, char *argv[])
magSqr magSqr
( (
blockPpoints blockPpoints
[blockPFacePoints[blockPFacePointI]] [blockPFacePoints[blockPFacePointi]]
- blockPpoints - blockPpoints
[blockPFacePoints[blockPFacePointI2]] [blockPFacePoints[blockPFacePointi2]]
) )
); );
} }
@ -291,7 +291,7 @@ int main(int argc, char *argv[])
labelList& cp = curPairs[blockPFaceLabel]; labelList& cp = curPairs[blockPFaceLabel];
cp.setSize(blockPFacePoints.size()); cp.setSize(blockPFacePoints.size());
forAll(blockPFacePoints, blockPFacePointI) forAll(blockPFacePoints, blockPFacePointi)
{ {
found = false; found = false;
@ -300,16 +300,16 @@ int main(int argc, char *argv[])
const labelList& blockNFacePoints = const labelList& blockNFacePoints =
blockNFaces[blockNFaceLabel]; blockNFaces[blockNFaceLabel];
forAll(blockNFacePoints, blockNFacePointI) forAll(blockNFacePoints, blockNFacePointi)
{ {
if if
( (
magSqr magSqr
( (
blockPpoints blockPpoints
[blockPFacePoints[blockPFacePointI]] [blockPFacePoints[blockPFacePointi]]
- blockNpoints - blockNpoints
[blockNFacePoints[blockNFacePointI]] [blockNFacePoints[blockNFacePointi]]
) )
< sqrMergeTol < sqrMergeTol
) )
@ -317,15 +317,15 @@ int main(int argc, char *argv[])
// Found a new pair // Found a new pair
found = true; found = true;
cp[blockPFacePointI] = cp[blockPFacePointi] =
blockNFacePoints[blockNFacePointI]; blockNFacePoints[blockNFacePointi];
label PpointLabel = label PpointLabel =
blockPFacePoints[blockPFacePointI] blockPFacePoints[blockPFacePointi]
+ blockOffsets[blockPlabel]; + blockOffsets[blockPlabel];
label NpointLabel = label NpointLabel =
blockNFacePoints[blockNFacePointI] blockNFacePoints[blockNFacePointi]
+ blockOffsets[blockNlabel]; + blockOffsets[blockNlabel];
label minPN = min(PpointLabel, NpointLabel); label minPN = min(PpointLabel, NpointLabel);
@ -381,14 +381,14 @@ int main(int argc, char *argv[])
const labelList& cp = curPairs[blockPFaceLabel]; const labelList& cp = curPairs[blockPFaceLabel];
forAll(cp, blockPFacePointI) forAll(cp, blockPFacePointi)
{ {
label PpointLabel = label PpointLabel =
blockPFacePoints[blockPFacePointI] blockPFacePoints[blockPFacePointi]
+ blockOffsets[blockPlabel]; + blockOffsets[blockPlabel];
label NpointLabel = label NpointLabel =
cp[blockPFacePointI] cp[blockPFacePointi]
+ blockOffsets[blockNlabel]; + blockOffsets[blockNlabel];
if if
@ -440,16 +440,16 @@ int main(int argc, char *argv[])
const labelList& blockPFacePoints const labelList& blockPFacePoints
= blockPFaces[blockPFaceLabel]; = blockPFaces[blockPFaceLabel];
forAll(blockPFacePoints, blockPFacePointI) forAll(blockPFacePoints, blockPFacePointi)
{ {
label PpointLabel = label PpointLabel =
blockPFacePoints[blockPFacePointI] blockPFacePoints[blockPFacePointi]
+ blockOffsets[blockPlabel]; + blockOffsets[blockPlabel];
if (pointMergeList[PpointLabel] == -1) if (pointMergeList[PpointLabel] == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unable to merge point " << blockPFacePointI << "Unable to merge point " << blockPFacePointi
<< " of face " << blockPFaceLabel << " of face " << blockPFaceLabel
<< " of block " << blockPlabel << " of block " << blockPlabel
<< abort(FatalError); << abort(FatalError);
@ -462,16 +462,16 @@ int main(int argc, char *argv[])
const labelList& blockNFacePoints const labelList& blockNFacePoints
= blockNFaces[blockNFaceLabel]; = blockNFaces[blockNFaceLabel];
forAll(blockNFacePoints, blockNFacePointI) forAll(blockNFacePoints, blockNFacePointi)
{ {
label NpointLabel = label NpointLabel =
blockNFacePoints[blockNFacePointI] blockNFacePoints[blockNFacePointi]
+ blockOffsets[blockNlabel]; + blockOffsets[blockNlabel];
if (pointMergeList[NpointLabel] == -1) if (pointMergeList[NpointLabel] == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Unable to merge point " << blockNFacePointI << "Unable to merge point " << blockNFacePointi
<< " of face " << blockNFaceLabel << " of face " << blockNFaceLabel
<< " of block " << blockNlabel << " of block " << blockNlabel
<< abort(FatalError); << abort(FatalError);
@ -554,12 +554,12 @@ int main(int argc, char *argv[])
{ {
labelList cellPoints(curBlockCells[blockCelli].size()); labelList cellPoints(curBlockCells[blockCelli].size());
forAll(cellPoints, pointI) forAll(cellPoints, pointi)
{ {
cellPoints[pointI] = cellPoints[pointi] =
pointMergeList pointMergeList
[ [
curBlockCells[blockCelli][pointI] curBlockCells[blockCelli][pointi]
+ blockOffsets[blockI] + blockOffsets[blockI]
]; ];
} }
@ -618,12 +618,12 @@ int main(int argc, char *argv[])
face& newFace = renumberedPatch[oldSize + facei]; face& newFace = renumberedPatch[oldSize + facei];
newFace.setSize(oldFace.size()); newFace.setSize(oldFace.size());
forAll(oldFace, pointI) forAll(oldFace, pointi)
{ {
newFace[pointI] = newFace[pointi] =
pointMergeList pointMergeList
[ [
oldFace[pointI] oldFace[pointi]
+ blockOffsets[curBlock] + blockOffsets[curBlock]
]; ];
} }
@ -642,12 +642,12 @@ int main(int argc, char *argv[])
face& newFace = renumberedPatch[facei]; face& newFace = renumberedPatch[facei];
newFace.setSize(oldFace.size()); newFace.setSize(oldFace.size());
forAll(oldFace, pointI) forAll(oldFace, pointi)
{ {
newFace[pointI] = newFace[pointi] =
pointMergeList pointMergeList
[ [
oldFace[pointI] oldFace[pointi]
+ blockOffsets[curBlock] + blockOffsets[curBlock]
]; ];
} }

View File

@ -155,9 +155,9 @@ cellShape create3DCellShape
meshFaceUsed[meshFacei] = true; meshFaceUsed[meshFacei] = true;
forAll(curMeshFace, pointI) forAll(curMeshFace, pointi)
{ {
pointLabels[firstModelFace[pointI]] = curMeshFace[pointI]; pointLabels[firstModelFace[pointi]] = curMeshFace[pointi];
} }
break; break;
@ -204,12 +204,12 @@ cellShape create3DCellShape
// try matching the face // try matching the face
label nMatchedLabels = 0; label nMatchedLabels = 0;
forAll(meshFaceLabels, pointI) forAll(meshFaceLabels, pointi)
{ {
if if
( (
pointLabels[curModelFace[pointI]] pointLabels[curModelFace[pointi]]
== meshFaceLabels[pointI] == meshFaceLabels[pointi]
) )
{ {
nMatchedLabels++; nMatchedLabels++;
@ -225,10 +225,10 @@ cellShape create3DCellShape
if (found) if (found)
{ {
// match found. Insert mesh face // match found. Insert mesh face
forAll(meshFaceLabels, pointI) forAll(meshFaceLabels, pointi)
{ {
pointLabels[curModelFace[pointI]] = pointLabels[curModelFace[pointi]] =
meshFaceLabels[pointI]; meshFaceLabels[pointi];
} }
meshFaceUsed[meshFacei] = true; meshFaceUsed[meshFacei] = true;

View File

@ -237,7 +237,7 @@ endOfSection {space}")"{space}
%{ %{
// Point data // Point data
label pointGroupNumberOfComponents = 3; label pointGroupNumberOfComponents = 3;
label pointI = 0; // index used for reading points label pointi = 0; // index used for reading points
// Face data // Face data
label faceGroupElementType = -1; label faceGroupElementType = -1;
@ -343,7 +343,7 @@ endOfSection {space}")"{space}
readHexLabel(pointGroupDataStream); readHexLabel(pointGroupDataStream);
// In FOAM, indices start from zero - adjust // In FOAM, indices start from zero - adjust
pointI = pointGroupStartIndex.last() - 1; pointi = pointGroupStartIndex.last() - 1;
// reset number of components to default // reset number of components to default
pointGroupNumberOfComponents = 3; pointGroupNumberOfComponents = 3;
@ -381,8 +381,8 @@ endOfSection {space}")"{space}
scalar x = readScalar(vertexXyzStream); scalar x = readScalar(vertexXyzStream);
scalar y = readScalar(vertexXyzStream); scalar y = readScalar(vertexXyzStream);
points[pointI] = point(x, y, 0); points[pointi] = point(x, y, 0);
pointI++; pointi++;
} }
<readPoints3D>{spaceNl}{scalarList} { <readPoints3D>{spaceNl}{scalarList} {
@ -394,19 +394,19 @@ endOfSection {space}")"{space}
scalar y = readScalar(vertexXyzStream); scalar y = readScalar(vertexXyzStream);
scalar z = readScalar(vertexXyzStream); scalar z = readScalar(vertexXyzStream);
points[pointI] = convertToMeters*point(x, y, z); points[pointi] = convertToMeters*point(x, y, z);
pointI++; pointi++;
} }
<readPoints2D,readPoints3D>{spaceNl}{endOfSection} { <readPoints2D,readPoints3D>{spaceNl}{endOfSection} {
// check read of points // check read of points
if (pointI != pointGroupEndIndex.last()) if (pointi != pointGroupEndIndex.last())
{ {
Info<< "problem with reading points: " Info<< "problem with reading points: "
<< "start index: " << pointGroupStartIndex.last() << "start index: " << pointGroupStartIndex.last()
<< " end index: " << pointGroupEndIndex.last() << " end index: " << pointGroupEndIndex.last()
<< " last points read: " << pointI << endl; << " last points read: " << pointi << endl;
} }
yy_pop_state(); yy_pop_state();
@ -986,18 +986,18 @@ int main(int argc, char *argv[])
// points given by Fluent need to represent the FRONT plane of the // points given by Fluent need to represent the FRONT plane of the
// geometry. Therefore, the extrusion will be in -z direction // geometry. Therefore, the extrusion will be in -z direction
// //
forAll(oldPoints, pointI) forAll(oldPoints, pointi)
{ {
points[nNewPoints] = oldPoints[pointI]; points[nNewPoints] = oldPoints[pointi];
points[nNewPoints].z() = zOffset; points[nNewPoints].z() = zOffset;
nNewPoints++; nNewPoints++;
} }
forAll(oldPoints, pointI) forAll(oldPoints, pointi)
{ {
points[nNewPoints] = oldPoints[pointI]; points[nNewPoints] = oldPoints[pointi];
points[nNewPoints].z() = -zOffset; points[nNewPoints].z() = -zOffset;

View File

@ -113,13 +113,13 @@ void Foam::fluentFvMesh::writeFluentMesh() const
const pointField& p = points(); const pointField& p = points();
forAll(p, pointI) forAll(p, pointi)
{ {
fluentMeshFile fluentMeshFile
<< " " << " "
<< p[pointI].x() << " " << p[pointi].x() << " "
<< p[pointI].y() << p[pointi].y()
<< " " << p[pointI].z() << std::endl; << " " << p[pointi].z() << std::endl;
} }
fluentMeshFile fluentMeshFile

View File

@ -663,20 +663,20 @@ int main(int argc, char *argv[])
// make a point mapping array // make a point mapping array
label maxPointIndex = 0; label maxPointIndex = 0;
forAll(pointMap, pointI) forAll(pointMap, pointi)
{ {
if (pointMap[pointI] > maxPointIndex) if (pointMap[pointi] > maxPointIndex)
{ {
maxPointIndex = pointMap[pointI]; maxPointIndex = pointMap[pointi];
} }
} }
labelList pointLookup(maxPointIndex + 1, -1); labelList pointLookup(maxPointIndex + 1, -1);
forAll(pointMap, pointI) forAll(pointMap, pointi)
{ {
pointLookup[pointMap[pointI] ] = pointI; pointLookup[pointMap[pointi] ] = pointi;
} }
// make a cell mapping array // make a cell mapping array

View File

@ -295,7 +295,7 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam)
points.setSize(nVerts); points.setSize(nVerts);
mshToFoam.resize(2*nVerts); mshToFoam.resize(2*nVerts);
for (label pointI = 0; pointI < nVerts; pointI++) for (label pointi = 0; pointi < nVerts; pointi++)
{ {
label mshLabel; label mshLabel;
scalar xVal, yVal, zVal; scalar xVal, yVal, zVal;
@ -306,13 +306,13 @@ void readPoints(IFstream& inFile, pointField& points, Map<label>& mshToFoam)
lineStr >> mshLabel >> xVal >> yVal >> zVal; lineStr >> mshLabel >> xVal >> yVal >> zVal;
point& pt = points[pointI]; point& pt = points[pointi];
pt.x() = xVal; pt.x() = xVal;
pt.y() = yVal; pt.y() = yVal;
pt.z() = zVal; pt.z() = zVal;
mshToFoam.insert(mshLabel, pointI); mshToFoam.insert(mshLabel, pointi);
} }
Info<< "Vertices read:" << mshToFoam.size() << endl; Info<< "Vertices read:" << mshToFoam.size() << endl;

View File

@ -212,20 +212,20 @@ void readPoints
string line; string line;
is.getLine(line); is.getLine(line);
label pointI = readLabel(IStringStream(line.substr(0, 10))()); label pointi = readLabel(IStringStream(line.substr(0, 10))());
if (pointI == -1) if (pointi == -1)
{ {
break; break;
} }
else if (pointI != points.size()+1 && !hasWarned) else if (pointi != points.size()+1 && !hasWarned)
{ {
hasWarned = true; hasWarned = true;
IOWarningInFunction IOWarningInFunction
( (
is is
) << "Points not in order starting at point " << pointI ) << "Points not in order starting at point " << pointi
//<< " at line " << is.lineNumber() //<< " at line " << is.lineNumber()
//<< abort(FatalError); //<< abort(FatalError);
<< endl; << endl;
@ -237,7 +237,7 @@ void readPoints
pt[1] = readUnvScalar(line.substr(25, 25)); pt[1] = readUnvScalar(line.substr(25, 25));
pt[2] = readUnvScalar(line.substr(50, 25)); pt[2] = readUnvScalar(line.substr(50, 25));
unvPointID.append(pointI); unvPointID.append(pointi);
points.append(pt); points.append(pt);
} }
@ -279,9 +279,9 @@ void readCells
// Invert point numbering. // Invert point numbering.
label maxUnvPoint = 0; label maxUnvPoint = 0;
forAll(unvPointID, pointI) forAll(unvPointID, pointi)
{ {
maxUnvPoint = max(maxUnvPoint, unvPointID[pointI]); maxUnvPoint = max(maxUnvPoint, unvPointID[pointi]);
} }
labelList unvToFoam(invert(maxUnvPoint+1, unvPointID)); labelList unvToFoam(invert(maxUnvPoint+1, unvPointID));
@ -605,10 +605,10 @@ void readDOFS
} }
IStringStream lineStr(line); IStringStream lineStr(line);
label pointI; label pointi;
lineStr >> pointI; lineStr >> pointi;
vertices.append(pointI); vertices.append(pointi);
} }
Info<< "For DOF set " << group Info<< "For DOF set " << group
@ -781,9 +781,9 @@ int main(int argc, char *argv[])
// Invert point numbering. // Invert point numbering.
label maxUnvPoint = 0; label maxUnvPoint = 0;
forAll(unvPointID, pointI) forAll(unvPointID, pointi)
{ {
maxUnvPoint = max(maxUnvPoint, unvPointID[pointI]); maxUnvPoint = max(maxUnvPoint, unvPointID[pointi]);
} }
labelList unvToFoam(invert(maxUnvPoint+1, unvPointID)); labelList unvToFoam(invert(maxUnvPoint+1, unvPointID));

View File

@ -123,13 +123,13 @@ int main(int argc, char *argv[])
pointField points(nPoints); pointField points(nPoints);
for (label pointI = 0; pointI < nPoints; pointI++) for (label pointi = 0; pointi < nPoints; pointi++)
{ {
scalar x, y, z; scalar x, y, z;
mshStream >> x >> y >> z; mshStream >> x >> y >> z;
points[pointI] = point(x, y, z); points[pointi] = point(x, y, z);
} }

View File

@ -105,13 +105,13 @@ int main(int argc, char *argv[])
pointField points(nNodes); pointField points(nNodes);
forAll(points, pointI) forAll(points, pointi)
{ {
scalar x,y,z; scalar x,y,z;
str >> x >> y >> z; str >> x >> y >> z;
points[pointI] = point(x, y, z); points[pointi] = point(x, y, z);
} }

View File

@ -211,12 +211,12 @@ int main(int argc, char *argv[])
{ {
labelList cellPoints(curBlockCells[blockCelli].size()); labelList cellPoints(curBlockCells[blockCelli].size());
forAll(cellPoints, pointI) forAll(cellPoints, pointi)
{ {
cellPoints[pointI] = cellPoints[pointi] =
oldToNew oldToNew
[ [
curBlockCells[blockCelli][pointI] curBlockCells[blockCelli][pointi]
+ blockOffsets[blockI] + blockOffsets[blockI]
]; ];
} }

View File

@ -83,10 +83,10 @@ void Foam::sammMesh::createBoundaryFaces()
face& curFace = patchFaces[facei]; face& curFace = patchFaces[facei];
const labelList& facePoints = curFace; const labelList& facePoints = curFace;
forAll(facePoints, pointI) forAll(facePoints, pointi)
{ {
const labelList& facePointCells = const labelList& facePointCells =
PointCells[facePoints[pointI]]; PointCells[facePoints[pointi]];
forAll(facePointCells, celli) forAll(facePointCells, celli)
{ {

View File

@ -59,10 +59,10 @@ void Foam::sammMesh::createPolyBoundary()
// mark it in the cellPolys_ // mark it in the cellPolys_
const labelList& facePoints = curFace; const labelList& facePoints = curFace;
forAll(facePoints, pointI) forAll(facePoints, pointi)
{ {
const labelList& facePointCells = const labelList& facePointCells =
PointCells[facePoints[pointI]]; PointCells[facePoints[pointi]];
forAll(facePointCells, celli) forAll(facePointCells, celli)
{ {

View File

@ -97,10 +97,10 @@ void Foam::sammMesh::createPolyCells()
const labelList& curPoints = curFace; const labelList& curPoints = curFace;
// For all points // For all points
forAll(curPoints, pointI) forAll(curPoints, pointi)
{ {
// get the list of cells sharing this point // get the list of cells sharing this point
const labelList& curNeighbours = PointCells[curPoints[pointI]]; const labelList& curNeighbours = PointCells[curPoints[pointi]];
// For all neighbours // For all neighbours
forAll(curNeighbours, neiI) forAll(curNeighbours, neiI)

View File

@ -117,10 +117,10 @@ void Foam::starMesh::markBoundaryFaces()
const face& curFace = patchFaces[facei]; const face& curFace = patchFaces[facei];
const labelList& facePoints = curFace; const labelList& facePoints = curFace;
forAll(facePoints, pointI) forAll(facePoints, pointi)
{ {
const labelList& facePointCells = const labelList& facePointCells =
PointCells[facePoints[pointI]]; PointCells[facePoints[pointi]];
forAll(facePointCells, celli) forAll(facePointCells, celli)
{ {

View File

@ -1311,17 +1311,17 @@ void Foam::starMesh::createCoupleMatches()
// onto the master face to ensure closedness // onto the master face to ensure closedness
vector pointProjectionNormal = -masterFace.normal(points_); vector pointProjectionNormal = -masterFace.normal(points_);
forAll(intersectedFace, intPointI) forAll(intersectedFace, intPointi)
{ {
#ifdef DEBUG_COUPLE_PROJECTION #ifdef DEBUG_COUPLE_PROJECTION
Info<< "Proj: old point: " Info<< "Proj: old point: "
<< points_[intersectedFace[intPointI]] << endl; << points_[intersectedFace[intPointi]] << endl;
#endif #endif
pointHit projHit = pointHit projHit =
masterFace.ray masterFace.ray
( (
points_[intersectedFace[intPointI]], points_[intersectedFace[intPointi]],
pointProjectionNormal, pointProjectionNormal,
points_, points_,
intersection::FULL_RAY intersection::FULL_RAY
@ -1329,12 +1329,12 @@ void Foam::starMesh::createCoupleMatches()
if (projHit.hit()) if (projHit.hit())
{ {
points_[intersectedFace[intPointI]] = points_[intersectedFace[intPointi]] =
projHit.hitPoint(); projHit.hitPoint();
#ifdef DEBUG_COUPLE_PROJECTION #ifdef DEBUG_COUPLE_PROJECTION
Info<< " new point: " Info<< " new point: "
<< points_[intersectedFace[intPointI]] << endl; << points_[intersectedFace[intPointi]] << endl;
#endif #endif
} }
} }

View File

@ -59,10 +59,10 @@ void Foam::starMesh::createPolyBoundary()
// mark it in the cellPolys_ // mark it in the cellPolys_
const labelList& facePoints = curFace; const labelList& facePoints = curFace;
forAll(facePoints, pointI) forAll(facePoints, pointi)
{ {
const labelList& facePointCells = const labelList& facePointCells =
PointCells[facePoints[pointI]]; PointCells[facePoints[pointi]];
forAll(facePointCells, celli) forAll(facePointCells, celli)
{ {

View File

@ -97,10 +97,10 @@ void Foam::starMesh::createPolyCells()
const labelList& curPoints = curFace; const labelList& curPoints = curFace;
// For all points // For all points
forAll(curPoints, pointI) forAll(curPoints, pointi)
{ {
// get the list of cells sharing this point // get the list of cells sharing this point
const labelList& curNeighbours = PointCells[curPoints[pointI]]; const labelList& curNeighbours = PointCells[curPoints[pointi]];
// For all neighbours // For all neighbours
forAll(curNeighbours, neiI) forAll(curNeighbours, neiI)

View File

@ -234,16 +234,16 @@ void Foam::starMesh::mergeCoupleFacePoints()
// Insert the primary point renumbering into the list // Insert the primary point renumbering into the list
// Take care of possibly unused points in the list // Take care of possibly unused points in the list
forAll(renumberPoints, pointI) forAll(renumberPoints, pointi)
{ {
if (renumberPoints[pointI] < 0) if (renumberPoints[pointi] < 0)
{ {
// point not merged // point not merged
renumberPoints[pointI] = pointI; renumberPoints[pointi] = pointi;
} }
else else
{ {
renumberPoints[pointI] = mergeSetID[renumberPoints[pointI]]; renumberPoints[pointi] = mergeSetID[renumberPoints[pointi]];
} }
} }
@ -262,9 +262,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
face& prelimFacePoints = prelimFaces[facei]; face& prelimFacePoints = prelimFaces[facei];
forAll(prelimFacePoints, pointI) forAll(prelimFacePoints, pointi)
{ {
if (renumberPoints[oldFacePoints[pointI]] < 0) if (renumberPoints[oldFacePoints[pointi]] < 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Error in point renumbering. Old face: " << "Error in point renumbering. Old face: "
@ -273,8 +273,8 @@ void Foam::starMesh::mergeCoupleFacePoints()
<< abort(FatalError); << abort(FatalError);
} }
prelimFacePoints[pointI] = prelimFacePoints[pointi] =
renumberPoints[oldFacePoints[pointI]]; renumberPoints[oldFacePoints[pointi]];
} }
} }
} }
@ -291,9 +291,9 @@ void Foam::starMesh::mergeCoupleFacePoints()
{ {
const face& curFacePoints = curFaces[facei]; const face& curFacePoints = curFaces[facei];
forAll(curFacePoints, pointI) forAll(curFacePoints, pointi)
{ {
renumberPoints[curFacePoints[pointI]]++; renumberPoints[curFacePoints[pointi]]++;
} }
} }
} }
@ -302,16 +302,16 @@ void Foam::starMesh::mergeCoupleFacePoints()
{ {
const labelList& curLabels = cellShapes_[celli]; const labelList& curLabels = cellShapes_[celli];
forAll(curLabels, pointI) forAll(curLabels, pointi)
{ {
if (renumberPoints[curLabels[pointI]] == 0) if (renumberPoints[curLabels[pointi]] == 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Error in point merging for cell " << "Error in point merging for cell "
<< celli << ". STAR index: " << starCellID_[celli] << celli << ". STAR index: " << starCellID_[celli]
<< ". " << endl << ". " << endl
<< "Point index: " << curLabels[pointI] << " STAR index " << "Point index: " << curLabels[pointi] << " STAR index "
<< starPointID_[curLabels[pointI]] << endl << starPointID_[curLabels[pointi]] << endl
<< "Please check the geometry for the cell." << endl; << "Please check the geometry for the cell." << endl;
} }
} }
@ -319,22 +319,22 @@ void Foam::starMesh::mergeCoupleFacePoints()
label nUsedPoints = 0; label nUsedPoints = 0;
forAll(renumberPoints, pointI) forAll(renumberPoints, pointi)
{ {
if (renumberPoints[pointI] > 0) if (renumberPoints[pointi] > 0)
{ {
// This should be OK as the compressed points list will always // This should be OK as the compressed points list will always
// have less points that the original lists. Even if there is // have less points that the original lists. Even if there is
// no points removed, this will copy the list back onto itself // no points removed, this will copy the list back onto itself
// //
renumberPoints[pointI] = nUsedPoints; renumberPoints[pointi] = nUsedPoints;
points_[nUsedPoints] = points_[pointI]; points_[nUsedPoints] = points_[pointi];
nUsedPoints++; nUsedPoints++;
} }
else else
{ {
renumberPoints[pointI] = -1; renumberPoints[pointi] = -1;
} }
} }
@ -356,19 +356,19 @@ void Foam::starMesh::mergeCoupleFacePoints()
face& newFacePoints = newFaces[facei]; face& newFacePoints = newFaces[facei];
forAll(newFacePoints, pointI) forAll(newFacePoints, pointi)
{ {
if (renumberPoints[oldFacePoints[pointI]] < 0) if (renumberPoints[oldFacePoints[pointi]] < 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Error in point renumbering for point " << "Error in point renumbering for point "
<< oldFacePoints[pointI] << oldFacePoints[pointi]
<< ". Renumbering index is -1." << endl << ". Renumbering index is -1." << endl
<< "Old face: " << oldFacePoints << endl << "Old face: " << oldFacePoints << endl
<< "New face: " << newFacePoints << abort(FatalError); << "New face: " << newFacePoints << abort(FatalError);
} }
newFacePoints[pointI] = renumberPoints[oldFacePoints[pointI]]; newFacePoints[pointi] = renumberPoints[oldFacePoints[pointi]];
} }
} }
} }
@ -381,23 +381,23 @@ void Foam::starMesh::mergeCoupleFacePoints()
labelList& curLabels = cellShapes_[celli]; labelList& curLabels = cellShapes_[celli];
forAll(curLabels, pointI) forAll(curLabels, pointi)
{ {
if (renumberPoints[curLabels[pointI]] < 0) if (renumberPoints[curLabels[pointi]] < 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Error in point renumbering for cell " << "Error in point renumbering for cell "
<< celli << ". STAR index: " << starCellID_[celli] << celli << ". STAR index: " << starCellID_[celli]
<< ". " << endl << ". " << endl
<< "Point index: " << curLabels[pointI] << " STAR index " << "Point index: " << curLabels[pointi] << " STAR index "
<< starPointID_[curLabels[pointI]] << " returns invalid " << starPointID_[curLabels[pointi]] << " returns invalid "
<< "renumbering index: " << "renumbering index: "
<< renumberPoints[curLabels[pointI]] << "." << endl << renumberPoints[curLabels[pointi]] << "." << endl
<< "Old cellShape: " << oldLabels << endl << "Old cellShape: " << oldLabels << endl
<< "New cell shape: " << curLabels << abort(FatalError); << "New cell shape: " << curLabels << abort(FatalError);
} }
curLabels[pointI] = renumberPoints[oldLabels[pointI]]; curLabels[pointi] = renumberPoints[oldLabels[pointi]];
} }
} }
@ -407,11 +407,11 @@ void Foam::starMesh::mergeCoupleFacePoints()
starPointID_ = -1; starPointID_ = -1;
forAll(starPointID_, pointI) forAll(starPointID_, pointi)
{ {
if (renumberPoints[pointI] > -1) if (renumberPoints[pointi] > -1)
{ {
starPointID_[renumberPoints[pointI]] = oldStarPointID[pointI]; starPointID_[renumberPoints[pointi]] = oldStarPointID[pointi];
} }
} }

View File

@ -191,7 +191,7 @@ int main(int argc, char *argv[])
{ {
labelList pointIndex(nNodes); labelList pointIndex(nNodes);
label pointI = 0; label pointi = 0;
while (nodeStream.good()) while (nodeStream.good())
{ {
@ -218,15 +218,15 @@ int main(int argc, char *argv[])
} }
// Store point and node number. // Store point and node number.
points[pointI] = point(x, y, z); points[pointi] = point(x, y, z);
nodeToPoint.insert(nodeI, pointI); nodeToPoint.insert(nodeI, pointi);
pointI++; pointi++;
} }
} }
if (pointI != nNodes) if (pointi != nNodes)
{ {
FatalIOErrorIn(args.executable().c_str(), nodeStream) FatalIOErrorIn(args.executable().c_str(), nodeStream)
<< "Only " << pointI << " nodes present instead of " << nNodes << "Only " << pointi << " nodes present instead of " << nNodes
<< " from header." << exit(FatalIOError); << " from header." << exit(FatalIOError);
} }
} }

View File

@ -69,9 +69,9 @@ void writePoints(const polyMesh& mesh, const fileName& timeName)
OFstream pointStream(pointFile); OFstream pointStream(pointFile);
forAll(mesh.points(), pointI) forAll(mesh.points(), pointi)
{ {
writeOBJ(mesh.points()[pointI], pointStream); writeOBJ(mesh.points()[pointi], pointStream);
vertI++; vertI++;
} }
@ -265,9 +265,9 @@ void writePatchFaces
OFstream patchFaceStream(faceFile); OFstream patchFaceStream(faceFile);
forAll(pp.localPoints(), pointI) forAll(pp.localPoints(), pointi)
{ {
writeOBJ(pp.localPoints()[pointI], patchFaceStream); writeOBJ(pp.localPoints()[pointi], patchFaceStream);
} }
forAll(pp.localFaces(), facei) forAll(pp.localFaces(), facei)
@ -308,9 +308,9 @@ void writePatchBoundaryEdges
OFstream patchEdgeStream(edgeFile); OFstream patchEdgeStream(edgeFile);
forAll(pp.localPoints(), pointI) forAll(pp.localPoints(), pointi)
{ {
writeOBJ(pp.localPoints()[pointI], patchEdgeStream); writeOBJ(pp.localPoints()[pointi], patchEdgeStream);
} }
for (label edgeI = pp.nInternalEdges(); edgeI < pp.nEdges(); edgeI++) for (label edgeI = pp.nInternalEdges(); edgeI < pp.nEdges(); edgeI++)
@ -329,11 +329,11 @@ void writePatchBoundaryEdges
void writePointCells void writePointCells
( (
const polyMesh& mesh, const polyMesh& mesh,
const label pointI, const label pointi,
const fileName& timeName const fileName& timeName
) )
{ {
const labelList& pCells = mesh.pointCells()[pointI]; const labelList& pCells = mesh.pointCells()[pointi];
labelHashSet allEdges(6*pCells.size()); labelHashSet allEdges(6*pCells.size());
@ -351,7 +351,7 @@ void writePointCells
fileName pFile fileName pFile
( (
mesh.time().path() mesh.time().path()
/ "pointEdges_" + timeName + '_' + name(pointI) + ".obj" / "pointEdges_" + timeName + '_' + name(pointi) + ".obj"
); );
Info<< "Writing pointEdges to " << pFile << endl; Info<< "Writing pointEdges to " << pFile << endl;
@ -470,9 +470,9 @@ int main(int argc, char *argv[])
} }
if (doPoint) if (doPoint)
{ {
label pointI = args.optionRead<label>("point"); label pointi = args.optionRead<label>("point");
writePointCells(mesh, pointI, runTime.timeName()); writePointCells(mesh, pointi, runTime.timeName());
} }
if (doFace) if (doFace)
{ {

View File

@ -581,25 +581,25 @@ int main(int argc, char *argv[])
// Determine points and extrusion // Determine points and extrusion
pointField layer0Points(extrudePatch.nPoints()); pointField layer0Points(extrudePatch.nPoints());
pointField displacement(extrudePatch.nPoints()); pointField displacement(extrudePatch.nPoints());
forAll(displacement, pointI) forAll(displacement, pointi)
{ {
const vector& patchNormal = extrudePatchPointNormals[pointI]; const vector& patchNormal = extrudePatchPointNormals[pointi];
// layer0 point // layer0 point
layer0Points[pointI] = model() layer0Points[pointi] = model()
( (
extrudePatch.localPoints()[pointI], extrudePatch.localPoints()[pointi],
patchNormal, patchNormal,
0 0
); );
// layerN point // layerN point
point extrudePt = model() point extrudePt = model()
( (
extrudePatch.localPoints()[pointI], extrudePatch.localPoints()[pointi],
patchNormal, patchNormal,
model().nLayers() model().nLayers()
); );
displacement[pointI] = extrudePt - layer0Points[pointI]; displacement[pointi] = extrudePt - layer0Points[pointi];
} }
@ -659,27 +659,27 @@ int main(int argc, char *argv[])
); );
// Reset points according to extrusion model // Reset points according to extrusion model
forAll(layerExtrude.addedPoints(), pointI) forAll(layerExtrude.addedPoints(), pointi)
{ {
const labelList& pPoints = layerExtrude.addedPoints()[pointI]; const labelList& pPoints = layerExtrude.addedPoints()[pointi];
forAll(pPoints, pPointI) forAll(pPoints, pPointi)
{ {
label meshPointI = pPoints[pPointI]; label meshPointi = pPoints[pPointi];
point modelPt point modelPt
( (
model() model()
( (
extrudePatch.localPoints()[pointI], extrudePatch.localPoints()[pointi],
extrudePatchPointNormals[pointI], extrudePatchPointNormals[pointi],
pPointI+1 // layer pPointi+1 // layer
) )
); );
const_cast<DynamicList<point>&> const_cast<DynamicList<point>&>
( (
meshMod().points() meshMod().points()
)[meshPointI] = modelPt; )[meshPointi] = modelPt;
} }
} }

View File

@ -2440,16 +2440,16 @@ int main(int argc, char *argv[])
( (
meshMod.points() meshMod.points()
); );
label meshPointI = extrudePatch.localPoints().size(); label meshPointi = extrudePatch.localPoints().size();
forAll(localRegionPoints, regionI) forAll(localRegionPoints, regionI)
{ {
label pointI = localRegionPoints[regionI]; label pointi = localRegionPoints[regionI];
point pt = extrudePatch.localPoints()[pointI]; point pt = extrudePatch.localPoints()[pointi];
const vector& n = localRegionNormals[regionI]; const vector& n = localRegionNormals[regionI];
for (label layerI = 1; layerI <= model().nLayers(); layerI++) for (label layerI = 1; layerI <= model().nLayers(); layerI++)
{ {
newPoints[meshPointI++] = model()(pt, n, layerI); newPoints[meshPointi++] = model()(pt, n, layerI);
} }
} }

View File

@ -226,13 +226,13 @@ void Foam::extrude2DMesh::setRefinement
{ {
label offset = layer * points.size(); label offset = layer * points.size();
forAll(points, pointI) forAll(points, pointi)
{ {
// Don't need the surface normal for either linearDirection or // Don't need the surface normal for either linearDirection or
// wedge. Will need to add to be able to use others. // wedge. Will need to add to be able to use others.
point newPoint = model_ point newPoint = model_
( (
points[pointI], points[pointi],
vector(), vector(),
layer layer
); );
@ -240,7 +240,7 @@ void Foam::extrude2DMesh::setRefinement
meshMod.addPoint meshMod.addPoint
( (
newPoint, newPoint,
pointI + offset, pointi + offset,
-1, // zoneID -1, // zoneID
true // inCell true // inCell
); );
@ -390,24 +390,24 @@ void Foam::extrude2DMesh::setRefinement
const face& f = faces[nextFacei]; const face& f = faces[nextFacei];
label nextPointI; label nextPointi;
if (mesh_.faceOwner()[nextFacei] == celli) if (mesh_.faceOwner()[nextFacei] == celli)
{ {
frontFace[0] = f[0]; frontFace[0] = f[0];
nextPointI = f[1]; nextPointi = f[1];
} }
else else
{ {
frontFace[0] = f[1]; frontFace[0] = f[1];
nextPointI = f[0]; nextPointi = f[0];
} }
for (label i = 1; i < frontFace.size(); i++) for (label i = 1; i < frontFace.size(); i++)
{ {
frontFace[i] = nextPointI; frontFace[i] = nextPointi;
// Find face containing pointI // Find face containing pointi
forAll(cFaces, cFacei) forAll(cFaces, cFacei)
{ {
label facei = cFaces[cFacei]; label facei = cFaces[cFacei];
@ -415,15 +415,15 @@ void Foam::extrude2DMesh::setRefinement
{ {
const face& f = faces[facei]; const face& f = faces[facei];
if (f[0] == nextPointI) if (f[0] == nextPointi)
{ {
nextPointI = f[1]; nextPointi = f[1];
nextFacei = facei; nextFacei = facei;
break; break;
} }
else if (f[1] == nextPointI) else if (f[1] == nextPointi)
{ {
nextPointI = f[0]; nextPointi = f[0];
nextFacei = facei; nextFacei = facei;
break; break;
} }
@ -486,24 +486,24 @@ void Foam::extrude2DMesh::setRefinement
const face& f = faces[nextFacei]; const face& f = faces[nextFacei];
label nextPointI; label nextPointi;
if (mesh_.faceOwner()[nextFacei] == celli) if (mesh_.faceOwner()[nextFacei] == celli)
{ {
frontFace[0] = f[0]; frontFace[0] = f[0];
nextPointI = f[1]; nextPointi = f[1];
} }
else else
{ {
frontFace[0] = f[1]; frontFace[0] = f[1];
nextPointI = f[0]; nextPointi = f[0];
} }
for (label i = 1; i < frontFace.size(); i++) for (label i = 1; i < frontFace.size(); i++)
{ {
frontFace[i] = nextPointI; frontFace[i] = nextPointi;
// Find face containing pointI // Find face containing pointi
forAll(cFaces, cFacei) forAll(cFaces, cFacei)
{ {
label facei = cFaces[cFacei]; label facei = cFaces[cFacei];
@ -511,15 +511,15 @@ void Foam::extrude2DMesh::setRefinement
{ {
const face& f = faces[facei]; const face& f = faces[facei];
if (f[0] == nextPointI) if (f[0] == nextPointi)
{ {
nextPointI = f[1]; nextPointi = f[1];
nextFacei = facei; nextFacei = facei;
break; break;
} }
else if (f[1] == nextPointI) else if (f[1] == nextPointi)
{ {
nextPointI = f[0]; nextPointi = f[0];
nextFacei = facei; nextFacei = facei;
break; break;
} }

View File

@ -78,28 +78,28 @@ static const NamedEnum<ExtrudeMode, 2> ExtrudeModeNames;
// pointField layer1Points(fMesh.nPoints()); // pointField layer1Points(fMesh.nPoints());
// pointField displacement(fMesh.nPoints()); // pointField displacement(fMesh.nPoints());
// forAll(layer0Points, pointI) // forAll(layer0Points, pointi)
// { // {
// const labelList& meshPoints = fMesh.meshPoints(); // const labelList& meshPoints = fMesh.meshPoints();
// label meshPointI = meshPoints[pointI]; // label meshPointi = meshPoints[pointi];
// layer0Points[meshPointI] = model // layer0Points[meshPointi] = model
// ( // (
// fMesh.points()[meshPointI], // fMesh.points()[meshPointi],
// fMesh.pointNormals()[pointI], // fMesh.pointNormals()[pointi],
// 0 // 0
// ); // );
// layer1Points[meshPointI] = model // layer1Points[meshPointi] = model
// ( // (
// fMesh.points()[meshPointI], // fMesh.points()[meshPointi],
// fMesh.pointNormals()[pointI], // fMesh.pointNormals()[pointi],
// 1 // 1
// ); // );
// displacement[pointI] = // displacement[pointi] =
// layer1Points[meshPointI] // layer1Points[meshPointi]
// - layer0Points[meshPointI]; // - layer0Points[meshPointi];
// } // }
// fMesh.movePoints(layer0Points); // fMesh.movePoints(layer0Points);

View File

@ -537,9 +537,9 @@ int main(int argc, char *argv[])
// Enforce the boundary conditions // Enforce the boundary conditions
const triad& fixedAlignment = fixedAlignments[pI]; const triad& fixedAlignment = fixedAlignments[pI];
forAll(pPoints, adjPointI) forAll(pPoints, adjPointi)
{ {
const label adjPointIndex = pPoints[adjPointI]; const label adjPointIndex = pPoints[adjPointi];
scalar dist = mag(points[pI] - points[adjPointIndex]); scalar dist = mag(points[pI] - points[adjPointIndex]);

View File

@ -91,9 +91,9 @@ void Foam::DelaunayMesh<Triangulation>::addPatches
label nPatches = patchFaces.size(); label nPatches = patchFaces.size();
patchDicts.setSize(nPatches); patchDicts.setSize(nPatches);
forAll(patchDicts, patchI) forAll(patchDicts, patchi)
{ {
patchDicts.set(patchI, new dictionary()); patchDicts.set(patchi, new dictionary());
} }
label nBoundaryFaces = 0; label nBoundaryFaces = 0;

View File

@ -364,9 +364,9 @@ void Foam::smoothAlignmentSolver::smoothAlignments
triad& newTriad = triadAv[pI]; triad& newTriad = triadAv[pI];
forAll(pPoints, adjPointI) forAll(pPoints, adjPointi)
{ {
const label adjPointIndex = pPoints[adjPointI]; const label adjPointIndex = pPoints[adjPointi];
scalar dist = mag(points[pI] - points[adjPointIndex]); scalar dist = mag(points[pI] - points[adjPointIndex]);

View File

@ -2566,7 +2566,7 @@ void Foam::conformalVoronoiMesh::removeUnusedPoints
} }
} }
label pointI = 0; label pointi = 0;
labelList oldToNew(pts.size(), label(-1)); labelList oldToNew(pts.size(), label(-1));
@ -2577,7 +2577,7 @@ void Foam::conformalVoronoiMesh::removeUnusedPoints
{ {
if (ptUsed[ptUI] == true) if (ptUsed[ptUI] == true)
{ {
oldToNew[ptUI] = pointI++; oldToNew[ptUI] = pointi++;
} }
} }
@ -2585,12 +2585,12 @@ void Foam::conformalVoronoiMesh::removeUnusedPoints
inplaceReorder(oldToNew, boundaryPts); inplaceReorder(oldToNew, boundaryPts);
Info<< " Removing " Info<< " Removing "
<< returnReduce(pts.size() - pointI, sumOp<label>()) << returnReduce(pts.size() - pointi, sumOp<label>())
<< " unused points" << " unused points"
<< endl; << endl;
pts.setSize(pointI); pts.setSize(pointi);
boundaryPts.setSize(pointI); boundaryPts.setSize(pointi);
// Renumber the faces to use the new point numbers // Renumber the faces to use the new point numbers

View File

@ -1831,10 +1831,10 @@ Foam::conformalVoronoiMesh::nearestFeatureEdgeLocations
{ {
label index = elems[elemI]; label index = elems[elemI];
const Foam::point& pointI const Foam::point& pointi
= edgeLocationTreePtr_().shapes().shapePoints()[index]; = edgeLocationTreePtr_().shapes().shapePoints()[index];
pointIndexHit nearHit(true, pointI, index); pointIndexHit nearHit(true, pointi, index);
dynPointHit.append(nearHit); dynPointHit.append(nearHit);
} }

View File

@ -307,11 +307,11 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// )() // )()
// ); // );
// //
// label pointI = findIndex(pointDualAddressing, -1); // label pointi = findIndex(pointDualAddressing, -1);
// if (pointI != -1) // if (pointi != -1)
// { // {
// WarningInFunction // WarningInFunction
// << "Delaunay vertex " << pointI // << "Delaunay vertex " << pointi
// << " does not have a corresponding dual cell." << endl; // << " does not have a corresponding dual cell." << endl;
// } // }
// //
@ -350,21 +350,21 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// points // points
// ); // );
// //
// forAll(pointDualAddressing, pointI) // forAll(pointDualAddressing, pointi)
// { // {
// label index = pointDualAddressing[pointI]; // label index = pointDualAddressing[pointi];
// //
// if (index > 0) // if (index > 0)
// { // {
// label celli = index-1; // label celli = index-1;
// dualPoints[pointI] = mesh.cellCentres()[celli]; // dualPoints[pointi] = mesh.cellCentres()[celli];
// } // }
// else if (index < 0) // else if (index < 0)
// { // {
// label facei = -index-1; // label facei = -index-1;
// if (facei >= mesh.nInternalFaces()) // if (facei >= mesh.nInternalFaces())
// { // {
// dualPoints[pointI] = mesh.faceCentres()[facei]; // dualPoints[pointi] = mesh.faceCentres()[facei];
// } // }
// } // }
// } // }
@ -1388,8 +1388,8 @@ Foam::labelHashSet Foam::conformalVoronoiMesh::findRemainingProtrusionSet
forAllConstIter(labelHashSet, protrudingBoundaryPoints, iter) forAllConstIter(labelHashSet, protrudingBoundaryPoints, iter)
{ {
const label pointI = iter.key(); const label pointi = iter.key();
const labelList& pCells = mesh.pointCells()[pointI]; const labelList& pCells = mesh.pointCells()[pointi];
forAll(pCells, pCI) forAll(pCells, pCI)
{ {

View File

@ -276,23 +276,23 @@ Foam::labelList Foam::conformalVoronoiMesh::calcCellZones
selectInside = false; selectInside = false;
} }
forAll(volType, pointI) forAll(volType, pointi)
{ {
if (cellToSurface[pointI] == -1) if (cellToSurface[pointi] == -1)
{ {
if if
( (
( (
volType[pointI] == volumeType::INSIDE volType[pointi] == volumeType::INSIDE
&& selectInside && selectInside
) )
|| ( || (
volType[pointI] == volumeType::OUTSIDE volType[pointi] == volumeType::OUTSIDE
&& !selectInside && !selectInside
) )
) )
{ {
cellToSurface[pointI] = surfI; cellToSurface[pointi] = surfI;
} }
} }
} }

View File

@ -1112,17 +1112,17 @@ void Foam::conformationSurfaces::findEdgeNearest
); );
// Update minDistSqr and arguments // Update minDistSqr and arguments
forAll(hitInfo, pointI) forAll(hitInfo, pointi)
{ {
if (hitInfo[pointI].hit()) if (hitInfo[pointi].hit())
{ {
minDistSqr[pointI] = magSqr minDistSqr[pointi] = magSqr
( (
hitInfo[pointI].hitPoint() hitInfo[pointi].hitPoint()
- samples[pointI] - samples[pointi]
); );
edgeHits[pointI] = hitInfo[pointI]; edgeHits[pointi] = hitInfo[pointi];
featuresHit[pointI] = testI; featuresHit[pointi] = testI;
} }
} }
} }

View File

@ -352,14 +352,14 @@ tmp<scalarField> signedDistance
// Push back to original // Push back to original
forAll(volType, i) forAll(volType, i)
{ {
label pointI = surfIndices[i]; label pointi = surfIndices[i];
scalar dist = mag(points[pointI] - nearest[pointI].hitPoint()); scalar dist = mag(points[pointi] - nearest[pointi].hitPoint());
volumeType vT = volType[i]; volumeType vT = volType[i];
if (vT == volumeType::OUTSIDE) if (vT == volumeType::OUTSIDE)
{ {
fld[pointI] = dist; fld[pointi] = dist;
} }
else if (vT == volumeType::INSIDE) else if (vT == volumeType::INSIDE)
{ {

View File

@ -206,9 +206,9 @@ public:
// return true; // return true;
//} //}
//const pointField points(bb.points()); //const pointField points(bb.points());
//forAll(points, pointI) //forAll(points, pointi)
//{ //{
// scalar pointVal = signedDistance(points[pointI]) - _iso_val; // scalar pointVal = signedDistance(points[pointi]) - _iso_val;
// if (ccVal*pointVal < 0) // if (ccVal*pointVal < 0)
// { // {
// return true; // return true;
@ -518,10 +518,10 @@ int main(int argc, char *argv[])
Point* vertices = mc.vertices(); Point* vertices = mc.vertices();
pointField points(mc.nverts()); pointField points(mc.nverts());
forAll(points, pointI) forAll(points, pointi)
{ {
const Point& v = vertices[pointI]; const Point& v = vertices[pointi];
points[pointI] = converter.toGlobal(v); points[pointi] = converter.toGlobal(v);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -141,7 +141,7 @@ int main(int argc, char *argv[])
// Generate points // Generate points
pointField points(mc.size_x()*mc.size_y()*mc.size_z()); pointField points(mc.size_x()*mc.size_y()*mc.size_z());
label pointI = 0; label pointi = 0;
point pt; point pt;
for( int k = 0 ; k < mc.size_z() ; k++ ) for( int k = 0 ; k < mc.size_z() ; k++ )
@ -153,7 +153,7 @@ int main(int argc, char *argv[])
for( int i = 0 ; i < mc.size_x() ; i++ ) for( int i = 0 ; i < mc.size_x() ; i++ )
{ {
pt.x() = bb.min().x() + i*d.x(); pt.x() = bb.min().x() + i*d.x();
points[pointI++] = pt; points[pointi++] = pt;
} }
} }
} }
@ -181,14 +181,14 @@ int main(int argc, char *argv[])
); );
// Fill elements // Fill elements
pointI = 0; pointi = 0;
for( int k = 0 ; k < mc.size_z() ; k++ ) for( int k = 0 ; k < mc.size_z() ; k++ )
{ {
for( int j = 0 ; j < mc.size_y() ; j++ ) for( int j = 0 ; j < mc.size_y() ; j++ )
{ {
for( int i = 0 ; i < mc.size_x() ; i++ ) for( int i = 0 ; i < mc.size_x() ; i++ )
{ {
mc.set_data(float(signedDist[pointI++]), i, j, k); mc.set_data(float(signedDist[pointi++]), i, j, k);
} }
} }
} }
@ -226,10 +226,10 @@ int main(int argc, char *argv[])
Vertex* vertices = mc.vertices(); Vertex* vertices = mc.vertices();
pointField points(mc.nverts()); pointField points(mc.nverts());
forAll(points, pointI) forAll(points, pointi)
{ {
Vertex& v = vertices[pointI]; Vertex& v = vertices[pointi];
points[pointI] = point points[pointi] = point
( (
bb.min().x() + v.x*span.x()/mc.size_x(), bb.min().x() + v.x*span.x()/mc.size_x(),
bb.min().y() + v.y*span.y()/mc.size_y(), bb.min().y() + v.y*span.y()/mc.size_y(),

View File

@ -938,7 +938,7 @@ void Foam::CV2D::newPoints()
/* /*
void Foam::CV2D::moveInternalPoints(const point2DField& newPoints) void Foam::CV2D::moveInternalPoints(const point2DField& newPoints)
{ {
label pointI = 0; label pointi = 0;
for for
( (
@ -949,7 +949,7 @@ void Foam::CV2D::moveInternalPoints(const point2DField& newPoints)
{ {
if (vit->internalPoint()) if (vit->internalPoint())
{ {
movePoint(vit, newPoints[pointI++]); movePoint(vit, newPoints[pointi++]);
} }
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -130,9 +130,9 @@ inline const Foam::point2D& Foam::CV2D::toPoint2D(const point& p) const
inline const Foam::point2DField Foam::CV2D::toPoint2D(const pointField& p) const inline const Foam::point2DField Foam::CV2D::toPoint2D(const pointField& p) const
{ {
point2DField temp(p.size()); point2DField temp(p.size());
forAll(temp, pointI) forAll(temp, pointi)
{ {
temp[pointI] = point2D(p[pointI].x(), p[pointI].y()); temp[pointi] = point2D(p[pointi].x(), p[pointi].y());
} }
return temp; return temp;
} }

View File

@ -433,14 +433,14 @@ Foam::shortEdgeFilter2D::filter()
// Maintain addressing from new to old point field // Maintain addressing from new to old point field
labelList newPtToOldPt(totalNewPoints, -1); labelList newPtToOldPt(totalNewPoints, -1);
forAll(points, pointI) forAll(points, pointi)
{ {
// If the point is NOT going to be removed. // If the point is NOT going to be removed.
if (pointsToRemove[pointI] == -1) if (pointsToRemove[pointi] == -1)
{ {
newPoints[pointI - numberRemoved] = points[pointI]; newPoints[pointi - numberRemoved] = points[pointi];
newPointNumbers[pointI] = pointI - numberRemoved; newPointNumbers[pointi] = pointi - numberRemoved;
newPtToOldPt[pointI - numberRemoved] = pointI; newPtToOldPt[pointi - numberRemoved] = pointi;
} }
else else
{ {
@ -466,31 +466,31 @@ Foam::shortEdgeFilter2D::filter()
forAll(f, fp) forAll(f, fp)
{ {
label pointI = f[fp]; label pointi = f[fp];
// If not removing the point, then add it to the new face. // If not removing the point, then add it to the new face.
if (pointsToRemove[pointI] == -1) if (pointsToRemove[pointi] == -1)
{ {
newFace[newFaceSize++] = newPointNumbers[pointI]; newFace[newFaceSize++] = newPointNumbers[pointi];
} }
else else
{ {
label newPointI = pointsToRemove[pointI]; label newPointi = pointsToRemove[pointi];
// Replace deleted point with point that it is being // Replace deleted point with point that it is being
// collapsed to. // collapsed to.
if if
( (
f.nextLabel(fp) != newPointI f.nextLabel(fp) != newPointi
&& f.prevLabel(fp) != newPointI && f.prevLabel(fp) != newPointi
) )
{ {
label pChain = newPointI; label pChain = newPointi;
label totalChain = 0; label totalChain = 0;
for (label nChain = 0; nChain <= totalChain; ++nChain) for (label nChain = 0; nChain <= totalChain; ++nChain)
{ {
if (newPointNumbers[pChain] != -1) if (newPointNumbers[pChain] != -1)
{ {
newFace[newFaceSize++] = newPointNumbers[pChain]; newFace[newFaceSize++] = newPointNumbers[pChain];
newPointNumbers[pointI] = newPointNumbers[pChain]; newPointNumbers[pointi] = newPointNumbers[pChain];
maxChain = max(totalChain, maxChain); maxChain = max(totalChain, maxChain);
} }
else else
@ -498,7 +498,7 @@ Foam::shortEdgeFilter2D::filter()
WarningInFunction WarningInFunction
<< "Point " << pChain << "Point " << pChain
<< " marked for deletion as well as point " << " marked for deletion as well as point "
<< pointI << nl << pointi << nl
<< " Incrementing maxChain by 1 from " << " Incrementing maxChain by 1 from "
<< totalChain << " to " << totalChain + 1 << totalChain << " to " << totalChain + 1
<< endl; << endl;
@ -509,9 +509,9 @@ Foam::shortEdgeFilter2D::filter()
} }
else else
{ {
if (newPointNumbers[newPointI] != -1) if (newPointNumbers[newPointi] != -1)
{ {
newPointNumbers[pointI] = newPointNumbers[newPointI]; newPointNumbers[pointi] = newPointNumbers[newPointi];
} }
} }
} }
@ -549,12 +549,12 @@ Foam::shortEdgeFilter2D::filter()
patchSizes_ patchSizes_
); );
forAll(newPointNumbers, pointI) forAll(newPointNumbers, pointi)
{ {
if (newPointNumbers[pointI] == -1) if (newPointNumbers[pointi] == -1)
{ {
WarningInFunction WarningInFunction
<< pointI << " will be deleted and " << newPointNumbers[pointI] << pointi << " will be deleted and " << newPointNumbers[pointi]
<< ", so it will not be replaced. " << ", so it will not be replaced. "
<< "This will cause edges to be deleted." << endl; << "This will cause edges to be deleted." << endl;
} }

View File

@ -339,12 +339,12 @@ void syncPoints
const labelList& meshPts = procPatch.meshPoints(); const labelList& meshPts = procPatch.meshPoints();
const labelList& nbrPts = procPatch.neighbPoints(); const labelList& nbrPts = procPatch.neighbPoints();
forAll(nbrPts, pointI) forAll(nbrPts, pointi)
{ {
label nbrPointI = nbrPts[pointI]; label nbrPointi = nbrPts[pointi];
if (nbrPointI >= 0 && nbrPointI < patchInfo.size()) if (nbrPointi >= 0 && nbrPointi < patchInfo.size())
{ {
patchInfo[nbrPointI] = points[meshPts[pointI]]; patchInfo[nbrPointi] = points[meshPts[pointi]];
} }
} }
@ -397,10 +397,10 @@ void syncPoints
const labelList& meshPts = procPatch.meshPoints(); const labelList& meshPts = procPatch.meshPoints();
forAll(meshPts, pointI) forAll(meshPts, pointi)
{ {
label meshPointI = meshPts[pointI]; label meshPointi = meshPts[pointi];
points[meshPointI] = nbrPatchInfo[pointI]; points[meshPointi] = nbrPatchInfo[pointi];
} }
} }
} }
@ -478,9 +478,9 @@ void syncPoints
forAll(pd.sharedPointLabels(), i) forAll(pd.sharedPointLabels(), i)
{ {
label meshPointI = pd.sharedPointLabels()[i]; label meshPointi = pd.sharedPointLabels()[i];
// Fill my entries in the shared points // Fill my entries in the shared points
sharedPts[pd.sharedPointAddr()[i]] = points[meshPointI]; sharedPts[pd.sharedPointAddr()[i]] = points[meshPointi];
} }
// Combine on master. // Combine on master.
@ -491,8 +491,8 @@ void syncPoints
// my local information. // my local information.
forAll(pd.sharedPointLabels(), i) forAll(pd.sharedPointLabels(), i)
{ {
label meshPointI = pd.sharedPointLabels()[i]; label meshPointi = pd.sharedPointLabels()[i];
points[meshPointI] = sharedPts[pd.sharedPointAddr()[i]]; points[meshPointi] = sharedPts[pd.sharedPointAddr()[i]];
} }
} }
} }

View File

@ -76,15 +76,15 @@ int main(int argc, char *argv[])
scalar minCmptVal = bb.min()[planeNormalCmpt]; scalar minCmptVal = bb.min()[planeNormalCmpt];
scalar maxCmptVal = bb.max()[planeNormalCmpt]; scalar maxCmptVal = bb.max()[planeNormalCmpt];
forAll(points, pointI) forAll(points, pointi)
{ {
if (points[pointI][planeNormalCmpt] < midCmptVal) if (points[pointi][planeNormalCmpt] < midCmptVal)
{ {
points[pointI][planeNormalCmpt] = minCmptVal; points[pointi][planeNormalCmpt] = minCmptVal;
} }
else else
{ {
points[pointI][planeNormalCmpt] = maxCmptVal; points[pointi][planeNormalCmpt] = maxCmptVal;
} }
} }

View File

@ -207,10 +207,10 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
pointZoneIndices[zoneI] = zoneIndex(pointZoneNames_, pz[zoneI].name()); pointZoneIndices[zoneI] = zoneIndex(pointZoneNames_, pz[zoneI].name());
} }
forAll(p, pointI) forAll(p, pointi)
{ {
// Grab zone ID. If a point is not in a zone, it will return -1 // Grab zone ID. If a point is not in a zone, it will return -1
zoneID = pz.whichZone(pointI); zoneID = pz.whichZone(pointi);
if (zoneID >= 0) if (zoneID >= 0)
{ {
@ -218,15 +218,15 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
zoneID = pointZoneIndices[zoneID]; zoneID = pointZoneIndices[zoneID];
} }
renumberPoints[pointI] = renumberPoints[pointi] =
meshMod_.setAction meshMod_.setAction
( (
polyAddPoint polyAddPoint
( (
p[pointI], // Point to add p[pointi], // Point to add
-1, // Master point (straight addition) -1, // Master point (straight addition)
zoneID, // Zone for point zoneID, // Zone for point
pointI < m.nPoints() // Is in cell? pointi < m.nPoints() // Is in cell?
) )
); );
} }
@ -309,9 +309,9 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
face newFace(curFace.size()); face newFace(curFace.size());
forAll(curFace, pointI) forAll(curFace, pointi)
{ {
newFace[pointI] = renumberPoints[curFace[pointI]]; newFace[pointi] = renumberPoints[curFace[pointi]];
} }
if (debug) if (debug)

View File

@ -369,16 +369,16 @@ int main(int argc, char *argv[])
pointSet dupPoints(mesh, "duplicatedPoints", 100); pointSet dupPoints(mesh, "duplicatedPoints", 100);
forAll(pointMap, pointI) forAll(pointMap, pointi)
{ {
label oldPointI = pointMap[pointI]; label oldPointi = pointMap[pointi];
nDupPerPoint[oldPointI]++; nDupPerPoint[oldPointi]++;
if (nDupPerPoint[oldPointI] > 1) if (nDupPerPoint[oldPointi] > 1)
{ {
dupPoints.insert(map().reversePointMap()[oldPointI]); dupPoints.insert(map().reversePointMap()[oldPointi]);
dupPoints.insert(pointI); dupPoints.insert(pointi);
} }
} }

View File

@ -67,18 +67,18 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
labelList mirrorPointLookup(oldPoints.size(), -1); labelList mirrorPointLookup(oldPoints.size(), -1);
// Grab the old points // Grab the old points
forAll(oldPoints, pointI) forAll(oldPoints, pointi)
{ {
newPoints[nNewPoints] = oldPoints[pointI]; newPoints[nNewPoints] = oldPoints[pointi];
nNewPoints++; nNewPoints++;
} }
forAll(oldPoints, pointI) forAll(oldPoints, pointi)
{ {
scalar alpha = scalar alpha =
mirrorPlane.normalIntersect mirrorPlane.normalIntersect
( (
oldPoints[pointI], oldPoints[pointi],
mirrorPlane.normal() mirrorPlane.normal()
); );
@ -87,10 +87,10 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
{ {
// The point gets mirrored // The point gets mirrored
newPoints[nNewPoints] = newPoints[nNewPoints] =
oldPoints[pointI] + 2.0*alpha*mirrorPlane.normal(); oldPoints[pointi] + 2.0*alpha*mirrorPlane.normal();
// remember the point correspondence // remember the point correspondence
mirrorPointLookup[pointI] = nNewPoints; mirrorPointLookup[pointi] = nNewPoints;
nNewPoints++; nNewPoints++;
} }
else else
@ -98,9 +98,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
// The point is on the plane and does not get mirrored // The point is on the plane and does not get mirrored
// Adjust plane location // Adjust plane location
newPoints[nNewPoints] = newPoints[nNewPoints] =
oldPoints[pointI] + alpha*mirrorPlane.normal(); oldPoints[pointi] + alpha*mirrorPlane.normal();
mirrorPointLookup[pointI] = pointI; mirrorPointLookup[pointi] = pointi;
} }
} }
@ -179,9 +179,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
const face& origFace = curPatch[facei]; const face& origFace = curPatch[facei];
face mirrorFace(origFace.size()); face mirrorFace(origFace.size());
forAll(mirrorFace, pointI) forAll(mirrorFace, pointi)
{ {
mirrorFace[pointI] = mirrorPointLookup[origFace[pointI]]; mirrorFace[pointi] = mirrorPointLookup[origFace[pointi]];
} }
if (origFace == mirrorFace) if (origFace == mirrorFace)

View File

@ -94,10 +94,10 @@ void Foam::meshDualiser::dumpPolyTopoChange
const DynamicList<point>& points = meshMod.points(); const DynamicList<point>& points = meshMod.points();
forAll(points, pointI) forAll(points, pointi)
{ {
meshTools::writeOBJ(str1, points[pointI]); meshTools::writeOBJ(str1, points[pointi]);
meshTools::writeOBJ(str2, points[pointI]); meshTools::writeOBJ(str2, points[pointi]);
} }
const DynamicList<face>& faces = meshMod.faces(); const DynamicList<face>& faces = meshMod.faces();
@ -126,10 +126,10 @@ void Foam::meshDualiser::dumpPolyTopoChange
Foam::label Foam::meshDualiser::findDualCell Foam::label Foam::meshDualiser::findDualCell
( (
const label celli, const label celli,
const label pointI const label pointi
) const ) const
{ {
const labelList& dualCells = pointToDualCells_[pointI]; const labelList& dualCells = pointToDualCells_[pointi];
if (dualCells.size() == 1) if (dualCells.size() == 1)
{ {
@ -137,7 +137,7 @@ Foam::label Foam::meshDualiser::findDualCell
} }
else else
{ {
label index = findIndex(mesh_.pointCells()[pointI], celli); label index = findIndex(mesh_.pointCells()[pointi], celli);
return dualCells[index]; return dualCells[index];
} }
@ -147,11 +147,11 @@ Foam::label Foam::meshDualiser::findDualCell
void Foam::meshDualiser::generateDualBoundaryEdges void Foam::meshDualiser::generateDualBoundaryEdges
( (
const PackedBoolList& isBoundaryEdge, const PackedBoolList& isBoundaryEdge,
const label pointI, const label pointi,
polyTopoChange& meshMod polyTopoChange& meshMod
) )
{ {
const labelList& pEdges = mesh_.pointEdges()[pointI]; const labelList& pEdges = mesh_.pointEdges()[pointi];
forAll(pEdges, pEdgeI) forAll(pEdges, pEdgeI)
{ {
@ -164,7 +164,7 @@ void Foam::meshDualiser::generateDualBoundaryEdges
edgeToDualPoint_[edgeI] = meshMod.addPoint edgeToDualPoint_[edgeI] = meshMod.addPoint
( (
e.centre(mesh_.points()), e.centre(mesh_.points()),
pointI, // masterPoint pointi, // masterPoint
-1, // zoneID -1, // zoneID
true // inCell true // inCell
); );
@ -178,7 +178,7 @@ void Foam::meshDualiser::generateDualBoundaryEdges
bool Foam::meshDualiser::sameDualCell bool Foam::meshDualiser::sameDualCell
( (
const label facei, const label facei,
const label pointI const label pointi
) const ) const
{ {
if (!mesh_.isInternalFace(facei)) if (!mesh_.isInternalFace(facei))
@ -191,13 +191,13 @@ bool Foam::meshDualiser::sameDualCell
label own = mesh_.faceOwner()[facei]; label own = mesh_.faceOwner()[facei];
label nei = mesh_.faceNeighbour()[facei]; label nei = mesh_.faceNeighbour()[facei];
return findDualCell(own, pointI) == findDualCell(nei, pointI); return findDualCell(own, pointi) == findDualCell(nei, pointi);
} }
Foam::label Foam::meshDualiser::addInternalFace Foam::label Foam::meshDualiser::addInternalFace
( (
const label masterPointI, const label masterPointi,
const label masterEdgeI, const label masterEdgeI,
const label masterFacei, const label masterFacei,
@ -261,7 +261,7 @@ Foam::label Foam::meshDualiser::addInternalFace
newFace, newFace,
dualCell0, // own dualCell0, // own
dualCell1, // nei dualCell1, // nei
masterPointI, // masterPointID masterPointi, // masterPointID
masterEdgeI, // masterEdgeID masterEdgeI, // masterEdgeID
masterFacei, // masterFaceID masterFacei, // masterFaceID
false, // flipFaceFlux false, // flipFaceFlux
@ -288,7 +288,7 @@ Foam::label Foam::meshDualiser::addInternalFace
newFace, newFace,
dualCell1, // own dualCell1, // own
dualCell0, // nei dualCell0, // nei
masterPointI, // masterPointID masterPointi, // masterPointID
masterEdgeI, // masterEdgeID masterEdgeI, // masterEdgeID
masterFacei, // masterFaceID masterFacei, // masterFaceID
false, // flipFaceFlux false, // flipFaceFlux
@ -314,7 +314,7 @@ Foam::label Foam::meshDualiser::addInternalFace
Foam::label Foam::meshDualiser::addBoundaryFace Foam::label Foam::meshDualiser::addBoundaryFace
( (
const label masterPointI, const label masterPointi,
const label masterEdgeI, const label masterEdgeI,
const label masterFacei, const label masterFacei,
@ -345,7 +345,7 @@ Foam::label Foam::meshDualiser::addBoundaryFace
newFace, newFace,
dualCelli, // own dualCelli, // own
-1, // nei -1, // nei
masterPointI, // masterPointID masterPointi, // masterPointID
masterEdgeI, // masterEdgeID masterEdgeI, // masterEdgeID
masterFacei, // masterFaceID masterFacei, // masterFaceID
false, // flipFaceFlux false, // flipFaceFlux
@ -473,7 +473,7 @@ void Foam::meshDualiser::createFacesAroundEdge
// Close current face. // Close current face.
addInternalFace addInternalFace
( (
-1, // masterPointI -1, // masterPointi
edgeI, // masterEdgeI edgeI, // masterEdgeI
-1, // masterFacei -1, // masterFacei
edgeOrder, edgeOrder,
@ -525,7 +525,7 @@ void Foam::meshDualiser::createFacesAroundEdge
verts.shrink(); verts.shrink();
addInternalFace addInternalFace
( (
-1, // masterPointI -1, // masterPointi
edgeI, // masterEdgeI edgeI, // masterEdgeI
-1, // masterFacei -1, // masterFacei
edgeOrder, edgeOrder,
@ -619,7 +619,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
verts.shrink(); verts.shrink();
addInternalFace addInternalFace
( (
-1, // masterPointI -1, // masterPointi
-1, // masterEdgeI -1, // masterEdgeI
facei, // masterFacei facei, // masterFacei
true, // edgeOrder, true, // edgeOrder,
@ -641,7 +641,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
void Foam::meshDualiser::createFacesAroundBoundaryPoint void Foam::meshDualiser::createFacesAroundBoundaryPoint
( (
const label patchi, const label patchi,
const label patchPointI, const label patchPointi,
const label startFacei, const label startFacei,
polyTopoChange& meshMod, polyTopoChange& meshMod,
boolList& donePFaces // pFaces visited boolList& donePFaces // pFaces visited
@ -649,12 +649,12 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
{ {
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh_.boundaryMesh();
const polyPatch& pp = patches[patchi]; const polyPatch& pp = patches[patchi];
const labelList& pFaces = pp.pointFaces()[patchPointI]; const labelList& pFaces = pp.pointFaces()[patchPointi];
const labelList& own = mesh_.faceOwner(); const labelList& own = mesh_.faceOwner();
label pointI = pp.meshPoints()[patchPointI]; label pointi = pp.meshPoints()[patchPointi];
if (pointToDualPoint_[pointI] == -1) if (pointToDualPoint_[pointi] == -1)
{ {
// Not a feature point. Loop over all connected // Not a feature point. Loop over all connected
// pointFaces. // pointFaces.
@ -678,11 +678,11 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// Insert face centre // Insert face centre
verts.append(faceToDualPoint_[facei]); verts.append(faceToDualPoint_[facei]);
label dualCelli = findDualCell(own[facei], pointI); label dualCelli = findDualCell(own[facei], pointi);
// Get the edge before the patchPointI // Get the edge before the patchPointi
const face& f = mesh_.faces()[facei]; const face& f = mesh_.faces()[facei];
label fp = findIndex(f, pointI); label fp = findIndex(f, pointi);
label prevFp = f.rcIndex(fp); label prevFp = f.rcIndex(fp);
label edgeI = mesh_.faceEdges()[facei][prevFp]; label edgeI = mesh_.faceEdges()[facei][prevFp];
@ -721,19 +721,19 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
} }
// Check if different cell. // Check if different cell.
if (dualCelli != findDualCell(own[facei], pointI)) if (dualCelli != findDualCell(own[facei], pointi))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Different dual cells but no feature edge" << "Different dual cells but no feature edge"
<< " inbetween point:" << pointI << " inbetween point:" << pointi
<< " coord:" << mesh_.points()[pointI] << " coord:" << mesh_.points()[pointi]
<< abort(FatalError); << abort(FatalError);
} }
} }
verts.shrink(); verts.shrink();
label dualCelli = findDualCell(own[facei], pointI); label dualCelli = findDualCell(own[facei], pointi);
//Bit dodgy: create dualface from the last face (instead of from //Bit dodgy: create dualface from the last face (instead of from
// the central point). This will also use the original faceZone to // the central point). This will also use the original faceZone to
@ -741,8 +741,8 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
addBoundaryFace addBoundaryFace
( (
//pointI, // masterPointI //pointi, // masterPointi
-1, // masterPointI -1, // masterPointi
-1, // masterEdgeI -1, // masterEdgeI
facei, // masterFacei facei, // masterFacei
dualCelli, dualCelli,
@ -759,11 +759,11 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
DynamicList<label> verts(mesh_.faces()[facei].size()); DynamicList<label> verts(mesh_.faces()[facei].size());
// Starting point. // Starting point.
verts.append(pointToDualPoint_[pointI]); verts.append(pointToDualPoint_[pointi]);
// Find edge between pointI and next point on face. // Find edge between pointi and next point on face.
const labelList& fEdges = mesh_.faceEdges()[facei]; const labelList& fEdges = mesh_.faceEdges()[facei];
label nextEdgeI = fEdges[findIndex(mesh_.faces()[facei], pointI)]; label nextEdgeI = fEdges[findIndex(mesh_.faces()[facei], pointi)];
if (edgeToDualPoint_[nextEdgeI] != -1) if (edgeToDualPoint_[nextEdgeI] != -1)
{ {
verts.append(edgeToDualPoint_[nextEdgeI]); verts.append(edgeToDualPoint_[nextEdgeI]);
@ -783,30 +783,30 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// Face centre // Face centre
verts.append(faceToDualPoint_[facei]); verts.append(faceToDualPoint_[facei]);
// Find edge before pointI on facei // Find edge before pointi on facei
const labelList& fEdges = mesh_.faceEdges()[facei]; const labelList& fEdges = mesh_.faceEdges()[facei];
const face& f = mesh_.faces()[facei]; const face& f = mesh_.faces()[facei];
label prevFp = f.rcIndex(findIndex(f, pointI)); label prevFp = f.rcIndex(findIndex(f, pointi));
label edgeI = fEdges[prevFp]; label edgeI = fEdges[prevFp];
if (edgeToDualPoint_[edgeI] != -1) if (edgeToDualPoint_[edgeI] != -1)
{ {
// Feature edge. Close any face so far. Note: uses face to // Feature edge. Close any face so far. Note: uses face to
// create dualFace from. Could use pointI instead. // create dualFace from. Could use pointi instead.
verts.append(edgeToDualPoint_[edgeI]); verts.append(edgeToDualPoint_[edgeI]);
addBoundaryFace addBoundaryFace
( (
-1, // masterPointI -1, // masterPointi
-1, // masterEdgeI -1, // masterEdgeI
facei, // masterFacei facei, // masterFacei
findDualCell(own[facei], pointI), findDualCell(own[facei], pointi),
patchi, patchi,
verts.shrink(), verts.shrink(),
meshMod meshMod
); );
verts.clear(); verts.clear();
verts.append(pointToDualPoint_[pointI]); verts.append(pointToDualPoint_[pointi]);
verts.append(edgeToDualPoint_[edgeI]); verts.append(edgeToDualPoint_[edgeI]);
} }
@ -838,13 +838,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
if (verts.size() > 2) if (verts.size() > 2)
{ {
// Note: face created from face, not from pointI // Note: face created from face, not from pointi
addBoundaryFace addBoundaryFace
( (
-1, // masterPointI -1, // masterPointi
-1, // masterEdgeI -1, // masterEdgeI
startFacei, // masterFacei startFacei, // masterFacei
findDualCell(own[facei], pointI), findDualCell(own[facei], pointi),
patchi, patchi,
verts.shrink(), verts.shrink(),
meshMod meshMod
@ -1007,7 +1007,7 @@ void Foam::meshDualiser::setRefinement
// Dual cells (from points) // Dual cells (from points)
// ~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~
// pointToDualCells_[pointI] // pointToDualCells_[pointi]
// - single entry : all cells surrounding point all become the same // - single entry : all cells surrounding point all become the same
// cell. // cell.
// - multiple entries: in order of pointCells. // - multiple entries: in order of pointCells.
@ -1016,21 +1016,21 @@ void Foam::meshDualiser::setRefinement
// feature points that become single cell // feature points that become single cell
forAll(singleCellFeaturePoints, i) forAll(singleCellFeaturePoints, i)
{ {
label pointI = singleCellFeaturePoints[i]; label pointi = singleCellFeaturePoints[i];
pointToDualPoint_[pointI] = meshMod.addPoint pointToDualPoint_[pointi] = meshMod.addPoint
( (
mesh_.points()[pointI], mesh_.points()[pointi],
pointI, // masterPoint pointi, // masterPoint
mesh_.pointZones().whichZone(pointI), // zoneID mesh_.pointZones().whichZone(pointi), // zoneID
true // inCell true // inCell
); );
// Generate single cell // Generate single cell
pointToDualCells_[pointI].setSize(1); pointToDualCells_[pointi].setSize(1);
pointToDualCells_[pointI][0] = meshMod.addCell pointToDualCells_[pointi][0] = meshMod.addCell
( (
pointI, //masterPointID, pointi, //masterPointID,
-1, //masterEdgeID, -1, //masterEdgeID,
-1, //masterFaceID, -1, //masterFaceID,
-1, //masterCellID, -1, //masterCellID,
@ -1038,43 +1038,43 @@ void Foam::meshDualiser::setRefinement
); );
if (dualCcStr.valid()) if (dualCcStr.valid())
{ {
meshTools::writeOBJ(dualCcStr(), mesh_.points()[pointI]); meshTools::writeOBJ(dualCcStr(), mesh_.points()[pointi]);
} }
} }
// feature points that become multiple cells // feature points that become multiple cells
forAll(multiCellFeaturePoints, i) forAll(multiCellFeaturePoints, i)
{ {
label pointI = multiCellFeaturePoints[i]; label pointi = multiCellFeaturePoints[i];
if (pointToDualCells_[pointI].size() > 0) if (pointToDualCells_[pointi].size() > 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Point " << pointI << " at:" << mesh_.points()[pointI] << "Point " << pointi << " at:" << mesh_.points()[pointi]
<< " is both in singleCellFeaturePoints" << " is both in singleCellFeaturePoints"
<< " and multiCellFeaturePoints." << " and multiCellFeaturePoints."
<< abort(FatalError); << abort(FatalError);
} }
pointToDualPoint_[pointI] = meshMod.addPoint pointToDualPoint_[pointi] = meshMod.addPoint
( (
mesh_.points()[pointI], mesh_.points()[pointi],
pointI, // masterPoint pointi, // masterPoint
mesh_.pointZones().whichZone(pointI), // zoneID mesh_.pointZones().whichZone(pointi), // zoneID
true // inCell true // inCell
); );
// Create dualcell for every cell connected to dual point // Create dualcell for every cell connected to dual point
const labelList& pCells = mesh_.pointCells()[pointI]; const labelList& pCells = mesh_.pointCells()[pointi];
pointToDualCells_[pointI].setSize(pCells.size()); pointToDualCells_[pointi].setSize(pCells.size());
forAll(pCells, pCelli) forAll(pCells, pCelli)
{ {
pointToDualCells_[pointI][pCelli] = meshMod.addCell pointToDualCells_[pointi][pCelli] = meshMod.addCell
( (
pointI, //masterPointID pointi, //masterPointID
-1, //masterEdgeID -1, //masterEdgeID
-1, //masterFaceID -1, //masterFaceID
-1, //masterCellID -1, //masterCellID
@ -1085,20 +1085,20 @@ void Foam::meshDualiser::setRefinement
meshTools::writeOBJ meshTools::writeOBJ
( (
dualCcStr(), dualCcStr(),
0.5*(mesh_.points()[pointI]+cellCentres[pCells[pCelli]]) 0.5*(mesh_.points()[pointi]+cellCentres[pCells[pCelli]])
); );
} }
} }
} }
// Normal points // Normal points
forAll(mesh_.points(), pointI) forAll(mesh_.points(), pointi)
{ {
if (pointToDualCells_[pointI].empty()) if (pointToDualCells_[pointi].empty())
{ {
pointToDualCells_[pointI].setSize(1); pointToDualCells_[pointi].setSize(1);
pointToDualCells_[pointI][0] = meshMod.addCell pointToDualCells_[pointi][0] = meshMod.addCell
( (
pointI, //masterPointID, pointi, //masterPointID,
-1, //masterEdgeID, -1, //masterEdgeID,
-1, //masterFaceID, -1, //masterFaceID,
-1, //masterCellID, -1, //masterCellID,
@ -1107,7 +1107,7 @@ void Foam::meshDualiser::setRefinement
if (dualCcStr.valid()) if (dualCcStr.valid())
{ {
meshTools::writeOBJ(dualCcStr(), mesh_.points()[pointI]); meshTools::writeOBJ(dualCcStr(), mesh_.points()[pointi]);
} }
} }
} }
@ -1396,9 +1396,9 @@ void Foam::meshDualiser::setRefinement
const labelListList& pointFaces = pp.pointFaces(); const labelListList& pointFaces = pp.pointFaces();
forAll(pointFaces, patchPointI) forAll(pointFaces, patchPointi)
{ {
const labelList& pFaces = pointFaces[patchPointI]; const labelList& pFaces = pointFaces[patchPointi];
boolList donePFaces(pFaces.size(), false); boolList donePFaces(pFaces.size(), false);
@ -1409,8 +1409,8 @@ void Foam::meshDualiser::setRefinement
// Starting face // Starting face
label startFacei = pp.start()+pFaces[i]; label startFacei = pp.start()+pFaces[i];
//Pout<< "Walking around point:" << pointI //Pout<< "Walking around point:" << pointi
// << " coord:" << mesh_.points()[pointI] // << " coord:" << mesh_.points()[pointi]
// << " on patch:" << patchi // << " on patch:" << patchi
// << " startFace:" << startFacei // << " startFace:" << startFacei
// << " at:" << mesh_.faceCentres()[startFacei] // << " at:" << mesh_.faceCentres()[startFacei]
@ -1419,7 +1419,7 @@ void Foam::meshDualiser::setRefinement
createFacesAroundBoundaryPoint createFacesAroundBoundaryPoint
( (
patchi, patchi,
patchPointI, patchPointi,
startFacei, startFacei,
meshMod, meshMod,
donePFaces // pFaces visited donePFaces // pFaces visited

View File

@ -94,14 +94,14 @@ class meshDualiser
static void dumpPolyTopoChange(const polyTopoChange&, const fileName&); static void dumpPolyTopoChange(const polyTopoChange&, const fileName&);
//- Find dual cell given point and cell //- Find dual cell given point and cell
label findDualCell(const label celli, const label pointI) const; label findDualCell(const label celli, const label pointi) const;
//- Helper function to generate dualpoints on all boundary edges //- Helper function to generate dualpoints on all boundary edges
// emanating from (boundary & feature) point // emanating from (boundary & feature) point
void generateDualBoundaryEdges void generateDualBoundaryEdges
( (
const PackedBoolList&, const PackedBoolList&,
const label pointI, const label pointi,
polyTopoChange& polyTopoChange&
); );
@ -109,13 +109,13 @@ class meshDualiser
bool sameDualCell bool sameDualCell
( (
const label facei, const label facei,
const label pointI const label pointi
) const; ) const;
//- Add internal face //- Add internal face
label addInternalFace label addInternalFace
( (
const label masterPointI, const label masterPointi,
const label masterEdgeI, const label masterEdgeI,
const label masterFacei, const label masterFacei,
@ -129,12 +129,12 @@ class meshDualiser
//- Add boundary face //- Add boundary face
label addBoundaryFace label addBoundaryFace
( (
const label masterPointI, const label masterPointi,
const label masterEdgeI, const label masterEdgeI,
const label masterFacei, const label masterFacei,
const label dualCelli, const label dualCelli,
const label patchI, const label patchi,
const DynamicList<label>& verts, const DynamicList<label>& verts,
polyTopoChange& meshMod polyTopoChange& meshMod
) const; ) const;
@ -158,11 +158,11 @@ class meshDualiser
polyTopoChange& polyTopoChange&
) const; ) const;
//- Creates boundary faces walking around point on patchI. //- Creates boundary faces walking around point on patchi.
void createFacesAroundBoundaryPoint void createFacesAroundBoundaryPoint
( (
const label patchI, const label patchi,
const label patchPointI, const label patchPointi,
const label startFacei, const label startFacei,
polyTopoChange&, polyTopoChange&,
boolList& donePFaces // pFaces visited boolList& donePFaces // pFaces visited

View File

@ -69,13 +69,13 @@ Foam::label Foam::regionSide::otherEdge
const primitiveMesh& mesh, const primitiveMesh& mesh,
const label facei, const label facei,
const label edgeI, const label edgeI,
const label pointI const label pointi
) )
{ {
const edge& e = mesh.edges()[edgeI]; const edge& e = mesh.edges()[edgeI];
// Get other point on edge. // Get other point on edge.
label freePointI = e.otherVertex(pointI); label freePointi = e.otherVertex(pointi);
const labelList& fEdges = mesh.faceEdges()[facei]; const labelList& fEdges = mesh.faceEdges()[facei];
@ -87,12 +87,12 @@ Foam::label Foam::regionSide::otherEdge
if if
( (
( (
otherE.start() == pointI otherE.start() == pointi
&& otherE.end() != freePointI && otherE.end() != freePointi
) )
|| ( || (
otherE.end() == pointI otherE.end() == pointi
&& otherE.start() != freePointI && otherE.start() != freePointi
) )
) )
{ {
@ -103,7 +103,7 @@ Foam::label Foam::regionSide::otherEdge
FatalErrorInFunction FatalErrorInFunction
<< "Cannot find other edge on face " << facei << " that uses point " << "Cannot find other edge on face " << facei << " that uses point "
<< pointI << " but not point " << freePointI << endl << pointi << " but not point " << freePointi << endl
<< "Edges on face:" << fEdges << "Edges on face:" << fEdges
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)() << " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
<< " Vertices on face:" << " Vertices on face:"
@ -214,7 +214,7 @@ void Foam::regionSide::visitConnectedFaces
} }
// From edge on face connected to point on region (regionPointI) cross // From edge on face connected to point on region (regionPointi) cross
// to all other edges using this point by walking across faces // to all other edges using this point by walking across faces
// Does not cross regionEdges so stays on one side // Does not cross regionEdges so stays on one side
// of region // of region
@ -222,7 +222,7 @@ void Foam::regionSide::walkPointConnectedFaces
( (
const primitiveMesh& mesh, const primitiveMesh& mesh,
const labelHashSet& regionEdges, const labelHashSet& regionEdges,
const label regionPointI, const label regionPointi,
const label startFacei, const label startFacei,
const label startEdgeI, const label startEdgeI,
labelHashSet& visitedEdges labelHashSet& visitedEdges
@ -233,15 +233,15 @@ void Foam::regionSide::walkPointConnectedFaces
if (debug) if (debug)
{ {
Info<< "walkPointConnectedFaces : regionPointI:" << regionPointI Info<< "walkPointConnectedFaces : regionPointi:" << regionPointi
<< " facei:" << startFacei << " facei:" << startFacei
<< " edgeI:" << startEdgeI << " verts:" << " edgeI:" << startEdgeI << " verts:"
<< mesh.edges()[startEdgeI] << mesh.edges()[startEdgeI]
<< endl; << endl;
} }
// Cross facei i.e. get edge not startEdgeI which uses regionPointI // Cross facei i.e. get edge not startEdgeI which uses regionPointi
label edgeI = otherEdge(mesh, startFacei, startEdgeI, regionPointI); label edgeI = otherEdge(mesh, startFacei, startEdgeI, regionPointi);
if (!regionEdges.found(edgeI)) if (!regionEdges.found(edgeI))
{ {
@ -271,7 +271,7 @@ void Foam::regionSide::walkPointConnectedFaces
( (
mesh, mesh,
regionEdges, regionEdges,
regionPointI, regionPointi,
facei, facei,
edgeI, edgeI,
visitedEdges visitedEdges

View File

@ -79,7 +79,7 @@ class regionSide
const primitiveMesh& mesh, const primitiveMesh& mesh,
const label facei, const label facei,
const label edgeI, const label edgeI,
const label pointI const label pointi
); );
//- From facei, side celli, cross to other faces/cells by //- From facei, side celli, cross to other faces/cells by
@ -94,14 +94,14 @@ class regionSide
labelHashSet& visitedFace labelHashSet& visitedFace
); );
//- From edge on face connected to point on region (regionPointI) cross //- From edge on face connected to point on region (regionPointi) cross
// to all other edges using this point by walking across faces // to all other edges using this point by walking across faces
// Does not cross regionEdges so stays on one side of region // Does not cross regionEdges so stays on one side of region
void walkPointConnectedFaces void walkPointConnectedFaces
( (
const primitiveMesh& mesh, const primitiveMesh& mesh,
const labelHashSet& regionEdges, const labelHashSet& regionEdges,
const label regionPointI, const label regionPointi,
const label startFacei, const label startFacei,
const label startEdgeI, const label startEdgeI,
labelHashSet& visitedEdges labelHashSet& visitedEdges

View File

@ -241,15 +241,15 @@ int main(int argc, char *argv[])
// Create mesh subsetting engine // Create mesh subsetting engine
fvMeshSubset subsetter(mesh); fvMeshSubset subsetter(mesh);
label patchI = -1; label patchi = -1;
if (args.optionFound("patch")) if (args.optionFound("patch"))
{ {
const word patchName = args["patch"]; const word patchName = args["patch"];
patchI = mesh.boundaryMesh().findPatchID(patchName); patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchI == -1) if (patchi == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< nl << "Valid patches are " << mesh.boundaryMesh().names() << nl << "Valid patches are " << mesh.boundaryMesh().names()
@ -269,7 +269,7 @@ int main(int argc, char *argv[])
cellSet currentSet(mesh, setName); cellSet currentSet(mesh, setName);
subsetter.setLargeCellSubset(currentSet, patchI, true); subsetter.setLargeCellSubset(currentSet, patchi, true);
IOobjectList objects(mesh, runTime.timeName()); IOobjectList objects(mesh, runTime.timeName());

View File

@ -46,14 +46,14 @@ namespace Foam
void outputFieldList void outputFieldList
( (
const PtrList<GeoField>& fieldList, const PtrList<GeoField>& fieldList,
const label patchI const label patchi
); );
template<class GeoField> template<class GeoField>
void collectFieldList void collectFieldList
( (
const PtrList<GeoField>& fieldList, const PtrList<GeoField>& fieldList,
const label patchI, const label patchi,
HashTable<word>& fieldToType HashTable<word>& fieldToType
); );
} // End namespace Foam } // End namespace Foam

View File

@ -250,24 +250,24 @@ autoPtr<mapPolyMesh> mergeSharedPoints
forAll(constructMap, i) forAll(constructMap, i)
{ {
label oldPointI = constructMap[i]; label oldPointi = constructMap[i];
// New label of point after changeMesh. // New label of point after changeMesh.
label newPointI = map().reversePointMap()[oldPointI]; label newPointi = map().reversePointMap()[oldPointi];
if (newPointI < -1) if (newPointi < -1)
{ {
constructMap[i] = -newPointI-2; constructMap[i] = -newPointi-2;
} }
else if (newPointI >= 0) else if (newPointi >= 0)
{ {
constructMap[i] = newPointI; constructMap[i] = newPointi;
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. oldPointI:" << oldPointI << "Problem. oldPointi:" << oldPointi
<< " newPointI:" << newPointI << abort(FatalError); << " newPointi:" << newPointi << abort(FatalError);
} }
} }
} }

View File

@ -529,9 +529,9 @@ void Foam::ensightMesh::writePrims
List<int> temp(cellPoints.size()); List<int> temp(cellPoints.size());
forAll(cellPoints, pointI) forAll(cellPoints, pointi)
{ {
temp[pointI] = cellPoints[pointI] + 1; temp[pointi] = cellPoints[pointi] + 1;
} }
ensightGeometryFile.write(temp); ensightGeometryFile.write(temp);
} }
@ -548,9 +548,9 @@ void Foam::ensightMesh::writePrims
{ {
const cellShape& cellPoints = cellShapes[i]; const cellShape& cellPoints = cellShapes[i];
forAll(cellPoints, pointI) forAll(cellPoints, pointi)
{ {
temp[n] = cellPoints[pointI] + 1; temp[n] = cellPoints[pointi] + 1;
n++; n++;
} }
} }
@ -639,15 +639,15 @@ void Foam::ensightMesh::writePolysPoints
// EnSight prefers to have all the faces of an nfaced cell // EnSight prefers to have all the faces of an nfaced cell
// oriented in the same way. // oriented in the same way.
List<int> temp(np); List<int> temp(np);
forAll(f, pointI) forAll(f, pointi)
{ {
if (reverseOrder) if (reverseOrder)
{ {
temp[np-1-pointI] = f[pointI] + 1; temp[np-1-pointi] = f[pointi] + 1;
} }
else else
{ {
temp[pointI] = f[pointI] + 1; temp[pointi] = f[pointi] + 1;
} }
} }
ensightGeometryFile.write(temp); ensightGeometryFile.write(temp);
@ -833,9 +833,9 @@ void Foam::ensightMesh::writeFacePrims
const face& patchFace = patchFaces[i]; const face& patchFace = patchFaces[i];
List<int> temp(patchFace.size()); List<int> temp(patchFace.size());
forAll(patchFace, pointI) forAll(patchFace, pointi)
{ {
temp[pointI] = patchFace[pointI] + 1; temp[pointi] = patchFace[pointi] + 1;
} }
ensightGeometryFile.write(temp); ensightGeometryFile.write(temp);

View File

@ -124,7 +124,7 @@ public:
( (
const bool nearCellValue, const bool nearCellValue,
const GeometricField<Type, fvPatchField, volMesh>& vfld, const GeometricField<Type, fvPatchField, volMesh>& vfld,
const label patchI const label patchi
) const; ) const;
//- Get mixed field: fvsPatchField for boundary faces and //- Get mixed field: fvsPatchField for boundary faces and

View File

@ -95,14 +95,14 @@ void ReadAndMapFields
// Map from read field. Set unmapped entries to nullValue. // Map from read field. Set unmapped entries to nullValue.
fld.setSize(map.size(), nullValue); fld.setSize(map.size(), nullValue);
forAll(map, pointI) forAll(map, pointi)
{ {
label index = map[pointI]; label index = map[pointi];
if (index > 0) if (index > 0)
{ {
label celli = index-1; label celli = index-1;
fld[pointI] = readField[celli]; fld[pointi] = readField[celli];
} }
else if (index < 0) else if (index < 0)
{ {
@ -115,7 +115,7 @@ void ReadAndMapFields
( (
facei facei
); );
fld[pointI] = readField.boundaryField()[patchi][localFacei]; fld[pointi] = readField.boundaryField()[patchi][localFacei];
} }
//else //else
//{ //{
@ -128,8 +128,8 @@ void ReadAndMapFields
//else //else
//{ //{
// WarningInFunction // WarningInFunction
// << "Point " << pointI << " at " // << "Point " << pointi << " at "
// << tetDualMesh.points()[pointI] // << tetDualMesh.points()[pointi]
// << " has no dual correspondence." << endl; // << " has no dual correspondence." << endl;
//} //}
} }
@ -200,9 +200,9 @@ int main(int argc, char *argv[])
label nCells = 0; label nCells = 0;
label nPatchFaces = 0; label nPatchFaces = 0;
label nUnmapped = 0; label nUnmapped = 0;
forAll(pointDualAddressing, pointI) forAll(pointDualAddressing, pointi)
{ {
label index = pointDualAddressing[pointI]; label index = pointDualAddressing[pointi];
if (index > 0) if (index > 0)
{ {

View File

@ -120,7 +120,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
cellTypes_.setSize(cellShapes.size() + nAddCells); cellTypes_.setSize(cellShapes.size() + nAddCells);
// Set counters for additional points and additional cells // Set counters for additional points and additional cells
label addPointI = 0, addCelli = 0; label addPointi = 0, addCelli = 0;
forAll(cellShapes, celli) forAll(cellShapes, celli)
{ {
@ -191,10 +191,10 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
// Polyhedral cell. Decompose into tets + pyramids. // Polyhedral cell. Decompose into tets + pyramids.
// Mapping from additional point to cell // Mapping from additional point to cell
addPointCellLabels_[addPointI] = celli; addPointCellLabels_[addPointi] = celli;
// The new vertex from the cell-centre // The new vertex from the cell-centre
const label newVertexLabel = mesh_.nPoints() + addPointI; const label newVertexLabel = mesh_.nPoints() + addPointi;
// Whether to insert cell in place of original or not. // Whether to insert cell in place of original or not.
bool substituteCell = true; bool substituteCell = true;
@ -305,7 +305,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
} }
} }
addPointI++; addPointi++;
} }
else else
{ {

View File

@ -158,7 +158,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
vtkmesh->Allocate(mesh.nCells() + nAddCells); vtkmesh->Allocate(mesh.nCells() + nAddCells);
// Set counters for additional points and additional cells // Set counters for additional points and additional cells
label addPointI = 0, addCelli = 0; label addPointi = 0, addCelli = 0;
// Create storage for points - needed for mapping from OpenFOAM to VTK // Create storage for points - needed for mapping from OpenFOAM to VTK
// data types - max 'order' = hex = 8 points // data types - max 'order' = hex = 8 points
@ -353,10 +353,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// Polyhedral cell. Decompose into tets + prisms. // Polyhedral cell. Decompose into tets + prisms.
// Mapping from additional point to cell // Mapping from additional point to cell
addPointCellLabels[addPointI] = celli; addPointCellLabels[addPointi] = celli;
// The new vertex from the cell-centre // The new vertex from the cell-centre
const label newVertexLabel = mesh.nPoints() + addPointI; const label newVertexLabel = mesh.nPoints() + addPointi;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[celli]); vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[celli]);
// Whether to insert cell in place of original or not. // Whether to insert cell in place of original or not.
@ -460,7 +460,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
} }
} }
addPointI++; addPointi++;
} }
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -54,9 +54,9 @@ vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
vtkPoints* vtkpoints = vtkPoints::New(); vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(pointLabels.size()); vtkpoints->Allocate(pointLabels.size());
forAll(pointLabels, pointI) forAll(pointLabels, pointi)
{ {
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointI]]); vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointi]]);
} }
vtkmesh->SetPoints(vtkpoints); vtkmesh->SetPoints(vtkpoints);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -252,9 +252,9 @@ Foam::vtkPV3blockMesh::~vtkPV3blockMesh()
// Hmm. pointNumberTextActors are not getting removed // Hmm. pointNumberTextActors are not getting removed
// //
forAll(pointNumberTextActorsPtrs_, pointI) forAll(pointNumberTextActorsPtrs_, pointi)
{ {
pointNumberTextActorsPtrs_[pointI]->Delete(); pointNumberTextActorsPtrs_[pointi]->Delete();
} }
pointNumberTextActorsPtrs_.clear(); pointNumberTextActorsPtrs_.clear();
@ -420,10 +420,10 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
{ {
// always remove old actors first // always remove old actors first
forAll(pointNumberTextActorsPtrs_, pointI) forAll(pointNumberTextActorsPtrs_, pointi)
{ {
renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointI]); renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointi]);
pointNumberTextActorsPtrs_[pointI]->Delete(); pointNumberTextActorsPtrs_[pointi]->Delete();
} }
pointNumberTextActorsPtrs_.clear(); pointNumberTextActorsPtrs_.clear();
@ -433,11 +433,11 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
const scalar scaleFactor = meshPtr_->scaleFactor(); const scalar scaleFactor = meshPtr_->scaleFactor();
pointNumberTextActorsPtrs_.setSize(cornerPts.size()); pointNumberTextActorsPtrs_.setSize(cornerPts.size());
forAll(cornerPts, pointI) forAll(cornerPts, pointi)
{ {
vtkTextActor* txt = vtkTextActor::New(); vtkTextActor* txt = vtkTextActor::New();
txt->SetInput(Foam::name(pointI).c_str()); txt->SetInput(Foam::name(pointi).c_str());
// Set text properties // Set text properties
vtkTextProperty* tprop = txt->GetTextProperty(); vtkTextProperty* tprop = txt->GetTextProperty();
@ -454,9 +454,9 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
txt->GetPositionCoordinate()->SetValue txt->GetPositionCoordinate()->SetValue
( (
cornerPts[pointI].x()*scaleFactor, cornerPts[pointi].x()*scaleFactor,
cornerPts[pointI].y()*scaleFactor, cornerPts[pointi].y()*scaleFactor,
cornerPts[pointI].z()*scaleFactor cornerPts[pointi].z()*scaleFactor
); );
// Add text to each renderer // Add text to each renderer
@ -464,7 +464,7 @@ void Foam::vtkPV3blockMesh::renderPointNumbers
// Maintain a list of text labels added so that they can be // Maintain a list of text labels added so that they can be
// removed later // removed later
pointNumberTextActorsPtrs_[pointI] = txt; pointNumberTextActorsPtrs_[pointi] = txt;
} }
} }
} }

View File

@ -158,7 +158,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
vtkmesh->Allocate(mesh.nCells() + nAddCells); vtkmesh->Allocate(mesh.nCells() + nAddCells);
// Set counters for additional points and additional cells // Set counters for additional points and additional cells
label addPointI = 0, addCelli = 0; label addPointi = 0, addCelli = 0;
// Create storage for points - needed for mapping from OpenFOAM to VTK // Create storage for points - needed for mapping from OpenFOAM to VTK
// data types - max 'order' = hex = 8 points // data types - max 'order' = hex = 8 points
@ -353,10 +353,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
// Polyhedral cell. Decompose into tets + prisms. // Polyhedral cell. Decompose into tets + prisms.
// Mapping from additional point to cell // Mapping from additional point to cell
addPointCellLabels[addPointI] = celli; addPointCellLabels[addPointi] = celli;
// The new vertex from the cell-centre // The new vertex from the cell-centre
const label newVertexLabel = mesh.nPoints() + addPointI; const label newVertexLabel = mesh.nPoints() + addPointi;
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[celli]); vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[celli]);
// Whether to insert cell in place of original or not. // Whether to insert cell in place of original or not.
@ -460,7 +460,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
} }
} }
addPointI++; addPointi++;
} }
} }

View File

@ -54,9 +54,9 @@ vtkPolyData* Foam::vtkPVFoam::pointZoneVTKMesh
vtkPoints* vtkpoints = vtkPoints::New(); vtkPoints* vtkpoints = vtkPoints::New();
vtkpoints->Allocate(pointLabels.size()); vtkpoints->Allocate(pointLabels.size());
forAll(pointLabels, pointI) forAll(pointLabels, pointi)
{ {
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointI]]); vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointi]]);
} }
vtkmesh->SetPoints(vtkpoints); vtkmesh->SetPoints(vtkpoints);

View File

@ -252,9 +252,9 @@ Foam::vtkPVblockMesh::~vtkPVblockMesh()
// Hmm. pointNumberTextActors are not getting removed // Hmm. pointNumberTextActors are not getting removed
// //
forAll(pointNumberTextActorsPtrs_, pointI) forAll(pointNumberTextActorsPtrs_, pointi)
{ {
pointNumberTextActorsPtrs_[pointI]->Delete(); pointNumberTextActorsPtrs_[pointi]->Delete();
} }
pointNumberTextActorsPtrs_.clear(); pointNumberTextActorsPtrs_.clear();
@ -420,10 +420,10 @@ void Foam::vtkPVblockMesh::renderPointNumbers
{ {
// always remove old actors first // always remove old actors first
forAll(pointNumberTextActorsPtrs_, pointI) forAll(pointNumberTextActorsPtrs_, pointi)
{ {
renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointI]); renderer->RemoveViewProp(pointNumberTextActorsPtrs_[pointi]);
pointNumberTextActorsPtrs_[pointI]->Delete(); pointNumberTextActorsPtrs_[pointi]->Delete();
} }
pointNumberTextActorsPtrs_.clear(); pointNumberTextActorsPtrs_.clear();
@ -433,11 +433,11 @@ void Foam::vtkPVblockMesh::renderPointNumbers
const scalar scaleFactor = meshPtr_->scaleFactor(); const scalar scaleFactor = meshPtr_->scaleFactor();
pointNumberTextActorsPtrs_.setSize(cornerPts.size()); pointNumberTextActorsPtrs_.setSize(cornerPts.size());
forAll(cornerPts, pointI) forAll(cornerPts, pointi)
{ {
vtkTextActor* txt = vtkTextActor::New(); vtkTextActor* txt = vtkTextActor::New();
txt->SetInput(Foam::name(pointI).c_str()); txt->SetInput(Foam::name(pointi).c_str());
// Set text properties // Set text properties
vtkTextProperty* tprop = txt->GetTextProperty(); vtkTextProperty* tprop = txt->GetTextProperty();
@ -454,9 +454,9 @@ void Foam::vtkPVblockMesh::renderPointNumbers
txt->GetPositionCoordinate()->SetValue txt->GetPositionCoordinate()->SetValue
( (
cornerPts[pointI].x()*scaleFactor, cornerPts[pointi].x()*scaleFactor,
cornerPts[pointI].y()*scaleFactor, cornerPts[pointi].y()*scaleFactor,
cornerPts[pointI].z()*scaleFactor cornerPts[pointi].z()*scaleFactor
); );
// Add text to each renderer // Add text to each renderer
@ -464,7 +464,7 @@ void Foam::vtkPVblockMesh::renderPointNumbers
// Maintain a list of text labels added so that they can be // Maintain a list of text labels added so that they can be
// removed later // removed later
pointNumberTextActorsPtrs_[pointI] = txt; pointNumberTextActorsPtrs_[pointi] = txt;
} }
} }
} }

View File

@ -120,9 +120,9 @@ int main(int argc, char *argv[])
); );
labelList visitedPoint(mesh.nPoints()); labelList visitedPoint(mesh.nPoints());
forAll(visitedPoint, pointI) forAll(visitedPoint, pointi)
{ {
visitedPoint[pointI] = 0; visitedPoint[pointi] = 0;
} }
label nVisited = 0; label nVisited = 0;
label nVisitedOld = 0; label nVisitedOld = 0;
@ -166,9 +166,9 @@ int main(int argc, char *argv[])
// Zero flux face found // Zero flux face found
found = true; found = true;
forAll(zeroPoints, pointI) forAll(zeroPoints, pointi)
{ {
if (visitedPoint[zeroPoints[pointI]] == 1) if (visitedPoint[zeroPoints[pointi]] == 1)
{ {
found = false; found = false;
break; break;
@ -180,10 +180,10 @@ int main(int argc, char *argv[])
Info<< "Zero face: patch: " << patchi Info<< "Zero face: patch: " << patchi
<< " face: " << facei << endl; << " face: " << facei << endl;
forAll(zeroPoints, pointI) forAll(zeroPoints, pointi)
{ {
streamFunction[zeroPoints[pointI]] = 0; streamFunction[zeroPoints[pointi]] = 0;
visitedPoint[zeroPoints[pointI]] = 1; visitedPoint[zeroPoints[pointi]] = 1;
nVisited++; nVisited++;
} }
@ -210,9 +210,9 @@ int main(int argc, char *argv[])
bool found = true; bool found = true;
forAll(zeroPoints, pointI) forAll(zeroPoints, pointi)
{ {
if (visitedPoint[zeroPoints[pointI]] == 1) if (visitedPoint[zeroPoints[pointi]] == 1)
{ {
found = false; found = false;
break; break;
@ -221,10 +221,10 @@ int main(int argc, char *argv[])
if (found) if (found)
{ {
forAll(zeroPoints, pointI) forAll(zeroPoints, pointi)
{ {
streamFunction[zeroPoints[pointI]] = 0.0; streamFunction[zeroPoints[pointi]] = 0.0;
visitedPoint[zeroPoints[pointI]] = 1; visitedPoint[zeroPoints[pointi]] = 1;
nVisited++; nVisited++;
} }
@ -261,16 +261,16 @@ int main(int argc, char *argv[])
scalar currentBStream = 0.0; scalar currentBStream = 0.0;
vector currentBStreamPoint(0, 0, 0); vector currentBStreamPoint(0, 0, 0);
forAll(curBPoints, pointI) forAll(curBPoints, pointi)
{ {
// Check if the point has been visited // Check if the point has been visited
if (visitedPoint[curBPoints[pointI]] == 1) if (visitedPoint[curBPoints[pointi]] == 1)
{ {
// The point has been visited // The point has been visited
currentBStream = currentBStream =
streamFunction[curBPoints[pointI]]; streamFunction[curBPoints[pointi]];
currentBStreamPoint = currentBStreamPoint =
points[curBPoints[pointI]]; points[curBPoints[pointi]];
bPointFound = true; bPointFound = true;
@ -281,10 +281,10 @@ int main(int argc, char *argv[])
if (bPointFound) if (bPointFound)
{ {
// Sort out other points on the face // Sort out other points on the face
forAll(curBPoints, pointI) forAll(curBPoints, pointi)
{ {
// Check if the point has been visited // Check if the point has been visited
if (visitedPoint[curBPoints[pointI]] == 0) if (visitedPoint[curBPoints[pointi]] == 0)
{ {
label patchNo = label patchNo =
mesh.boundaryMesh().whichPatch(facei); mesh.boundaryMesh().whichPatch(facei);
@ -306,7 +306,7 @@ int main(int argc, char *argv[])
.whichFace(facei); .whichFace(facei);
vector edgeHat = vector edgeHat =
points[curBPoints[pointI]] points[curBPoints[pointi]]
- currentBStreamPoint; - currentBStreamPoint;
edgeHat.replace(slabDir, 0); edgeHat.replace(slabDir, 0);
edgeHat /= mag(edgeHat); edgeHat /= mag(edgeHat);
@ -315,11 +315,11 @@ int main(int argc, char *argv[])
if (edgeHat.y() > VSMALL) if (edgeHat.y() > VSMALL)
{ {
visitedPoint[curBPoints[pointI]] = visitedPoint[curBPoints[pointi]] =
1; 1;
nVisited++; nVisited++;
streamFunction[curBPoints[pointI]] streamFunction[curBPoints[pointi]]
= =
currentBStream currentBStream
+ phi.boundaryField() + phi.boundaryField()
@ -328,11 +328,11 @@ int main(int argc, char *argv[])
} }
else if (edgeHat.y() < -VSMALL) else if (edgeHat.y() < -VSMALL)
{ {
visitedPoint[curBPoints[pointI]] = visitedPoint[curBPoints[pointi]] =
1; 1;
nVisited++; nVisited++;
streamFunction[curBPoints[pointI]] streamFunction[curBPoints[pointi]]
= =
currentBStream currentBStream
- phi.boundaryField() - phi.boundaryField()
@ -344,11 +344,11 @@ int main(int argc, char *argv[])
if (edgeHat.x() > VSMALL) if (edgeHat.x() > VSMALL)
{ {
visitedPoint visitedPoint
[curBPoints[pointI]] = 1; [curBPoints[pointi]] = 1;
nVisited++; nVisited++;
streamFunction streamFunction
[curBPoints[pointI]] = [curBPoints[pointi]] =
currentBStream currentBStream
+ phi.boundaryField() + phi.boundaryField()
[patchNo][faceNo] [patchNo][faceNo]
@ -357,11 +357,11 @@ int main(int argc, char *argv[])
else if (edgeHat.x() < -VSMALL) else if (edgeHat.x() < -VSMALL)
{ {
visitedPoint visitedPoint
[curBPoints[pointI]] = 1; [curBPoints[pointi]] = 1;
nVisited++; nVisited++;
streamFunction streamFunction
[curBPoints[pointI]] = [curBPoints[pointi]] =
currentBStream currentBStream
- phi.boundaryField() - phi.boundaryField()
[patchNo][faceNo] [patchNo][faceNo]
@ -388,16 +388,16 @@ int main(int argc, char *argv[])
scalar currentStream = 0.0; scalar currentStream = 0.0;
point currentStreamPoint(0, 0, 0); point currentStreamPoint(0, 0, 0);
forAll(curPoints, pointI) forAll(curPoints, pointi)
{ {
// Check if the point has been visited // Check if the point has been visited
if (visitedPoint[curPoints[pointI]] == 1) if (visitedPoint[curPoints[pointi]] == 1)
{ {
// The point has been visited // The point has been visited
currentStream = currentStream =
streamFunction[curPoints[pointI]]; streamFunction[curPoints[pointi]];
currentStreamPoint = currentStreamPoint =
points[curPoints[pointI]]; points[curPoints[pointi]];
pointFound = true; pointFound = true;
break; break;
@ -407,13 +407,13 @@ int main(int argc, char *argv[])
if (pointFound) if (pointFound)
{ {
// Sort out other points on the face // Sort out other points on the face
forAll(curPoints, pointI) forAll(curPoints, pointi)
{ {
// Check if the point has been visited // Check if the point has been visited
if (visitedPoint[curPoints[pointI]] == 0) if (visitedPoint[curPoints[pointi]] == 0)
{ {
vector edgeHat = vector edgeHat =
points[curPoints[pointI]] points[curPoints[pointi]]
- currentStreamPoint; - currentStreamPoint;
edgeHat.replace(slabDir, 0); edgeHat.replace(slabDir, 0);
@ -423,19 +423,19 @@ int main(int argc, char *argv[])
if (edgeHat.y() > VSMALL) if (edgeHat.y() > VSMALL)
{ {
visitedPoint[curPoints[pointI]] = 1; visitedPoint[curPoints[pointi]] = 1;
nVisited++; nVisited++;
streamFunction[curPoints[pointI]] = streamFunction[curPoints[pointi]] =
currentStream currentStream
+ phi[facei]*sign(nHat.x()); + phi[facei]*sign(nHat.x());
} }
else if (edgeHat.y() < -VSMALL) else if (edgeHat.y() < -VSMALL)
{ {
visitedPoint[curPoints[pointI]] = 1; visitedPoint[curPoints[pointi]] = 1;
nVisited++; nVisited++;
streamFunction[curPoints[pointI]] = streamFunction[curPoints[pointi]] =
currentStream currentStream
- phi[facei]*sign(nHat.x()); - phi[facei]*sign(nHat.x());
} }

View File

@ -133,12 +133,12 @@ int main(int argc, char *argv[])
Info<< "Additional Points:" << extraPoints.size() << endl; Info<< "Additional Points:" << extraPoints.size() << endl;
vectorField pointsAll(points1); vectorField pointsAll(points1);
label pointI = pointsAll.size(); label pointi = pointsAll.size();
pointsAll.setSize(pointsAll.size() + extraPoints.size()); pointsAll.setSize(pointsAll.size() + extraPoints.size());
forAll(extraPoints, i) forAll(extraPoints, i)
{ {
pointsAll[pointI++] = extraPoints[i]; pointsAll[pointi++] = extraPoints[i];
} }
combinedSurf = triSurface(surface1, surface1.patches(), pointsAll); combinedSurf = triSurface(surface1, surface1.patches(), pointsAll);

View File

@ -766,9 +766,9 @@ int main(int argc, char *argv[])
// Info<< "Writing edges of intersection to selfInter.obj" << endl; // Info<< "Writing edges of intersection to selfInter.obj" << endl;
// //
// OFstream intStream("selfInter.obj"); // OFstream intStream("selfInter.obj");
// forAll(inter.cutPoints(), cutPointI) // forAll(inter.cutPoints(), cutPointi)
// { // {
// const point& pt = inter.cutPoints()[cutPointI]; // const point& pt = inter.cutPoints()[cutPointi];
// //
// intStream << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() // intStream << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z()
// << endl; // << endl;

View File

@ -70,13 +70,13 @@ int main(int argc, char *argv[])
label minIndex = -1; label minIndex = -1;
scalar minDist = GREAT; scalar minDist = GREAT;
forAll(localPoints, pointI) forAll(localPoints, pointi)
{ {
const scalar dist = mag(localPoints[pointI] - samplePt); const scalar dist = mag(localPoints[pointi] - samplePt);
if (dist < minDist) if (dist < minDist)
{ {
minDist = dist; minDist = dist;
minIndex = pointI; minIndex = pointi;
} }
} }

View File

@ -44,13 +44,13 @@ Usage
using namespace Foam; using namespace Foam;
// Split facei along edgeI at position newPointI // Split facei along edgeI at position newPointi
void greenRefine void greenRefine
( (
const triSurface& surf, const triSurface& surf,
const label facei, const label facei,
const label edgeI, const label edgeI,
const label newPointI, const label newPointi,
DynamicList<labelledTri>& newFaces DynamicList<labelledTri>& newFaces
) )
{ {
@ -71,7 +71,7 @@ void greenRefine
labelledTri labelledTri
( (
f[fp0], f[fp0],
newPointI, newPointi,
f[fp2], f[fp2],
f.region() f.region()
) )
@ -80,7 +80,7 @@ void greenRefine
( (
labelledTri labelledTri
( (
newPointI, newPointi,
f[fp1], f[fp1],
f[fp2], f[fp2],
f.region() f.region()
@ -94,7 +94,7 @@ void greenRefine
labelledTri labelledTri
( (
f[fp2], f[fp2],
newPointI, newPointi,
f[fp1], f[fp1],
f.region() f.region()
) )
@ -103,7 +103,7 @@ void greenRefine
( (
labelledTri labelledTri
( (
newPointI, newPointi,
f[fp0], f[fp0],
f[fp1], f[fp1],
f.region() f.region()
@ -383,14 +383,14 @@ int main(int argc, char *argv[])
const labelListList& pointEdges = surf.pointEdges(); const labelListList& pointEdges = surf.pointEdges();
forAll(bPointsTobEdges, bPointI) forAll(bPointsTobEdges, bPointi)
{ {
pointIndexHit& nearestHit = bPointsTobEdges[bPointI]; pointIndexHit& nearestHit = bPointsTobEdges[bPointi];
const label pointI = surf.boundaryPoints()[bPointI]; const label pointi = surf.boundaryPoints()[bPointi];
const point& samplePt = surf.localPoints()[pointI]; const point& samplePt = surf.localPoints()[pointi];
const labelList& pEdges = pointEdges[pointI]; const labelList& pEdges = pointEdges[pointi];
// Add edges connected to the edge to the shapeMask // Add edges connected to the edge to the shapeMask
DynamicList<label> shapeMask; DynamicList<label> shapeMask;
@ -428,7 +428,7 @@ int main(int argc, char *argv[])
) )
{ {
nearestHit = currentHit; nearestHit = currentHit;
bPointsHitTree[bPointI] = treeI; bPointsHitTree[bPointi] = treeI;
} }
} }
@ -441,7 +441,7 @@ int main(int argc, char *argv[])
// ( // (
// surf, // surf,
// nearestHit.index(), // nearestHit.index(),
// pointI, // pointi,
// 30 // 30
// ); // );
@ -452,20 +452,20 @@ int main(int argc, char *argv[])
} }
} }
forAll(bPointsTobEdges, bPointI) forAll(bPointsTobEdges, bPointi)
{ {
const pointIndexHit& eHit = bPointsTobEdges[bPointI]; const pointIndexHit& eHit = bPointsTobEdges[bPointi];
if (eHit.hit()) if (eHit.hit())
{ {
const label hitSurfI = bPointsHitTree[bPointI]; const label hitSurfI = bPointsHitTree[bPointi];
const triSurface& hitSurf = newSurfaces[hitSurfI]; const triSurface& hitSurf = newSurfaces[hitSurfI];
const label eIndex = const label eIndex =
treeBoundaryEdges[hitSurfI][eHit.index()]; treeBoundaryEdges[hitSurfI][eHit.index()];
const edge& e = hitSurf.edges()[eIndex]; const edge& e = hitSurf.edges()[eIndex];
const label pointI = surf.boundaryPoints()[bPointI]; const label pointi = surf.boundaryPoints()[bPointi];
const labelList& eFaces = hitSurf.edgeFaces()[eIndex]; const labelList& eFaces = hitSurf.edgeFaces()[eIndex];
@ -487,7 +487,7 @@ int main(int argc, char *argv[])
DynamicList<labelledTri> newFacesFromSplit(2); DynamicList<labelledTri> newFacesFromSplit(2);
const point& pt = surf.localPoints()[pointI]; const point& pt = surf.localPoints()[pointi];
if if
( (
@ -506,17 +506,17 @@ int main(int argc, char *argv[])
nChanged++; nChanged++;
label newPointI = -1; label newPointi = -1;
// Keep the points in the same place and move the edge // Keep the points in the same place and move the edge
if (hitSurfI == surfI) if (hitSurfI == surfI)
{ {
newPointI = pointI; newPointi = pointi;
} }
else else
{ {
newPoints[hitSurfI].append(newPoints[surfI][pointI]); newPoints[hitSurfI].append(newPoints[surfI][pointi]);
newPointI = newPoints[hitSurfI].size() - 1; newPointi = newPoints[hitSurfI].size() - 1;
} }
// Split the other face. // Split the other face.
@ -525,7 +525,7 @@ int main(int argc, char *argv[])
hitSurf, hitSurf,
facei, facei,
eIndex, eIndex,
newPointI, newPointi,
newFacesFromSplit newFacesFromSplit
); );

View File

@ -82,11 +82,11 @@ void dumpPoints(const triSurface& surf, const labelList& borderPoint)
OFstream os(fName); OFstream os(fName);
forAll(borderPoint, pointI) forAll(borderPoint, pointi)
{ {
if (borderPoint[pointI] != -1) if (borderPoint[pointi] != -1)
{ {
const point& pt = surf.localPoints()[pointI]; const point& pt = surf.localPoints()[pointi];
os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; os << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
} }
@ -211,9 +211,9 @@ label markBorderPoints
const labelListList& pointEdges = surf.pointEdges(); const labelListList& pointEdges = surf.pointEdges();
forAll(pointEdges, pointI) forAll(pointEdges, pointi)
{ {
const labelList& pEdges = pointEdges[pointI]; const labelList& pEdges = pointEdges[pointi];
label nBorderEdges = 0; label nBorderEdges = 0;
@ -225,9 +225,9 @@ label markBorderPoints
} }
} }
if (nBorderEdges == 2 && borderPoint[pointI] == -1) if (nBorderEdges == 2 && borderPoint[pointi] == -1)
{ {
borderPoint[pointI] = nPoints++; borderPoint[pointi] = nPoints++;
} }
} }
@ -242,13 +242,13 @@ label markBorderPoints
} }
// Get minumum length of edges connected to pointI // Get minumum length of edges connected to pointi
// Serves to get some local length scale. // Serves to get some local length scale.
scalar minEdgeLen(const triSurface& surf, const label pointI) scalar minEdgeLen(const triSurface& surf, const label pointi)
{ {
const pointField& points = surf.localPoints(); const pointField& points = surf.localPoints();
const labelList& pEdges = surf.pointEdges()[pointI]; const labelList& pEdges = surf.pointEdges()[pointi];
scalar minLen = GREAT; scalar minLen = GREAT;
@ -308,13 +308,13 @@ label findEdge
} }
// Get the other edge connected to pointI on facei. // Get the other edge connected to pointi on facei.
label otherEdge label otherEdge
( (
const triSurface& surf, const triSurface& surf,
const label facei, const label facei,
const label otherEdgeI, const label otherEdgeI,
const label pointI const label pointi
) )
{ {
const labelList& fEdges = surf.faceEdges()[facei]; const labelList& fEdges = surf.faceEdges()[facei];
@ -329,8 +329,8 @@ label otherEdge
( (
edgeI != otherEdgeI edgeI != otherEdgeI
&& ( && (
e.start() == pointI e.start() == pointi
|| e.end() == pointI || e.end() == pointi
) )
) )
{ {
@ -340,7 +340,7 @@ label otherEdge
FatalErrorInFunction FatalErrorInFunction
<< " verts:" << surf.localPoints()[facei] << " verts:" << surf.localPoints()[facei]
<< " connected to point " << pointI << " connected to point " << pointi
<< " faceEdges:" << UIndirectList<edge>(surf.edges(), fEdges)() << " faceEdges:" << UIndirectList<edge>(surf.edges(), fEdges)()
<< abort(FatalError); << abort(FatalError);
@ -359,7 +359,7 @@ void walkSplitLine
const label startFacei, const label startFacei,
const label startEdgeI, // is border edge const label startEdgeI, // is border edge
const label startPointI, // is border point const label startPointi, // is border point
Map<label>& faceToEdge, Map<label>& faceToEdge,
Map<label>& faceToPoint Map<label>& faceToPoint
@ -367,18 +367,18 @@ void walkSplitLine
{ {
label facei = startFacei; label facei = startFacei;
label edgeI = startEdgeI; label edgeI = startEdgeI;
label pointI = startPointI; label pointi = startPointi;
do do
{ {
// //
// Stick to pointI and walk face-edge-face until back on border edge. // Stick to pointi and walk face-edge-face until back on border edge.
// //
do do
{ {
// Cross face to next edge. // Cross face to next edge.
edgeI = otherEdge(surf, facei, edgeI, pointI); edgeI = otherEdge(surf, facei, edgeI, pointi);
if (borderEdge[edgeI]) if (borderEdge[edgeI])
{ {
@ -393,7 +393,7 @@ void walkSplitLine
break; break;
} }
} }
else if (!faceToPoint.insert(facei, pointI)) else if (!faceToPoint.insert(facei, pointi))
{ {
// Was already visited. // Was already visited.
return; return;
@ -429,9 +429,9 @@ void walkSplitLine
// Back on border edge. Cross to other point on edge. // Back on border edge. Cross to other point on edge.
// //
pointI = surf.edges()[edgeI].otherVertex(pointI); pointi = surf.edges()[edgeI].otherVertex(pointi);
if (borderPoint[pointI] == -1) if (borderPoint[pointi] == -1)
{ {
return; return;
} }
@ -773,7 +773,7 @@ int main(int argc, char *argv[])
// //
label startEdgeI = -1; label startEdgeI = -1;
label startPointI = -1; label startPointi = -1;
forAll(borderEdge, edgeI) forAll(borderEdge, edgeI)
{ {
@ -784,14 +784,14 @@ int main(int argc, char *argv[])
if ((borderPoint[e[0]] != -1) && (borderPoint[e[1]] == -1)) if ((borderPoint[e[0]] != -1) && (borderPoint[e[1]] == -1))
{ {
startEdgeI = edgeI; startEdgeI = edgeI;
startPointI = e[0]; startPointi = e[0];
break; break;
} }
else if ((borderPoint[e[0]] == -1) && (borderPoint[e[1]] != -1)) else if ((borderPoint[e[0]] == -1) && (borderPoint[e[1]] != -1))
{ {
startEdgeI = edgeI; startEdgeI = edgeI;
startPointI = e[1]; startPointi = e[1];
break; break;
} }
@ -816,7 +816,7 @@ int main(int argc, char *argv[])
Info<< "Starting local walk from:" << endl Info<< "Starting local walk from:" << endl
<< " edge :" << startEdgeI << endl << " edge :" << startEdgeI << endl
<< " point:" << startPointI << endl << " point:" << startPointi << endl
<< " face0:" << firstFacei << endl << " face0:" << firstFacei << endl
<< " face1:" << secondFacei << endl << " face1:" << secondFacei << endl
<< endl; << endl;
@ -836,7 +836,7 @@ int main(int argc, char *argv[])
firstFacei, firstFacei,
startEdgeI, startEdgeI,
startPointI, startPointi,
faceToEdge, faceToEdge,
faceToPoint faceToPoint
@ -852,7 +852,7 @@ int main(int argc, char *argv[])
secondFacei, secondFacei,
startEdgeI, startEdgeI,
startPointI, startPointi,
faceToEdge, faceToEdge,
faceToPoint faceToPoint
@ -885,18 +885,18 @@ int main(int argc, char *argv[])
pointField newPoints(surf.localPoints()); pointField newPoints(surf.localPoints());
newPoints.setSize(newPoints.size() + nBorderPoints); newPoints.setSize(newPoints.size() + nBorderPoints);
forAll(borderPoint, pointI) forAll(borderPoint, pointi)
{ {
label newPointI = borderPoint[pointI]; label newPointi = borderPoint[pointi];
if (newPointI != -1) if (newPointi != -1)
{ {
scalar minLen = minEdgeLen(surf, pointI); scalar minLen = minEdgeLen(surf, pointi);
vector n = borderPointVec[pointI]; vector n = borderPointVec[pointi];
n /= mag(n); n /= mag(n);
newPoints[newPointI] = newPoints[pointI] + 0.1 * minLen * n; newPoints[newPointi] = newPoints[pointi] + 0.1 * minLen * n;
} }
} }

View File

@ -124,16 +124,16 @@ int main(int argc, char *argv[])
// pick up cells sharing the point // pick up cells sharing the point
forAll(markedPoints, pointI) forAll(markedPoints, pointi)
{ {
if if
( (
markedPoints[pointI] < 0 markedPoints[pointi] < 0
|| markedPoints[pointI] >= surf1.nPoints() || markedPoints[pointi] >= surf1.nPoints()
) )
{ {
FatalErrorInFunction FatalErrorInFunction
<< "localPoint label " << markedPoints[pointI] << "localPoint label " << markedPoints[pointi]
<< "out of range." << "out of range."
<< " The mesh has got " << " The mesh has got "
<< surf1.nPoints() << " localPoints." << surf1.nPoints() << " localPoints."
@ -141,7 +141,7 @@ int main(int argc, char *argv[])
} }
const labelList& curFaces = const labelList& curFaces =
surf1.pointFaces()[markedPoints[pointI]]; surf1.pointFaces()[markedPoints[pointi]];
forAll(curFaces, i) forAll(curFaces, i)
{ {

View File

@ -435,7 +435,7 @@
Within the implementation, a loop over all patches is done: Within the implementation, a loop over all patches is done:
\code \code
forAll(patches, patchI) forAll(patches, patchi)
{ {
... // some operation ... // some operation
} }

View File

@ -422,9 +422,9 @@ void Foam::invertManyToMany
// Number of points per edge // Number of points per edge
labelList nPointsPerEdge(nEdges, 0); labelList nPointsPerEdge(nEdges, 0);
forAll(pointEdges, pointI) forAll(pointEdges, pointi)
{ {
const InList& pEdges = pointEdges[pointI]; const InList& pEdges = pointEdges[pointi];
forAll(pEdges, j) forAll(pEdges, j)
{ {
@ -442,15 +442,15 @@ void Foam::invertManyToMany
nPointsPerEdge = 0; nPointsPerEdge = 0;
// Fill edges // Fill edges
forAll(pointEdges, pointI) forAll(pointEdges, pointi)
{ {
const InList& pEdges = pointEdges[pointI]; const InList& pEdges = pointEdges[pointi];
forAll(pEdges, j) forAll(pEdges, j)
{ {
label edgeI = pEdges[j]; label edgeI = pEdges[j];
edges[edgeI][nPointsPerEdge[edgeI]++] = pointI; edges[edgeI][nPointsPerEdge[edgeI]++] = pointi;
} }
} }
} }

View File

@ -196,9 +196,9 @@ void Foam::pointPatchField<Type>::addToInternalField
// Get the addressing // Get the addressing
const labelList& mp = patch().meshPoints(); const labelList& mp = patch().meshPoints();
forAll(mp, pointI) forAll(mp, pointi)
{ {
iF[mp[pointI]] += pF[pointI]; iF[mp[pointi]] += pF[pointi];
} }
} }
@ -236,8 +236,8 @@ void Foam::pointPatchField<Type>::addToInternalField
forAll(points, i) forAll(points, i)
{ {
label pointI = points[i]; label pointi = points[i];
iF[mp[pointI]] += pF[pointI]; iF[mp[pointi]] += pF[pointi];
} }
} }
@ -270,9 +270,9 @@ void Foam::pointPatchField<Type>::setInInternalField
<< abort(FatalError); << abort(FatalError);
} }
forAll(meshPoints, pointI) forAll(meshPoints, pointi)
{ {
iF[meshPoints[pointI]] = pF[pointI]; iF[meshPoints[pointi]] = pF[pointi];
} }
} }

View File

@ -73,27 +73,27 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
bool doWeights = false; bool doWeights = false;
forAll(pointAddressing, pointI) forAll(pointAddressing, pointi)
{ {
doWeights = false; doWeights = false;
const typename FromPatch::FaceType& hitFace = const typename FromPatch::FaceType& hitFace =
fromPatchFaces[proj[pointI].hitObject()]; fromPatchFaces[proj[pointi].hitObject()];
point hitPoint = Zero; point hitPoint = Zero;
if (proj[pointI].hit()) if (proj[pointi].hit())
{ {
// A hit exists // A hit exists
doWeights = true; doWeights = true;
pointAddressing[pointI] = proj[pointI].hitObject(); pointAddressing[pointi] = proj[pointi].hitObject();
pointHit curHit = pointHit curHit =
hitFace.ray hitFace.ray
( (
toPatchPoints[pointI], toPatchPoints[pointi],
projectionDirection[pointI], projectionDirection[pointi],
fromPatchPoints, fromPatchPoints,
alg_, alg_,
dir_ dir_
@ -102,17 +102,17 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
// Grab distance to target // Grab distance to target
if (dir_ == intersection::CONTACT_SPHERE) if (dir_ == intersection::CONTACT_SPHERE)
{ {
pointDistance[pointI] = pointDistance[pointi] =
hitFace.contactSphereDiameter hitFace.contactSphereDiameter
( (
toPatchPoints[pointI], toPatchPoints[pointi],
projectionDirection[pointI], projectionDirection[pointi],
fromPatchPoints fromPatchPoints
); );
} }
else else
{ {
pointDistance[pointI] = curHit.distance(); pointDistance[pointi] = curHit.distance();
} }
// Grab hit point // Grab hit point
@ -124,8 +124,8 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
pointHit ph = pointHit ph =
hitFace.ray hitFace.ray
( (
toPatchPoints[pointI], toPatchPoints[pointi],
projectionDirection[pointI], projectionDirection[pointi],
fromPatchPoints, fromPatchPoints,
alg_, alg_,
dir_ dir_
@ -134,8 +134,8 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
scalar dist = scalar dist =
Foam::mag Foam::mag
( (
toPatchPoints[pointI] toPatchPoints[pointi]
+ projectionDirection[pointI]*ph.distance() + projectionDirection[pointi]*ph.distance()
- ph.missPoint() - ph.missPoint()
); );
@ -144,7 +144,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
// Do shortest edge of hit object // Do shortest edge of hit object
edgeList hitFaceEdges = edgeList hitFaceEdges =
fromPatchFaces[proj[pointI].hitObject()].edges(); fromPatchFaces[proj[pointi].hitObject()].edges();
forAll(hitFaceEdges, edgeI) forAll(hitFaceEdges, edgeI)
{ {
@ -156,7 +156,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
); );
} }
const labelList& curEdges = toPatchPointEdges[pointI]; const labelList& curEdges = toPatchPointEdges[pointi];
forAll(curEdges, edgeI) forAll(curEdges, edgeI)
{ {
@ -173,7 +173,7 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
// This point is being corrected // This point is being corrected
doWeights = true; doWeights = true;
pointAddressing[pointI] = proj[pointI].hitObject(); pointAddressing[pointi] = proj[pointi].hitObject();
// Grab nearest point on face as hit point // Grab nearest point on face as hit point
hitPoint = ph.missPoint(); hitPoint = ph.missPoint();
@ -181,22 +181,22 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
// Grab distance to target // Grab distance to target
if (dir_ == intersection::CONTACT_SPHERE) if (dir_ == intersection::CONTACT_SPHERE)
{ {
pointDistance[pointI] = pointDistance[pointi] =
hitFace.contactSphereDiameter hitFace.contactSphereDiameter
( (
toPatchPoints[pointI], toPatchPoints[pointi],
projectionDirection[pointI], projectionDirection[pointi],
fromPatchPoints fromPatchPoints
); );
} }
else else
{ {
pointDistance[pointI] = pointDistance[pointi] =
( (
projectionDirection[pointI] projectionDirection[pointi]
/mag(projectionDirection[pointI]) /mag(projectionDirection[pointi])
) )
& (hitPoint - toPatchPoints[pointI]); & (hitPoint - toPatchPoints[pointi]);
} }
} }
} }
@ -204,29 +204,29 @@ void PatchToPatchInterpolation<FromPatch, ToPatch>::calcPointAddressing() const
if (doWeights) if (doWeights)
{ {
// Set interpolation pointWeights // Set interpolation pointWeights
pointWeights.set(pointI, new scalarField(hitFace.size())); pointWeights.set(pointi, new scalarField(hitFace.size()));
pointField hitFacePoints = hitFace.points(fromPatchPoints); pointField hitFacePoints = hitFace.points(fromPatchPoints);
forAll(hitFacePoints, masterPointI) forAll(hitFacePoints, masterPointi)
{ {
pointWeights[pointI][masterPointI] = pointWeights[pointi][masterPointi] =
1.0/ 1.0/
( (
mag mag
( (
hitFacePoints[masterPointI] hitFacePoints[masterPointi]
- hitPoint - hitPoint
) )
+ VSMALL + VSMALL
); );
} }
pointWeights[pointI] /= sum(pointWeights[pointI]); pointWeights[pointi] /= sum(pointWeights[pointi]);
} }
else else
{ {
pointWeights.set(pointI, new scalarField(0)); pointWeights.set(pointi, new scalarField(0));
} }
} }
} }

View File

@ -63,18 +63,18 @@ PatchToPatchInterpolation<FromPatch, ToPatch>::pointInterpolate
const labelList& addr = pointAddr(); const labelList& addr = pointAddr();
forAll(result, pointI) forAll(result, pointi)
{ {
const scalarField& curWeights = weights[pointI]; const scalarField& curWeights = weights[pointi];
if (addr[pointI] > -1) if (addr[pointi] > -1)
{ {
const labelList& hitFacePoints = const labelList& hitFacePoints =
fromPatchLocalFaces[addr[pointI]]; fromPatchLocalFaces[addr[pointi]];
forAll(curWeights, wI) forAll(curWeights, wI)
{ {
result[pointI] += curWeights[wI]*pf[hitFacePoints[wI]]; result[pointi] += curWeights[wI]*pf[hitFacePoints[wI]];
} }
} }
} }

View File

@ -63,8 +63,8 @@ private:
// Private data // Private data
//- Local map from neighbour proc to patchI. Different per processor! //- Local map from neighbour proc to patchi. Different per processor!
// -1 or patchI for connection to procID // -1 or patchi for connection to procID
labelList procPatchMap_; labelList procPatchMap_;
//- Order in which the patches should be initialised/evaluated //- Order in which the patches should be initialised/evaluated

View File

@ -52,9 +52,9 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
// in the first face there is no duplicates // in the first face there is no duplicates
const labelList& first = f[faces[0]]; const labelList& first = f[faces[0]];
forAll(first, pointI) forAll(first, pointi)
{ {
p[pointI] = first[pointI]; p[pointi] = first[pointi];
} }
// re-use maxVert to count the real vertices // re-use maxVert to count the real vertices
@ -67,9 +67,9 @@ Foam::labelList Foam::cell::labels(const faceUList& f) const
{ {
const labelList& curFace = f[faces[facei]]; const labelList& curFace = f[faces[facei]];
forAll(curFace, pointI) forAll(curFace, pointi)
{ {
const label curPoint = curFace[pointI]; const label curPoint = curFace[pointi];
bool found = false; bool found = false;

View File

@ -70,13 +70,13 @@ Foam::label Foam::cell::opposingFaceLabel
// Compare every vertex of the current face agains the // Compare every vertex of the current face agains the
// vertices of the master face // vertices of the master face
forAll(curFace, pointI) forAll(curFace, pointi)
{ {
const label l = curFace[pointI]; const label l = curFace[pointi];
forAll(masterFace, masterPointI) forAll(masterFace, masterPointi)
{ {
if (masterFace[masterPointI] == l) if (masterFace[masterPointi] == l)
{ {
sharedPoint = true; sharedPoint = true;
break; break;
@ -149,7 +149,7 @@ Foam::oppositeFace Foam::cell::opposingFace
oppFaceLabel oppFaceLabel
); );
forAll(masterFace, pointI) forAll(masterFace, pointi)
{ {
// Go through the list of edges and find the edge from this vertex // Go through the list of edges and find the edge from this vertex
// to the slave face // to the slave face
@ -159,19 +159,19 @@ Foam::oppositeFace Foam::cell::opposingFace
{ {
// Get the other vertex // Get the other vertex
label otherVertex = label otherVertex =
e[edgeI].otherVertex(masterFace[pointI]); e[edgeI].otherVertex(masterFace[pointi]);
if (otherVertex != -1) if (otherVertex != -1)
{ {
// Found an edge coming from this vertex. // Found an edge coming from this vertex.
// Check all vertices of the slave to find out // Check all vertices of the slave to find out
// if it exists. // if it exists.
forAll(slaveFace, slavePointI) forAll(slaveFace, slavePointi)
{ {
if (slaveFace[slavePointI] == otherVertex) if (slaveFace[slavePointi] == otherVertex)
{ {
usedEdges[edgeI] = true; usedEdges[edgeI] = true;
oppFace[pointI] = otherVertex; oppFace[pointi] = otherVertex;
break; break;
} }

View File

@ -618,9 +618,9 @@ Foam::face Foam::face::reverseFace() const
newList[0] = f[0]; newList[0] = f[0];
for (label pointI = 1; pointI < newList.size(); pointI++) for (label pointi = 1; pointi < newList.size(); pointi++)
{ {
newList[pointI] = f[size() - pointI]; newList[pointi] = f[size() - pointi];
} }
return face(xferMove(newList)); return face(xferMove(newList));
@ -764,9 +764,9 @@ Foam::edgeList Foam::face::edges() const
edgeList e(points.size()); edgeList e(points.size());
for (label pointI = 0; pointI < points.size() - 1; ++pointI) for (label pointi = 0; pointi < points.size() - 1; ++pointi)
{ {
e[pointI] = edge(points[pointI], points[pointI + 1]); e[pointi] = edge(points[pointi], points[pointi + 1]);
} }
// Add last edge // Add last edge

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,9 +73,9 @@ Foam::label Foam::mergePoints
const Field<Type> d(points - compareOrigin); const Field<Type> d(points - compareOrigin);
List<scalar> magSqrD(d.size()); List<scalar> magSqrD(d.size());
forAll(d, pointI) forAll(d, pointi)
{ {
magSqrD[pointI] = magSqr(d[pointI]); magSqrD[pointi] = magSqr(d[pointi]);
} }
labelList order; labelList order;
sortedOrder(magSqrD, order); sortedOrder(magSqrD, order);
@ -84,42 +84,42 @@ Foam::label Foam::mergePoints
Field<scalar> sortedTol(points.size()); Field<scalar> sortedTol(points.size());
forAll(order, sortI) forAll(order, sortI)
{ {
label pointI = order[sortI]; label pointi = order[sortI];
// Convert to scalar precision // Convert to scalar precision
const point pt const point pt
( (
scalar(d[pointI].x()), scalar(d[pointi].x()),
scalar(d[pointI].y()), scalar(d[pointi].y()),
scalar(d[pointI].z()) scalar(d[pointi].z())
); );
sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z())); sortedTol[sortI] = 2*mergeTol*(mag(pt.x())+mag(pt.y())+mag(pt.z()));
} }
label newPointI = 0; label newPointi = 0;
// Handle 0th point separately (is always unique) // Handle 0th point separately (is always unique)
label pointI = order[0]; label pointi = order[0];
pointMap[pointI] = newPointI++; pointMap[pointi] = newPointi++;
for (label sortI = 1; sortI < order.size(); sortI++) for (label sortI = 1; sortI < order.size(); sortI++)
{ {
// Get original point index // Get original point index
label pointI = order[sortI]; label pointi = order[sortI];
const scalar mag2 = magSqrD[order[sortI]]; const scalar mag2 = magSqrD[order[sortI]];
// Convert to scalar precision // Convert to scalar precision
const point pt const point pt
( (
scalar(points[pointI].x()), scalar(points[pointi].x()),
scalar(points[pointI].y()), scalar(points[pointi].y()),
scalar(points[pointI].z()) scalar(points[pointi].z())
); );
// Compare to previous points to find equal one. // Compare to previous points to find equal one.
label equalPointI = -1; label equalPointi = -1;
for for
( (
@ -129,46 +129,46 @@ Foam::label Foam::mergePoints
prevSortI-- prevSortI--
) )
{ {
label prevPointI = order[prevSortI]; label prevPointi = order[prevSortI];
const point prevPt const point prevPt
( (
scalar(points[prevPointI].x()), scalar(points[prevPointi].x()),
scalar(points[prevPointI].y()), scalar(points[prevPointi].y()),
scalar(points[prevPointI].z()) scalar(points[prevPointi].z())
); );
if (magSqr(pt - prevPt) <= mergeTolSqr) if (magSqr(pt - prevPt) <= mergeTolSqr)
{ {
// Found match. // Found match.
equalPointI = prevPointI; equalPointi = prevPointi;
break; break;
} }
} }
if (equalPointI != -1) if (equalPointi != -1)
{ {
// Same coordinate as equalPointI. Map to same new point. // Same coordinate as equalPointi. Map to same new point.
pointMap[pointI] = pointMap[equalPointI]; pointMap[pointi] = pointMap[equalPointi];
if (verbose) if (verbose)
{ {
Pout<< "Foam::mergePoints : Merging points " Pout<< "Foam::mergePoints : Merging points "
<< pointI << " and " << equalPointI << pointi << " and " << equalPointi
<< " with coordinates:" << points[pointI] << " with coordinates:" << points[pointi]
<< " and " << points[equalPointI] << " and " << points[equalPointi]
<< endl; << endl;
} }
} }
else else
{ {
// Differs. Store new point. // Differs. Store new point.
pointMap[pointI] = newPointI++; pointMap[pointi] = newPointi++;
} }
} }
return newPointI; return newPointi;
} }
@ -193,9 +193,9 @@ bool Foam::mergePoints
); );
newPoints.setSize(nUnique); newPoints.setSize(nUnique);
forAll(pointMap, pointI) forAll(pointMap, pointi)
{ {
newPoints[pointMap[pointI]] = points[pointI]; newPoints[pointMap[pointi]] = points[pointi];
} }
return (nUnique != points.size()); return (nUnique != points.size());

View File

@ -60,13 +60,13 @@ void Foam::pointMapper::calcAddressing() const
label nInsertedPoints = 0; label nInsertedPoints = 0;
forAll(directAddr, pointI) forAll(directAddr, pointi)
{ {
if (directAddr[pointI] < 0) if (directAddr[pointi] < 0)
{ {
// Found inserted point // Found inserted point
directAddr[pointI] = 0; directAddr[pointi] = 0;
insertedPoints[nInsertedPoints] = pointI; insertedPoints[nInsertedPoints] = pointi;
nInsertedPoints++; nInsertedPoints++;
} }
} }
@ -91,19 +91,19 @@ void Foam::pointMapper::calcAddressing() const
// Get addressing // Get addressing
const labelList& mo = cfc[cfcI].masterObjects(); const labelList& mo = cfc[cfcI].masterObjects();
label pointI = cfc[cfcI].index(); label pointi = cfc[cfcI].index();
if (addr[pointI].size()) if (addr[pointi].size())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Master point " << pointI << "Master point " << pointi
<< " mapped from points " << mo << " mapped from points " << mo
<< " already destination of mapping." << abort(FatalError); << " already destination of mapping." << abort(FatalError);
} }
// Map from masters, uniform weights // Map from masters, uniform weights
addr[pointI] = mo; addr[pointi] = mo;
w[pointI] = scalarList(mo.size(), 1.0/mo.size()); w[pointi] = scalarList(mo.size(), 1.0/mo.size());
} }
@ -112,13 +112,13 @@ void Foam::pointMapper::calcAddressing() const
const labelList& cm = mpm_.pointMap(); const labelList& cm = mpm_.pointMap();
forAll(cm, pointI) forAll(cm, pointi)
{ {
if (cm[pointI] > -1 && addr[pointI].empty()) if (cm[pointi] > -1 && addr[pointi].empty())
{ {
// Mapped from a single point // Mapped from a single point
addr[pointI] = labelList(1, cm[pointI]); addr[pointi] = labelList(1, cm[pointi]);
w[pointI] = scalarList(1, 1.0); w[pointi] = scalarList(1, 1.0);
} }
} }
@ -129,15 +129,15 @@ void Foam::pointMapper::calcAddressing() const
label nInsertedPoints = 0; label nInsertedPoints = 0;
forAll(addr, pointI) forAll(addr, pointi)
{ {
if (addr[pointI].empty()) if (addr[pointi].empty())
{ {
// Mapped from a dummy point. Take point 0 with weight 1. // Mapped from a dummy point. Take point 0 with weight 1.
addr[pointI] = labelList(1, label(0)); addr[pointi] = labelList(1, label(0));
w[pointI] = scalarList(1, 1.0); w[pointi] = scalarList(1, 1.0);
insertedPoints[nInsertedPoints] = pointI; insertedPoints[nInsertedPoints] = pointi;
nInsertedPoints++; nInsertedPoints++;
} }
} }

View File

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

View File

@ -126,7 +126,7 @@ Foam::labelPairList Foam::globalPoints::addSendTransform
void Foam::globalPoints::addToSend void Foam::globalPoints::addToSend
( (
const polyPatch& pp, const polyPatch& pp,
const label patchPointI, const label patchPointi,
const labelPairList& knownInfo, const labelPairList& knownInfo,
DynamicList<label>& patchFaces, DynamicList<label>& patchFaces,
@ -138,11 +138,11 @@ void Foam::globalPoints::addToSend
// information is the patch faces using the point and the relative position // information is the patch faces using the point and the relative position
// of the point in the face) // of the point in the face)
label meshPointI = pp.meshPoints()[patchPointI]; label meshPointi = pp.meshPoints()[patchPointi];
// Add all faces using the point so we are sure we find it on the // Add all faces using the point so we are sure we find it on the
// other side. // other side.
const labelList& pFaces = pp.pointFaces()[patchPointI]; const labelList& pFaces = pp.pointFaces()[patchPointi];
forAll(pFaces, i) forAll(pFaces, i)
{ {
@ -151,7 +151,7 @@ void Foam::globalPoints::addToSend
const face& f = pp[patchFacei]; const face& f = pp[patchFacei];
patchFaces.append(patchFacei); patchFaces.append(patchFacei);
indexInFace.append(findIndex(f, meshPointI)); indexInFace.append(findIndex(f, meshPointi));
// Add patch transformation // Add patch transformation
allInfo.append(addSendTransform(pp.index(), knownInfo)); allInfo.append(addSendTransform(pp.index(), knownInfo));
@ -162,7 +162,7 @@ void Foam::globalPoints::addToSend
bool Foam::globalPoints::mergeInfo bool Foam::globalPoints::mergeInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI, const label localPointi,
labelPairList& myInfo labelPairList& myInfo
) const ) const
{ {
@ -194,7 +194,7 @@ bool Foam::globalPoints::mergeInfo
} }
else else
{ {
// Same point. So we already have a connection between localPointI // Same point. So we already have a connection between localPointi
// and the nbrIndex. Two situations: // and the nbrIndex. Two situations:
// - same transform // - same transform
// - one transform takes two steps, the other just a single. // - one transform takes two steps, the other just a single.
@ -240,14 +240,14 @@ bool Foam::globalPoints::mergeInfo
Foam::label Foam::globalPoints::meshToLocalPoint Foam::label Foam::globalPoints::meshToLocalPoint
( (
const Map<label>& meshToPatchPoint, // from mesh point to local numbering const Map<label>& meshToPatchPoint, // from mesh point to local numbering
const label meshPointI const label meshPointi
) )
{ {
return return
( (
meshToPatchPoint.size() == 0 meshToPatchPoint.size() == 0
? meshPointI ? meshPointi
: meshToPatchPoint[meshPointI] : meshToPatchPoint[meshPointi]
); );
} }
@ -255,14 +255,14 @@ Foam::label Foam::globalPoints::meshToLocalPoint
Foam::label Foam::globalPoints::localToMeshPoint Foam::label Foam::globalPoints::localToMeshPoint
( (
const labelList& patchToMeshPoint, const labelList& patchToMeshPoint,
const label localPointI const label localPointi
) )
{ {
return return
( (
patchToMeshPoint.size() == 0 patchToMeshPoint.size() == 0
? localPointI ? localPointi
: patchToMeshPoint[localPointI] : patchToMeshPoint[localPointi]
); );
} }
@ -270,20 +270,20 @@ Foam::label Foam::globalPoints::localToMeshPoint
bool Foam::globalPoints::mergeInfo bool Foam::globalPoints::mergeInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI const label localPointi
) )
{ {
// Updates database of current information on meshpoints with nbrInfo. Uses // Updates database of current information on meshpoints with nbrInfo. Uses
// mergeInfo above. Returns true if data kept for meshPointI changed. // mergeInfo above. Returns true if data kept for meshPointi changed.
label infoChanged = false; label infoChanged = false;
// Get the index into the procPoints list. // Get the index into the procPoints list.
Map<label>::iterator iter = meshToProcPoint_.find(localPointI); Map<label>::iterator iter = meshToProcPoint_.find(localPointi);
if (iter != meshToProcPoint_.end()) if (iter != meshToProcPoint_.end())
{ {
if (mergeInfo(nbrInfo, localPointI, procPoints_[iter()])) if (mergeInfo(nbrInfo, localPointi, procPoints_[iter()]))
{ {
infoChanged = true; infoChanged = true;
} }
@ -297,15 +297,15 @@ bool Foam::globalPoints::mergeInfo
globalIndexAndTransform::encode globalIndexAndTransform::encode
( (
Pstream::myProcNo(), Pstream::myProcNo(),
localPointI, localPointi,
globalTransforms_.nullTransformIndex() globalTransforms_.nullTransformIndex()
) )
); );
if (mergeInfo(nbrInfo, localPointI, knownInfo)) if (mergeInfo(nbrInfo, localPointi, knownInfo))
{ {
// Update addressing from into procPoints // Update addressing from into procPoints
meshToProcPoint_.insert(localPointI, procPoints_.size()); meshToProcPoint_.insert(localPointi, procPoints_.size());
// Insert into list of equivalences. // Insert into list of equivalences.
procPoints_.append(knownInfo); procPoints_.append(knownInfo);
@ -319,20 +319,20 @@ bool Foam::globalPoints::mergeInfo
bool Foam::globalPoints::storeInitialInfo bool Foam::globalPoints::storeInitialInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI const label localPointi
) )
{ {
// Updates database of current information on meshpoints with nbrInfo. Uses // Updates database of current information on meshpoints with nbrInfo. Uses
// mergeInfo above. Returns true if data kept for meshPointI changed. // mergeInfo above. Returns true if data kept for meshPointi changed.
label infoChanged = false; label infoChanged = false;
// Get the index into the procPoints list. // Get the index into the procPoints list.
Map<label>::iterator iter = meshToProcPoint_.find(localPointI); Map<label>::iterator iter = meshToProcPoint_.find(localPointi);
if (iter != meshToProcPoint_.end()) if (iter != meshToProcPoint_.end())
{ {
if (mergeInfo(nbrInfo, localPointI, procPoints_[iter()])) if (mergeInfo(nbrInfo, localPointi, procPoints_[iter()]))
{ {
infoChanged = true; infoChanged = true;
} }
@ -340,7 +340,7 @@ bool Foam::globalPoints::storeInitialInfo
else else
{ {
// Update addressing into procPoints // Update addressing into procPoints
meshToProcPoint_.insert(localPointI, procPoints_.size()); meshToProcPoint_.insert(localPointi, procPoints_.size());
// Insert into list of equivalences. // Insert into list of equivalences.
procPoints_.append(nbrInfo); procPoints_.append(nbrInfo);
@ -369,8 +369,8 @@ void Foam::globalPoints::printProcPoint
if (proci == Pstream::myProcNo()) if (proci == Pstream::myProcNo())
{ {
label meshPointI = localToMeshPoint(patchToMeshPoint, index); label meshPointi = localToMeshPoint(patchToMeshPoint, index);
Pout<< " at:" << mesh_.points()[meshPointI]; Pout<< " at:" << mesh_.points()[meshPointi];
} }
} }
@ -409,13 +409,13 @@ void Foam::globalPoints::initOwnPoints
if (allPoints) if (allPoints)
{ {
// All points on patch // All points on patch
forAll(meshPoints, patchPointI) forAll(meshPoints, patchPointi)
{ {
label meshPointI = meshPoints[patchPointI]; label meshPointi = meshPoints[patchPointi];
label localPointI = meshToLocalPoint label localPointi = meshToLocalPoint
( (
meshToPatchPoint, meshToPatchPoint,
meshPointI meshPointi
); );
labelPairList knownInfo labelPairList knownInfo
@ -424,19 +424,19 @@ void Foam::globalPoints::initOwnPoints
globalIndexAndTransform::encode globalIndexAndTransform::encode
( (
Pstream::myProcNo(), Pstream::myProcNo(),
localPointI, localPointi,
globalTransforms_.nullTransformIndex() globalTransforms_.nullTransformIndex()
) )
); );
//Pout<< "For point "<< pp.points()[meshPointI] //Pout<< "For point "<< pp.points()[meshPointi]
// << " inserting info " << knownInfo // << " inserting info " << knownInfo
// << endl; // << endl;
// Update changedpoints info. // Update changedpoints info.
if (storeInitialInfo(knownInfo, localPointI)) if (storeInitialInfo(knownInfo, localPointi))
{ {
changedPoints.insert(localPointI); changedPoints.insert(localPointi);
} }
} }
} }
@ -447,11 +447,11 @@ void Foam::globalPoints::initOwnPoints
forAll(boundaryPoints, i) forAll(boundaryPoints, i)
{ {
label meshPointI = meshPoints[boundaryPoints[i]]; label meshPointi = meshPoints[boundaryPoints[i]];
label localPointI = meshToLocalPoint label localPointi = meshToLocalPoint
( (
meshToPatchPoint, meshToPatchPoint,
meshPointI meshPointi
); );
labelPairList knownInfo labelPairList knownInfo
@ -460,14 +460,14 @@ void Foam::globalPoints::initOwnPoints
globalIndexAndTransform::encode globalIndexAndTransform::encode
( (
Pstream::myProcNo(), Pstream::myProcNo(),
localPointI, localPointi,
globalTransforms_.nullTransformIndex() globalTransforms_.nullTransformIndex()
) )
); );
if (storeInitialInfo(knownInfo, localPointI)) if (storeInitialInfo(knownInfo, localPointi))
{ {
changedPoints.insert(localPointI); changedPoints.insert(localPointi);
} }
} }
} }
@ -518,27 +518,27 @@ void Foam::globalPoints::sendPatchPoints
const labelList& meshPoints = pp.meshPoints(); const labelList& meshPoints = pp.meshPoints();
forAll(meshPoints, patchPointI) forAll(meshPoints, patchPointi)
{ {
label meshPointI = meshPoints[patchPointI]; label meshPointi = meshPoints[patchPointi];
label localPointI = meshToLocalPoint label localPointi = meshToLocalPoint
( (
meshToPatchPoint, meshToPatchPoint,
meshPointI meshPointi
); );
if (changedPoints.found(localPointI)) if (changedPoints.found(localPointi))
{ {
label index = meshToProcPoint_[localPointI]; label index = meshToProcPoint_[localPointi];
const labelPairList& knownInfo = procPoints_[index]; const labelPairList& knownInfo = procPoints_[index];
// Add my information about localPointI to the // Add my information about localPointi to the
// send buffers. Encode the transformation // send buffers. Encode the transformation
addToSend addToSend
( (
pp, pp,
patchPointI, patchPointi,
knownInfo, knownInfo,
patchFaces, patchFaces,
@ -622,17 +622,17 @@ void Foam::globalPoints::receivePatchPoints
label index = (f.size() - indexInFace[i]) % f.size(); label index = (f.size() - indexInFace[i]) % f.size();
// Get the meshpoint on my side // Get the meshpoint on my side
label meshPointI = f[index]; label meshPointi = f[index];
label localPointI = meshToLocalPoint label localPointi = meshToLocalPoint
( (
meshToPatchPoint, meshToPatchPoint,
meshPointI meshPointi
); );
if (mergeInfo(nbrInfo[i], localPointI)) if (mergeInfo(nbrInfo[i], localPointi))
{ {
changedPoints.insert(localPointI); changedPoints.insert(localPointi);
} }
} }
} }
@ -740,7 +740,7 @@ void Foam::globalPoints::remove
// Go through all equivalences // Go through all equivalences
forAllConstIter(Map<label>, oldMeshToProcPoint, iter) forAllConstIter(Map<label>, oldMeshToProcPoint, iter)
{ {
label localPointI = iter.key(); label localPointi = iter.key();
const labelPairList& pointInfo = oldProcPoints[iter()]; const labelPairList& pointInfo = oldProcPoints[iter()];
if (pointInfo.size() == 2) if (pointInfo.size() == 2)
@ -801,7 +801,7 @@ void Foam::globalPoints::remove
// be found if the two domains are face connected at all // be found if the two domains are face connected at all
// (not shown in the picture) // (not shown in the picture)
meshToProcPoint_.insert(localPointI, procPoints_.size()); meshToProcPoint_.insert(localPointi, procPoints_.size());
procPoints_.append(pointInfo); procPoints_.append(pointInfo);
} }
} }
@ -820,13 +820,13 @@ void Foam::globalPoints::remove
) )
) )
{ {
meshToProcPoint_.insert(localPointI, procPoints_.size()); meshToProcPoint_.insert(localPointi, procPoints_.size());
procPoints_.append(pointInfo); procPoints_.append(pointInfo);
} }
} }
else else
{ {
meshToProcPoint_.insert(localPointI, procPoints_.size()); meshToProcPoint_.insert(localPointi, procPoints_.size());
procPoints_.append(pointInfo); procPoints_.append(pointInfo);
} }
} }
@ -972,7 +972,7 @@ void Foam::globalPoints::calculateSharedPoints
//{ //{
// label localI = iter.key(); // label localI = iter.key();
// const labelPairList& pointInfo = procPoints_[iter()]; // const labelPairList& pointInfo = procPoints_[iter()];
// Pout<< "pointI:" << localI << " index:" << iter() // Pout<< "pointi:" << localI << " index:" << iter()
// << " coord:" // << " coord:"
// << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)] // << mesh_.points()[localToMeshPoint(patchToMeshPoint, localI)]
// << endl; // << endl;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -152,16 +152,16 @@ class globalPoints
labelPairList addSendTransform labelPairList addSendTransform
( (
const label patchI, const label patchi,
const labelPairList& info const labelPairList& info
) const; ) const;
//- Add information about patchPointI in relative indices to send //- Add information about patchPointi in relative indices to send
// buffers (patchFaces, indexInFace etc.) // buffers (patchFaces, indexInFace etc.)
void addToSend void addToSend
( (
const polyPatch&, const polyPatch&,
const label patchPointI, const label patchPointi,
const labelPairList&, const labelPairList&,
DynamicList<label>& patchFaces, DynamicList<label>& patchFaces,
DynamicList<label>& indexInFace, DynamicList<label>& indexInFace,
@ -172,7 +172,7 @@ class globalPoints
bool mergeInfo bool mergeInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI, const label localPointi,
labelPairList& myInfo labelPairList& myInfo
) const; ) const;
@ -181,28 +181,28 @@ class globalPoints
static label meshToLocalPoint static label meshToLocalPoint
( (
const Map<label>& meshToPatchPoint, const Map<label>& meshToPatchPoint,
const label meshPointI const label meshPointi
); );
//- Opposite of meshToLocalPoint. //- Opposite of meshToLocalPoint.
static label localToMeshPoint static label localToMeshPoint
( (
const labelList& patchToMeshPoint, const labelList& patchToMeshPoint,
const label localPointI const label localPointi
); );
//- Store (and merge) info for meshPointI //- Store (and merge) info for meshPointi
bool storeInitialInfo bool storeInitialInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI const label localPointi
); );
//- Store (and merge) info for meshPointI //- Store (and merge) info for meshPointi
bool mergeInfo bool mergeInfo
( (
const labelPairList& nbrInfo, const labelPairList& nbrInfo,
const label localPointI const label localPointi
); );
//- Debug printing //- Debug printing

View File

@ -52,19 +52,19 @@ Description
\par points \par points
- unchanged: - unchanged:
- pointMap[pointI] contains old point label - pointMap[pointi] contains old point label
- reversePointMap[oldPointI] contains new point label - reversePointMap[oldPointi] contains new point label
- removed: - removed:
- reversePointMap[oldPointI] contains -1 - reversePointMap[oldPointi] contains -1
- merged into point: - merged into point:
- reversePointMap[oldPointI] contains <-1 : -newPointI-2 - reversePointMap[oldPointi] contains <-1 : -newPointi-2
- pointMap[pointI] contains the old master point label - pointMap[pointi] contains the old master point label
- pointsFromPoints gives for pointI all the old point labels - pointsFromPoints gives for pointi all the old point labels
(including the old master point!) (including the old master point!)
- added-from-same: - added-from-same:
- pointMap[pointI] contains the old master point label - pointMap[pointi] contains the old master point label
- appended: - appended:
- pointMap[pointI] contains -1 - pointMap[pointi] contains -1
\par faces \par faces
@ -468,9 +468,9 @@ public:
//- If point is removed return point (on new mesh) it merged //- If point is removed return point (on new mesh) it merged
// into // into
label mergedPoint(const label oldPointI) const label mergedPoint(const label oldPointi) const
{ {
label i = reversePointMap_[oldPointI]; label i = reversePointMap_[oldPointi];
if (i == -1) if (i == -1)
{ {
@ -483,7 +483,7 @@ public:
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "old point label " << oldPointI << "old point label " << oldPointi
<< " has reverseMap " << i << endl << " has reverseMap " << i << endl
<< "Only call mergedPoint for removed points." << "Only call mergedPoint for removed points."
<< abort(FatalError); << abort(FatalError);

View File

@ -1315,24 +1315,24 @@ bool Foam::polyMesh::pointInCell
forAll(f, fp) forAll(f, fp)
{ {
label pointI; label pointi;
label nextPointI; label nextPointi;
if (isOwn) if (isOwn)
{ {
pointI = f[fp]; pointi = f[fp];
nextPointI = f.nextLabel(fp); nextPointi = f.nextLabel(fp);
} }
else else
{ {
pointI = f.nextLabel(fp); pointi = f.nextLabel(fp);
nextPointI = f[fp]; nextPointi = f[fp];
} }
triPointRef faceTri triPointRef faceTri
( (
points()[pointI], points()[pointi],
points()[nextPointI], points()[nextPointi],
fc fc
); );

View File

@ -61,9 +61,9 @@ Foam::labelListList Foam::polyMesh::cellShapePointCells
labelListList pointCellAddr(pc.size()); labelListList pointCellAddr(pc.size());
forAll(pc, pointI) forAll(pc, pointi)
{ {
pointCellAddr[pointI].transfer(pc[pointI]); pointCellAddr[pointi].transfer(pc[pointi]);
} }
return pointCellAddr; return pointCellAddr;
@ -89,9 +89,9 @@ Foam::labelList Foam::polyMesh::facePatchFaceCells
const face& curFace = patchFaces[fI]; const face& curFace = patchFaces[fI];
const labelList& facePoints = patchFaces[fI]; const labelList& facePoints = patchFaces[fI];
forAll(facePoints, pointI) forAll(facePoints, pointi)
{ {
const labelList& facePointCells = pointCells[facePoints[pointI]]; const labelList& facePointCells = pointCells[facePoints[pointi]];
forAll(facePointCells, celli) forAll(facePointCells, celli)
{ {
@ -203,11 +203,11 @@ void Foam::polyMesh::setTopology
const labelList& curPoints = curFace; const labelList& curPoints = curFace;
// For all points // For all points
forAll(curPoints, pointI) forAll(curPoints, pointi)
{ {
// dGget the list of cells sharing this point // dGget the list of cells sharing this point
const labelList& curNeighbours = const labelList& curNeighbours =
PointCells[curPoints[pointI]]; PointCells[curPoints[pointi]];
// For all neighbours // For all neighbours
forAll(curNeighbours, neiI) forAll(curNeighbours, neiI)

View File

@ -82,11 +82,11 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
// Any points created out-of-nothing get set to the current coordinate // Any points created out-of-nothing get set to the current coordinate
// for lack of anything better. // for lack of anything better.
forAll(mpm.pointMap(), newPointI) forAll(mpm.pointMap(), newPointi)
{ {
if (mpm.pointMap()[newPointI] == -1) if (mpm.pointMap()[newPointi] == -1)
{ {
newMotionPoints[newPointI] = points_[newPointI]; newMotionPoints[newPointi] = points_[newPointi];
} }
} }
} }

View File

@ -354,15 +354,15 @@ void Foam::processorPolyPatch::initUpdateMesh(PstreamBuffers& pBufs)
labelList pointFace(nPoints()); labelList pointFace(nPoints());
labelList pointIndex(nPoints()); labelList pointIndex(nPoints());
for (label patchPointI = 0; patchPointI < nPoints(); patchPointI++) for (label patchPointi = 0; patchPointi < nPoints(); patchPointi++)
{ {
label facei = pointFaces()[patchPointI][0]; label facei = pointFaces()[patchPointi][0];
pointFace[patchPointI] = facei; pointFace[patchPointi] = facei;
const face& f = localFaces()[facei]; const face& f = localFaces()[facei];
pointIndex[patchPointI] = findIndex(f, patchPointI); pointIndex[patchPointi] = findIndex(f, patchPointi);
} }
// Express all edges as patch face and index in face. // Express all edges as patch face and index in face.
@ -433,32 +433,32 @@ void Foam::processorPolyPatch::updateMesh(PstreamBuffers& pBufs)
neighbPointsPtr_.reset(new labelList(nPoints(), -1)); neighbPointsPtr_.reset(new labelList(nPoints(), -1));
labelList& neighbPoints = neighbPointsPtr_(); labelList& neighbPoints = neighbPointsPtr_();
forAll(nbrPointFace, nbrPointI) forAll(nbrPointFace, nbrPointi)
{ {
// Find face and index in face on this side. // Find face and index in face on this side.
const face& f = localFaces()[nbrPointFace[nbrPointI]]; const face& f = localFaces()[nbrPointFace[nbrPointi]];
label index = (f.size() - nbrPointIndex[nbrPointI]) % f.size(); label index = (f.size() - nbrPointIndex[nbrPointi]) % f.size();
label patchPointI = f[index]; label patchPointi = f[index];
if (neighbPoints[patchPointI] == -1) if (neighbPoints[patchPointi] == -1)
{ {
// First reference of point // First reference of point
neighbPoints[patchPointI] = nbrPointI; neighbPoints[patchPointi] = nbrPointi;
} }
else if (neighbPoints[patchPointI] >= 0) else if (neighbPoints[patchPointi] >= 0)
{ {
// Point already visited. Mark as duplicate. // Point already visited. Mark as duplicate.
neighbPoints[patchPointI] = -2; neighbPoints[patchPointi] = -2;
} }
} }
// Reset all duplicate entries to -1. // Reset all duplicate entries to -1.
forAll(neighbPoints, patchPointI) forAll(neighbPoints, patchPointi)
{ {
if (neighbPoints[patchPointI] == -2) if (neighbPoints[patchPointi] == -2)
{ {
neighbPoints[patchPointI] = -1; neighbPoints[patchPointi] = -1;
} }
} }

View File

@ -73,32 +73,32 @@ Foam::PackedBoolList Foam::syncTools::getMasterPoints(const polyMesh& mesh)
const labelListList& transformedSlaves = const labelListList& transformedSlaves =
globalData.globalPointTransformedSlaves(); globalData.globalPointTransformedSlaves();
forAll(meshPoints, coupledPointI) forAll(meshPoints, coupledPointi)
{ {
label meshPointI = meshPoints[coupledPointI]; label meshPointi = meshPoints[coupledPointi];
if if
( (
( (
slaves[coupledPointI].size() slaves[coupledPointi].size()
+ transformedSlaves[coupledPointI].size() + transformedSlaves[coupledPointi].size()
) )
> 0 > 0
) )
{ {
isMasterPoint[meshPointI] = true; isMasterPoint[meshPointi] = true;
} }
donePoint[meshPointI] = true; donePoint[meshPointi] = true;
} }
// Do all other points // Do all other points
// ~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~
forAll(donePoint, pointI) forAll(donePoint, pointi)
{ {
if (!donePoint[pointI]) if (!donePoint[pointi])
{ {
isMasterPoint[pointI] = true; isMasterPoint[pointi] = true;
} }
} }

View File

@ -108,10 +108,10 @@ void Foam::syncTools::syncPointMap
// Fill my entries in the shared points // Fill my entries in the shared points
forAll(sharedPtLabels, i) forAll(sharedPtLabels, i)
{ {
label meshPointI = sharedPtLabels[i]; label meshPointi = sharedPtLabels[i];
typename Map<T>::const_iterator fnd = typename Map<T>::const_iterator fnd =
pointValues.find(meshPointI); pointValues.find(meshPointi);
if (fnd != pointValues.end()) if (fnd != pointValues.end())
{ {
@ -791,9 +791,9 @@ void Foam::syncTools::syncEdgeMap
// //
// forAll(pd.sharedPointLabels(), i) // forAll(pd.sharedPointLabels(), i)
// { // {
// label meshPointI = pd.sharedPointLabels()[i]; // label meshPointi = pd.sharedPointLabels()[i];
// // Fill my entries in the shared points // // Fill my entries in the shared points
// sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointI]; // sharedPts[pd.sharedPointAddr()[i]] = pointValues[meshPointi];
// } // }
// } // }
// //
@ -820,10 +820,10 @@ void Foam::syncTools::syncEdgeMap
// const labelList& meshPts = procPatch.meshPoints(); // const labelList& meshPts = procPatch.meshPoints();
// const labelList& nbrPts = procPatch.neighbPoints(); // const labelList& nbrPts = procPatch.neighbPoints();
// //
// forAll(nbrPts, pointI) // forAll(nbrPts, pointi)
// { // {
// label nbrPointI = nbrPts[pointI]; // label nbrPointi = nbrPts[pointi];
// patchInfo[nbrPointI] = pointValues[meshPts[pointI]]; // patchInfo[nbrPointi] = pointValues[meshPts[pointi]];
// } // }
// //
// UOPstream toNbr(procPatch.neighbProcNo(), pBufs); // UOPstream toNbr(procPatch.neighbProcNo(), pBufs);
@ -857,10 +857,10 @@ void Foam::syncTools::syncEdgeMap
// //
// const labelList& meshPts = procPatch.meshPoints(); // const labelList& meshPts = procPatch.meshPoints();
// //
// forAll(meshPts, pointI) // forAll(meshPts, pointi)
// { // {
// label meshPointI = meshPts[pointI]; // label meshPointi = meshPts[pointi];
// cop(pointValues[meshPointI], nbrPatchInfo[pointI]); // cop(pointValues[meshPointi], nbrPatchInfo[pointi]);
// } // }
// } // }
// } // }
@ -924,8 +924,8 @@ void Foam::syncTools::syncEdgeMap
// // my local information. // // my local information.
// forAll(pd.sharedPointLabels(), i) // forAll(pd.sharedPointLabels(), i)
// { // {
// label meshPointI = pd.sharedPointLabels()[i]; // label meshPointi = pd.sharedPointLabels()[i];
// pointValues[meshPointI] = sharedPts[pd.sharedPointAddr()[i]]; // pointValues[meshPointi] = sharedPts[pd.sharedPointAddr()[i]];
// } // }
// } // }
//} //}
@ -1046,8 +1046,8 @@ void Foam::syncTools::syncPointList
forAll(meshPoints, i) forAll(meshPoints, i)
{ {
label pointI = meshPoints[i]; label pointi = meshPoints[i];
Map<label>::const_iterator iter = mpm.find(pointI); Map<label>::const_iterator iter = mpm.find(pointi);
if (iter != mpm.end()) if (iter != mpm.end())
{ {
cppFld[iter()] = pointValues[i]; cppFld[iter()] = pointValues[i];
@ -1067,8 +1067,8 @@ void Foam::syncTools::syncPointList
forAll(meshPoints, i) forAll(meshPoints, i)
{ {
label pointI = meshPoints[i]; label pointi = meshPoints[i];
Map<label>::const_iterator iter = mpm.find(pointI); Map<label>::const_iterator iter = mpm.find(pointi);
if (iter != mpm.end()) if (iter != mpm.end())
{ {
pointValues[i] = cppFld[iter()]; pointValues[i] = cppFld[iter()];
@ -1102,8 +1102,8 @@ void Foam::syncTools::syncPointList
// //
// forAll(meshPoints, i) // forAll(meshPoints, i)
// { // {
// label pointI = meshPoints[i]; // label pointi = meshPoints[i];
// Map<label>::const_iterator iter = mpm.find(pointI); // Map<label>::const_iterator iter = mpm.find(pointi);
// if (iter != mpm.end()) // if (iter != mpm.end())
// { // {
// cppFld[iter()] = pointValues[i]; // cppFld[iter()] = pointValues[i];
@ -1124,8 +1124,8 @@ void Foam::syncTools::syncPointList
// //
// forAll(meshPoints, i) // forAll(meshPoints, i)
// { // {
// label pointI = meshPoints[i]; // label pointi = meshPoints[i];
// Map<label>::const_iterator iter = mpm.find(pointI); // Map<label>::const_iterator iter = mpm.find(pointi);
// if (iter != mpm.end()) // if (iter != mpm.end())
// { // {
// pointValues[i] = cppFld[iter()]; // pointValues[i] = cppFld[iter()];

Some files were not shown because too many files have changed in this diff Show More