Standardized cell, patch, face and processor loop index names

This commit is contained in:
Henry Weller
2016-04-25 12:00:53 +01:00
parent 43beb06018
commit 450728ea84
525 changed files with 6296 additions and 6296 deletions

View File

@ -163,11 +163,11 @@ int main(int argc, char *argv[])
} }
// Remove face // Remove face
label candidateFaceI = rndGen.integer(0, mesh.nInternalFaces()-1); label candidateFacei = rndGen.integer(0, mesh.nInternalFaces()-1);
Info<< "Wanting to delete face " << mesh.faceCentres()[candidateFaceI] Info<< "Wanting to delete face " << mesh.faceCentres()[candidateFacei]
<< nl << endl; << nl << endl;
labelList candidates(1, candidateFaceI); labelList candidates(1, candidateFacei);
// Get compatible set of faces and connected sets of cells. // Get compatible set of faces and connected sets of cells.

View File

@ -69,23 +69,23 @@ int main(int argc, char *argv[])
for (label celli = 0; celli < mesh.nCells(); celli++) for (label celli = 0; celli < mesh.nCells(); celli++)
{ {
// to global index // to global index
label globalCellI = globalNumbering.toGlobal(celli); label globalCelli = globalNumbering.toGlobal(celli);
// and back // and back
label procI = globalNumbering.whichProcID(globalCellI); label proci = globalNumbering.whichProcID(globalCelli);
label localCellI = globalNumbering.toLocal(globalCellI); label localCelli = globalNumbering.toLocal(globalCelli);
if (procI != Pstream::myProcNo() || localCellI != celli) if (proci != Pstream::myProcNo() || localCelli != celli)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. celli:" << celli << " localCellI:" << localCellI << "Problem. celli:" << celli << " localCelli:" << localCelli
<< " procI:" << procI << abort(FatalError); << " proci:" << proci << abort(FatalError);
} }
if (!globalNumbering.isLocal(globalCellI)) if (!globalNumbering.isLocal(globalCelli))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. celli:" << celli << " globalCellI:" << globalCellI << "Problem. celli:" << celli << " globalCelli:" << globalCelli
<< " not local" << abort(FatalError); << " not local" << abort(FatalError);
} }
} }
@ -104,30 +104,30 @@ int main(int argc, char *argv[])
{ {
// We already checked that toGlobal(0) maps back correctly to myProcNo // We already checked that toGlobal(0) maps back correctly to myProcNo
// so now check that the index one before maps to the previous processor // so now check that the index one before maps to the previous processor
label prevProcCellI = globalNumbering.toGlobal(0)-1; label prevProcCelli = globalNumbering.toGlobal(0)-1;
label procI = globalNumbering.whichProcID(prevProcCellI); label proci = globalNumbering.whichProcID(prevProcCelli);
if (procI != Pstream::myProcNo()-1) if (proci != Pstream::myProcNo()-1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. global:" << prevProcCellI << "Problem. global:" << prevProcCelli
<< " expected on processor:" << Pstream::myProcNo()-1 << " expected on processor:" << Pstream::myProcNo()-1
<< " but is calculated to be on procI:" << procI << " but is calculated to be on proci:" << proci
<< abort(FatalError); << abort(FatalError);
} }
if (globalNumbering.isLocal(prevProcCellI)) if (globalNumbering.isLocal(prevProcCelli))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. globalCellI:" << prevProcCellI << "Problem. globalCelli:" << prevProcCelli
<< " calculated as local" << abort(FatalError); << " calculated as local" << abort(FatalError);
} }
if (!globalNumbering.isLocal(procI, prevProcCellI)) if (!globalNumbering.isLocal(proci, prevProcCelli))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. globalCellI:" << prevProcCellI << "Problem. globalCelli:" << prevProcCelli
<< " not calculated as local on processor:" << procI << " not calculated as local on processor:" << proci
<< abort(FatalError); << abort(FatalError);
} }
} }
@ -135,30 +135,30 @@ int main(int argc, char *argv[])
if (Pstream::myProcNo() < Pstream::nProcs()-1) if (Pstream::myProcNo() < Pstream::nProcs()-1)
{ {
label nextProcCellI = globalNumbering.toGlobal(mesh.nCells()-1)+1; label nextProcCelli = globalNumbering.toGlobal(mesh.nCells()-1)+1;
label procI = globalNumbering.whichProcID(nextProcCellI); label proci = globalNumbering.whichProcID(nextProcCelli);
if (procI != Pstream::myProcNo()+1) if (proci != Pstream::myProcNo()+1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. global:" << nextProcCellI << "Problem. global:" << nextProcCelli
<< " expected on processor:" << Pstream::myProcNo()+1 << " expected on processor:" << Pstream::myProcNo()+1
<< " but is calculated to be on procI:" << procI << " but is calculated to be on proci:" << proci
<< abort(FatalError); << abort(FatalError);
} }
if (globalNumbering.isLocal(nextProcCellI)) if (globalNumbering.isLocal(nextProcCelli))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. globalCellI:" << nextProcCellI << "Problem. globalCelli:" << nextProcCelli
<< " calculated as local" << abort(FatalError); << " calculated as local" << abort(FatalError);
} }
if (!globalNumbering.isLocal(procI, nextProcCellI)) if (!globalNumbering.isLocal(proci, nextProcCelli))
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Problem. globalCellI:" << nextProcCellI << "Problem. globalCelli:" << nextProcCelli
<< " not calculated as local on processor:" << procI << " not calculated as local on processor:" << proci
<< abort(FatalError); << abort(FatalError);
} }
} }

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
@ -151,9 +151,9 @@ int main(int argc, char *argv[])
{ {
PstreamBuffers pBufs(Pstream::nonBlocking); PstreamBuffers pBufs(Pstream::nonBlocking);
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
UOPstream toProc(procI, pBufs); UOPstream toProc(proci, pBufs);
toProc << Pstream::myProcNo(); toProc << Pstream::myProcNo();
} }
@ -161,17 +161,17 @@ int main(int argc, char *argv[])
pBufs.finishedSends(); pBufs.finishedSends();
// Consume // Consume
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
UIPstream fromProc(procI, pBufs); UIPstream fromProc(proci, pBufs);
label data; label data;
fromProc >> data; fromProc >> data;
if (data != procI) if (data != proci)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "From processor " << procI << " received " << data << "From processor " << proci << " received " << data
<< " but expected " << procI << " but expected " << proci
<< exit(FatalError); << exit(FatalError);
} }
} }

View File

@ -76,21 +76,21 @@ int main(int argc, char *argv[])
labelList nSend(Pstream::nProcs(), 0); labelList nSend(Pstream::nProcs(), 0);
forAll(complexData, i) forAll(complexData, i)
{ {
label procI = complexData[i].first(); label proci = complexData[i].first();
nSend[procI]++; nSend[proci]++;
} }
// Collect items to be sent // Collect items to be sent
labelListList sendMap(Pstream::nProcs()); labelListList sendMap(Pstream::nProcs());
forAll(sendMap, procI) forAll(sendMap, proci)
{ {
sendMap[procI].setSize(nSend[procI]); sendMap[proci].setSize(nSend[proci]);
} }
nSend = 0; nSend = 0;
forAll(complexData, i) forAll(complexData, i)
{ {
label procI = complexData[i].first(); label proci = complexData[i].first();
sendMap[procI][nSend[procI]++] = i; sendMap[proci][nSend[proci]++] = i;
} }
// Sync how many to send // Sync how many to send
@ -99,9 +99,9 @@ int main(int argc, char *argv[])
// Collect items to be received // Collect items to be received
labelListList recvMap(Pstream::nProcs()); labelListList recvMap(Pstream::nProcs());
forAll(recvMap, procI) forAll(recvMap, proci)
{ {
recvMap[procI].setSize(nRecv[procI]); recvMap[proci].setSize(nRecv[proci]);
} }
label constructSize = 0; label constructSize = 0;
@ -111,13 +111,13 @@ int main(int argc, char *argv[])
recvMap[Pstream::myProcNo()][i] = constructSize++; recvMap[Pstream::myProcNo()][i] = constructSize++;
} }
// Construct from other processors // Construct from other processors
forAll(recvMap, procI) forAll(recvMap, proci)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
forAll(recvMap[procI], i) forAll(recvMap[proci], i)
{ {
recvMap[procI][i] = constructSize++; recvMap[proci][i] = constructSize++;
} }
} }
} }

View File

@ -80,14 +80,14 @@ int main(int argc, char *argv[])
{ {
const labelList& fEdges = patch.faceEdges()[facei]; const labelList& fEdges = patch.faceEdges()[facei];
label globalFaceI = globalNumbering.toGlobal(facei); label globalFacei = globalNumbering.toGlobal(facei);
forAll(fEdges, i) forAll(fEdges, i)
{ {
changedEdges.append(fEdges[i]); changedEdges.append(fEdges[i]);
changedInfo.append changedInfo.append
( (
patchEdgeFaceRegions(labelPair(globalFaceI, globalFaceI)) patchEdgeFaceRegions(labelPair(globalFacei, globalFacei))
); );
} }
} }

View File

@ -142,20 +142,20 @@ int main(int argc, char *argv[])
OFstream objFile(fName); OFstream objFile(fName);
// Write processors as single vertex in centre of mesh // Write processors as single vertex in centre of mesh
forAll(meshCentres, procI) forAll(meshCentres, proci)
{ {
const point& pt = meshCentres[procI]; const point& pt = meshCentres[proci];
objFile << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl; objFile << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
} }
// Write connections as lines between processors (duplicated) // Write connections as lines between processors (duplicated)
forAll(connections, procI) forAll(connections, proci)
{ {
const labelList& nbs = connections[procI]; const labelList& nbs = connections[proci];
forAll(nbs, nbI) forAll(nbs, nbI)
{ {
objFile << "l " << procI + 1 << ' ' << nbs[nbI] + 1 << endl; objFile << "l " << proci + 1 << ' ' << nbs[nbI] + 1 << endl;
} }
} }
@ -196,9 +196,9 @@ int main(int argc, char *argv[])
OFstream objFile(fName); OFstream objFile(fName);
forAll(meshCentres, procI) forAll(meshCentres, proci)
{ {
const point& pt = meshCentres[procI]; const point& pt = meshCentres[proci];
objFile << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() objFile << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z()
<< endl; << endl;

View File

@ -71,7 +71,7 @@ void modifyOrAddFace
const label facei, const label facei,
const label own, const label own,
const bool flipFaceFlux, const bool flipFaceFlux,
const label newPatchI, const label newPatchi,
const label zoneID, const label zoneID,
const bool zoneFlip, const bool zoneFlip,
@ -90,7 +90,7 @@ void modifyOrAddFace
own, // owner own, // owner
-1, // neighbour -1, // neighbour
flipFaceFlux, // face flip flipFaceFlux, // face flip
newPatchI, // patch for face newPatchi, // patch for face
false, // remove from zone false, // remove from zone
zoneID, // zone for face zoneID, // zone for face
zoneFlip // face flip in zone zoneFlip // face flip in zone
@ -112,7 +112,7 @@ void modifyOrAddFace
-1, // master edge -1, // master edge
facei, // master face facei, // master face
flipFaceFlux, // face flip flipFaceFlux, // face flip
newPatchI, // patch for face newPatchi, // patch for face
zoneID, // zone for face zoneID, // zone for face
zoneFlip // face flip in zone zoneFlip // face flip in zone
) )
@ -160,9 +160,9 @@ void subsetVolFields
label newStart = fld.patch().patch().start(); label newStart = fld.patch().patch().start();
label oldPatchI = subsetter.patchMap()[patchi]; label oldPatchi = subsetter.patchMap()[patchi];
if (oldPatchI == -1) if (oldPatchi == -1)
{ {
// New patch. Reset whole value. // New patch. Reset whole value.
fld = exposedValue; fld = exposedValue;
@ -171,17 +171,17 @@ void subsetVolFields
{ {
// Reset those faces that originate from different patch // Reset those faces that originate from different patch
// or internal faces. // or internal faces.
label oldSize = volField.boundaryField()[oldPatchI].size(); label oldSize = volField.boundaryField()[oldPatchi].size();
label oldStart = volField.boundaryField() label oldStart = volField.boundaryField()
[ [
oldPatchI oldPatchi
].patch().patch().start(); ].patch().patch().start();
forAll(fld, j) forAll(fld, j)
{ {
label oldFaceI = subsetter.faceMap()[newStart+j]; label oldFacei = subsetter.faceMap()[newStart+j];
if (oldFaceI < oldStart || oldFaceI >= oldStart+oldSize) if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
{ {
fld[j] = exposedValue; fld[j] = exposedValue;
} }
@ -233,9 +233,9 @@ void subsetSurfaceFields
label newStart = fld.patch().patch().start(); label newStart = fld.patch().patch().start();
label oldPatchI = subsetter.patchMap()[patchi]; label oldPatchi = subsetter.patchMap()[patchi];
if (oldPatchI == -1) if (oldPatchi == -1)
{ {
// New patch. Reset whole value. // New patch. Reset whole value.
fld = exposedValue; fld = exposedValue;
@ -244,17 +244,17 @@ void subsetSurfaceFields
{ {
// Reset those faces that originate from different patch // Reset those faces that originate from different patch
// or internal faces. // or internal faces.
label oldSize = volField.boundaryField()[oldPatchI].size(); label oldSize = volField.boundaryField()[oldPatchi].size();
label oldStart = volField.boundaryField() label oldStart = volField.boundaryField()
[ [
oldPatchI oldPatchi
].patch().patch().start(); ].patch().patch().start();
forAll(fld, j) forAll(fld, j)
{ {
label oldFaceI = subsetter.faceMap()[newStart+j]; label oldFacei = subsetter.faceMap()[newStart+j];
if (oldFaceI < oldStart || oldFaceI >= oldStart+oldSize) if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
{ {
fld[j] = exposedValue; fld[j] = exposedValue;
} }
@ -706,7 +706,7 @@ int main(int argc, char *argv[])
} }
// Exposed faces patch // Exposed faces patch
label defaultPatchI = findPatch(mesh.boundaryMesh(), defaultPatch); label defaultPatchi = findPatch(mesh.boundaryMesh(), defaultPatch);
// //
@ -725,7 +725,7 @@ int main(int argc, char *argv[])
blockedCells.invert(mesh.nCells()); blockedCells.invert(mesh.nCells());
// Create subsetted mesh. // Create subsetted mesh.
subsetter.setLargeCellSubset(blockedCells, defaultPatchI, true); subsetter.setLargeCellSubset(blockedCells, defaultPatchi, true);
} }
@ -783,7 +783,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
scalar(Zero), scalar(Zero),
volScalarField::typeName, volScalarField::typeName,
scalarFlds scalarFlds
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
vector(Zero), vector(Zero),
volVectorField::typeName, volVectorField::typeName,
vectorFlds vectorFlds
@ -813,7 +813,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
sphericalTensor(Zero), sphericalTensor(Zero),
volSphericalTensorField::typeName, volSphericalTensorField::typeName,
sphericalTensorFlds sphericalTensorFlds
@ -825,7 +825,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
symmTensor(Zero), symmTensor(Zero),
volSymmTensorField::typeName, volSymmTensorField::typeName,
symmTensorFlds symmTensorFlds
@ -837,7 +837,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
tensor(Zero), tensor(Zero),
volTensorField::typeName, volTensorField::typeName,
tensorFlds tensorFlds
@ -851,7 +851,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
scalar(Zero), scalar(Zero),
surfaceScalarField::typeName, surfaceScalarField::typeName,
surfScalarFlds surfScalarFlds
@ -863,7 +863,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
vector(Zero), vector(Zero),
surfaceVectorField::typeName, surfaceVectorField::typeName,
surfVectorFlds surfVectorFlds
@ -881,7 +881,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
sphericalTensor(Zero), sphericalTensor(Zero),
surfaceSphericalTensorField::typeName, surfaceSphericalTensorField::typeName,
surfSphericalTensorFlds surfSphericalTensorFlds
@ -901,7 +901,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
symmTensor(Zero), symmTensor(Zero),
surfaceSymmTensorField::typeName, surfaceSymmTensorField::typeName,
surfSymmTensorFlds surfSymmTensorFlds
@ -913,7 +913,7 @@ int main(int argc, char *argv[])
( (
subsetter, subsetter,
objects, objects,
defaultPatchI, defaultPatchi,
tensor(Zero), tensor(Zero),
surfaceTensorField::typeName, surfaceTensorField::typeName,
surfTensorFlds surfTensorFlds

View File

@ -458,15 +458,15 @@ void doRefinement
const labelListList& addedCells = multiRef.addedCells(); const labelListList& addedCells = multiRef.addedCells();
forAll(addedCells, oldCellI) forAll(addedCells, oldCelli)
{ {
const labelList& added = addedCells[oldCellI]; const labelList& added = addedCells[oldCelli];
if (added.size()) if (added.size())
{ {
// Give all cells resulting from split the refinement level // Give all cells resulting from split the refinement level
// of the master. // of the master.
label masterLevel = ++refLevel[oldCellI]; label masterLevel = ++refLevel[oldCelli];
forAll(added, i) forAll(added, i)
{ {
@ -629,7 +629,7 @@ int main(int argc, char *argv[])
#include "createPolyMesh.H" #include "createPolyMesh.H"
// If nessecary add oldInternalFaces patch // If nessecary add oldInternalFaces patch
label newPatchI = addPatch(mesh, "oldInternalFaces"); label newPatchi = addPatch(mesh, "oldInternalFaces");
// //
@ -854,7 +854,7 @@ int main(int argc, char *argv[])
{ {
// Subset mesh to remove inside cells altogether. Updates cutCells, // Subset mesh to remove inside cells altogether. Updates cutCells,
// refLevel. // refLevel.
subsetMesh(mesh, writeMesh, newPatchI, inside, cutCells, refLevel); subsetMesh(mesh, writeMesh, newPatchi, inside, cutCells, refLevel);
} }

View File

@ -208,7 +208,7 @@ void Foam::cellSplitter::setRefinement
// Add other pyramids // Add other pyramids
for (label i = 1; i < cFaces.size(); i++) for (label i = 1; i < cFaces.size(); i++)
{ {
label addedCellI = label addedCelli =
meshMod.setAction meshMod.setAction
( (
polyAddCell polyAddCell
@ -221,7 +221,7 @@ void Foam::cellSplitter::setRefinement
) )
); );
newCells[i] = addedCellI; newCells[i] = addedCelli;
} }
cellToCells.insert(celli, newCells); cellToCells.insert(celli, newCells);
@ -469,17 +469,17 @@ void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
forAllConstIter(Map<label>, addedPoints_, iter) forAllConstIter(Map<label>, addedPoints_, iter)
{ {
label oldCellI = iter.key(); label oldCelli = iter.key();
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

@ -223,9 +223,9 @@ label findFace
scalar almostMinDist = GREAT; scalar almostMinDist = GREAT;
label almostMinI = -1; label almostMinI = -1;
forAll(pp, patchFaceI) forAll(pp, patchFacei)
{ {
pointHit pHit(pp[patchFaceI].nearestPoint(nearPoint, points)); pointHit pHit(pp[patchFacei].nearestPoint(nearPoint, points));
if (pHit.hit()) if (pHit.hit())
{ {
@ -235,12 +235,12 @@ label findFace
almostMinI = minI; almostMinI = minI;
minDist = pHit.distance(); minDist = pHit.distance();
minI = patchFaceI + mesh.nInternalFaces(); minI = patchFacei + mesh.nInternalFaces();
} }
else if (pHit.distance() < almostMinDist) else if (pHit.distance() < almostMinDist)
{ {
almostMinDist = pHit.distance(); almostMinDist = pHit.distance();
almostMinI = patchFaceI + mesh.nInternalFaces(); almostMinI = patchFacei + mesh.nInternalFaces();
} }
} }
} }

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
@ -120,9 +120,9 @@ int main(int argc, char *argv[])
const labelList& pCells = mesh.pointCells()[meshPointI]; const labelList& pCells = mesh.pointCells()[meshPointI];
forAll(pCells, pCellI) forAll(pCells, pCelli)
{ {
cutCells.insert(pCells[pCellI]); cutCells.insert(pCells[pCelli]);
} }
} }
} }

View File

@ -65,7 +65,7 @@ labelList getInternalFaceOrder
labelList oldToNew(owner.size(), -1); labelList oldToNew(owner.size(), -1);
// First unassigned face // First unassigned face
label newFaceI = 0; label newFacei = 0;
forAll(cells, celli) forAll(cells, celli)
{ {
@ -77,20 +77,20 @@ labelList getInternalFaceOrder
{ {
label facei = cFaces[i]; label facei = cFaces[i];
label nbrCellI = neighbour[facei]; label nbrCelli = neighbour[facei];
if (nbrCellI != -1) if (nbrCelli != -1)
{ {
// Internal face. Get cell on other side. // Internal face. Get cell on other side.
if (nbrCellI == celli) if (nbrCelli == celli)
{ {
nbrCellI = owner[facei]; nbrCelli = owner[facei];
} }
if (celli < nbrCellI) if (celli < nbrCelli)
{ {
// CellI is master // Celli is master
nbr[i] = nbrCellI; nbr[i] = nbrCelli;
} }
else else
{ {
@ -111,13 +111,13 @@ labelList getInternalFaceOrder
{ {
if (nbr[i] != -1) if (nbr[i] != -1)
{ {
oldToNew[cFaces[nbr.indices()[i]]] = newFaceI++; oldToNew[cFaces[nbr.indices()[i]]] = newFacei++;
} }
} }
} }
// Keep boundary faces in same order. // Keep boundary faces in same order.
for (label facei = newFaceI; facei < owner.size(); facei++) for (label facei = newFacei; facei < owner.size(); facei++)
{ {
oldToNew[facei] = facei; oldToNew[facei] = facei;
} }
@ -285,7 +285,7 @@ void ReadProblem
) )
{ {
// Index of foam patch // Index of foam patch
label foamPatchI = -1; label foamPatchi = -1;
// Read prostar id // Read prostar id
@ -311,7 +311,7 @@ void ReadProblem
if (prostarToFoamPatch.found(prostarI)) if (prostarToFoamPatch.found(prostarI))
{ {
foamPatchI = prostarToFoamPatch[prostarI]; foamPatchi = prostarToFoamPatch[prostarI];
// Read boundary type // Read boundary type
@ -325,7 +325,7 @@ void ReadProblem
char* s = new char[size + 1]; char* s = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s); CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
s[size] = '\0'; s[size] = '\0';
foamPatchTypes[foamPatchI] = string::validate<word>(string(s)); foamPatchTypes[foamPatchi] = string::validate<word>(string(s));
delete [] s; delete [] s;
} }
@ -347,7 +347,7 @@ void ReadProblem
char* name = new char[size + 1]; char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name); CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
name[size] = '\0'; name[size] = '\0';
foamPatchNames[foamPatchI] = foamPatchNames[foamPatchi] =
string::validate<word>(string(name)); string::validate<word>(string(name));
delete [] name; delete [] name;
} }
@ -360,22 +360,22 @@ void ReadProblem
char* name = new char[size + 1]; char* name = new char[size + 1];
CCMIOReadOptstr(NULL, boundary, "Label", &size, name); CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
name[size] = '\0'; name[size] = '\0';
foamPatchNames[foamPatchI] = foamPatchNames[foamPatchi] =
string::validate<word>(string(name)); string::validate<word>(string(name));
delete [] name; delete [] name;
} }
else else
{ {
foamPatchNames[foamPatchI] = foamPatchNames[foamPatchi] =
foamPatchTypes[foamPatchI] foamPatchTypes[foamPatchi]
+ Foam::name(foamPatchI); + Foam::name(foamPatchi);
Pout<< "Made up name:" << foamPatchNames[foamPatchI] Pout<< "Made up name:" << foamPatchNames[foamPatchi]
<< endl; << endl;
} }
Pout<< "Read patch:" << foamPatchI Pout<< "Read patch:" << foamPatchi
<< " name:" << foamPatchNames[foamPatchI] << " name:" << foamPatchNames[foamPatchi]
<< " foamPatchTypes:" << foamPatchTypes[foamPatchI] << " foamPatchTypes:" << foamPatchTypes[foamPatchi]
<< endl; << endl;
} }
@ -557,12 +557,12 @@ void ReadCells
for (unsigned int i = 0; i < nFaces; i++) for (unsigned int i = 0; i < nFaces; i++)
{ {
label foamFaceI = foamPatchStarts[regionI] + i; label foamFacei = foamPatchStarts[regionI] + i;
foamFaceMap[foamFaceI] = mapData[i]; foamFaceMap[foamFacei] = mapData[i];
foamOwner[foamFaceI] = faceCells[i]; foamOwner[foamFacei] = faceCells[i];
foamNeighbour[foamFaceI] = -1; foamNeighbour[foamFacei] = -1;
face& f = foamFaces[foamFaceI]; face& f = foamFaces[foamFacei];
f.setSize(faces[pos++]); f.setSize(faces[pos++]);
forAll(f, fp) forAll(f, fp)
@ -812,8 +812,8 @@ int main(int argc, char *argv[])
// Renumber cell labels // Renumber cell labels
{ {
label maxCCMCellI = max(foamCellMap); label maxCCMCelli = max(foamCellMap);
labelList toFoamCells(invert(maxCCMCellI+1, foamCellMap)); labelList toFoamCells(invert(maxCCMCelli+1, foamCellMap));
inplaceRenumber(toFoamCells, foamOwner); inplaceRenumber(toFoamCells, foamOwner);
inplaceRenumber(toFoamCells, foamNeighbour); inplaceRenumber(toFoamCells, foamNeighbour);
@ -929,16 +929,16 @@ int main(int argc, char *argv[])
// Create patches. Use patch types to determine what Foam types to generate. // Create patches. Use patch types to determine what Foam types to generate.
List<polyPatch*> newPatches(foamPatchNames.size()); List<polyPatch*> newPatches(foamPatchNames.size());
label meshFaceI = foamPatchStarts[0]; label meshFacei = foamPatchStarts[0];
forAll(newPatches, patchi) forAll(newPatches, patchi)
{ {
const word& patchName = foamPatchNames[patchi]; const word& patchName = foamPatchNames[patchi];
const word& patchType = foamPatchTypes[patchi]; const word& patchType = foamPatchTypes[patchi];
Pout<< "Patch:" << patchName << " start at:" << meshFaceI Pout<< "Patch:" << patchName << " start at:" << meshFacei
<< " size:" << foamPatchSizes[patchi] << " size:" << foamPatchSizes[patchi]
<< " end at:" << meshFaceI+foamPatchSizes[patchi] << " end at:" << meshFacei+foamPatchSizes[patchi]
<< endl; << endl;
if (patchType == "wall") if (patchType == "wall")
@ -948,7 +948,7 @@ int main(int argc, char *argv[])
( (
patchName, patchName,
foamPatchSizes[patchi], foamPatchSizes[patchi],
meshFaceI, meshFacei,
patchi, patchi,
mesh.boundaryMesh(), mesh.boundaryMesh(),
patchType patchType
@ -961,7 +961,7 @@ int main(int argc, char *argv[])
( (
patchName, patchName,
foamPatchSizes[patchi], foamPatchSizes[patchi],
meshFaceI, meshFacei,
patchi, patchi,
mesh.boundaryMesh(), mesh.boundaryMesh(),
patchType patchType
@ -975,7 +975,7 @@ int main(int argc, char *argv[])
( (
patchName, patchName,
foamPatchSizes[patchi], foamPatchSizes[patchi],
meshFaceI, meshFacei,
patchi, patchi,
mesh.boundaryMesh(), mesh.boundaryMesh(),
patchType patchType
@ -990,20 +990,20 @@ int main(int argc, char *argv[])
( (
patchName, patchName,
foamPatchSizes[patchi], foamPatchSizes[patchi],
meshFaceI, meshFacei,
patchi, patchi,
mesh.boundaryMesh(), mesh.boundaryMesh(),
word::null word::null
); );
} }
meshFaceI += foamPatchSizes[patchi]; meshFacei += foamPatchSizes[patchi];
} }
if (meshFaceI != foamOwner.size()) if (meshFacei != foamOwner.size())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "meshFaceI:" << meshFaceI << "meshFacei:" << meshFacei
<< " nFaces:" << foamOwner.size() << " nFaces:" << foamOwner.size()
<< abort(FatalError); << abort(FatalError);
} }

View File

@ -550,16 +550,16 @@ int main(int argc, char *argv[])
{ {
labelListList curBlockCells = blocks[blockI].blockCells(); labelListList curBlockCells = blocks[blockI].blockCells();
forAll(curBlockCells, blockCellI) forAll(curBlockCells, blockCelli)
{ {
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]
]; ];
} }
@ -587,11 +587,11 @@ int main(int argc, char *argv[])
// Check if this name has been already created // Check if this name has been already created
label existingPatch = -1; label existingPatch = -1;
for (label oldPatchI = 0; oldPatchI < nCreatedPatches; oldPatchI++) for (label oldPatchi = 0; oldPatchi < nCreatedPatches; oldPatchi++)
{ {
if (patchNames[oldPatchI] == cfxPatchNames[patchi]) if (patchNames[oldPatchi] == cfxPatchNames[patchi])
{ {
existingPatch = oldPatchI; existingPatch = oldPatchi;
break; break;
} }
} }

View File

@ -144,16 +144,16 @@ cellShape create3DCellShape
bool found = false; bool found = false;
forAll(localFaces, meshFaceI) forAll(localFaces, meshFacei)
{ {
if (localFaces[meshFaceI].size() == firstModelFace.size()) if (localFaces[meshFacei].size() == firstModelFace.size())
{ {
// Match. Insert points into the pointLabels // Match. Insert points into the pointLabels
found = true; found = true;
const labelList& curMeshFace = localFaces[meshFaceI]; const labelList& curMeshFace = localFaces[meshFacei];
meshFaceUsed[meshFaceI] = true; meshFaceUsed[meshFacei] = true;
forAll(curMeshFace, pointI) forAll(curMeshFace, pointI)
{ {
@ -173,26 +173,26 @@ cellShape create3DCellShape
<< abort(FatalError); << abort(FatalError);
} }
for (label modelFaceI = 1; modelFaceI < modelFaces.size(); modelFaceI++) for (label modelFacei = 1; modelFacei < modelFaces.size(); modelFacei++)
{ {
// get the next model face // get the next model face
const labelList& curModelFace = const labelList& curModelFace =
modelFaces modelFaces
[faceMatchingOrder[fluentCellModelID][modelFaceI]]; [faceMatchingOrder[fluentCellModelID][modelFacei]];
found = false; found = false;
// Loop through mesh faces until a match is found // Loop through mesh faces until a match is found
forAll(localFaces, meshFaceI) forAll(localFaces, meshFacei)
{ {
if if
( (
!meshFaceUsed[meshFaceI] !meshFaceUsed[meshFacei]
&& localFaces[meshFaceI].size() == curModelFace.size() && localFaces[meshFacei].size() == curModelFace.size()
) )
{ {
// A possible match. A mesh face will be rotated, so make a copy // A possible match. A mesh face will be rotated, so make a copy
labelList meshFaceLabels = localFaces[meshFaceI]; labelList meshFaceLabels = localFaces[meshFacei];
for for
( (
@ -231,7 +231,7 @@ cellShape create3DCellShape
meshFaceLabels[pointI]; meshFaceLabels[pointI];
} }
meshFaceUsed[meshFaceI] = true; meshFaceUsed[meshFacei] = true;
break; break;
} }
@ -258,7 +258,7 @@ cellShape create3DCellShape
// A model face is not matched. Shape detection failed // A model face is not matched. Shape detection failed
FatalErrorInFunction FatalErrorInFunction
<< "Cannot find match for face " << "Cannot find match for face "
<< modelFaceI << modelFacei
<< ".\nModel: " << curModel.name() << " model face: " << ".\nModel: " << curModel.name() << " model face: "
<< curModelFace << " Mesh faces: " << localFaces << curModelFace << " Mesh faces: " << localFaces
<< "Matched points: " << pointLabels << "Matched points: " << pointLabels

View File

@ -949,23 +949,23 @@ int main(int argc, char *argv[])
const face& f = pFaces[i]; const face& f = pFaces[i];
// Find face in pp using all vertices of f. // Find face in pp using all vertices of f.
label patchFaceI = findFace(pp, f); label patchFacei = findFace(pp, f);
if (patchFaceI != -1) if (patchFacei != -1)
{ {
label meshFaceI = pp.start() + patchFaceI; label meshFacei = pp.start() + patchFacei;
repatcher.changePatchID(meshFaceI, patchi); repatcher.changePatchID(meshFacei, patchi);
} }
else else
{ {
// Maybe internal face? If so add to faceZone with same index // Maybe internal face? If so add to faceZone with same index
// - might be useful. // - might be useful.
label meshFaceI = findInternalFace(mesh, f); label meshFacei = findInternalFace(mesh, f);
if (meshFaceI != -1) if (meshFacei != -1)
{ {
zoneFaces[patchi].append(meshFaceI); zoneFaces[patchi].append(meshFacei);
} }
else else
{ {
@ -1103,22 +1103,22 @@ int main(int argc, char *argv[])
if (mesh.boundaryMesh()[defaultPatchID].size() == 0) if (mesh.boundaryMesh()[defaultPatchID].size() == 0)
{ {
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1)); List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
label newPatchI = 0; label newPatchi = 0;
forAll(mesh.boundaryMesh(), patchi) forAll(mesh.boundaryMesh(), patchi)
{ {
if (patchi != defaultPatchID) if (patchi != defaultPatchID)
{ {
const polyPatch& patch = mesh.boundaryMesh()[patchi]; const polyPatch& patch = mesh.boundaryMesh()[patchi];
newPatchPtrList[newPatchI] = patch.clone newPatchPtrList[newPatchi] = patch.clone
( (
mesh.boundaryMesh(), mesh.boundaryMesh(),
newPatchI, newPatchi,
patch.size(), patch.size(),
patch.start() patch.start()
).ptr(); ).ptr();
newPatchI++; newPatchi++;
} }
} }
repatcher.changePatches(newPatchPtrList); repatcher.changePatches(newPatchPtrList);

View File

@ -816,21 +816,21 @@ int main(int argc, char *argv[])
// Renumber vertex numbers on boundaryFaces // Renumber vertex numbers on boundaryFaces
forAll(boundaryFaces, bFaceI) forAll(boundaryFaces, bFacei)
{ {
labelList foamVerts(renumber(unvToFoam, boundaryFaces[bFaceI])); labelList foamVerts(renumber(unvToFoam, boundaryFaces[bFacei]));
if (findIndex(foamVerts, -1) != -1) if (findIndex(foamVerts, -1) != -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Boundary face " << bFaceI << "Boundary face " << bFacei
<< " unv vertices " << boundaryFaces[bFaceI] << " unv vertices " << boundaryFaces[bFacei]
<< " has some undefined vertices " << foamVerts << " has some undefined vertices " << foamVerts
<< abort(FatalError); << abort(FatalError);
} }
// Bit nasty: replace vertex list. // Bit nasty: replace vertex list.
boundaryFaces[bFaceI].transfer(foamVerts); boundaryFaces[bFacei].transfer(foamVerts);
} }
@ -1021,13 +1021,13 @@ int main(int argc, char *argv[])
{ {
if (boundaryFaceToIndex.found(faceIndices[i])) if (boundaryFaceToIndex.found(faceIndices[i]))
{ {
label bFaceI = boundaryFaceToIndex[faceIndices[i]]; label bFacei = boundaryFaceToIndex[faceIndices[i]];
if (own[bFaceI] != -1 && nei[bFaceI] == -1) if (own[bFacei] != -1 && nei[bFacei] == -1)
{ {
patchFaces[cnt] = boundaryFaces[bFaceI]; patchFaces[cnt] = boundaryFaces[bFacei];
cnt++; cnt++;
if (alreadyOnBoundary.found(bFaceI)) if (alreadyOnBoundary.found(bFacei))
{ {
duplicateFaces = true; duplicateFaces = true;
} }
@ -1100,8 +1100,8 @@ int main(int argc, char *argv[])
forAll(patchFaces, i) forAll(patchFaces, i)
{ {
label bFaceI = boundaryFaceToIndex[faceIndices[i]]; label bFacei = boundaryFaceToIndex[faceIndices[i]];
alreadyOnBoundary.insert(bFaceI); alreadyOnBoundary.insert(bFacei);
} }
} }
} }

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
@ -207,16 +207,16 @@ int main(int argc, char *argv[])
{ {
labelListList curBlockCells = blocks[blockI].blockCells(); labelListList curBlockCells = blocks[blockI].blockCells();
forAll(curBlockCells, blockCellI) forAll(curBlockCells, blockCelli)
{ {
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

@ -93,16 +93,16 @@ void Foam::sammMesh::createBoundaryFaces()
const faceList& curCellFaces = const faceList& curCellFaces =
cellFaces_[facePointCells[celli]]; cellFaces_[facePointCells[celli]];
forAll(curCellFaces, cellFaceI) forAll(curCellFaces, cellFacei)
{ {
if (sammEqualFace(curCellFaces[cellFaceI], curFace)) if (sammEqualFace(curCellFaces[cellFacei], curFace))
{ {
// Found the cell face corresponding to this face // Found the cell face corresponding to this face
found = true; found = true;
// Set boundary face to the corresponding cell face // Set boundary face to the corresponding cell face
// which guarantees it is outward-pointing // which guarantees it is outward-pointing
curFace = curCellFaces[cellFaceI]; curFace = curCellFaces[cellFacei];
} }
if (found) break; if (found) break;
} }

View File

@ -69,9 +69,9 @@ void Foam::sammMesh::createPolyBoundary()
const faceList& curCellFaces = const faceList& curCellFaces =
cellFaces_[facePointCells[celli]]; cellFaces_[facePointCells[celli]];
forAll(curCellFaces, cellFaceI) forAll(curCellFaces, cellFacei)
{ {
if (curCellFaces[cellFaceI] == curFace) if (curCellFaces[cellFacei] == curFace)
{ {
// Found the cell face corresponding to this face // Found the cell face corresponding to this face
found = true; found = true;
@ -79,7 +79,7 @@ void Foam::sammMesh::createPolyBoundary()
// Debugging // Debugging
if if
( (
cellPolys_[facePointCells[celli]][cellFaceI] cellPolys_[facePointCells[celli]][cellFacei]
!= -1 != -1
) )
{ {
@ -89,7 +89,7 @@ void Foam::sammMesh::createPolyBoundary()
<< abort(FatalError); << abort(FatalError);
} }
cellPolys_[facePointCells[celli]][cellFaceI] = cellPolys_[facePointCells[celli]][cellFacei] =
nCreatedFaces; nCreatedFaces;
nBoundaryFacesFound++; nBoundaryFacesFound++;

View File

@ -114,16 +114,16 @@ void Foam::sammMesh::createPolyCells()
// get the list of search faces // get the list of search faces
const faceList& searchFaces = cellFaces_[curNei]; const faceList& searchFaces = cellFaces_[curNei];
forAll(searchFaces, neiFaceI) forAll(searchFaces, neiFacei)
{ {
if (searchFaces[neiFaceI] == curFace) if (searchFaces[neiFacei] == curFace)
{ {
// match!! // match!!
found = true; found = true;
// Record the neighbour cell and face // Record the neighbour cell and face
neiCells[facei] = curNei; neiCells[facei] = curNei;
faceOfNeiCell[facei] = neiFaceI; faceOfNeiCell[facei] = neiFacei;
nNeighbours++; nNeighbours++;
break; break;

View File

@ -129,16 +129,16 @@ void Foam::starMesh::markBoundaryFaces()
const faceList& curCellFaces = const faceList& curCellFaces =
cellFaces_[curCellIndex]; cellFaces_[curCellIndex];
forAll(curCellFaces, cellFaceI) forAll(curCellFaces, cellFacei)
{ {
if (starEqualFace(curFace, curCellFaces[cellFaceI])) if (starEqualFace(curFace, curCellFaces[cellFacei]))
{ {
// Found the cell face corresponding to this face // Found the cell face corresponding to this face
found = true; found = true;
// Set boundary face to the corresponding cell face // Set boundary face to the corresponding cell face
curBoundaryCellIDs[facei] = curCellIndex; curBoundaryCellIDs[facei] = curCellIndex;
curBoundaryCellFaceIDs[facei] = cellFaceI; curBoundaryCellFaceIDs[facei] = cellFacei;
} }
if (found) break; if (found) break;
} }

View File

@ -69,9 +69,9 @@ void Foam::starMesh::createPolyBoundary()
const faceList& curCellFaces = const faceList& curCellFaces =
cellFaces_[facePointCells[celli]]; cellFaces_[facePointCells[celli]];
forAll(curCellFaces, cellFaceI) forAll(curCellFaces, cellFacei)
{ {
if (curCellFaces[cellFaceI] == curFace) if (curCellFaces[cellFacei] == curFace)
{ {
// Found the cell face corresponding to this face // Found the cell face corresponding to this face
found = true; found = true;
@ -79,13 +79,13 @@ void Foam::starMesh::createPolyBoundary()
// Debugging // Debugging
if if
( (
cellPolys_[facePointCells[celli]][cellFaceI] cellPolys_[facePointCells[celli]][cellFacei]
!= -1 != -1
) )
{ {
if if
( (
cellPolys_[facePointCells[celli]][cellFaceI] cellPolys_[facePointCells[celli]][cellFacei]
> nInternalFaces_ > nInternalFaces_
) )
{ {
@ -94,24 +94,24 @@ void Foam::starMesh::createPolyBoundary()
<< "\nProbably multiple definitions " << "\nProbably multiple definitions "
<< "of a single boundary face. " << endl << "of a single boundary face. " << endl
<< "Other boundary face: " << "Other boundary face: "
<< curCellFaces[cellFaceI] << curCellFaces[cellFacei]
<< endl; << endl;
Info<< "PROSTAR Command: vset,news,vlis"; Info<< "PROSTAR Command: vset,news,vlis";
forAll(curCellFaces[cellFaceI], spI) forAll(curCellFaces[cellFacei], spI)
{ {
// check if the point is given by STAR // check if the point is given by STAR
// or created locally // or created locally
if if
( (
curCellFaces[cellFaceI][spI] > -1 curCellFaces[cellFacei][spI] > -1
&& curCellFaces[cellFaceI][spI] && curCellFaces[cellFacei][spI]
< starPointID_.size() < starPointID_.size()
) )
{ {
Info<< "," Info<< ","
<< starPointID_ << starPointID_
[curCellFaces[cellFaceI][spI]]; [curCellFaces[cellFacei][spI]];
} }
else else
{ {
@ -128,24 +128,24 @@ void Foam::starMesh::createPolyBoundary()
<< "boundary face on a previously " << "boundary face on a previously "
<< "matched internal face. " << endl << "matched internal face. " << endl
<< "Internal face: " << "Internal face: "
<< curCellFaces[cellFaceI] << curCellFaces[cellFacei]
<< endl; << endl;
Info<< "PROSTAR Command: vset,news,vlis"; Info<< "PROSTAR Command: vset,news,vlis";
forAll(curCellFaces[cellFaceI], spI) forAll(curCellFaces[cellFacei], spI)
{ {
// check if the point is given by STAR // check if the point is given by STAR
// or created locally // or created locally
if if
( (
curCellFaces[cellFaceI][spI] > -1 curCellFaces[cellFacei][spI] > -1
&& curCellFaces[cellFaceI][spI] && curCellFaces[cellFacei][spI]
< starPointID_.size() < starPointID_.size()
) )
{ {
Info<< "," Info<< ","
<< starPointID_ << starPointID_
[curCellFaces[cellFaceI][spI]]; [curCellFaces[cellFacei][spI]];
} }
else else
{ {
@ -157,7 +157,7 @@ void Foam::starMesh::createPolyBoundary()
} }
} }
cellPolys_[facePointCells[celli]][cellFaceI] = cellPolys_[facePointCells[celli]][cellFacei] =
nCreatedFaces; nCreatedFaces;
nBoundaryFacesFound++; nBoundaryFacesFound++;

View File

@ -114,16 +114,16 @@ void Foam::starMesh::createPolyCells()
// get the list of search faces // get the list of search faces
const faceList& searchFaces = cellFaces_[curNei]; const faceList& searchFaces = cellFaces_[curNei];
forAll(searchFaces, neiFaceI) forAll(searchFaces, neiFacei)
{ {
if (searchFaces[neiFaceI] == curFace) if (searchFaces[neiFacei] == curFace)
{ {
// match!! // match!!
found = true; found = true;
// Record the neighbour cell and face // Record the neighbour cell and face
neiCells[facei] = curNei; neiCells[facei] = curNei;
faceOfNeiCell[facei] = neiFaceI; faceOfNeiCell[facei] = neiFacei;
nNeighbours++; nNeighbours++;
break; break;

View File

@ -406,9 +406,9 @@ int main(int argc, char *argv[])
{ {
IStringStream faceLine(line); IStringStream faceLine(line);
label tetGenFaceI, dummy, region; label tetGenFacei, dummy, region;
faceLine >> tetGenFaceI; faceLine >> tetGenFacei;
// Read face and reverse orientation (Foam needs outwards // Read face and reverse orientation (Foam needs outwards
// pointing) // pointing)

View File

@ -183,11 +183,11 @@ void updateFaceLabels(const mapPolyMesh& map, labelList& faceLabels)
forAll(faceLabels, i) forAll(faceLabels, i)
{ {
label oldFaceI = faceLabels[i]; label oldFacei = faceLabels[i];
if (reverseMap[oldFaceI] >= 0) if (reverseMap[oldFacei] >= 0)
{ {
newFaceLabels[newI++] = reverseMap[oldFaceI]; newFaceLabels[newI++] = reverseMap[oldFacei];
} }
} }
newFaceLabels.setSize(newI); newFaceLabels.setSize(newI);
@ -203,11 +203,11 @@ void updateCellSet(const mapPolyMesh& map, labelHashSet& cellLabels)
forAll(cellLabels, i) forAll(cellLabels, i)
{ {
label oldCellI = cellLabels[i]; label oldCelli = cellLabels[i];
if (reverseMap[oldCellI] >= 0) if (reverseMap[oldCelli] >= 0)
{ {
newCellLabels.insert(reverseMap[oldCellI]); newCellLabels.insert(reverseMap[oldCelli]);
} }
} }
cellLabels.transfer(newCellLabels); cellLabels.transfer(newCellLabels);
@ -224,8 +224,8 @@ void changeFrontBackPatches
{ {
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
label frontPatchI = findPatchID(patches, frontPatchName); label frontPatchi = findPatchID(patches, frontPatchName);
label backPatchI = findPatchID(patches, backPatchName); label backPatchi = findPatchID(patches, backPatchName);
DynamicList<polyPatch*> newPatches(patches.size()); DynamicList<polyPatch*> newPatches(patches.size());
@ -233,7 +233,7 @@ void changeFrontBackPatches
{ {
const polyPatch& pp(patches[patchi]); const polyPatch& pp(patches[patchi]);
if (patchi == frontPatchI || patchi == backPatchI) if (patchi == frontPatchi || patchi == backPatchi)
{ {
newPatches.append newPatches.append
( (
@ -395,28 +395,28 @@ int main(int argc, char *argv[])
polyTopoChange meshMod(mesh); polyTopoChange meshMod(mesh);
forAll(meshFaces, i) forAll(meshFaces, i)
{ {
label meshFaceI = meshFaces[i]; label meshFacei = meshFaces[i];
label patchi = patches.whichPatch(meshFaceI); label patchi = patches.whichPatch(meshFacei);
label own = mesh.faceOwner()[meshFaceI]; label own = mesh.faceOwner()[meshFacei];
label nei = -1; label nei = -1;
if (patchi == -1) if (patchi == -1)
{ {
nei = mesh.faceNeighbour()[meshFaceI]; nei = mesh.faceNeighbour()[meshFacei];
} }
label zoneI = mesh.faceZones().whichZone(meshFaceI); label zoneI = mesh.faceZones().whichZone(meshFacei);
bool zoneFlip = false; bool zoneFlip = false;
if (zoneI != -1) if (zoneI != -1)
{ {
label index = mesh.faceZones()[zoneI].whichFace(meshFaceI); label index = mesh.faceZones()[zoneI].whichFace(meshFacei);
zoneFlip = mesh.faceZones()[zoneI].flipMap()[index]; zoneFlip = mesh.faceZones()[zoneI].flipMap()[index];
} }
meshMod.modifyFace meshMod.modifyFace
( (
mesh.faces()[meshFaceI].reverseFace(), // modified face mesh.faces()[meshFacei].reverseFace(), // modified face
meshFaceI, // label of face meshFacei, // label of face
own, // owner own, // owner
nei, // neighbour nei, // neighbour
true, // face flip true, // face flip
@ -538,11 +538,11 @@ int main(int argc, char *argv[])
patchi++ patchi++
) )
{ {
label nbrProcI = patchToNbrProc[patchi]; label nbrProci = patchToNbrProc[patchi];
Pout<< "Adding patch " << patchi Pout<< "Adding patch " << patchi
<< " between " << Pstream::myProcNo() << " between " << Pstream::myProcNo()
<< " and " << nbrProcI << " and " << nbrProci
<< endl; << endl;
newPatches.append newPatches.append
@ -554,7 +554,7 @@ int main(int argc, char *argv[])
patchi, // index patchi, // index
mesh.boundaryMesh(),// polyBoundaryMesh mesh.boundaryMesh(),// polyBoundaryMesh
Pstream::myProcNo(),// myProcNo Pstream::myProcNo(),// myProcNo
nbrProcI // neighbProcNo nbrProci // neighbProcNo
) )
); );
} }
@ -688,10 +688,10 @@ int main(int argc, char *argv[])
const labelListList& layerFaces = layerExtrude.layerFaces(); const labelListList& layerFaces = layerExtrude.layerFaces();
backPatchFaces.setSize(layerFaces.size()); backPatchFaces.setSize(layerFaces.size());
frontPatchFaces.setSize(layerFaces.size()); frontPatchFaces.setSize(layerFaces.size());
forAll(backPatchFaces, patchFaceI) forAll(backPatchFaces, patchFacei)
{ {
backPatchFaces[patchFaceI] = layerFaces[patchFaceI].first(); backPatchFaces[patchFacei] = layerFaces[patchFacei].first();
frontPatchFaces[patchFaceI] = layerFaces[patchFaceI].last(); frontPatchFaces[patchFacei] = layerFaces[patchFacei].last();
} }

View File

@ -185,11 +185,11 @@ label addPatch
patchi = newPatches.size(); patchi = newPatches.size();
label startFaceI = 0; label startFacei = 0;
if (patchi > 0) if (patchi > 0)
{ {
const polyPatch& pp = *newPatches.last(); const polyPatch& pp = *newPatches.last();
startFaceI = pp.start()+pp.size(); startFacei = pp.start()+pp.size();
} }
@ -200,7 +200,7 @@ label addPatch
PatchType::typeName, PatchType::typeName,
patchName, patchName,
0, // size 0, // size
startFaceI, // nFaces startFacei, // nFaces
patchi, patchi,
patches patches
).ptr() ).ptr()
@ -240,17 +240,17 @@ label addPatch
patchi = newPatches.size(); patchi = newPatches.size();
label startFaceI = 0; label startFacei = 0;
if (patchi > 0) if (patchi > 0)
{ {
const polyPatch& pp = *newPatches.last(); const polyPatch& pp = *newPatches.last();
startFaceI = pp.start()+pp.size(); startFacei = pp.start()+pp.size();
} }
dictionary patchDict(dict); dictionary patchDict(dict);
patchDict.set("type", PatchType::typeName); patchDict.set("type", PatchType::typeName);
patchDict.set("nFaces", 0); patchDict.set("nFaces", 0);
patchDict.set("startFace", startFaceI); patchDict.set("startFace", startFacei);
newPatches.append newPatches.append
( (
@ -873,9 +873,9 @@ void addCoupledPatches
{ {
forAll(eFaces, i) forAll(eFaces, i)
{ {
label procI = procID[eFaces[i]]; label proci = procID[eFaces[i]];
minProcID[edgeI] = min(minProcID[edgeI], procI); minProcID[edgeI] = min(minProcID[edgeI], proci);
maxProcID[edgeI] = max(maxProcID[edgeI], procI); maxProcID[edgeI] = max(maxProcID[edgeI], proci);
} }
} }
} }
@ -915,14 +915,14 @@ void addCoupledPatches
) )
{ {
// coupled boundary edge. Find matching patch. // coupled boundary edge. Find matching patch.
label nbrProcI = minProcID[edgeI]; label nbrProci = minProcID[edgeI];
if (nbrProcI == Pstream::myProcNo()) if (nbrProci == Pstream::myProcNo())
{ {
nbrProcI = maxProcID[edgeI]; nbrProci = maxProcID[edgeI];
} }
if (nbrProcI == Pstream::myProcNo()) if (nbrProci == Pstream::myProcNo())
{ {
// Cyclic patch since both procs the same. This cyclic should // Cyclic patch since both procs the same. This cyclic should
// already exist in newPatches so no adding necessary. // already exist in newPatches so no adding necessary.
@ -938,13 +938,13 @@ void addCoupledPatches
{ {
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
label newPatchI = findPatchID label newPatchi = findPatchID
( (
newPatches, newPatches,
patches[patches.whichPatch(facei)].name() patches[patches.whichPatch(facei)].name()
); );
sidePatchID[edgeI] = newPatchI; sidePatchID[edgeI] = newPatchi;
} }
else else
{ {
@ -958,7 +958,7 @@ void addCoupledPatches
// Processor patch // Processor patch
word name word name
( (
processorPolyPatch::newName(Pstream::myProcNo(), nbrProcI) processorPolyPatch::newName(Pstream::myProcNo(), nbrProci)
); );
sidePatchID[edgeI] = findPatchID(newPatches, name); sidePatchID[edgeI] = findPatchID(newPatches, name);
@ -967,7 +967,7 @@ void addCoupledPatches
{ {
dictionary patchDict; dictionary patchDict;
patchDict.add("myProcNo", Pstream::myProcNo()); patchDict.add("myProcNo", Pstream::myProcNo());
patchDict.add("neighbProcNo", nbrProcI); patchDict.add("neighbProcNo", nbrProci);
sidePatchID[edgeI] = addPatch<processorPolyPatch> sidePatchID[edgeI] = addPatch<processorPolyPatch>
( (
@ -1154,9 +1154,9 @@ tmp<pointField> calcOffset
forAll(fc, i) forAll(fc, i)
{ {
label meshFaceI = pp.start()+i; label meshFacei = pp.start()+i;
label patchFaceI = mag(extruder.faceToFaceMap()[meshFaceI])-1; label patchFacei = mag(extruder.faceToFaceMap()[meshFacei])-1;
point patchFc = extrudePatch[patchFaceI].centre point patchFc = extrudePatch[patchFacei].centre
( (
extrudePatch.points() extrudePatch.points()
); );
@ -1310,7 +1310,7 @@ void extrudeGeometricProperties
if (extruder.faceToFaceMap()[facei] != 0) if (extruder.faceToFaceMap()[facei] != 0)
{ {
// 'horizontal' face // 'horizontal' face
label patchFaceI = mag(extruder.faceToFaceMap()[facei])-1; label patchFacei = mag(extruder.faceToFaceMap()[facei])-1;
label celli = regionMesh.faceOwner()[facei]; label celli = regionMesh.faceOwner()[facei];
if (regionMesh.isInternalFace(facei)) if (regionMesh.isInternalFace(facei))
@ -1335,8 +1335,8 @@ void extrudeGeometricProperties
// Recalculate based on extrusion model // Recalculate based on extrusion model
faceCentres[facei] = model faceCentres[facei] = model
( (
patchFaceCentres[patchFaceI], patchFaceCentres[patchFacei],
extrudePatch.faceNormals()[patchFaceI], extrudePatch.faceNormals()[patchFacei],
layerI layerI
); );
} }
@ -1387,7 +1387,7 @@ void extrudeGeometricProperties
forAll(extruder.cellToFaceMap(), celli) forAll(extruder.cellToFaceMap(), celli)
{ {
label patchFaceI = extruder.cellToFaceMap()[celli]; label patchFacei = extruder.cellToFaceMap()[celli];
// Calculate layer from cell numbering (see createShellMesh) // Calculate layer from cell numbering (see createShellMesh)
label layerI = (celli % model.nLayers()); label layerI = (celli % model.nLayers());
@ -1395,14 +1395,14 @@ void extrudeGeometricProperties
// Recalculate based on extrusion model // Recalculate based on extrusion model
point pt0 = model point pt0 = model
( (
patchFaceCentres[patchFaceI], patchFaceCentres[patchFacei],
extrudePatch.faceNormals()[patchFaceI], extrudePatch.faceNormals()[patchFacei],
layerI layerI
); );
point pt1 = model point pt1 = model
( (
patchFaceCentres[patchFaceI], patchFaceCentres[patchFacei],
extrudePatch.faceNormals()[patchFaceI], extrudePatch.faceNormals()[patchFacei],
layerI+1 layerI+1
); );
@ -1960,13 +1960,13 @@ int main(int argc, char *argv[])
{ {
if (!isA<processorPolyPatch>(patches[patchi])) if (!isA<processorPolyPatch>(patches[patchi]))
{ {
label newPatchI = regionPatches.size(); label newPatchi = regionPatches.size();
regionPatches.append regionPatches.append
( (
patches[patchi].clone patches[patchi].clone
( (
patches, patches,
newPatchI, newPatchi,
0, // size 0, // size
0 // start 0 // start
).ptr() ).ptr()
@ -2240,12 +2240,12 @@ int main(int argc, char *argv[])
if (facei != -1) if (facei != -1)
{ {
label newPatchI = findPatchID label newPatchi = findPatchID
( (
regionPatches, regionPatches,
patches[patches.whichPatch(facei)].name() patches[patches.whichPatch(facei)].name()
); );
ePatches.setSize(eFaces.size(), newPatchI); ePatches.setSize(eFaces.size(), newPatchi);
} }
else else
{ {
@ -2683,20 +2683,20 @@ int main(int argc, char *argv[])
polyTopoChange meshMod(mesh); polyTopoChange meshMod(mesh);
// Modify faces to be in bottom (= always coupled) patch // Modify faces to be in bottom (= always coupled) patch
forAll(extrudeMeshFaces, zoneFaceI) forAll(extrudeMeshFaces, zoneFacei)
{ {
label meshFaceI = extrudeMeshFaces[zoneFaceI]; label meshFacei = extrudeMeshFaces[zoneFacei];
label zoneI = zoneID[zoneFaceI]; label zoneI = zoneID[zoneFacei];
bool flip = zoneFlipMap[zoneFaceI]; bool flip = zoneFlipMap[zoneFacei];
const face& f = mesh.faces()[meshFaceI]; const face& f = mesh.faces()[meshFacei];
if (!flip) if (!flip)
{ {
meshMod.modifyFace meshMod.modifyFace
( (
f, // modified face f, // modified face
meshFaceI, // label of face being modified meshFacei, // label of face being modified
mesh.faceOwner()[meshFaceI],// owner mesh.faceOwner()[meshFacei],// owner
-1, // neighbour -1, // neighbour
false, // face flip false, // face flip
interMeshBottomPatch[zoneI],// patch for face interMeshBottomPatch[zoneI],// patch for face
@ -2704,13 +2704,13 @@ int main(int argc, char *argv[])
flip // face flip in zone flip // face flip in zone
); );
} }
else if (mesh.isInternalFace(meshFaceI)) else if (mesh.isInternalFace(meshFacei))
{ {
meshMod.modifyFace meshMod.modifyFace
( (
f.reverseFace(), // modified face f.reverseFace(), // modified face
meshFaceI, // label of modified face meshFacei, // label of modified face
mesh.faceNeighbour()[meshFaceI],// owner mesh.faceNeighbour()[meshFacei],// owner
-1, // neighbour -1, // neighbour
true, // face flip true, // face flip
interMeshBottomPatch[zoneI], // patch for face interMeshBottomPatch[zoneI], // patch for face
@ -2722,20 +2722,20 @@ int main(int argc, char *argv[])
if (zoneShadowNames.size() > 0) //if there is a top faceZone specified if (zoneShadowNames.size() > 0) //if there is a top faceZone specified
{ {
forAll(extrudeMeshFaces, zoneFaceI) forAll(extrudeMeshFaces, zoneFacei)
{ {
label meshFaceI = extrudeMeshShadowFaces[zoneFaceI]; label meshFacei = extrudeMeshShadowFaces[zoneFacei];
label zoneI = zoneShadowID[zoneFaceI]; label zoneI = zoneShadowID[zoneFacei];
bool flip = zoneShadowFlipMap[zoneFaceI]; bool flip = zoneShadowFlipMap[zoneFacei];
const face& f = mesh.faces()[meshFaceI]; const face& f = mesh.faces()[meshFacei];
if (!flip) if (!flip)
{ {
meshMod.modifyFace meshMod.modifyFace
( (
f, // modified face f, // modified face
meshFaceI, // face being modified meshFacei, // face being modified
mesh.faceOwner()[meshFaceI],// owner mesh.faceOwner()[meshFacei],// owner
-1, // neighbour -1, // neighbour
false, // face flip false, // face flip
interMeshTopPatch[zoneI], // patch for face interMeshTopPatch[zoneI], // patch for face
@ -2743,13 +2743,13 @@ int main(int argc, char *argv[])
flip // face flip in zone flip // face flip in zone
); );
} }
else if (mesh.isInternalFace(meshFaceI)) else if (mesh.isInternalFace(meshFacei))
{ {
meshMod.modifyFace meshMod.modifyFace
( (
f.reverseFace(), // modified face f.reverseFace(), // modified face
meshFaceI, // label modified face meshFacei, // label modified face
mesh.faceNeighbour()[meshFaceI],// owner mesh.faceNeighbour()[meshFacei],// owner
-1, // neighbour -1, // neighbour
true, // face flip true, // face flip
interMeshTopPatch[zoneI], // patch for face interMeshTopPatch[zoneI], // patch for face
@ -2762,25 +2762,25 @@ int main(int argc, char *argv[])
else else
{ {
// Add faces (using same points) to be in top patch // Add faces (using same points) to be in top patch
forAll(extrudeMeshFaces, zoneFaceI) forAll(extrudeMeshFaces, zoneFacei)
{ {
label meshFaceI = extrudeMeshFaces[zoneFaceI]; label meshFacei = extrudeMeshFaces[zoneFacei];
label zoneI = zoneID[zoneFaceI]; label zoneI = zoneID[zoneFacei];
bool flip = zoneFlipMap[zoneFaceI]; bool flip = zoneFlipMap[zoneFacei];
const face& f = mesh.faces()[meshFaceI]; const face& f = mesh.faces()[meshFacei];
if (!flip) if (!flip)
{ {
if (mesh.isInternalFace(meshFaceI)) if (mesh.isInternalFace(meshFacei))
{ {
meshMod.addFace meshMod.addFace
( (
f.reverseFace(), // modified face f.reverseFace(), // modified face
mesh.faceNeighbour()[meshFaceI],// owner mesh.faceNeighbour()[meshFacei],// owner
-1, // neighbour -1, // neighbour
-1, // master point -1, // master point
-1, // master edge -1, // master edge
meshFaceI, // master face meshFacei, // master face
true, // flip flux true, // flip flux
interMeshTopPatch[zoneI], // patch for face interMeshTopPatch[zoneI], // patch for face
-1, // zone for face -1, // zone for face
@ -2793,11 +2793,11 @@ int main(int argc, char *argv[])
meshMod.addFace meshMod.addFace
( (
f, // face f, // face
mesh.faceOwner()[meshFaceI], // owner mesh.faceOwner()[meshFacei], // owner
-1, // neighbour -1, // neighbour
-1, // master point -1, // master point
-1, // master edge -1, // master edge
meshFaceI, // master face meshFacei, // master face
false, // flip flux false, // flip flux
interMeshTopPatch[zoneI], // patch for face interMeshTopPatch[zoneI], // patch for face
-1, // zone for face -1, // zone for face

View File

@ -92,8 +92,8 @@ Foam::extrude2DMesh::extrude2DMesh
model_(model), model_(model),
modelType_(dict.lookup("extrudeModel")), modelType_(dict.lookup("extrudeModel")),
patchType_(dict.lookup("patchType")), patchType_(dict.lookup("patchType")),
frontPatchI_(-1), frontPatchi_(-1),
backPatchI_(-1) backPatchi_(-1)
{ {
check2D(); check2D();
} }
@ -111,8 +111,8 @@ void Foam::extrude2DMesh::addFrontBackPatches()
{ {
const polyBoundaryMesh& patches = mesh_.boundaryMesh(); const polyBoundaryMesh& patches = mesh_.boundaryMesh();
frontPatchI_ = patches.findPatchID("front"); frontPatchi_ = patches.findPatchID("front");
backPatchI_ = patches.findPatchID("back"); backPatchi_ = patches.findPatchID("back");
// Add patch. // Add patch.
List<polyPatch*> newPatches(patches.size() + 2); List<polyPatch*> newPatches(patches.size() + 2);
@ -131,59 +131,59 @@ void Foam::extrude2DMesh::addFrontBackPatches()
).ptr(); ).ptr();
} }
if (frontPatchI_ == -1) if (frontPatchi_ == -1)
{ {
frontPatchI_ = patches.size(); frontPatchi_ = patches.size();
newPatches[frontPatchI_] = newPatches[frontPatchi_] =
polyPatch::New polyPatch::New
( (
patchType_, patchType_,
"front", "front",
0, 0,
mesh_.nFaces(), mesh_.nFaces(),
frontPatchI_, frontPatchi_,
patches patches
).ptr(); ).ptr();
// newPatches[frontPatchI_] = polyPatch::New // newPatches[frontPatchi_] = polyPatch::New
// ( // (
// "front", // "front",
// patchDict_, // patchDict_,
// frontPatchI_, // frontPatchi_,
// patches // patches
// ).ptr(); // ).ptr();
Info<< "Adding patch " << newPatches[frontPatchI_]->name() Info<< "Adding patch " << newPatches[frontPatchi_]->name()
<< " at index " << frontPatchI_ << " at index " << frontPatchi_
<< " for front faces." << nl << endl; << " for front faces." << nl << endl;
} }
if (backPatchI_ == -1) if (backPatchi_ == -1)
{ {
backPatchI_ = patches.size() + 1; backPatchi_ = patches.size() + 1;
newPatches[backPatchI_] = newPatches[backPatchi_] =
polyPatch::New polyPatch::New
( (
patchType_, patchType_,
"back", "back",
0, 0,
mesh_.nFaces(), mesh_.nFaces(),
backPatchI_, backPatchi_,
patches patches
).ptr(); ).ptr();
// newPatches[frontPatchI_] = polyPatch::New // newPatches[frontPatchi_] = polyPatch::New
// ( // (
// "back", // "back",
// patchDict_, // patchDict_,
// backPatchI_, // backPatchi_,
// patches // patches
// ).ptr(); // ).ptr();
Info<< "Adding patch " << newPatches[backPatchI_]->name() Info<< "Adding patch " << newPatches[backPatchi_]->name()
<< " at index " << backPatchI_ << " at index " << backPatchi_
<< " for back faces." << nl << endl; << " for back faces." << nl << endl;
} }
@ -330,10 +330,10 @@ void Foam::extrude2DMesh::setRefinement
label currentLayerOffset = layer*mesh_.nPoints(); label currentLayerOffset = layer*mesh_.nPoints();
label nextLayerOffset = currentLayerOffset + mesh_.nPoints(); label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
label startFaceI = patches[patchi].start(); label startFacei = patches[patchi].start();
label endFaceI = startFaceI + patches[patchi].size(); label endFacei = startFacei + patches[patchi].size();
for (label facei = startFaceI; facei < endFaceI; facei++) for (label facei = startFacei; facei < endFacei; facei++)
{ {
label zoneID = mesh_.faceZones().whichZone(facei); label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false; bool zoneFlip = false;
@ -386,12 +386,12 @@ void Foam::extrude2DMesh::setRefinement
face frontFace(cFaces.size()); face frontFace(cFaces.size());
// Make a loop out of faces. // Make a loop out of faces.
label nextFaceI = cFaces[0]; label nextFacei = cFaces[0];
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];
@ -408,23 +408,23 @@ void Foam::extrude2DMesh::setRefinement
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];
if (facei != nextFaceI) if (facei != nextFacei)
{ {
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;
} }
} }
@ -482,12 +482,12 @@ void Foam::extrude2DMesh::setRefinement
face frontFace(cFaces.size()); face frontFace(cFaces.size());
// Make a loop out of faces. // Make a loop out of faces.
label nextFaceI = cFaces[0]; label nextFacei = cFaces[0];
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];
@ -504,23 +504,23 @@ void Foam::extrude2DMesh::setRefinement
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];
if (facei != nextFaceI) if (facei != nextFacei)
{ {
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;
} }
} }
@ -537,7 +537,7 @@ void Foam::extrude2DMesh::setRefinement
-1, // masterEdgeID -1, // masterEdgeID
nFaces++, // masterFaceID nFaces++, // masterFaceID
false, // flipFaceFlux false, // flipFaceFlux
backPatchI_, // patchID backPatchi_, // patchID
-1, // zoneID -1, // zoneID
false // zoneFlip false // zoneFlip
); );
@ -567,7 +567,7 @@ void Foam::extrude2DMesh::setRefinement
-1, // masterEdgeID -1, // masterEdgeID
nFaces++, // masterFaceID nFaces++, // masterFaceID
false, // flipFaceFlux false, // flipFaceFlux
frontPatchI_, // patchID frontPatchi_, // patchID
-1, // zoneID -1, // zoneID
false // zoneFlip false // zoneFlip
); );

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-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -76,8 +76,8 @@ class extrude2DMesh
const word patchType_; const word patchType_;
label frontPatchI_; label frontPatchi_;
label backPatchI_; label backPatchi_;
// Private Member Functions // Private Member Functions
@ -128,14 +128,14 @@ public:
void distribute(const mapDistributePolyMesh&) void distribute(const mapDistributePolyMesh&)
{} {}
label frontPatchI() const label frontPatchi() const
{ {
return frontPatchI_; return frontPatchi_;
} }
label backPatchI() const label backPatchi() const
{ {
return backPatchI_; return backPatchi_;
} }
}; };

View File

@ -101,7 +101,7 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
labelList oldToNew(owner_.size(), -1); labelList oldToNew(owner_.size(), -1);
label newFaceI = 0; label newFacei = 0;
forAll(faceEdges, facei) forAll(faceEdges, facei)
{ {
@ -115,17 +115,17 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
{ {
// Internal edge. Get the face on other side. // Internal edge. Get the face on other side.
label nbrFaceI = neighbour_[fEdges[feI]]; label nbrFacei = neighbour_[fEdges[feI]];
if (nbrFaceI == facei) if (nbrFacei == facei)
{ {
nbrFaceI = owner_[fEdges[feI]]; nbrFacei = owner_[fEdges[feI]];
} }
if (facei < nbrFaceI) if (facei < nbrFacei)
{ {
// facei is master // facei is master
nbr[feI] = nbrFaceI; nbr[feI] = nbrFacei;
} }
} }
} }
@ -136,7 +136,7 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
{ {
if (nbr[i] != -1) if (nbr[i] != -1)
{ {
oldToNew[fEdges[nbr.indices()[i]]] = newFaceI++; oldToNew[fEdges[nbr.indices()[i]]] = newFacei++;
} }
} }
} }
@ -183,12 +183,12 @@ void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
for for
( (
label bFaceI = nInternalEdges; label bFacei = nInternalEdges;
bFaceI < faces_.size(); bFacei < faces_.size();
++bFaceI ++bFacei
) )
{ {
const face& e = faces_[bFaceI]; const face& e = faces_[bFacei];
bool matched = false; bool matched = false;
@ -209,14 +209,14 @@ void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
label fp = findIndex(f, e[0]); label fp = findIndex(f, e[0]);
newOwner[bFaceI] = owner_[bEdgeI]; newOwner[bFacei] = owner_[bEdgeI];
if (f.nextLabel(fp) != e[1]) if (f.nextLabel(fp) != e[1])
{ {
Info<< "Flipping" << endl; Info<< "Flipping" << endl;
faces_[bFaceI][0] = e[1]; faces_[bFacei][0] = e[1];
faces_[bFaceI][1] = e[0]; faces_[bFacei][1] = e[0];
} }
nMatched++; nMatched++;

View File

@ -51,28 +51,28 @@ Foam::DistributedDelaunayMesh<Triangulation>::buildMap
forAll(toProc, i) forAll(toProc, i)
{ {
label procI = toProc[i]; label proci = toProc[i];
nSend[procI]++; nSend[proci]++;
} }
// 2. Size sendMap // 2. Size sendMap
labelListList sendMap(Pstream::nProcs()); labelListList sendMap(Pstream::nProcs());
forAll(nSend, procI) forAll(nSend, proci)
{ {
sendMap[procI].setSize(nSend[procI]); sendMap[proci].setSize(nSend[proci]);
nSend[procI] = 0; nSend[proci] = 0;
} }
// 3. Fill sendMap // 3. Fill sendMap
forAll(toProc, i) forAll(toProc, i)
{ {
label procI = toProc[i]; label proci = toProc[i];
sendMap[procI][nSend[procI]++] = i; sendMap[proci][nSend[proci]++] = i;
} }
// 4. Send over how many I need to receive // 4. Send over how many I need to receive
@ -93,17 +93,17 @@ Foam::DistributedDelaunayMesh<Triangulation>::buildMap
label constructSize = constructMap[Pstream::myProcNo()].size(); label constructSize = constructMap[Pstream::myProcNo()].size();
forAll(constructMap, procI) forAll(constructMap, proci)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
label nRecv = recvSizes[procI]; label nRecv = recvSizes[proci];
constructMap[procI].setSize(nRecv); constructMap[proci].setSize(nRecv);
for (label i = 0; i < nRecv; i++) for (label i = 0; i < nRecv; i++)
{ {
constructMap[procI][i] = constructSize++; constructMap[proci][i] = constructSize++;
} }
} }
} }
@ -201,16 +201,16 @@ Foam::labelList Foam::DistributedDelaunayMesh<Triangulation>::overlapProcessors
{ {
DynamicList<label> toProc(Pstream::nProcs()); DynamicList<label> toProc(Pstream::nProcs());
forAll(allBackgroundMeshBounds_(), procI) forAll(allBackgroundMeshBounds_(), proci)
{ {
// Test against the bounding box of the processor // Test against the bounding box of the processor
if if
( (
!isLocal(procI) !isLocal(proci)
&& allBackgroundMeshBounds_()[procI].overlaps(centre, radiusSqr) && allBackgroundMeshBounds_()[proci].overlaps(centre, radiusSqr)
) )
{ {
toProc.append(procI); toProc.append(proci);
} }
} }
@ -366,9 +366,9 @@ void Foam::DistributedDelaunayMesh<Triangulation>::findProcessorBoundaryCells
if (cellToCheck.found(cit->cellIndex())) if (cellToCheck.found(cit->cellIndex()))
{ {
// Get the neighbours and check them // Get the neighbours and check them
for (label adjCellI = 0; adjCellI < 4; ++adjCellI) for (label adjCelli = 0; adjCelli < 4; ++adjCelli)
{ {
Cell_handle citNeighbor = cit->neighbor(adjCellI); Cell_handle citNeighbor = cit->neighbor(adjCelli);
// Ignore if has far point or previously visited // Ignore if has far point or previously visited
if if
@ -432,7 +432,7 @@ void Foam::DistributedDelaunayMesh<Triangulation>::markVerticesToRefer
forAll(citOverlaps, cOI) forAll(citOverlaps, cOI)
{ {
label procI = citOverlaps[cOI]; label proci = citOverlaps[cOI];
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
{ {
@ -451,11 +451,11 @@ void Foam::DistributedDelaunayMesh<Triangulation>::markVerticesToRefer
// Using the hashSet to ensure that each vertex is only // Using the hashSet to ensure that each vertex is only
// referred once to each processor. // referred once to each processor.
// Do not refer a vertex to its own processor. // Do not refer a vertex to its own processor.
if (vProcIndex != procI) if (vProcIndex != proci)
{ {
if (referralVertices[procI].insert(procIndexPair)) if (referralVertices[proci].insert(procIndexPair))
{ {
targetProcessor.append(procI); targetProcessor.append(proci);
parallelInfluenceVertices.append parallelInfluenceVertices.append
( (
@ -501,9 +501,9 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
pointMap.distribute(parallelVertices); pointMap.distribute(parallelVertices);
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
const labelList& constructMap = pointMap.constructMap()[procI]; const labelList& constructMap = pointMap.constructMap()[proci];
if (constructMap.size()) if (constructMap.size())
{ {
@ -841,11 +841,11 @@ void Foam::DistributedDelaunayMesh<Triangulation>::sync(const boundBox& bb)
/Pstream::nProcs(); /Pstream::nProcs();
PtrList<labelPairHashSet> referralVertices(Pstream::nProcs()); PtrList<labelPairHashSet> referralVertices(Pstream::nProcs());
forAll(referralVertices, procI) forAll(referralVertices, proci)
{ {
if (!isLocal(procI)) if (!isLocal(proci))
{ {
referralVertices.set(procI, new labelPairHashSet(nApproxReferred)); referralVertices.set(proci, new labelPairHashSet(nApproxReferred));
} }
} }

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
@ -86,9 +86,9 @@ void Foam::PrintTable<KeyType, DataType>::print
List<label> largestProcSize(Pstream::nProcs(), 0); List<label> largestProcSize(Pstream::nProcs(), 0);
forAll(procData, procI) forAll(procData, proci)
{ {
const HashTableData& procIData = procData[procI]; const HashTableData& procIData = procData[proci];
for for
( (
@ -108,7 +108,7 @@ void Foam::PrintTable<KeyType, DataType>::print
HashTable<DataType, label>& key = combinedTable[iter.key()]; HashTable<DataType, label>& key = combinedTable[iter.key()];
key.insert(procI, iter()); key.insert(proci, iter());
for for
( (
@ -145,11 +145,11 @@ void Foam::PrintTable<KeyType, DataType>::print
os.width(largestKeyLength); os.width(largestKeyLength);
os << indent << "# Proc"; os << indent << "# Proc";
forAll(procData, procI) forAll(procData, proci)
{ {
os << tab; os << tab;
os.width(largestDataLength); os.width(largestDataLength);
os << procI; os << proci;
} }
if (printSum) if (printSum)

View File

@ -56,28 +56,28 @@ Foam::autoPtr<Foam::mapDistribute> Foam::backgroundMeshDecomposition::buildMap
forAll(toProc, i) forAll(toProc, i)
{ {
label procI = toProc[i]; label proci = toProc[i];
nSend[procI]++; nSend[proci]++;
} }
// 2. Size sendMap // 2. Size sendMap
labelListList sendMap(Pstream::nProcs()); labelListList sendMap(Pstream::nProcs());
forAll(nSend, procI) forAll(nSend, proci)
{ {
sendMap[procI].setSize(nSend[procI]); sendMap[proci].setSize(nSend[proci]);
nSend[procI] = 0; nSend[proci] = 0;
} }
// 3. Fill sendMap // 3. Fill sendMap
forAll(toProc, i) forAll(toProc, i)
{ {
label procI = toProc[i]; label proci = toProc[i];
sendMap[procI][nSend[procI]++] = i; sendMap[proci][nSend[proci]++] = i;
} }
// 4. Send over how many I need to receive // 4. Send over how many I need to receive
@ -98,17 +98,17 @@ Foam::autoPtr<Foam::mapDistribute> Foam::backgroundMeshDecomposition::buildMap
label constructSize = constructMap[Pstream::myProcNo()].size(); label constructSize = constructMap[Pstream::myProcNo()].size();
forAll(constructMap, procI) forAll(constructMap, proci)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
label nRecv = recvSizes[procI]; label nRecv = recvSizes[proci];
constructMap[procI].setSize(nRecv); constructMap[proci].setSize(nRecv);
for (label i = 0; i < nRecv; i++) for (label i = 0; i < nRecv; i++)
{ {
constructMap[procI][i] = constructSize++; constructMap[proci][i] = constructSize++;
} }
} }
} }
@ -259,17 +259,17 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
List<volumeType> newVolumeStatus(cellMap.size()); List<volumeType> newVolumeStatus(cellMap.size());
forAll(cellMap, newCellI) forAll(cellMap, newCelli)
{ {
label oldCellI = cellMap[newCellI]; label oldCelli = cellMap[newCelli];
if (oldCellI == -1) if (oldCelli == -1)
{ {
newVolumeStatus[newCellI] = volumeType::UNKNOWN; newVolumeStatus[newCelli] = volumeType::UNKNOWN;
} }
else else
{ {
newVolumeStatus[newCellI] = volumeStatus[oldCellI]; newVolumeStatus[newCelli] = volumeStatus[oldCelli];
} }
} }
@ -369,17 +369,17 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
List<volumeType> newVolumeStatus(cellMap.size()); List<volumeType> newVolumeStatus(cellMap.size());
forAll(cellMap, newCellI) forAll(cellMap, newCelli)
{ {
label oldCellI = cellMap[newCellI]; label oldCelli = cellMap[newCelli];
if (oldCellI == -1) if (oldCelli == -1)
{ {
newVolumeStatus[newCellI] = volumeType::UNKNOWN; newVolumeStatus[newCelli] = volumeType::UNKNOWN;
} }
else else
{ {
newVolumeStatus[newCellI] = volumeStatus[oldCellI]; newVolumeStatus[newCelli] = volumeStatus[oldCelli];
} }
} }
@ -474,29 +474,29 @@ void Foam::backgroundMeshDecomposition::printMeshData
// globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces()); // globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces());
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
Info<< "Processor " << procI << " " Info<< "Processor " << proci << " "
<< "Number of cells = " << globalCells.localSize(procI) << "Number of cells = " << globalCells.localSize(proci)
<< endl; << endl;
// label nProcFaces = 0; // label nProcFaces = 0;
// const labelList& nei = patchNeiProcNo[procI]; // const labelList& nei = patchNeiProcNo[proci];
// forAll(patchNeiProcNo[procI], i) // forAll(patchNeiProcNo[proci], i)
// { // {
// Info<< " Number of faces shared with processor " // Info<< " Number of faces shared with processor "
// << patchNeiProcNo[procI][i] << " = " << patchSize[procI][i] // << patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
// << endl; // << endl;
// nProcFaces += patchSize[procI][i]; // nProcFaces += patchSize[proci][i];
// } // }
// Info<< " Number of processor patches = " << nei.size() << nl // Info<< " Number of processor patches = " << nei.size() << nl
// << " Number of processor faces = " << nProcFaces << nl // << " Number of processor faces = " << nProcFaces << nl
// << " Number of boundary faces = " // << " Number of boundary faces = "
// << globalBoundaryFaces.localSize(procI) << endl; // << globalBoundaryFaces.localSize(proci) << endl;
} }
} }
@ -721,10 +721,10 @@ void Foam::backgroundMeshDecomposition::buildPatchAndTree()
point bbMin(GREAT, GREAT, GREAT); point bbMin(GREAT, GREAT, GREAT);
point bbMax(-GREAT, -GREAT, -GREAT); point bbMax(-GREAT, -GREAT, -GREAT);
forAll(allBackgroundMeshBounds_, procI) forAll(allBackgroundMeshBounds_, proci)
{ {
bbMin = min(bbMin, allBackgroundMeshBounds_[procI].min()); bbMin = min(bbMin, allBackgroundMeshBounds_[proci].min());
bbMax = max(bbMax, allBackgroundMeshBounds_[procI].max()); bbMax = max(bbMax, allBackgroundMeshBounds_[proci].max());
} }
globalBackgroundBounds_ = treeBoundBox(bbMin, bbMax); globalBackgroundBounds_ = treeBoundBox(bbMin, bbMax);
@ -1119,13 +1119,13 @@ Foam::labelList Foam::backgroundMeshDecomposition::processorNearestPosition
label nCandidates = 0; label nCandidates = 0;
forAll(allBackgroundMeshBounds_, procI) forAll(allBackgroundMeshBounds_, proci)
{ {
// Candidate points may lie just outside a processor box, increase // Candidate points may lie just outside a processor box, increase
// test range by using overlaps rather than contains // test range by using overlaps rather than contains
if (allBackgroundMeshBounds_[procI].overlaps(pt, sqr(SMALL*100))) if (allBackgroundMeshBounds_[proci].overlaps(pt, sqr(SMALL*100)))
{ {
toCandidateProc.append(procI); toCandidateProc.append(proci);
testPoints.append(pt); testPoints.append(pt);
nCandidates++; nCandidates++;
@ -1242,17 +1242,17 @@ Foam::backgroundMeshDecomposition::intersectsProcessors
label nCandidates = 0; label nCandidates = 0;
forAll(allBackgroundMeshBounds_, procI) forAll(allBackgroundMeshBounds_, proci)
{ {
// It is assumed that the sphere in question overlaps the source // It is assumed that the sphere in question overlaps the source
// processor, so don't test it, unless includeOwnProcessor is true // processor, so don't test it, unless includeOwnProcessor is true
if if
( (
(includeOwnProcessor || procI != Pstream::myProcNo()) (includeOwnProcessor || proci != Pstream::myProcNo())
&& allBackgroundMeshBounds_[procI].intersects(s, e, p) && allBackgroundMeshBounds_[proci].intersects(s, e, p)
) )
{ {
toCandidateProc.append(procI); toCandidateProc.append(proci);
testStarts.append(s); testStarts.append(s);
testEnds.append(e); testEnds.append(e);
@ -1336,7 +1336,7 @@ bool Foam::backgroundMeshDecomposition::overlapsOtherProcessors
const scalar& radiusSqr const scalar& radiusSqr
) const ) const
{ {
forAll(allBackgroundMeshBounds_, procI) forAll(allBackgroundMeshBounds_, proci)
{ {
if (bFTreePtr_().findNearest(centre, radiusSqr).hit()) if (bFTreePtr_().findNearest(centre, radiusSqr).hit())
{ {
@ -1356,19 +1356,19 @@ Foam::labelList Foam::backgroundMeshDecomposition::overlapProcessors
{ {
DynamicList<label> toProc(Pstream::nProcs()); DynamicList<label> toProc(Pstream::nProcs());
forAll(allBackgroundMeshBounds_, procI) forAll(allBackgroundMeshBounds_, proci)
{ {
// Test against the bounding box of the processor // Test against the bounding box of the processor
if if
( (
procI != Pstream::myProcNo() proci != Pstream::myProcNo()
&& allBackgroundMeshBounds_[procI].overlaps(centre, radiusSqr) && allBackgroundMeshBounds_[proci].overlaps(centre, radiusSqr)
) )
{ {
// Expensive test // Expensive test
// if (bFTreePtr_().findNearest(centre, radiusSqr).hit()) // if (bFTreePtr_().findNearest(centre, radiusSqr).hit())
{ {
toProc.append(procI); toProc.append(proci);
} }
} }
} }
@ -1400,19 +1400,19 @@ Foam::labelList Foam::backgroundMeshDecomposition::overlapProcessors
// //
// label nCandidates = 0; // label nCandidates = 0;
// //
// forAll(allBackgroundMeshBounds_, procI) // forAll(allBackgroundMeshBounds_, proci)
// { // {
// // It is assumed that the sphere in question overlaps the source // // It is assumed that the sphere in question overlaps the source
// // processor, so don't test it, unless includeOwnProcessor is true // // processor, so don't test it, unless includeOwnProcessor is true
// if // if
// ( // (
// (includeOwnProcessor || procI != Pstream::myProcNo()) // (includeOwnProcessor || proci != Pstream::myProcNo())
// && allBackgroundMeshBounds_[procI].overlaps(c, rSqr) // && allBackgroundMeshBounds_[proci].overlaps(c, rSqr)
// ) // )
// { // {
// if (bFTreePtr_().findNearest(c, rSqr).hit()) // if (bFTreePtr_().findNearest(c, rSqr).hit())
// { // {
// toCandidateProc.append(procI); // toCandidateProc.append(proci);
// testCentres.append(c); // testCentres.append(c);
// testRadiusSqrs.append(rSqr); // testRadiusSqrs.append(rSqr);
// //
@ -1525,17 +1525,17 @@ Foam::labelList Foam::backgroundMeshDecomposition::overlapProcessors
// //
// label nCandidates = 0; // label nCandidates = 0;
// //
// forAll(allBackgroundMeshBounds_, procI) // forAll(allBackgroundMeshBounds_, proci)
// { // {
// // It is assumed that the sphere in question overlaps the source // // It is assumed that the sphere in question overlaps the source
// // processor, so don't test it, unless includeOwnProcessor is true // // processor, so don't test it, unless includeOwnProcessor is true
// if // if
// ( // (
// (includeOwnProcessor || procI != Pstream::myProcNo()) // (includeOwnProcessor || proci != Pstream::myProcNo())
// && allBackgroundMeshBounds_[procI].overlaps(cc, rSqr) // && allBackgroundMeshBounds_[proci].overlaps(cc, rSqr)
// ) // )
// { // {
// toCandidateProc.append(procI); // toCandidateProc.append(proci);
// //
// nCandidates++; // nCandidates++;
// } // }

View File

@ -64,11 +64,11 @@ Foam::labelList Foam::backgroundMeshDecomposition::processorPosition
label nCandidates = 0; label nCandidates = 0;
forAll(allBackgroundMeshBounds_, procI) forAll(allBackgroundMeshBounds_, proci)
{ {
if (allBackgroundMeshBounds_[procI].contains(pt)) if (allBackgroundMeshBounds_[proci].contains(pt))
{ {
toCandidateProc.append(procI); toCandidateProc.append(proci);
testPoints.append(pt); testPoints.append(pt);
nCandidates++; nCandidates++;

View File

@ -1595,13 +1595,13 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
Pstream::gatherList(procUsedList); Pstream::gatherList(procUsedList);
Pstream::scatterList(procUsedList); Pstream::scatterList(procUsedList);
forAll(procUsedList, procI) forAll(procUsedList, proci)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
if (procUsedList[procI][Pstream::myProcNo()]) if (procUsedList[proci][Pstream::myProcNo()])
{ {
procUsed[procI] = true; procUsed[proci] = true;
} }
} }
} }
@ -1762,7 +1762,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
labelPairPairDynListList procPatchSortingIndex(nPatches); labelPairPairDynListList procPatchSortingIndex(nPatches);
label dualFaceI = 0; label dualFacei = 0;
if (foamyHexMeshControls().guardFeaturePoints()) if (foamyHexMeshControls().guardFeaturePoints())
{ {
@ -2029,11 +2029,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
} }
// internal face // internal face
faces[dualFaceI] = newDualFace; faces[dualFacei] = newDualFace;
owner[dualFaceI] = own; owner[dualFacei] = own;
neighbour[dualFaceI] = nei; neighbour[dualFacei] = nei;
dualFaceI++; dualFacei++;
} }
else if else if
( (
@ -2293,11 +2293,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
// else // else
{ {
// internal face // internal face
faces[dualFaceI] = newDualFace; faces[dualFacei] = newDualFace;
owner[dualFaceI] = own; owner[dualFacei] = own;
neighbour[dualFaceI] = nei; neighbour[dualFacei] = nei;
dualFaceI++; dualFacei++;
} }
} }
} }
@ -2313,7 +2313,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
<< endl; << endl;
} }
label nInternalFaces = dualFaceI; label nInternalFaces = dualFacei;
faces.setSize(nInternalFaces); faces.setSize(nInternalFaces);
owner.setSize(nInternalFaces); owner.setSize(nInternalFaces);

View File

@ -408,13 +408,13 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
if (Pstream::parRun()) if (Pstream::parRun())
{ {
forAll(referralVertices, procI) forAll(referralVertices, proci)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
referralVertices.set referralVertices.set
( (
procI, proci,
new labelPairHashSet(number_of_vertices()/Pstream::nProcs()) new labelPairHashSet(number_of_vertices()/Pstream::nProcs())
); );
} }
@ -700,16 +700,16 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
label nStoppedInsertion = 0; label nStoppedInsertion = 0;
// Do the nearness tests here // Do the nearness tests here
for (label procI = 0; procI < Pstream::nProcs(); ++procI) for (label proci = 0; proci < Pstream::nProcs(); ++proci)
{ {
// Skip own points // Skip own points
if (procI >= Pstream::myProcNo()) if (proci >= Pstream::myProcNo())
{ {
continue; continue;
} }
const pointIndexHitAndFeatureList& otherSurfEdges = const pointIndexHitAndFeatureList& otherSurfEdges =
procSurfLocations[procI]; procSurfLocations[proci];
forAll(otherSurfEdges, peI) forAll(otherSurfEdges, peI)
{ {
@ -725,9 +725,9 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
{ {
nStoppedInsertion++; nStoppedInsertion++;
if (!hits[procI].found(peI)) if (!hits[proci].found(peI))
{ {
hits[procI].insert(peI); hits[proci].insert(peI);
} }
} }
} }
@ -792,15 +792,15 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
label nStoppedInsertion = 0; label nStoppedInsertion = 0;
// Do the nearness tests here // Do the nearness tests here
for (label procI = 0; procI < Pstream::nProcs(); ++procI) for (label proci = 0; proci < Pstream::nProcs(); ++proci)
{ {
// Skip own points // Skip own points
if (procI >= Pstream::myProcNo()) if (proci >= Pstream::myProcNo())
{ {
continue; continue;
} }
pointIndexHitAndFeatureList& otherProcEdges = procEdgeLocations[procI]; pointIndexHitAndFeatureList& otherProcEdges = procEdgeLocations[proci];
forAll(otherProcEdges, peI) forAll(otherProcEdges, peI)
{ {
@ -812,7 +812,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
if (nearest.hit()) if (nearest.hit())
{ {
// Pout<< "Not inserting " << peI << " " << pt << " " // Pout<< "Not inserting " << peI << " " << pt << " "
// << nearest.rawPoint() << " on proc " << procI // << nearest.rawPoint() << " on proc " << proci
// << ", near edge = " << nearest // << ", near edge = " << nearest
// << " near ftPt = "<< info // << " near ftPt = "<< info
// << " " << featureEdgeExclusionDistanceSqr(pt) // << " " << featureEdgeExclusionDistanceSqr(pt)
@ -820,9 +820,9 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
nStoppedInsertion++; nStoppedInsertion++;
if (!hits[procI].found(peI)) if (!hits[proci].found(peI))
{ {
hits[procI].insert(peI); hits[proci].insert(peI);
} }
} }
} }

View File

@ -250,8 +250,8 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
// //
// // Vertex might be used by multiple faces. Which one to // // Vertex might be used by multiple faces. Which one to
// // use? For now last one wins. // // use? For now last one wins.
// label dualFaceI = dualPatchStarts[patchi]+i; // label dualFacei = dualPatchStarts[patchi]+i;
// vertexToDualAddressing[vertI] = -dualFaceI-1; // vertexToDualAddressing[vertI] = -dualFacei-1;
// } // }
// } // }
// //
@ -498,19 +498,19 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
{ {
bool allMatch = true; bool allMatch = true;
forAll(procPatchSizes, procI) forAll(procPatchSizes, proci)
{ {
const labelList& patchSizes = procPatchSizes[procI]; const labelList& patchSizes = procPatchSizes[proci];
forAll(patchSizes, patchi) forAll(patchSizes, patchi)
{ {
if (patchSizes[patchi] != procPatchSizes[patchi][procI]) if (patchSizes[patchi] != procPatchSizes[patchi][proci])
{ {
allMatch = false; allMatch = false;
Info<< indent << "Patches " << procI << " and " << patchi Info<< indent << "Patches " << proci << " and " << patchi
<< " have different sizes: " << patchSizes[patchi] << " have different sizes: " << patchSizes[patchi]
<< " and " << procPatchSizes[patchi][procI] << endl; << " and " << procPatchSizes[patchi][proci] << endl;
} }
} }
} }
@ -708,18 +708,18 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
if (changed) if (changed)
{ {
// Merge patch face reordering into mesh face reordering table // Merge patch face reordering into mesh face reordering table
forAll(patchFaceRotation, patchFaceI) forAll(patchFaceRotation, patchFacei)
{ {
rotation[patchFaceI + patchStartFace] rotation[patchFacei + patchStartFace]
= patchFaceRotation[patchFaceI]; = patchFaceRotation[patchFacei];
} }
forAll(patchFaceMap, patchFaceI) forAll(patchFaceMap, patchFacei)
{ {
if (patchFaceMap[patchFaceI] != patchFaceI) if (patchFaceMap[patchFacei] != patchFacei)
{ {
faceMap[patchFaceI + patchStartFace] faceMap[patchFacei + patchStartFace]
= patchFaceMap[patchFaceI] + patchStartFace; = patchFaceMap[patchFacei] + patchStartFace;
} }
} }

View File

@ -57,14 +57,14 @@ void Foam::conformalVoronoiMesh::calcNeighbourCellCentres
const labelUList& faceCells = pp.faceCells(); const labelUList& faceCells = pp.faceCells();
label bFaceI = pp.start() - mesh.nInternalFaces(); label bFacei = pp.start() - mesh.nInternalFaces();
if (pp.coupled()) if (pp.coupled())
{ {
forAll(faceCells, i) forAll(faceCells, i)
{ {
neiCc[bFaceI] = cellCentres[faceCells[i]]; neiCc[bFacei] = cellCentres[faceCells[i]];
bFaceI++; bFacei++;
} }
} }
} }
@ -329,14 +329,14 @@ void Foam::conformalVoronoiMesh::calcFaceZones
const labelUList& faceCells = pp.faceCells(); const labelUList& faceCells = pp.faceCells();
label bFaceI = pp.start() - mesh.nInternalFaces(); label bFacei = pp.start() - mesh.nInternalFaces();
if (pp.coupled()) if (pp.coupled())
{ {
forAll(faceCells, i) forAll(faceCells, i)
{ {
neiFaceOwner[bFaceI] = cellToSurface[faceCells[i]]; neiFaceOwner[bFacei] = cellToSurface[faceCells[i]];
bFaceI++; bFacei++;
} }
} }
} }

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
@ -127,15 +127,15 @@ List<Vb::Point> pointFile::initialPoints() const
{ {
bool foundAlready = false; bool foundAlready = false;
forAll(allProcPt, procI) forAll(allProcPt, proci)
{ {
// If a processor with a lower index has found this point // If a processor with a lower index has found this point
// to insert already, defer to it and don't insert. // to insert already, defer to it and don't insert.
if (foundAlready) if (foundAlready)
{ {
allProcPt[procI][ptI] = false; allProcPt[proci][ptI] = false;
} }
else if (allProcPt[procI][ptI]) else if (allProcPt[proci][ptI])
{ {
foundAlready = true; foundAlready = true;
} }

View File

@ -127,32 +127,32 @@ void printMeshData(const polyMesh& mesh)
label totProcPatches = 0; label totProcPatches = 0;
label maxProcFaces = 0; label maxProcFaces = 0;
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
Info<< endl Info<< endl
<< "Processor " << procI << nl << "Processor " << proci << nl
<< " Number of cells = " << globalCells.localSize(procI) << " Number of cells = " << globalCells.localSize(proci)
<< endl; << endl;
label nProcFaces = 0; label nProcFaces = 0;
const labelList& nei = patchNeiProcNo[procI]; const labelList& nei = patchNeiProcNo[proci];
forAll(patchNeiProcNo[procI], i) forAll(patchNeiProcNo[proci], i)
{ {
Info<< " Number of faces shared with processor " Info<< " Number of faces shared with processor "
<< patchNeiProcNo[procI][i] << " = " << patchSize[procI][i] << patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
<< endl; << endl;
nProcFaces += patchSize[procI][i]; nProcFaces += patchSize[proci][i];
} }
Info<< " Number of processor patches = " << nei.size() << nl Info<< " Number of processor patches = " << nei.size() << nl
<< " Number of processor faces = " << nProcFaces << nl << " Number of processor faces = " << nProcFaces << nl
<< " Number of boundary faces = " << " Number of boundary faces = "
<< globalBoundaryFaces.localSize(procI) << endl; << globalBoundaryFaces.localSize(proci) << endl;
maxProcCells = max(maxProcCells, globalCells.localSize(procI)); maxProcCells = max(maxProcCells, globalCells.localSize(proci));
totProcFaces += nProcFaces; totProcFaces += nProcFaces;
totProcPatches += nei.size(); totProcPatches += nei.size();
maxProcPatches = max(maxProcPatches, nei.size()); maxProcPatches = max(maxProcPatches, nei.size());

View File

@ -352,29 +352,29 @@ Foam::shortEdgeFilter2D::filter()
bool flagDegenerateFace = false; bool flagDegenerateFace = false;
const labelList& pFaces = ms_.pointFaces()[startVertex]; const labelList& pFaces = ms_.pointFaces()[startVertex];
forAll(pFaces, pFaceI) forAll(pFaces, pFacei)
{ {
const face& f = ms_.localFaces()[pFaces[pFaceI]]; const face& f = ms_.localFaces()[pFaces[pFacei]];
forAll(f, fp) forAll(f, fp)
{ {
// If the edge is part of this face... // If the edge is part of this face...
if (f[fp] == endVertex) if (f[fp] == endVertex)
{ {
// If deleting vertex would create a triangle, don't! // If deleting vertex would create a triangle, don't!
if (newFaceVertexCount[pFaces[pFaceI]] < 4) if (newFaceVertexCount[pFaces[pFacei]] < 4)
{ {
flagDegenerateFace = true; flagDegenerateFace = true;
} }
else else
{ {
newFaceVertexCount[pFaces[pFaceI]]--; newFaceVertexCount[pFaces[pFacei]]--;
} }
} }
// If the edge is not part of this face... // If the edge is not part of this face...
else else
{ {
// Deleting vertex of a triangle... // Deleting vertex of a triangle...
if (newFaceVertexCount[pFaces[pFaceI]] < 3) if (newFaceVertexCount[pFaces[pFacei]] < 3)
{ {
flagDegenerateFace = true; flagDegenerateFace = true;
} }
@ -450,7 +450,7 @@ Foam::shortEdgeFilter2D::filter()
// Need a new faceList // Need a new faceList
faceList newFaces(faces.size()); faceList newFaces(faces.size());
label newFaceI = 0; label newFacei = 0;
labelList newFace; labelList newFace;
label newFaceSize = 0; label newFaceSize = 0;
@ -521,7 +521,7 @@ Foam::shortEdgeFilter2D::filter()
if (newFace.size() > 2) if (newFace.size() > 2)
{ {
newFaces[newFaceI++] = face(newFace); newFaces[newFacei++] = face(newFace);
} }
else else
{ {
@ -531,7 +531,7 @@ Foam::shortEdgeFilter2D::filter()
} }
} }
newFaces.setSize(newFaceI); newFaces.setSize(newFacei);
MeshedSurface<face> fMesh MeshedSurface<face> fMesh
( (

View File

@ -120,16 +120,16 @@ int main(int argc, char *argv[])
// //
// Current patch number. // Current patch number.
label newPatchI = bMesh.patches().size(); label newPatchi = bMesh.patches().size();
label suffix = 0; label suffix = 0;
while (true) while (true)
{ {
// Find first unset face. // Find first unset face.
label unsetFaceI = findIndex(patchIDs, -1); label unsetFacei = findIndex(patchIDs, -1);
if (unsetFaceI == -1) if (unsetFacei == -1)
{ {
// All faces have patchID set. Exit. // All faces have patchID set. Exit.
break; break;
@ -148,10 +148,10 @@ int main(int argc, char *argv[])
bMesh.changePatchType(patchName, "patch"); bMesh.changePatchType(patchName, "patch");
// Fill visited with all faces reachable from unsetFaceI. // Fill visited with all faces reachable from unsetFacei.
boolList visited(bMesh.mesh().size()); boolList visited(bMesh.mesh().size());
bMesh.markFaces(markedEdges, unsetFaceI, visited); bMesh.markFaces(markedEdges, unsetFacei, visited);
// Assign all visited faces to current patch // Assign all visited faces to current patch
@ -163,14 +163,14 @@ int main(int argc, char *argv[])
{ {
nVisited++; nVisited++;
patchIDs[facei] = newPatchI; patchIDs[facei] = newPatchi;
} }
} }
Info<< "Assigned " << nVisited << " faces to patch " << patchName Info<< "Assigned " << nVisited << " faces to patch " << patchName
<< endl << endl; << endl << endl;
newPatchI++; newPatchi++;
} }
@ -180,41 +180,41 @@ int main(int argc, char *argv[])
// Create new list of patches with old ones first // Create new list of patches with old ones first
List<polyPatch*> newPatchPtrList(patches.size()); List<polyPatch*> newPatchPtrList(patches.size());
newPatchI = 0; newPatchi = 0;
// Copy old patches // Copy old patches
forAll(mesh.boundaryMesh(), patchi) forAll(mesh.boundaryMesh(), patchi)
{ {
const polyPatch& patch = mesh.boundaryMesh()[patchi]; const polyPatch& patch = mesh.boundaryMesh()[patchi];
newPatchPtrList[newPatchI] = newPatchPtrList[newPatchi] =
patch.clone patch.clone
( (
mesh.boundaryMesh(), mesh.boundaryMesh(),
newPatchI, newPatchi,
patch.size(), patch.size(),
patch.start() patch.start()
).ptr(); ).ptr();
newPatchI++; newPatchi++;
} }
// Add new ones with empty size. // Add new ones with empty size.
for (label patchi = newPatchI; patchi < patches.size(); patchi++) for (label patchi = newPatchi; patchi < patches.size(); patchi++)
{ {
const boundaryPatch& bp = patches[patchi]; const boundaryPatch& bp = patches[patchi];
newPatchPtrList[newPatchI] = polyPatch::New newPatchPtrList[newPatchi] = polyPatch::New
( (
polyPatch::typeName, polyPatch::typeName,
bp.name(), bp.name(),
0, 0,
mesh.nFaces(), mesh.nFaces(),
newPatchI, newPatchi,
mesh.boundaryMesh() mesh.boundaryMesh()
).ptr(); ).ptr();
newPatchI++; newPatchi++;
} }
if (!overwrite) if (!overwrite)
@ -236,9 +236,9 @@ int main(int argc, char *argv[])
forAll(patchIDs, facei) forAll(patchIDs, facei)
{ {
label meshFaceI = meshFace[facei]; label meshFacei = meshFace[facei];
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[facei]); polyMeshRepatcher.changePatchID(meshFacei, patchIDs[facei]);
} }
polyMeshRepatcher.repatch(); polyMeshRepatcher.repatch();

View File

@ -84,9 +84,9 @@ bool Foam::checkWedges
} }
// Find opposite // Find opposite
label oppositePatchI = findOppositeWedge(mesh, pp); label oppositePatchi = findOppositeWedge(mesh, pp);
if (oppositePatchI == -1) if (oppositePatchi == -1)
{ {
if (report) if (report)
{ {
@ -97,7 +97,7 @@ bool Foam::checkWedges
} }
const wedgePolyPatch& opp = const wedgePolyPatch& opp =
refCast<const wedgePolyPatch>(patches[oppositePatchI]); refCast<const wedgePolyPatch>(patches[oppositePatchi]);
if (mag(opp.axis() & pp.axis()) < (1-1e-3)) if (mag(opp.axis() & pp.axis()) < (1-1e-3))
@ -351,13 +351,13 @@ bool Foam::checkCoupledPoints
forAll(cpp, i) forAll(cpp, i)
{ {
label bFaceI = cpp.start() + i - mesh.nInternalFaces(); label bFacei = cpp.start() + i - mesh.nInternalFaces();
const face& f = cpp[i]; const face& f = cpp[i];
nbrPoints[bFaceI].setSize(f.size()); nbrPoints[bFacei].setSize(f.size());
forAll(f, fp) forAll(f, fp)
{ {
const point& p0 = p[f[fp]]; const point& p0 = p[f[fp]];
nbrPoints[bFaceI][fp] = p0; nbrPoints[bFacei][fp] = p0;
} }
} }
} }
@ -397,15 +397,15 @@ bool Foam::checkCoupledPoints
forAll(cpp, i) forAll(cpp, i)
{ {
label bFaceI = cpp.start() + i - mesh.nInternalFaces(); label bFacei = cpp.start() + i - mesh.nInternalFaces();
const face& f = cpp[i]; const face& f = cpp[i];
if (f.size() != nbrPoints[bFaceI].size()) if (f.size() != nbrPoints[bFacei].size())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Local face size : " << f.size() << "Local face size : " << f.size()
<< " does not equal neighbour face size : " << " does not equal neighbour face size : "
<< nbrPoints[bFaceI].size() << nbrPoints[bFacei].size()
<< abort(FatalError); << abort(FatalError);
} }
@ -413,7 +413,7 @@ bool Foam::checkCoupledPoints
forAll(f, j) forAll(f, j)
{ {
const point& p0 = p[f[fp]]; const point& p0 = p[f[fp]];
scalar d = mag(p0 - nbrPoints[bFaceI][j]); scalar d = mag(p0 - nbrPoints[bFacei][j]);
if (d > smallDist[i]) if (d > smallDist[i])
{ {

View File

@ -113,7 +113,7 @@ void modifyOrAddFace
const label facei, const label facei,
const label own, const label own,
const bool flipFaceFlux, const bool flipFaceFlux,
const label newPatchI, const label newPatchi,
const label zoneID, const label zoneID,
const bool zoneFlip, const bool zoneFlip,
@ -132,7 +132,7 @@ void modifyOrAddFace
own, // owner own, // owner
-1, // neighbour -1, // neighbour
flipFaceFlux, // face flip flipFaceFlux, // face flip
newPatchI, // patch for face newPatchi, // patch for face
false, // remove from zone false, // remove from zone
zoneID, // zone for face zoneID, // zone for face
zoneFlip // face flip in zone zoneFlip // face flip in zone
@ -154,7 +154,7 @@ void modifyOrAddFace
-1, // master edge -1, // master edge
facei, // master face facei, // master face
flipFaceFlux, // face flip flipFaceFlux, // face flip
newPatchI, // patch for face newPatchi, // patch for face
zoneID, // zone for face zoneID, // zone for face
zoneFlip // face flip in zone zoneFlip // face flip in zone
) )
@ -186,11 +186,11 @@ void createFaces
for (label facei = 0; facei < mesh.nInternalFaces(); facei++) for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{ {
label zoneFaceI = fZone.whichFace(facei); label zoneFacei = fZone.whichFace(facei);
if (zoneFaceI != -1) if (zoneFacei != -1)
{ {
if (!fZone.flipMap()[zoneFaceI]) if (!fZone.flipMap()[zoneFacei])
{ {
// Use owner side of face // Use owner side of face
modifyOrAddFace modifyOrAddFace
@ -236,11 +236,11 @@ void createFaces
for (label facei = 0; facei < mesh.nInternalFaces(); facei++) for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{ {
label zoneFaceI = fZone.whichFace(facei); label zoneFacei = fZone.whichFace(facei);
if (zoneFaceI != -1) if (zoneFacei != -1)
{ {
if (!fZone.flipMap()[zoneFaceI]) if (!fZone.flipMap()[zoneFacei])
{ {
// Use neighbour side of face // Use neighbour side of face
modifyOrAddFace modifyOrAddFace
@ -294,9 +294,9 @@ void createFaces
{ {
const polyPatch& pp = pbm[patchi]; const polyPatch& pp = pbm[patchi];
label newPatchI = newMasterPatches[i]; label newPatchi = newMasterPatches[i];
if (pp.coupled() && pbm[newPatchI].coupled()) if (pp.coupled() && pbm[newPatchi].coupled())
{ {
// Do not allow coupled faces to be moved to different // Do not allow coupled faces to be moved to different
// coupled patches. // coupled patches.
@ -307,9 +307,9 @@ void createFaces
{ {
label facei = pp.start()+i; label facei = pp.start()+i;
label zoneFaceI = fZone.whichFace(facei); label zoneFacei = fZone.whichFace(facei);
if (zoneFaceI != -1) if (zoneFacei != -1)
{ {
if (patchWarned.insert(patchi)) if (patchWarned.insert(patchi))
{ {
@ -318,7 +318,7 @@ void createFaces
<< pp.name() << pp.name()
<< ") in faceZone " << fZone.name() << ") in faceZone " << fZone.name()
<< " to convert to baffle patch " << " to convert to baffle patch "
<< pbm[newPatchI].name() << pbm[newPatchi].name()
<< endl << endl
<< " Run with -internalFacesOnly option" << " Run with -internalFacesOnly option"
<< " if you don't wish to convert" << " if you don't wish to convert"
@ -332,9 +332,9 @@ void createFaces
facei, // label of face facei, // label of face
mesh.faceOwner()[facei], // owner mesh.faceOwner()[facei], // owner
false, // face flip false, // face flip
newPatchI, // patch for face newPatchi, // patch for face
fZone.index(), // zone for face fZone.index(), // zone for face
fZone.flipMap()[zoneFaceI], // face flip in zone fZone.flipMap()[zoneFacei], // face flip in zone
modifiedFace // modify or add modifiedFace // modify or add
); );
nModified++; nModified++;

View File

@ -555,7 +555,7 @@ int main(int argc, char *argv[])
// Old and new patches. // Old and new patches.
DynamicList<polyPatch*> allPatches(patches.size()+patchSources.size()); DynamicList<polyPatch*> allPatches(patches.size()+patchSources.size());
label startFaceI = mesh.nInternalFaces(); label startFacei = mesh.nInternalFaces();
// Copy old patches. // Copy old patches.
forAll(patches, patchi) forAll(patches, patchi)
@ -571,10 +571,10 @@ int main(int argc, char *argv[])
patches, patches,
patchi, patchi,
pp.size(), pp.size(),
startFaceI startFacei
).ptr() ).ptr()
); );
startFaceI += pp.size(); startFacei += pp.size();
} }
} }
@ -584,20 +584,20 @@ int main(int argc, char *argv[])
word patchName(dict.lookup("name")); word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName); label destPatchi = patches.findPatchID(patchName);
if (destPatchI == -1) if (destPatchi == -1)
{ {
dictionary patchDict(dict.subDict("patchInfo")); dictionary patchDict(dict.subDict("patchInfo"));
destPatchI = allPatches.size(); destPatchi = allPatches.size();
Info<< "Adding new patch " << patchName Info<< "Adding new patch " << patchName
<< " as patch " << destPatchI << " as patch " << destPatchi
<< " from " << patchDict << endl; << " from " << patchDict << endl;
patchDict.set("nFaces", 0); patchDict.set("nFaces", 0);
patchDict.set("startFace", startFaceI); patchDict.set("startFace", startFacei);
// Add an empty patch. // Add an empty patch.
allPatches.append allPatches.append
@ -606,7 +606,7 @@ int main(int argc, char *argv[])
( (
patchName, patchName,
patchDict, patchDict,
destPatchI, destPatchi,
patches patches
).ptr() ).ptr()
); );
@ -632,10 +632,10 @@ int main(int argc, char *argv[])
patches, patches,
patchi, patchi,
pp.size(), pp.size(),
startFaceI startFacei
).ptr() ).ptr()
); );
startFaceI += pp.size(); startFacei += pp.size();
} }
} }
@ -659,9 +659,9 @@ int main(int argc, char *argv[])
const dictionary& dict = patchSources[addedI]; const dictionary& dict = patchSources[addedI];
const word patchName(dict.lookup("name")); const word patchName(dict.lookup("name"));
label destPatchI = patches.findPatchID(patchName); label destPatchi = patches.findPatchID(patchName);
if (destPatchI == -1) if (destPatchi == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "patch " << patchName << " not added. Problem." << "patch " << patchName << " not added. Problem."
@ -686,7 +686,7 @@ int main(int argc, char *argv[])
const polyPatch& pp = patches[iter.key()]; const polyPatch& pp = patches[iter.key()];
Info<< "Moving faces from patch " << pp.name() Info<< "Moving faces from patch " << pp.name()
<< " to patch " << destPatchI << endl; << " to patch " << destPatchi << endl;
forAll(pp, i) forAll(pp, i)
{ {
@ -694,7 +694,7 @@ int main(int argc, char *argv[])
( (
mesh, mesh,
pp.start() + i, pp.start() + i,
destPatchI, destPatchi,
meshMod meshMod
); );
} }
@ -732,7 +732,7 @@ int main(int argc, char *argv[])
( (
mesh, mesh,
facei, facei,
destPatchI, destPatchi,
meshMod meshMod
); );
} }

View File

@ -76,16 +76,16 @@ void insertDuplicateMerge
const labelList& faceOwner = mesh.faceOwner(); const labelList& faceOwner = mesh.faceOwner();
const faceZoneMesh& faceZones = mesh.faceZones(); const faceZoneMesh& faceZones = mesh.faceZones();
forAll(duplicates, bFaceI) forAll(duplicates, bFacei)
{ {
label otherFaceI = duplicates[bFaceI]; label otherFacei = duplicates[bFacei];
if (otherFaceI != -1 && otherFaceI > bFaceI) if (otherFacei != -1 && otherFacei > bFacei)
{ {
// Two duplicate faces. Merge. // Two duplicate faces. Merge.
label face0 = mesh.nInternalFaces() + bFaceI; label face0 = mesh.nInternalFaces() + bFacei;
label face1 = mesh.nInternalFaces() + otherFaceI; label face1 = mesh.nInternalFaces() + otherFacei;
label own0 = faceOwner[face0]; label own0 = faceOwner[face0];
label own1 = faceOwner[face1]; label own1 = faceOwner[face1];
@ -166,11 +166,11 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
// Check that none are on processor patches // Check that none are on processor patches
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
forAll(duplicates, bFaceI) forAll(duplicates, bFacei)
{ {
if (duplicates[bFaceI] != -1) if (duplicates[bFacei] != -1)
{ {
label facei = mesh.nInternalFaces() + bFaceI; label facei = mesh.nInternalFaces() + bFacei;
label patchi = patches.whichPatch(facei); label patchi = patches.whichPatch(facei);
if (isA<processorPolyPatch>(patches[patchi])) if (isA<processorPolyPatch>(patches[patchi]))
@ -196,14 +196,14 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
(mesh.nFaces() - mesh.nInternalFaces())/256 (mesh.nFaces() - mesh.nInternalFaces())/256
); );
forAll(duplicates, bFaceI) forAll(duplicates, bFacei)
{ {
label otherFaceI = duplicates[bFaceI]; label otherFacei = duplicates[bFacei];
if (otherFaceI != -1 && otherFaceI > bFaceI) if (otherFacei != -1 && otherFacei > bFacei)
{ {
duplicateSet.insert(mesh.nInternalFaces() + bFaceI); duplicateSet.insert(mesh.nInternalFaces() + bFacei);
duplicateSet.insert(mesh.nInternalFaces() + otherFaceI); duplicateSet.insert(mesh.nInternalFaces() + otherFacei);
} }
} }

View File

@ -101,14 +101,14 @@ int main(int argc, char *argv[])
forAll(faceLabels, facei) forAll(faceLabels, facei)
{ {
const label meshFaceI = faceLabels[facei]; const label meshFacei = faceLabels[facei];
const label patchi = bm.whichPatch(meshFaceI); const label patchi = bm.whichPatch(meshFacei);
if if
( (
patchi != -1 patchi != -1
&& bm[patchi].coupled() && bm[patchi].coupled()
&& !isMasterFace[meshFaceI] && !isMasterFace[meshFacei]
) )
{ {
// Slave side. Mark so doesn't get visited. // Slave side. Mark so doesn't get visited.
@ -127,9 +127,9 @@ int main(int argc, char *argv[])
forAll(faceLabels, facei) forAll(faceLabels, facei)
{ {
const label meshFaceI = faceLabels[facei]; const label meshFacei = faceLabels[facei];
if (isMasterFace[meshFaceI]) if (isMasterFace[meshFacei])
{ {
const labelList& fEdges = patch.faceEdges()[facei]; const labelList& fEdges = patch.faceEdges()[facei];
forAll(fEdges, fEdgeI) forAll(fEdges, fEdgeI)
@ -183,59 +183,59 @@ int main(int argc, char *argv[])
while (true) while (true)
{ {
// Pick an unset face // Pick an unset face
label unsetFaceI = labelMax; label unsetFacei = labelMax;
forAll(allFaceInfo, facei) forAll(allFaceInfo, facei)
{ {
if (allFaceInfo[facei] == orientedSurface::UNVISITED) if (allFaceInfo[facei] == orientedSurface::UNVISITED)
{ {
unsetFaceI = globalFaces.toGlobal(facei); unsetFacei = globalFaces.toGlobal(facei);
break; break;
} }
} }
reduce(unsetFaceI, minOp<label>()); reduce(unsetFacei, minOp<label>());
if (unsetFaceI == labelMax) if (unsetFacei == labelMax)
{ {
break; break;
} }
label procI = globalFaces.whichProcID(unsetFaceI); label proci = globalFaces.whichProcID(unsetFacei);
label seedFaceI = globalFaces.toLocal(procI, unsetFaceI); label seedFacei = globalFaces.toLocal(proci, unsetFacei);
Info<< "Seeding from processor " << procI << " face " << seedFaceI Info<< "Seeding from processor " << proci << " face " << seedFacei
<< endl; << endl;
if (procI == Pstream::myProcNo()) if (proci == Pstream::myProcNo())
{ {
// Determine orientation of seedFace // Determine orientation of seedFace
vector d = outsidePoint-patch.faceCentres()[seedFaceI]; vector d = outsidePoint-patch.faceCentres()[seedFacei];
const vector& fn = patch.faceNormals()[seedFaceI]; const vector& fn = patch.faceNormals()[seedFacei];
// Set information to correct orientation // Set information to correct orientation
patchFaceOrientation& faceInfo = allFaceInfo[seedFaceI]; patchFaceOrientation& faceInfo = allFaceInfo[seedFacei];
faceInfo = orientedSurface::NOFLIP; faceInfo = orientedSurface::NOFLIP;
if ((fn&d) < 0) if ((fn&d) < 0)
{ {
faceInfo.flip(); faceInfo.flip();
Pout<< "Face " << seedFaceI << " at " Pout<< "Face " << seedFacei << " at "
<< patch.faceCentres()[seedFaceI] << patch.faceCentres()[seedFacei]
<< " with normal " << fn << " with normal " << fn
<< " needs to be flipped." << endl; << " needs to be flipped." << endl;
} }
else else
{ {
Pout<< "Face " << seedFaceI << " at " Pout<< "Face " << seedFacei << " at "
<< patch.faceCentres()[seedFaceI] << patch.faceCentres()[seedFacei]
<< " with normal " << fn << " with normal " << fn
<< " points in positive direction (cos = " << (fn&d)/mag(d) << " points in positive direction (cos = " << (fn&d)/mag(d)
<< ")" << endl; << ")" << endl;
} }
const labelList& fEdges = patch.faceEdges()[seedFaceI]; const labelList& fEdges = patch.faceEdges()[seedFacei];
forAll(fEdges, fEdgeI) forAll(fEdges, fEdgeI)
{ {
label edgeI = fEdges[fEdgeI]; label edgeI = fEdges[fEdgeI];
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
mesh, mesh,
patch, patch,
edgeI, edgeI,
seedFaceI, seedFacei,
faceInfo, faceInfo,
tol, tol,
dummyTrackData dummyTrackData
@ -300,10 +300,10 @@ int main(int argc, char *argv[])
forAll(faceLabels, i) forAll(faceLabels, i)
{ {
const label meshFaceI = faceLabels[i]; const label meshFacei = faceLabels[i];
if (!mesh.isInternalFace(meshFaceI)) if (!mesh.isInternalFace(meshFacei))
{ {
neiStatus[meshFaceI-mesh.nInternalFaces()] = neiStatus[meshFacei-mesh.nInternalFaces()] =
allFaceInfo[i].flipStatus(); allFaceInfo[i].flipStatus();
} }
} }
@ -311,31 +311,31 @@ int main(int argc, char *argv[])
forAll(faceLabels, i) forAll(faceLabels, i)
{ {
const label meshFaceI = faceLabels[i]; const label meshFacei = faceLabels[i];
const label patchi = bm.whichPatch(meshFaceI); const label patchi = bm.whichPatch(meshFacei);
if if
( (
patchi != -1 patchi != -1
&& bm[patchi].coupled() && bm[patchi].coupled()
&& !isMasterFace[meshFaceI] && !isMasterFace[meshFacei]
) )
{ {
// Slave side. Take flipped from neighbour // Slave side. Take flipped from neighbour
label bFaceI = meshFaceI-mesh.nInternalFaces(); label bFacei = meshFacei-mesh.nInternalFaces();
if (neiStatus[bFaceI] == orientedSurface::NOFLIP) if (neiStatus[bFacei] == orientedSurface::NOFLIP)
{ {
allFaceInfo[i] = orientedSurface::FLIP; allFaceInfo[i] = orientedSurface::FLIP;
} }
else if (neiStatus[bFaceI] == orientedSurface::FLIP) else if (neiStatus[bFacei] == orientedSurface::FLIP)
{ {
allFaceInfo[i] = orientedSurface::NOFLIP; allFaceInfo[i] = orientedSurface::NOFLIP;
} }
else else
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Incorrect status for face " << meshFaceI << "Incorrect status for face " << meshFacei
<< abort(FatalError); << abort(FatalError);
} }
} }

View File

@ -199,7 +199,7 @@ Foam::label Foam::meshDualiser::addInternalFace
( (
const label masterPointI, const label masterPointI,
const label masterEdgeI, const label masterEdgeI,
const label masterFaceI, const label masterFacei,
const bool edgeOrder, const bool edgeOrder,
const label dualCell0, const label dualCell0,
@ -240,30 +240,30 @@ Foam::label Foam::meshDualiser::addInternalFace
label zoneID = -1; label zoneID = -1;
bool zoneFlip = false; bool zoneFlip = false;
if (masterFaceI != -1) if (masterFacei != -1)
{ {
zoneID = mesh_.faceZones().whichZone(masterFaceI); zoneID = mesh_.faceZones().whichZone(masterFacei);
if (zoneID != -1) if (zoneID != -1)
{ {
const faceZone& fZone = mesh_.faceZones()[zoneID]; const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)]; zoneFlip = fZone.flipMap()[fZone.whichFace(masterFacei)];
} }
} }
label dualFaceI; label dualFacei;
if (dualCell0 < dualCell1) if (dualCell0 < dualCell1)
{ {
dualFaceI = meshMod.addFace dualFacei = meshMod.addFace
( (
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
-1, // patchID -1, // patchID
zoneID, // zoneID zoneID, // zoneID
@ -273,7 +273,7 @@ Foam::label Foam::meshDualiser::addInternalFace
//pointField dualPoints(meshMod.points()); //pointField dualPoints(meshMod.points());
//vector n(newFace.normal(dualPoints)); //vector n(newFace.normal(dualPoints));
//n /= mag(n); //n /= mag(n);
//Pout<< "Generated internal dualFace:" << dualFaceI //Pout<< "Generated internal dualFace:" << dualFacei
// << " verts:" << newFace // << " verts:" << newFace
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)() // << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
// << " n:" << n // << " n:" << n
@ -283,14 +283,14 @@ Foam::label Foam::meshDualiser::addInternalFace
} }
else else
{ {
dualFaceI = meshMod.addFace dualFacei = meshMod.addFace
( (
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
-1, // patchID -1, // patchID
zoneID, // zoneID zoneID, // zoneID
@ -300,7 +300,7 @@ Foam::label Foam::meshDualiser::addInternalFace
//pointField dualPoints(meshMod.points()); //pointField dualPoints(meshMod.points());
//vector n(newFace.normal(dualPoints)); //vector n(newFace.normal(dualPoints));
//n /= mag(n); //n /= mag(n);
//Pout<< "Generated internal dualFace:" << dualFaceI //Pout<< "Generated internal dualFace:" << dualFacei
// << " verts:" << newFace // << " verts:" << newFace
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)() // << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
// << " n:" << n // << " n:" << n
@ -308,7 +308,7 @@ Foam::label Foam::meshDualiser::addInternalFace
// << " dualneigbour:" << dualCell0 // << " dualneigbour:" << dualCell0
// << endl; // << endl;
} }
return dualFaceI; return dualFacei;
} }
@ -316,9 +316,9 @@ Foam::label Foam::meshDualiser::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
@ -328,26 +328,26 @@ Foam::label Foam::meshDualiser::addBoundaryFace
label zoneID = -1; label zoneID = -1;
bool zoneFlip = false; bool zoneFlip = false;
if (masterFaceI != -1) if (masterFacei != -1)
{ {
zoneID = mesh_.faceZones().whichZone(masterFaceI); zoneID = mesh_.faceZones().whichZone(masterFacei);
if (zoneID != -1) if (zoneID != -1)
{ {
const faceZone& fZone = mesh_.faceZones()[zoneID]; const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)]; zoneFlip = fZone.flipMap()[fZone.whichFace(masterFacei)];
} }
} }
label dualFaceI = meshMod.addFace label dualFacei = meshMod.addFace
( (
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
patchi, // patchID patchi, // patchID
zoneID, // zoneID zoneID, // zoneID
@ -357,13 +357,13 @@ Foam::label Foam::meshDualiser::addBoundaryFace
//pointField dualPoints(meshMod.points()); //pointField dualPoints(meshMod.points());
//vector n(newFace.normal(dualPoints)); //vector n(newFace.normal(dualPoints));
//n /= mag(n); //n /= mag(n);
//Pout<< "Generated boundary dualFace:" << dualFaceI //Pout<< "Generated boundary dualFace:" << dualFacei
// << " verts:" << newFace // << " verts:" << newFace
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)() // << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
// << " n:" << n // << " n:" << n
// << " on dualowner:" << dualCellI // << " on dualowner:" << dualCelli
// << endl; // << endl;
return dualFaceI; return dualFacei;
} }
@ -376,7 +376,7 @@ void Foam::meshDualiser::createFacesAroundEdge
const bool splitFace, const bool splitFace,
const PackedBoolList& isBoundaryEdge, const PackedBoolList& isBoundaryEdge,
const label edgeI, const label edgeI,
const label startFaceI, const label startFacei,
polyTopoChange& meshMod, polyTopoChange& meshMod,
boolList& doneEFaces boolList& doneEFaces
) const ) const
@ -386,7 +386,7 @@ void Foam::meshDualiser::createFacesAroundEdge
label fp = edgeFaceCirculator::getMinIndex label fp = edgeFaceCirculator::getMinIndex
( (
mesh_.faces()[startFaceI], mesh_.faces()[startFacei],
e[0], e[0],
e[1] e[1]
); );
@ -394,7 +394,7 @@ void Foam::meshDualiser::createFacesAroundEdge
edgeFaceCirculator ie edgeFaceCirculator ie
( (
mesh_, mesh_,
startFaceI, // face startFacei, // face
true, // ownerSide true, // ownerSide
fp, // fp fp, // fp
isBoundaryEdge.get(edgeI) == 1 // isBoundaryEdge isBoundaryEdge.get(edgeI) == 1 // isBoundaryEdge
@ -475,7 +475,7 @@ void Foam::meshDualiser::createFacesAroundEdge
( (
-1, // masterPointI -1, // masterPointI
edgeI, // masterEdgeI edgeI, // masterEdgeI
-1, // masterFaceI -1, // masterFacei
edgeOrder, edgeOrder,
currentDualCell0, currentDualCell0,
currentDualCell1, currentDualCell1,
@ -527,7 +527,7 @@ void Foam::meshDualiser::createFacesAroundEdge
( (
-1, // masterPointI -1, // masterPointI
edgeI, // masterEdgeI edgeI, // masterEdgeI
-1, // masterFaceI -1, // masterFacei
edgeOrder, edgeOrder,
currentDualCell0, currentDualCell0,
currentDualCell1, currentDualCell1,
@ -621,7 +621,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
( (
-1, // masterPointI -1, // masterPointI
-1, // masterEdgeI -1, // masterEdgeI
facei, // masterFaceI facei, // masterFacei
true, // edgeOrder, true, // edgeOrder,
currentDualCell0, currentDualCell0,
currentDualCell1, currentDualCell1,
@ -642,7 +642,7 @@ 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
) const ) const
@ -660,7 +660,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
// pointFaces. // pointFaces.
// Starting face // Starting face
label facei = startFaceI; label facei = startFacei;
DynamicList<label> verts(4); DynamicList<label> verts(4);
@ -678,7 +678,7 @@ 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];
@ -721,7 +721,7 @@ 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"
@ -733,7 +733,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
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
@ -744,8 +744,8 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
//pointI, // masterPointI //pointI, // masterPointI
-1, // masterPointI -1, // masterPointI
-1, // masterEdgeI -1, // masterEdgeI
facei, // masterFaceI facei, // masterFacei
dualCellI, dualCelli,
patchi, patchi,
verts, verts,
meshMod meshMod
@ -753,7 +753,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
} }
else else
{ {
label facei = startFaceI; label facei = startFacei;
// Storage for face // Storage for face
DynamicList<label> verts(mesh_.faces()[facei].size()); DynamicList<label> verts(mesh_.faces()[facei].size());
@ -798,7 +798,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
( (
-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(),
@ -831,7 +831,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
} }
while while
( (
facei != startFaceI facei != startFacei
&& facei >= pp.start() && facei >= pp.start()
&& facei < pp.start()+pp.size() && facei < pp.start()+pp.size()
); );
@ -843,7 +843,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
( (
-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(),
@ -1070,22 +1070,22 @@ void Foam::meshDualiser::setRefinement
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
mesh_.cellZones().whichZone(pCells[pCellI]) //zoneID mesh_.cellZones().whichZone(pCells[pCelli]) //zoneID
); );
if (dualCcStr.valid()) if (dualCcStr.valid())
{ {
meshTools::writeOBJ meshTools::writeOBJ
( (
dualCcStr(), dualCcStr(),
0.5*(mesh_.points()[pointI]+cellCentres[pCells[pCellI]]) 0.5*(mesh_.points()[pointI]+cellCentres[pCells[pCelli]])
); );
} }
} }
@ -1299,13 +1299,13 @@ void Foam::meshDualiser::setRefinement
// happen for non-manifold edges where a single edge can // happen for non-manifold edges where a single edge can
// become multiple faces. // become multiple faces.
label startFaceI = eFaces[i]; label startFacei = eFaces[i];
//Pout<< "Walking edge:" << edgeI //Pout<< "Walking edge:" << edgeI
// << " points:" << mesh_.points()[e[0]] // << " points:" << mesh_.points()[e[0]]
// << mesh_.points()[e[1]] // << mesh_.points()[e[1]]
// << " startFace:" << startFaceI // << " startFace:" << startFacei
// << " at:" << mesh_.faceCentres()[startFaceI] // << " at:" << mesh_.faceCentres()[startFacei]
// << endl; // << endl;
createFacesAroundEdge createFacesAroundEdge
@ -1313,7 +1313,7 @@ void Foam::meshDualiser::setRefinement
splitFace, splitFace,
isBoundaryEdge, isBoundaryEdge,
edgeI, edgeI,
startFaceI, startFacei,
meshMod, meshMod,
doneEFaces doneEFaces
); );
@ -1407,20 +1407,20 @@ void Foam::meshDualiser::setRefinement
if (!donePFaces[i]) if (!donePFaces[i])
{ {
// 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]
// << endl; // << endl;
createFacesAroundBoundaryPoint createFacesAroundBoundaryPoint
( (
patchi, patchi,
patchPointI, patchPointI,
startFaceI, startFacei,
meshMod, meshMod,
donePFaces // pFaces visited donePFaces // pFaces visited
); );

View File

@ -117,7 +117,7 @@ class meshDualiser
( (
const label masterPointI, const label masterPointI,
const label masterEdgeI, const label masterEdgeI,
const label masterFaceI, const label masterFacei,
const bool edgeOrder, const bool edgeOrder,
const label dualCell0, const label dualCell0,
@ -131,9 +131,9 @@ class meshDualiser
( (
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
@ -145,7 +145,7 @@ class meshDualiser
const bool splitFace, const bool splitFace,
const PackedBoolList&, const PackedBoolList&,
const label edgeI, const label edgeI,
const label startFaceI, const label startFacei,
polyTopoChange&, polyTopoChange&,
boolList& doneEFaces boolList& doneEFaces
) const; ) const;
@ -163,7 +163,7 @@ class meshDualiser
( (
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
) const; ) const;

View File

@ -329,9 +329,9 @@ int main(int argc, char *argv[])
// Create cellSet with added cells for easy inspection // Create cellSet with added cells for easy inspection
cellSet newCells(mesh, "refinedCells", refCells.size()); cellSet newCells(mesh, "refinedCells", refCells.size());
forAll(oldToNew, oldCellI) forAll(oldToNew, oldCelli)
{ {
const labelList& added = oldToNew[oldCellI]; const labelList& added = oldToNew[oldCelli];
forAll(added, i) forAll(added, i)
{ {
@ -372,21 +372,21 @@ int main(int argc, char *argv[])
+ oldTimeName; + oldTimeName;
forAll(oldToNew, oldCellI) forAll(oldToNew, oldCelli)
{ {
const labelList& added = oldToNew[oldCellI]; const labelList& added = oldToNew[oldCelli];
if (added.size()) if (added.size())
{ {
forAll(added, i) forAll(added, i)
{ {
newToOld[added[i]] = oldCellI; newToOld[added[i]] = oldCelli;
} }
} }
else else
{ {
// Unrefined cell // Unrefined cell
newToOld[oldCellI] = oldCellI; newToOld[oldCelli] = oldCelli;
} }
} }

View File

@ -174,16 +174,16 @@ labelList getFaceOrder
labelList oldToNewFace(mesh.nFaces(), -1); labelList oldToNewFace(mesh.nFaces(), -1);
label newFaceI = 0; label newFacei = 0;
labelList nbr; labelList nbr;
labelList order; labelList order;
forAll(cellOrder, newCellI) forAll(cellOrder, newCelli)
{ {
label oldCellI = cellOrder[newCellI]; label oldCelli = cellOrder[newCelli];
const cell& cFaces = mesh.cells()[oldCellI]; const cell& cFaces = mesh.cells()[oldCelli];
// Neighbouring cells // Neighbouring cells
nbr.setSize(cFaces.size()); nbr.setSize(cFaces.size());
@ -195,16 +195,16 @@ labelList getFaceOrder
if (mesh.isInternalFace(facei)) if (mesh.isInternalFace(facei))
{ {
// Internal face. Get cell on other side. // Internal face. Get cell on other side.
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]]; label nbrCelli = reverseCellOrder[mesh.faceNeighbour()[facei]];
if (nbrCellI == newCellI) if (nbrCelli == newCelli)
{ {
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]]; nbrCelli = reverseCellOrder[mesh.faceOwner()[facei]];
} }
if (newCellI < nbrCellI) if (newCelli < nbrCelli)
{ {
// CellI is master // Celli is master
nbr[i] = nbrCellI; nbr[i] = nbrCelli;
} }
else else
{ {
@ -227,13 +227,13 @@ labelList getFaceOrder
label index = order[i]; label index = order[i];
if (nbr[index] != -1) if (nbr[index] != -1)
{ {
oldToNewFace[cFaces[index]] = newFaceI++; oldToNewFace[cFaces[index]] = newFacei++;
} }
} }
} }
// Leave patch faces intact. // Leave patch faces intact.
for (label facei = newFaceI; facei < mesh.nFaces(); facei++) for (label facei = newFacei; facei < mesh.nFaces(); facei++)
{ {
oldToNewFace[facei] = facei; oldToNewFace[facei] = facei;
} }
@ -267,20 +267,20 @@ labelList getRegionFaceOrder
labelList oldToNewFace(mesh.nFaces(), -1); labelList oldToNewFace(mesh.nFaces(), -1);
label newFaceI = 0; label newFacei = 0;
label prevRegion = -1; label prevRegion = -1;
forAll(cellOrder, newCellI) forAll(cellOrder, newCelli)
{ {
label oldCellI = cellOrder[newCellI]; label oldCelli = cellOrder[newCelli];
if (cellToRegion[oldCellI] != prevRegion) if (cellToRegion[oldCelli] != prevRegion)
{ {
prevRegion = cellToRegion[oldCellI]; prevRegion = cellToRegion[oldCelli];
} }
const cell& cFaces = mesh.cells()[oldCellI]; const cell& cFaces = mesh.cells()[oldCelli];
SortableList<label> nbr(cFaces.size()); SortableList<label> nbr(cFaces.size());
@ -291,21 +291,21 @@ labelList getRegionFaceOrder
if (mesh.isInternalFace(facei)) if (mesh.isInternalFace(facei))
{ {
// Internal face. Get cell on other side. // Internal face. Get cell on other side.
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]]; label nbrCelli = reverseCellOrder[mesh.faceNeighbour()[facei]];
if (nbrCellI == newCellI) if (nbrCelli == newCelli)
{ {
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]]; nbrCelli = reverseCellOrder[mesh.faceOwner()[facei]];
} }
if (cellToRegion[oldCellI] != cellToRegion[cellOrder[nbrCellI]]) if (cellToRegion[oldCelli] != cellToRegion[cellOrder[nbrCelli]])
{ {
// Treat like external face. Do later. // Treat like external face. Do later.
nbr[i] = -1; nbr[i] = -1;
} }
else if (newCellI < nbrCellI) else if (newCelli < nbrCelli)
{ {
// CellI is master // Celli is master
nbr[i] = nbrCellI; nbr[i] = nbrCelli;
} }
else else
{ {
@ -326,7 +326,7 @@ labelList getRegionFaceOrder
{ {
if (nbr[i] != -1) if (nbr[i] != -1)
{ {
oldToNewFace[cFaces[nbr.indices()[i]]] = newFaceI++; oldToNewFace[cFaces[nbr.indices()[i]]] = newFacei++;
} }
} }
} }
@ -367,12 +367,12 @@ labelList getRegionFaceOrder
prevKey = key; prevKey = key;
} }
oldToNewFace[sortKey.indices()[i]] = newFaceI++; oldToNewFace[sortKey.indices()[i]] = newFacei++;
} }
} }
// Leave patch faces intact. // Leave patch faces intact.
for (label facei = newFaceI; facei < mesh.nFaces(); facei++) for (label facei = newFacei; facei < mesh.nFaces(); facei++)
{ {
oldToNewFace[facei] = facei; oldToNewFace[facei] = facei;
} }
@ -477,8 +477,8 @@ autoPtr<mapPolyMesh> reorderMesh
boolList newFlipMap(fZone.size()); boolList newFlipMap(fZone.size());
forAll(fZone, i) forAll(fZone, i)
{ {
label oldFaceI = fZone[i]; label oldFacei = fZone[i];
newAddressing[i] = reverseFaceOrder[oldFaceI]; newAddressing[i] = reverseFaceOrder[oldFacei];
if (flipFaceFlux.found(newAddressing[i])) if (flipFaceFlux.found(newAddressing[i]))
{ {
newFlipMap[i] = !fZone.flipMap()[i]; newFlipMap[i] = !fZone.flipMap()[i];
@ -999,8 +999,8 @@ int main(int argc, char *argv[])
label sortedI = mesh.nCells(); label sortedI = mesh.nCells();
forAllReverse(order, i) forAllReverse(order, i)
{ {
label origCellI = bndCells[order[i]]; label origCelli = bndCells[order[i]];
newReverseCellOrder[origCellI] = --sortedI; newReverseCellOrder[origCelli] = --sortedI;
} }
Info<< "Ordered all " << nBndCells << " cells with a coupled face" Info<< "Ordered all " << nBndCells << " cells with a coupled face"
@ -1009,12 +1009,12 @@ int main(int argc, char *argv[])
// Compact // Compact
sortedI = 0; sortedI = 0;
forAll(cellOrder, newCellI) forAll(cellOrder, newCelli)
{ {
label origCellI = cellOrder[newCellI]; label origCelli = cellOrder[newCelli];
if (newReverseCellOrder[origCellI] == -1) if (newReverseCellOrder[origCelli] == -1)
{ {
newReverseCellOrder[origCellI] = sortedI++; newReverseCellOrder[origCelli] = sortedI++;
} }
} }
@ -1106,14 +1106,14 @@ int main(int argc, char *argv[])
forAllConstIter(labelHashSet, fff, iter) forAllConstIter(labelHashSet, fff, iter)
{ {
label facei = iter.key(); label facei = iter.key();
label masterFaceI = faceProcAddressing[facei]; label masterFacei = faceProcAddressing[facei];
faceProcAddressing[facei] = -masterFaceI; faceProcAddressing[facei] = -masterFacei;
if (masterFaceI == 0) if (masterFacei == 0)
{ {
FatalErrorInFunction FatalErrorInFunction
<< " masterFaceI:" << masterFaceI << exit(FatalError); << " masterFacei:" << masterFacei << exit(FatalError);
} }
} }
} }

View File

@ -81,13 +81,13 @@ void writeVTK
faceList setFaces(currentSet.size()); faceList setFaces(currentSet.size());
labelList faceValues(currentSet.size()); labelList faceValues(currentSet.size());
label setFaceI = 0; label setFacei = 0;
forAllConstIter(topoSet, currentSet, iter) forAllConstIter(topoSet, currentSet, iter)
{ {
setFaces[setFaceI] = mesh.faces()[iter.key()]; setFaces[setFacei] = mesh.faces()[iter.key()];
faceValues[setFaceI] = iter.key(); faceValues[setFacei] = iter.key();
setFaceI++; setFacei++;
} }
primitiveFacePatch fp(setFaces, mesh.points()); primitiveFacePatch fp(setFaces, mesh.points());
@ -120,14 +120,14 @@ void writeVTK
if (mesh.isInternalFace(facei)) if (mesh.isInternalFace(facei))
{ {
label otherCellI = mesh.faceOwner()[facei]; label otherCelli = mesh.faceOwner()[facei];
if (otherCellI == celli) if (otherCelli == celli)
{ {
otherCellI = mesh.faceNeighbour()[facei]; otherCelli = mesh.faceNeighbour()[facei];
} }
if (!currentSet.found(otherCellI)) if (!currentSet.found(otherCelli))
{ {
cellFaces.insert(facei, celli); cellFaces.insert(facei, celli);
} }
@ -141,13 +141,13 @@ void writeVTK
faceList setFaces(cellFaces.size()); faceList setFaces(cellFaces.size());
labelList faceValues(cellFaces.size()); labelList faceValues(cellFaces.size());
label setFaceI = 0; label setFacei = 0;
forAllConstIter(Map<label>, cellFaces, iter) forAllConstIter(Map<label>, cellFaces, iter)
{ {
setFaces[setFaceI] = mesh.faces()[iter.key()]; setFaces[setFacei] = mesh.faces()[iter.key()];
faceValues[setFaceI] = iter(); // Cell ID faceValues[setFacei] = iter(); // Cell ID
setFaceI++; setFacei++;
} }
primitiveFacePatch fp(setFaces, mesh.points()); primitiveFacePatch fp(setFaces, mesh.points());

View File

@ -159,41 +159,41 @@ void Foam::regionSide::visitConnectedFaces
// we hit face on faceSet. // we hit face on faceSet.
// Find face reachable from edge // Find face reachable from edge
label otherFaceI = otherFace(mesh, celli, facei, edgeI); label otherFacei = otherFace(mesh, celli, facei, edgeI);
if (mesh.isInternalFace(otherFaceI)) if (mesh.isInternalFace(otherFacei))
{ {
label otherCellI = celli; label otherCelli = celli;
// Keep on crossing faces/cells until back on face on // Keep on crossing faces/cells until back on face on
// surface // surface
while (!region.found(otherFaceI)) while (!region.found(otherFacei))
{ {
visitedFace.insert(otherFaceI); visitedFace.insert(otherFacei);
if (debug) if (debug)
{ {
Info<< "visitConnectedFaces : celli:" << celli Info<< "visitConnectedFaces : celli:" << celli
<< " found insideEdgeFace:" << otherFaceI << " found insideEdgeFace:" << otherFacei
<< endl; << endl;
} }
// Cross otherFaceI into neighbouring cell // Cross otherFacei into neighbouring cell
otherCellI = otherCelli =
meshTools::otherCell meshTools::otherCell
( (
mesh, mesh,
otherCellI, otherCelli,
otherFaceI otherFacei
); );
otherFaceI = otherFacei =
otherFace otherFace
( (
mesh, mesh,
otherCellI, otherCelli,
otherFaceI, otherFacei,
edgeI edgeI
); );
} }
@ -203,8 +203,8 @@ void Foam::regionSide::visitConnectedFaces
mesh, mesh,
region, region,
fenceEdges, fenceEdges,
otherCellI, otherCelli,
otherFaceI, otherFacei,
visitedFace visitedFace
); );
} }
@ -223,25 +223,25 @@ 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
) )
{ {
// Mark as visited // Mark as visited
insidePointFaces_.insert(startFaceI); insidePointFaces_.insert(startFacei);
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))
{ {
@ -263,9 +263,9 @@ void Foam::regionSide::walkPointConnectedFaces
const labelList& eFaces = mesh.edgeFaces()[edgeI]; const labelList& eFaces = mesh.edgeFaces()[edgeI];
forAll(eFaces, eFaceI) forAll(eFaces, eFacei)
{ {
label facei = eFaces[eFaceI]; label facei = eFaces[eFacei];
walkPointConnectedFaces walkPointConnectedFaces
( (
@ -353,7 +353,7 @@ void Foam::regionSide::walkAllPointConnectedFaces
label edgeI = fEdges[fEdgeI]; label edgeI = fEdges[fEdgeI];
// Get the face 'perpendicular' to facei on region. // Get the face 'perpendicular' to facei on region.
label otherFaceI = otherFace(mesh, celli, facei, edgeI); label otherFacei = otherFace(mesh, celli, facei, edgeI);
// Edge // Edge
const edge& e = mesh.edges()[edgeI]; const edge& e = mesh.edges()[edgeI];
@ -365,14 +365,14 @@ void Foam::regionSide::walkAllPointConnectedFaces
visitedPoint.insert(e.start()); visitedPoint.insert(e.start());
//edgeI = otherEdge(mesh, otherFaceI, edgeI, e.start()); //edgeI = otherEdge(mesh, otherFacei, edgeI, e.start());
walkPointConnectedFaces walkPointConnectedFaces
( (
mesh, mesh,
regionEdges, regionEdges,
e.start(), e.start(),
otherFaceI, otherFacei,
edgeI, edgeI,
visitedEdges visitedEdges
); );
@ -384,14 +384,14 @@ void Foam::regionSide::walkAllPointConnectedFaces
visitedPoint.insert(e.end()); visitedPoint.insert(e.end());
//edgeI = otherEdge(mesh, otherFaceI, edgeI, e.end()); //edgeI = otherEdge(mesh, otherFacei, edgeI, e.end());
walkPointConnectedFaces walkPointConnectedFaces
( (
mesh, mesh,
regionEdges, regionEdges,
e.end(), e.end(),
otherFaceI, otherFacei,
edgeI, edgeI,
visitedEdges visitedEdges
); );
@ -409,8 +409,8 @@ Foam::regionSide::regionSide
const primitiveMesh& mesh, const primitiveMesh& mesh,
const labelHashSet& region, // faces of region const labelHashSet& region, // faces of region
const labelHashSet& fenceEdges, // outside edges const labelHashSet& fenceEdges, // outside edges
const label startCellI, const label startCelli,
const label startFaceI const label startFacei
) )
: :
sideOwner_(region.size()), sideOwner_(region.size()),
@ -427,8 +427,8 @@ Foam::regionSide::regionSide
mesh, mesh,
region, region,
fenceEdges, fenceEdges,
startCellI, startCelli,
startFaceI, startFacei,
visitedFace visitedFace
); );

View File

@ -102,7 +102,7 @@ class regionSide
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
); );
@ -128,7 +128,7 @@ public:
( (
const primitiveMesh& mesh, const primitiveMesh& mesh,
const label celli, const label celli,
const label excludeFaceI, const label excludeFacei,
const label edgeI const label edgeI
); );

View File

@ -200,15 +200,15 @@ int main(int argc, char *argv[])
} }
// Find sides reachable from 0th face of faceSet // Find sides reachable from 0th face of faceSet
label startFaceI = faces[0]; label startFacei = faces[0];
regionSide regionInfo regionSide regionInfo
( (
mesh, mesh,
facesSet, facesSet,
fenceEdges, fenceEdges,
mesh.faceOwner()[startFaceI], mesh.faceOwner()[startFacei],
startFaceI startFacei
); );
// Determine flip state for all faces in faceSet // Determine flip state for all faces in faceSet

View File

@ -972,19 +972,19 @@ void createAndWriteRegion
{ {
// face + turning index. (see decomposePar) // face + turning index. (see decomposePar)
// Is the face pointing in the same direction? // Is the face pointing in the same direction?
label oldFaceI = map().faceMap()[facei]; label oldFacei = map().faceMap()[facei];
if if
( (
map().cellMap()[newMesh().faceOwner()[facei]] map().cellMap()[newMesh().faceOwner()[facei]]
== mesh.faceOwner()[oldFaceI] == mesh.faceOwner()[oldFacei]
) )
{ {
faceProcAddressing[facei] = oldFaceI+1; faceProcAddressing[facei] = oldFacei+1;
} }
else else
{ {
faceProcAddressing[facei] = -(oldFaceI+1); faceProcAddressing[facei] = -(oldFacei+1);
} }
} }
Info<< "Writing map " << faceProcAddressing.name() Info<< "Writing map " << faceProcAddressing.name()
@ -1261,15 +1261,15 @@ void matchRegions
Pstream::gatherList(zoneNames); Pstream::gatherList(zoneNames);
Pstream::scatterList(zoneNames); Pstream::scatterList(zoneNames);
forAll(zoneNames, procI) forAll(zoneNames, proci)
{ {
if (zoneNames[procI] != zoneNames[0]) if (zoneNames[proci] != zoneNames[0])
{ {
FatalErrorInFunction FatalErrorInFunction
<< "cellZones not synchronised across processors." << endl << "cellZones not synchronised across processors." << endl
<< "Master has cellZones " << zoneNames[0] << endl << "Master has cellZones " << zoneNames[0] << endl
<< "Processor " << procI << "Processor " << proci
<< " has cellZones " << zoneNames[procI] << " has cellZones " << zoneNames[proci]
<< exit(FatalError); << exit(FatalError);
} }
} }
@ -1561,14 +1561,14 @@ int main(int argc, char *argv[])
<< " This requires all" << " This requires all"
<< " cells to be in one and only one cellZone." << nl << endl; << " cells to be in one and only one cellZone." << nl << endl;
label unzonedCellI = findIndex(zoneID, -1); label unzonedCelli = findIndex(zoneID, -1);
if (unzonedCellI != -1) if (unzonedCelli != -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "For the cellZonesOnly option all cells " << "For the cellZonesOnly option all cells "
<< "have to be in a cellZone." << endl << "have to be in a cellZone." << endl
<< "Cell " << unzonedCellI << "Cell " << unzonedCelli
<< " at" << mesh.cellCentres()[unzonedCellI] << " at" << mesh.cellCentres()[unzonedCelli]
<< " is not in a cellZone. There might be more unzoned cells." << " is not in a cellZone. There might be more unzoned cells."
<< exit(FatalError); << exit(FatalError);
} }
@ -1610,14 +1610,14 @@ int main(int argc, char *argv[])
labelList newNeiZoneID(mesh.nFaces()-mesh.nInternalFaces()); labelList newNeiZoneID(mesh.nFaces()-mesh.nInternalFaces());
getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID); getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID);
label unzonedCellI = findIndex(newZoneID, -1); label unzonedCelli = findIndex(newZoneID, -1);
if (unzonedCellI != -1) if (unzonedCelli != -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "For the cellZonesFileOnly option all cells " << "For the cellZonesFileOnly option all cells "
<< "have to be in a cellZone." << endl << "have to be in a cellZone." << endl
<< "Cell " << unzonedCellI << "Cell " << unzonedCelli
<< " at" << mesh.cellCentres()[unzonedCellI] << " at" << mesh.cellCentres()[unzonedCelli]
<< " is not in a cellZone. There might be more unzoned cells." << " is not in a cellZone. There might be more unzoned cells."
<< exit(FatalError); << exit(FatalError);
} }

View File

@ -102,18 +102,18 @@ Usage
const labelIOList& procAddressing const labelIOList& procAddressing
( (
const PtrList<fvMesh>& procMeshList, const PtrList<fvMesh>& procMeshList,
const label procI, const label proci,
const word& name, const word& name,
PtrList<labelIOList>& procAddressingList PtrList<labelIOList>& procAddressingList
) )
{ {
const fvMesh& procMesh = procMeshList[procI]; const fvMesh& procMesh = procMeshList[proci];
if (!procAddressingList.set(procI)) if (!procAddressingList.set(proci))
{ {
procAddressingList.set procAddressingList.set
( (
procI, proci,
new labelIOList new labelIOList
( (
IOobject IOobject
@ -129,7 +129,7 @@ const labelIOList& procAddressing
) )
); );
} }
return procAddressingList[procI]; return procAddressingList[proci];
} }
@ -314,11 +314,11 @@ int main(int argc, char *argv[])
// remove existing processor dirs // remove existing processor dirs
// reverse order to avoid gaps if someone interrupts the process // reverse order to avoid gaps if someone interrupts the process
for (label procI = nProcs-1; procI >= 0; --procI) for (label proci = nProcs-1; proci >= 0; --proci)
{ {
fileName procDir fileName procDir
( (
runTime.path()/(word("processor") + name(procI)) runTime.path()/(word("processor") + name(proci))
); );
rmDir(procDir); rmDir(procDir);
@ -794,27 +794,27 @@ int main(int argc, char *argv[])
Info<< endl; Info<< endl;
// split the fields over processors // split the fields over processors
for (label procI = 0; procI < mesh.nProcs(); procI++) for (label proci = 0; proci < mesh.nProcs(); proci++)
{ {
Info<< "Processor " << procI << ": field transfer" << endl; Info<< "Processor " << proci << ": field transfer" << endl;
// open the database // open the database
if (!processorDbList.set(procI)) if (!processorDbList.set(proci))
{ {
processorDbList.set processorDbList.set
( (
procI, proci,
new Time new Time
( (
Time::controlDictName, Time::controlDictName,
args.rootPath(), args.rootPath(),
args.caseName() args.caseName()
/fileName(word("processor") + name(procI)) /fileName(word("processor") + name(proci))
) )
); );
} }
Time& processorDb = processorDbList[procI]; Time& processorDb = processorDbList[proci];
processorDb.setTime(runTime); processorDb.setTime(runTime);
@ -830,11 +830,11 @@ int main(int argc, char *argv[])
} }
// read the mesh // read the mesh
if (!procMeshList.set(procI)) if (!procMeshList.set(proci))
{ {
procMeshList.set procMeshList.set
( (
procI, proci,
new fvMesh new fvMesh
( (
IOobject IOobject
@ -846,12 +846,12 @@ int main(int argc, char *argv[])
) )
); );
} }
const fvMesh& procMesh = procMeshList[procI]; const fvMesh& procMesh = procMeshList[proci];
const labelIOList& faceProcAddressing = procAddressing const labelIOList& faceProcAddressing = procAddressing
( (
procMeshList, procMeshList,
procI, proci,
"faceProcAddressing", "faceProcAddressing",
faceProcAddressingList faceProcAddressingList
); );
@ -859,7 +859,7 @@ int main(int argc, char *argv[])
const labelIOList& cellProcAddressing = procAddressing const labelIOList& cellProcAddressing = procAddressing
( (
procMeshList, procMeshList,
procI, proci,
"cellProcAddressing", "cellProcAddressing",
cellProcAddressingList cellProcAddressingList
); );
@ -867,7 +867,7 @@ int main(int argc, char *argv[])
const labelIOList& boundaryProcAddressing = procAddressing const labelIOList& boundaryProcAddressing = procAddressing
( (
procMeshList, procMeshList,
procI, proci,
"boundaryProcAddressing", "boundaryProcAddressing",
boundaryProcAddressingList boundaryProcAddressingList
); );
@ -875,11 +875,11 @@ int main(int argc, char *argv[])
// FV fields // FV fields
{ {
if (!fieldDecomposerList.set(procI)) if (!fieldDecomposerList.set(proci))
{ {
fieldDecomposerList.set fieldDecomposerList.set
( (
procI, proci,
new fvFieldDecomposer new fvFieldDecomposer
( (
mesh, mesh,
@ -891,7 +891,7 @@ int main(int argc, char *argv[])
); );
} }
const fvFieldDecomposer& fieldDecomposer = const fvFieldDecomposer& fieldDecomposer =
fieldDecomposerList[procI]; fieldDecomposerList[proci];
fieldDecomposer.decomposeFields(volScalarFields); fieldDecomposer.decomposeFields(volScalarFields);
fieldDecomposer.decomposeFields(volVectorFields); fieldDecomposer.decomposeFields(volVectorFields);
@ -911,17 +911,17 @@ int main(int argc, char *argv[])
if (times.size() == 1) if (times.size() == 1)
{ {
// Clear cached decomposer // Clear cached decomposer
fieldDecomposerList.set(procI, NULL); fieldDecomposerList.set(proci, NULL);
} }
} }
// Dimensioned fields // Dimensioned fields
{ {
if (!dimFieldDecomposerList.set(procI)) if (!dimFieldDecomposerList.set(proci))
{ {
dimFieldDecomposerList.set dimFieldDecomposerList.set
( (
procI, proci,
new dimFieldDecomposer new dimFieldDecomposer
( (
mesh, mesh,
@ -932,7 +932,7 @@ int main(int argc, char *argv[])
); );
} }
const dimFieldDecomposer& dimDecomposer = const dimFieldDecomposer& dimDecomposer =
dimFieldDecomposerList[procI]; dimFieldDecomposerList[proci];
dimDecomposer.decomposeFields(dimScalarFields); dimDecomposer.decomposeFields(dimScalarFields);
dimDecomposer.decomposeFields(dimVectorFields); dimDecomposer.decomposeFields(dimVectorFields);
@ -942,7 +942,7 @@ int main(int argc, char *argv[])
if (times.size() == 1) if (times.size() == 1)
{ {
dimFieldDecomposerList.set(procI, NULL); dimFieldDecomposerList.set(proci, NULL);
} }
} }
@ -960,18 +960,18 @@ int main(int argc, char *argv[])
const labelIOList& pointProcAddressing = procAddressing const labelIOList& pointProcAddressing = procAddressing
( (
procMeshList, procMeshList,
procI, proci,
"pointProcAddressing", "pointProcAddressing",
pointProcAddressingList pointProcAddressingList
); );
const pointMesh& procPMesh = pointMesh::New(procMesh); const pointMesh& procPMesh = pointMesh::New(procMesh);
if (!pointFieldDecomposerList.set(procI)) if (!pointFieldDecomposerList.set(proci))
{ {
pointFieldDecomposerList.set pointFieldDecomposerList.set
( (
procI, proci,
new pointFieldDecomposer new pointFieldDecomposer
( (
pMesh, pMesh,
@ -982,7 +982,7 @@ int main(int argc, char *argv[])
); );
} }
const pointFieldDecomposer& pointDecomposer = const pointFieldDecomposer& pointDecomposer =
pointFieldDecomposerList[procI]; pointFieldDecomposerList[proci];
pointDecomposer.decomposeFields(pointScalarFields); pointDecomposer.decomposeFields(pointScalarFields);
pointDecomposer.decomposeFields(pointVectorFields); pointDecomposer.decomposeFields(pointVectorFields);
@ -993,8 +993,8 @@ int main(int argc, char *argv[])
if (times.size() == 1) if (times.size() == 1)
{ {
pointProcAddressingList.set(procI, NULL); pointProcAddressingList.set(proci, NULL);
pointFieldDecomposerList.set(procI, NULL); pointFieldDecomposerList.set(proci, NULL);
} }
} }
@ -1118,11 +1118,11 @@ int main(int argc, char *argv[])
// times, otherwise it is just extra storage. // times, otherwise it is just extra storage.
if (times.size() == 1) if (times.size() == 1)
{ {
boundaryProcAddressingList.set(procI, NULL); boundaryProcAddressingList.set(proci, NULL);
cellProcAddressingList.set(procI, NULL); cellProcAddressingList.set(proci, NULL);
faceProcAddressingList.set(procI, NULL); faceProcAddressingList.set(proci, NULL);
procMeshList.set(procI, NULL); procMeshList.set(proci, NULL);
processorDbList.set(procI, NULL); processorDbList.set(proci, NULL);
} }
} }
} }

View File

@ -257,10 +257,10 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
// Write out the meshes // Write out the meshes
for (label procI = 0; procI < nProcs_; procI++) for (label proci = 0; proci < nProcs_; proci++)
{ {
// Create processor points // Create processor points
const labelList& curPointLabels = procPointAddressing_[procI]; const labelList& curPointLabels = procPointAddressing_[proci];
const pointField& meshPoints = points(); const pointField& meshPoints = points();
@ -276,7 +276,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
} }
// Create processor faces // Create processor faces
const labelList& curFaceLabels = procFaceAddressing_[procI]; const labelList& curFaceLabels = procFaceAddressing_[proci];
const faceList& meshFaces = faces(); const faceList& meshFaces = faces();
@ -318,7 +318,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
} }
// Create processor cells // Create processor cells
const labelList& curCellLabels = procCellAddressing_[procI]; const labelList& curCellLabels = procCellAddressing_[proci];
const cellList& meshCells = cells(); const cellList& meshCells = cells();
@ -332,9 +332,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
curCell.setSize(origCellLabels.size()); curCell.setSize(origCellLabels.size());
forAll(origCellLabels, cellFaceI) forAll(origCellLabels, cellFacei)
{ {
curCell[cellFaceI] = faceLookup[origCellLabels[cellFaceI]]; curCell[cellFacei] = faceLookup[origCellLabels[cellFacei]];
} }
} }
@ -342,7 +342,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
fileName processorCasePath fileName processorCasePath
( (
time().caseName()/fileName(word("processor") + Foam::name(procI)) time().caseName()/fileName(word("processor") + Foam::name(proci))
); );
// make the processor directory // make the processor directory
@ -418,33 +418,33 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
// Create processor boundary patches // Create processor boundary patches
const labelList& curPatchSizes = procPatchSize_[procI]; const labelList& curPatchSizes = procPatchSize_[proci];
const labelList& curPatchStarts = procPatchStartIndex_[procI]; const labelList& curPatchStarts = procPatchStartIndex_[proci];
const labelList& curNeighbourProcessors = const labelList& curNeighbourProcessors =
procNeighbourProcessors_[procI]; procNeighbourProcessors_[proci];
const labelList& curProcessorPatchSizes = const labelList& curProcessorPatchSizes =
procProcessorPatchSize_[procI]; procProcessorPatchSize_[proci];
const labelList& curProcessorPatchStarts = const labelList& curProcessorPatchStarts =
procProcessorPatchStartIndex_[procI]; procProcessorPatchStartIndex_[proci];
const labelListList& curSubPatchIDs = const labelListList& curSubPatchIDs =
procProcessorPatchSubPatchIDs_[procI]; procProcessorPatchSubPatchIDs_[proci];
const labelListList& curSubStarts = const labelListList& curSubStarts =
procProcessorPatchSubPatchStarts_[procI]; procProcessorPatchSubPatchStarts_[proci];
const polyPatchList& meshPatches = boundaryMesh(); const polyPatchList& meshPatches = boundaryMesh();
// Count the number of inter-proc patches // Count the number of inter-proc patches
label nInterProcPatches = 0; label nInterProcPatches = 0;
forAll(curSubPatchIDs, procPatchI) forAll(curSubPatchIDs, procPatchi)
{ {
nInterProcPatches += curSubPatchIDs[procPatchI].size(); nInterProcPatches += curSubPatchIDs[procPatchi].size();
} }
List<polyPatch*> procPatches List<polyPatch*> procPatches
@ -484,12 +484,12 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
nPatches++; nPatches++;
} }
forAll(curProcessorPatchSizes, procPatchI) forAll(curProcessorPatchSizes, procPatchi)
{ {
const labelList& subPatchID = curSubPatchIDs[procPatchI]; const labelList& subPatchID = curSubPatchIDs[procPatchi];
const labelList& subStarts = curSubStarts[procPatchI]; const labelList& subStarts = curSubStarts[procPatchi];
label curStart = curProcessorPatchStarts[procPatchI]; label curStart = curProcessorPatchStarts[procPatchi];
forAll(subPatchID, i) forAll(subPatchID, i)
{ {
@ -497,7 +497,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
( (
i < subPatchID.size()-1 i < subPatchID.size()-1
? subStarts[i+1] - subStarts[i] ? subStarts[i+1] - subStarts[i]
: curProcessorPatchSizes[procPatchI] - subStarts[i] : curProcessorPatchSizes[procPatchi] - subStarts[i]
); );
if (subPatchID[i] == -1) if (subPatchID[i] == -1)
@ -510,8 +510,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
curStart, curStart,
nPatches, nPatches,
procMesh.boundaryMesh(), procMesh.boundaryMesh(),
procI, proci,
curNeighbourProcessors[procPatchI] curNeighbourProcessors[procPatchi]
); );
} }
else else
@ -529,8 +529,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
curStart, curStart,
nPatches, nPatches,
procMesh.boundaryMesh(), procMesh.boundaryMesh(),
procI, proci,
curNeighbourProcessors[procPatchI], curNeighbourProcessors[procPatchi],
pcPatch.name(), pcPatch.name(),
pcPatch.transform() pcPatch.transform()
); );
@ -724,9 +724,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
forAll(curCellLabels, celli) forAll(curCellLabels, celli)
{ {
label curCellI = curCellLabels[celli]; label curCelli = curCellLabels[celli];
label zoneI = cellToZone[curCellI]; label zoneI = cellToZone[curCelli];
if (zoneI >= 0) if (zoneI >= 0)
{ {
@ -738,7 +738,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
// Multiple zones. Lookup. // Multiple zones. Lookup.
forAll(cz, zoneI) forAll(cz, zoneI)
{ {
label index = cz[zoneI].whichCell(curCellI); label index = cz[zoneI].whichCell(curCelli);
if (index != -1) if (index != -1)
{ {
@ -859,7 +859,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
UIndirectList<label> UIndirectList<label>
( (
cellLevelPtr(), cellLevelPtr(),
procCellAddressing_[procI] procCellAddressing_[proci]
)() )()
).write(); ).write();
} }
@ -879,7 +879,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
UIndirectList<label> UIndirectList<label>
( (
pointLevelPtr(), pointLevelPtr(),
procPointAddressing_[procI] procPointAddressing_[proci]
)() )()
).write(); ).write();
} }
@ -905,7 +905,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
// Statistics // Statistics
Info<< endl Info<< endl
<< "Processor " << procI << nl << "Processor " << proci << nl
<< " Number of cells = " << procMesh.nCells() << " Number of cells = " << procMesh.nCells()
<< endl; << endl;
@ -958,7 +958,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
procPointAddressing_[procI] procPointAddressing_[proci]
); );
pointProcAddressing.write(); pointProcAddressing.write();
@ -973,7 +973,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
procFaceAddressing_[procI] procFaceAddressing_[proci]
); );
faceProcAddressing.write(); faceProcAddressing.write();
@ -988,7 +988,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
IOobject::NO_READ, IOobject::NO_READ,
IOobject::NO_WRITE IOobject::NO_WRITE
), ),
procCellAddressing_[procI] procCellAddressing_[proci]
); );
cellProcAddressing.write(); cellProcAddressing.write();

View File

@ -64,28 +64,28 @@ void Foam::domainDecomposition::addInterProcFace
if (patchiter != nbrToInterPatch[ownerProc].end()) if (patchiter != nbrToInterPatch[ownerProc].end())
{ {
// Existing interproc patch. Add to both sides. // Existing interproc patch. Add to both sides.
label toNbrProcPatchI = patchiter(); label toNbrProcPatchi = patchiter();
interPatchFaces[ownerProc][toNbrProcPatchI].append(ownerIndex); interPatchFaces[ownerProc][toNbrProcPatchi].append(ownerIndex);
if (isInternalFace(facei)) if (isInternalFace(facei))
{ {
label toOwnerProcPatchI = nbrToInterPatch[nbrProc][ownerProc]; label toOwnerProcPatchi = nbrToInterPatch[nbrProc][ownerProc];
interPatchFaces[nbrProc][toOwnerProcPatchI].append(nbrIndex); interPatchFaces[nbrProc][toOwnerProcPatchi].append(nbrIndex);
} }
} }
else else
{ {
// Create new interproc patches. // Create new interproc patches.
label toNbrProcPatchI = nbrToInterPatch[ownerProc].size(); label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchI); nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
DynamicList<label> oneFace; DynamicList<label> oneFace;
oneFace.append(ownerIndex); oneFace.append(ownerIndex);
interPatchFaces[ownerProc].append(oneFace); interPatchFaces[ownerProc].append(oneFace);
if (isInternalFace(facei)) if (isInternalFace(facei))
{ {
label toOwnerProcPatchI = nbrToInterPatch[nbrProc].size(); label toOwnerProcPatchi = nbrToInterPatch[nbrProc].size();
nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchI); nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchi);
oneFace.clear(); oneFace.clear();
oneFace.append(nbrIndex); oneFace.append(nbrIndex);
interPatchFaces[nbrProc].append(oneFace); interPatchFaces[nbrProc].append(oneFace);
@ -139,20 +139,20 @@ void Foam::domainDecomposition::decomposeMesh()
// for all processors, set the size of start index and patch size // for all processors, set the size of start index and patch size
// lists to the number of patches in the mesh // lists to the number of patches in the mesh
forAll(procPatchSize_, procI) forAll(procPatchSize_, proci)
{ {
procPatchSize_[procI].setSize(patches.size()); procPatchSize_[proci].setSize(patches.size());
procPatchStartIndex_[procI].setSize(patches.size()); procPatchStartIndex_[proci].setSize(patches.size());
} }
forAll(patches, patchi) forAll(patches, patchi)
{ {
// Reset size and start index for all processors // Reset size and start index for all processors
forAll(procPatchSize_, procI) forAll(procPatchSize_, proci)
{ {
procPatchSize_[procI][patchi] = 0; procPatchSize_[proci][patchi] = 0;
procPatchStartIndex_[procI][patchi] = procPatchStartIndex_[proci][patchi] =
procFaceAddressing_[procI].size(); procFaceAddressing_[proci].size();
} }
const label patchStart = patches[patchi].start(); const label patchStart = patches[patchi].start();
@ -239,12 +239,12 @@ void Foam::domainDecomposition::decomposeMesh()
// originating from internal faces this is always -1. // originating from internal faces this is always -1.
List<labelListList> subPatchIDs(nProcs_); List<labelListList> subPatchIDs(nProcs_);
List<labelListList> subPatchStarts(nProcs_); List<labelListList> subPatchStarts(nProcs_);
forAll(interPatchFaces, procI) forAll(interPatchFaces, proci)
{ {
label nInterfaces = interPatchFaces[procI].size(); label nInterfaces = interPatchFaces[proci].size();
subPatchIDs[procI].setSize(nInterfaces, labelList(1, label(-1))); subPatchIDs[proci].setSize(nInterfaces, labelList(1, label(-1)));
subPatchStarts[procI].setSize(nInterfaces, labelList(1, label(0))); subPatchStarts[proci].setSize(nInterfaces, labelList(1, label(0)));
} }
@ -318,63 +318,63 @@ void Foam::domainDecomposition::decomposeMesh()
// Sort inter-proc patch by neighbour // Sort inter-proc patch by neighbour
labelList order; labelList order;
forAll(procNbrToInterPatch, procI) forAll(procNbrToInterPatch, proci)
{ {
label nInterfaces = procNbrToInterPatch[procI].size(); label nInterfaces = procNbrToInterPatch[proci].size();
procNeighbourProcessors_[procI].setSize(nInterfaces); procNeighbourProcessors_[proci].setSize(nInterfaces);
procProcessorPatchSize_[procI].setSize(nInterfaces); procProcessorPatchSize_[proci].setSize(nInterfaces);
procProcessorPatchStartIndex_[procI].setSize(nInterfaces); procProcessorPatchStartIndex_[proci].setSize(nInterfaces);
procProcessorPatchSubPatchIDs_[procI].setSize(nInterfaces); procProcessorPatchSubPatchIDs_[proci].setSize(nInterfaces);
procProcessorPatchSubPatchStarts_[procI].setSize(nInterfaces); procProcessorPatchSubPatchStarts_[proci].setSize(nInterfaces);
//Info<< "Processor " << procI << endl; //Info<< "Processor " << proci << endl;
// Get sorted neighbour processors // Get sorted neighbour processors
const Map<label>& curNbrToInterPatch = procNbrToInterPatch[procI]; const Map<label>& curNbrToInterPatch = procNbrToInterPatch[proci];
labelList nbrs = curNbrToInterPatch.toc(); labelList nbrs = curNbrToInterPatch.toc();
sortedOrder(nbrs, order); sortedOrder(nbrs, order);
DynamicList<DynamicList<label>>& curInterPatchFaces = DynamicList<DynamicList<label>>& curInterPatchFaces =
interPatchFaces[procI]; interPatchFaces[proci];
forAll(nbrs, i) forAll(nbrs, i)
{ {
const label nbrProc = nbrs[i]; const label nbrProc = nbrs[i];
const label interPatch = curNbrToInterPatch[nbrProc]; const label interPatch = curNbrToInterPatch[nbrProc];
procNeighbourProcessors_[procI][i] = nbrProc; procNeighbourProcessors_[proci][i] = nbrProc;
procProcessorPatchSize_[procI][i] = procProcessorPatchSize_[proci][i] =
curInterPatchFaces[interPatch].size(); curInterPatchFaces[interPatch].size();
procProcessorPatchStartIndex_[procI][i] = procProcessorPatchStartIndex_[proci][i] =
procFaceAddressing_[procI].size(); procFaceAddressing_[proci].size();
// Add size as last element to substarts and transfer // Add size as last element to substarts and transfer
append append
( (
subPatchStarts[procI][interPatch], subPatchStarts[proci][interPatch],
curInterPatchFaces[interPatch].size() curInterPatchFaces[interPatch].size()
); );
procProcessorPatchSubPatchIDs_[procI][i].transfer procProcessorPatchSubPatchIDs_[proci][i].transfer
( (
subPatchIDs[procI][interPatch] subPatchIDs[proci][interPatch]
); );
procProcessorPatchSubPatchStarts_[procI][i].transfer procProcessorPatchSubPatchStarts_[proci][i].transfer
( (
subPatchStarts[procI][interPatch] subPatchStarts[proci][interPatch]
); );
//Info<< " nbr:" << nbrProc << endl; //Info<< " nbr:" << nbrProc << endl;
//Info<< " interpatch:" << interPatch << endl; //Info<< " interpatch:" << interPatch << endl;
//Info<< " size:" << procProcessorPatchSize_[procI][i] << endl; //Info<< " size:" << procProcessorPatchSize_[proci][i] << endl;
//Info<< " start:" << procProcessorPatchStartIndex_[procI][i] //Info<< " start:" << procProcessorPatchStartIndex_[proci][i]
// << endl; // << endl;
//Info<< " subPatches:" //Info<< " subPatches:"
// << procProcessorPatchSubPatchIDs_[procI][i] // << procProcessorPatchSubPatchIDs_[proci][i]
// << endl; // << endl;
//Info<< " subStarts:" //Info<< " subStarts:"
// << procProcessorPatchSubPatchStarts_[procI][i] << endl; // << procProcessorPatchSubPatchStarts_[proci][i] << endl;
// And add all the face labels for interPatch // And add all the face labels for interPatch
DynamicList<label>& interPatchFaces = DynamicList<label>& interPatchFaces =
@ -382,55 +382,55 @@ void Foam::domainDecomposition::decomposeMesh()
forAll(interPatchFaces, j) forAll(interPatchFaces, j)
{ {
procFaceAddressing_[procI].append(interPatchFaces[j]); procFaceAddressing_[proci].append(interPatchFaces[j]);
} }
interPatchFaces.clearStorage(); interPatchFaces.clearStorage();
} }
curInterPatchFaces.clearStorage(); curInterPatchFaces.clearStorage();
procFaceAddressing_[procI].shrink(); procFaceAddressing_[proci].shrink();
} }
////XXXXXXX ////XXXXXXX
//// Print a bit //// Print a bit
// forAll(procPatchStartIndex_, procI) // forAll(procPatchStartIndex_, proci)
// { // {
// Info<< "Processor:" << procI << endl; // Info<< "Processor:" << proci << endl;
// //
// Info<< " total faces:" << procFaceAddressing_[procI].size() // Info<< " total faces:" << procFaceAddressing_[proci].size()
// << endl; // << endl;
// //
// const labelList& curProcPatchStartIndex = procPatchStartIndex_[procI]; // const labelList& curProcPatchStartIndex = procPatchStartIndex_[proci];
// //
// forAll(curProcPatchStartIndex, patchi) // forAll(curProcPatchStartIndex, patchi)
// { // {
// Info<< " patch:" << patchi // Info<< " patch:" << patchi
// << "\tstart:" << curProcPatchStartIndex[patchi] // << "\tstart:" << curProcPatchStartIndex[patchi]
// << "\tsize:" << procPatchSize_[procI][patchi] // << "\tsize:" << procPatchSize_[proci][patchi]
// << endl; // << endl;
// } // }
// } // }
// Info<< endl; // Info<< endl;
// //
// forAll(procNeighbourProcessors_, procI) // forAll(procNeighbourProcessors_, proci)
// { // {
// Info<< "Processor " << procI << endl; // Info<< "Processor " << proci << endl;
// //
// forAll(procNeighbourProcessors_[procI], i) // forAll(procNeighbourProcessors_[proci], i)
// { // {
// Info<< " nbr:" << procNeighbourProcessors_[procI][i] << endl; // Info<< " nbr:" << procNeighbourProcessors_[proci][i] << endl;
// Info<< " size:" << procProcessorPatchSize_[procI][i] << endl; // Info<< " size:" << procProcessorPatchSize_[proci][i] << endl;
// Info<< " start:" << procProcessorPatchStartIndex_[procI][i] // Info<< " start:" << procProcessorPatchStartIndex_[proci][i]
// << endl; // << endl;
// } // }
// } // }
// Info<< endl; // Info<< endl;
// //
// forAll(procFaceAddressing_, procI) // forAll(procFaceAddressing_, proci)
// { // {
// Info<< "Processor:" << procI << endl; // Info<< "Processor:" << proci << endl;
// //
// Info<< " faces:" << procFaceAddressing_[procI] << endl; // Info<< " faces:" << procFaceAddressing_[proci] << endl;
// } // }
@ -441,12 +441,12 @@ void Foam::domainDecomposition::decomposeMesh()
// used for the processor. Collect the list of used points for the // used for the processor. Collect the list of used points for the
// processor. // processor.
forAll(procPointAddressing_, procI) forAll(procPointAddressing_, proci)
{ {
boolList pointLabels(nPoints(), false); boolList pointLabels(nPoints(), false);
// Get reference to list of used faces // Get reference to list of used faces
const labelList& procFaceLabels = procFaceAddressing_[procI]; const labelList& procFaceLabels = procFaceAddressing_[proci];
forAll(procFaceLabels, facei) forAll(procFaceLabels, facei)
{ {
@ -461,7 +461,7 @@ void Foam::domainDecomposition::decomposeMesh()
} }
// Collect the used points // Collect the used points
labelList& procPointLabels = procPointAddressing_[procI]; labelList& procPointLabels = procPointAddressing_[proci];
procPointLabels.setSize(pointLabels.size()); procPointLabels.setSize(pointLabels.size());

View File

@ -62,15 +62,15 @@ void Foam::domainDecomposition::processInterCyclics
// Store old sizes. Used to detect which inter-proc patches // Store old sizes. Used to detect which inter-proc patches
// have been added to. // have been added to.
labelListList oldInterfaceSizes(nProcs_); labelListList oldInterfaceSizes(nProcs_);
forAll(oldInterfaceSizes, procI) forAll(oldInterfaceSizes, proci)
{ {
labelList& curOldSizes = oldInterfaceSizes[procI]; labelList& curOldSizes = oldInterfaceSizes[proci];
curOldSizes.setSize(interPatchFaces[procI].size()); curOldSizes.setSize(interPatchFaces[proci].size());
forAll(curOldSizes, interI) forAll(curOldSizes, interI)
{ {
curOldSizes[interI] = curOldSizes[interI] =
interPatchFaces[procI][interI].size(); interPatchFaces[proci][interI].size();
} }
} }
@ -94,28 +94,28 @@ void Foam::domainDecomposition::processInterCyclics
} }
// 1. Check if any faces added to existing interfaces // 1. Check if any faces added to existing interfaces
forAll(oldInterfaceSizes, procI) forAll(oldInterfaceSizes, proci)
{ {
const labelList& curOldSizes = oldInterfaceSizes[procI]; const labelList& curOldSizes = oldInterfaceSizes[proci];
forAll(curOldSizes, interI) forAll(curOldSizes, interI)
{ {
label oldSz = curOldSizes[interI]; label oldSz = curOldSizes[interI];
if (interPatchFaces[procI][interI].size() > oldSz) if (interPatchFaces[proci][interI].size() > oldSz)
{ {
// Added faces to this interface. Add an entry // Added faces to this interface. Add an entry
append(subPatchIDs[procI][interI], patchi); append(subPatchIDs[proci][interI], patchi);
append(subPatchStarts[procI][interI], oldSz); append(subPatchStarts[proci][interI], oldSz);
} }
} }
} }
// 2. Any new interfaces // 2. Any new interfaces
forAll(subPatchIDs, procI) forAll(subPatchIDs, proci)
{ {
label nIntfcs = interPatchFaces[procI].size(); label nIntfcs = interPatchFaces[proci].size();
subPatchIDs[procI].setSize(nIntfcs, labelList(1, patchi)); subPatchIDs[proci].setSize(nIntfcs, labelList(1, patchi));
subPatchStarts[procI].setSize(nIntfcs, labelList(1, label(0))); subPatchStarts[proci].setSize(nIntfcs, labelList(1, label(0)));
} }
} }
} }

View File

@ -8,9 +8,9 @@
PtrList<labelIOList>& faceProcAddressing = procMeshes.faceProcAddressing(); PtrList<labelIOList>& faceProcAddressing = procMeshes.faceProcAddressing();
forAll(faceProcAddressing, procI) forAll(faceProcAddressing, proci)
{ {
const labelList& curFaceAddr = faceProcAddressing[procI]; const labelList& curFaceAddr = faceProcAddressing[proci];
forAll(curFaceAddr, facei) forAll(curFaceAddr, facei)
{ {
@ -33,16 +33,16 @@
<< "the current version fo decomposePar" << "the current version fo decomposePar"
<< endl; << endl;
forAll(faceProcAddressing, procI) forAll(faceProcAddressing, proci)
{ {
labelList& curFaceAddr = faceProcAddressing[procI]; labelList& curFaceAddr = faceProcAddressing[proci];
forAll(curFaceAddr, facei) forAll(curFaceAddr, facei)
{ {
curFaceAddr[facei] += sign(curFaceAddr[facei]); curFaceAddr[facei] += sign(curFaceAddr[facei]);
} }
faceProcAddressing[procI].write(); faceProcAddressing[proci].write();
} }
} }
} }

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
@ -176,16 +176,16 @@ int main(int argc, char *argv[])
// Create the processor databases // Create the processor databases
PtrList<Time> databases(nProcs); PtrList<Time> databases(nProcs);
forAll(databases, procI) forAll(databases, proci)
{ {
databases.set databases.set
( (
procI, proci,
new Time new Time
( (
Time::controlDictName, Time::controlDictName,
args.rootPath(), args.rootPath(),
args.caseName()/fileName(word("processor") + name(procI)) args.caseName()/fileName(word("processor") + name(proci))
) )
); );
} }
@ -227,9 +227,9 @@ int main(int argc, char *argv[])
// Set all times on processor meshes equal to reconstructed mesh // Set all times on processor meshes equal to reconstructed mesh
forAll(databases, procI) forAll(databases, proci)
{ {
databases[procI].setTime(runTime); databases[proci].setTime(runTime);
} }
@ -329,9 +329,9 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << endl << endl; Info<< "Time = " << runTime.timeName() << endl << endl;
// Set time for all databases // Set time for all databases
forAll(databases, procI) forAll(databases, proci)
{ {
databases[procI].setTime(timeDirs[timeI], timeI); databases[proci].setTime(timeDirs[timeI], timeI);
} }
// Check if any new meshes need to be read. // Check if any new meshes need to be read.
@ -470,12 +470,12 @@ int main(int argc, char *argv[])
const pointMesh& pMesh = pointMesh::New(mesh); const pointMesh& pMesh = pointMesh::New(mesh);
PtrList<pointMesh> pMeshes(procMeshes.meshes().size()); PtrList<pointMesh> pMeshes(procMeshes.meshes().size());
forAll(pMeshes, procI) forAll(pMeshes, proci)
{ {
pMeshes.set pMeshes.set
( (
procI, proci,
new pointMesh(procMeshes.meshes()[procI]) new pointMesh(procMeshes.meshes()[proci])
); );
} }
@ -531,13 +531,13 @@ int main(int argc, char *argv[])
{ {
HashTable<IOobjectList> cloudObjects; HashTable<IOobjectList> cloudObjects;
forAll(databases, procI) forAll(databases, proci)
{ {
fileNameList cloudDirs fileNameList cloudDirs
( (
readDir readDir
( (
databases[procI].timePath() databases[proci].timePath()
/ regionDir / regionDir
/ cloud::prefix, / cloud::prefix,
fileName::DIRECTORY fileName::DIRECTORY
@ -556,8 +556,8 @@ int main(int argc, char *argv[])
// Do local scan for valid cloud objects // Do local scan for valid cloud objects
IOobjectList sprayObjs IOobjectList sprayObjs
( (
procMeshes.meshes()[procI], procMeshes.meshes()[proci],
databases[procI].timeName(), databases[proci].timeName(),
cloud::prefix/cloudDirs[i] cloud::prefix/cloudDirs[i]
); );
@ -709,9 +709,9 @@ int main(int argc, char *argv[])
HashTable<label> fSetNames; HashTable<label> fSetNames;
HashTable<label> pSetNames; HashTable<label> pSetNames;
forAll(procMeshes.meshes(), procI) forAll(procMeshes.meshes(), proci)
{ {
const fvMesh& procMesh = procMeshes.meshes()[procI]; const fvMesh& procMesh = procMeshes.meshes()[proci];
// Note: look at sets in current time only or between // Note: look at sets in current time only or between
// mesh and current time?. For now current time. This will // mesh and current time?. For now current time. This will
@ -762,9 +762,9 @@ int main(int argc, char *argv[])
} }
// Load sets // Load sets
forAll(procMeshes.meshes(), procI) forAll(procMeshes.meshes(), proci)
{ {
const fvMesh& procMesh = procMeshes.meshes()[procI]; const fvMesh& procMesh = procMeshes.meshes()[proci];
IOobjectList objects IOobjectList objects
( (
@ -775,7 +775,7 @@ int main(int argc, char *argv[])
// cellSets // cellSets
const labelList& cellMap = const labelList& cellMap =
procMeshes.cellProcAddressing()[procI]; procMeshes.cellProcAddressing()[proci];
IOobjectList cSets(objects.lookupClass(cellSet::typeName)); IOobjectList cSets(objects.lookupClass(cellSet::typeName));
forAllConstIter(IOobjectList, cSets, iter) forAllConstIter(IOobjectList, cSets, iter)
@ -802,7 +802,7 @@ int main(int argc, char *argv[])
// faceSets // faceSets
const labelList& faceMap = const labelList& faceMap =
procMeshes.faceProcAddressing()[procI]; procMeshes.faceProcAddressing()[proci];
IOobjectList fSets(objects.lookupClass(faceSet::typeName)); IOobjectList fSets(objects.lookupClass(faceSet::typeName));
forAllConstIter(IOobjectList, fSets, iter) forAllConstIter(IOobjectList, fSets, iter)
@ -828,7 +828,7 @@ int main(int argc, char *argv[])
} }
// pointSets // pointSets
const labelList& pointMap = const labelList& pointMap =
procMeshes.pointProcAddressing()[procI]; procMeshes.pointProcAddressing()[proci];
IOobjectList pSets(objects.lookupClass(pointSet::typeName)); IOobjectList pSets(objects.lookupClass(pointSet::typeName));
forAllConstIter(IOobjectList, pSets, iter) forAllConstIter(IOobjectList, pSets, iter)

View File

@ -78,12 +78,12 @@ static void renumber
// Determine which faces are coupled. Uses geometric merge distance. // Determine which faces are coupled. Uses geometric merge distance.
// Looks either at all boundaryFaces (fullMatch) or only at the // Looks either at all boundaryFaces (fullMatch) or only at the
// procBoundaries for procI. Assumes that masterMesh contains already merged // procBoundaries for proci. Assumes that masterMesh contains already merged
// all the processors < procI. // all the processors < proci.
autoPtr<faceCoupleInfo> determineCoupledFaces autoPtr<faceCoupleInfo> determineCoupledFaces
( (
const bool fullMatch, const bool fullMatch,
const label procI, const label proci,
const polyMesh& masterMesh, const polyMesh& masterMesh,
const polyMesh& meshToAdd, const polyMesh& meshToAdd,
const scalar mergeDist const scalar mergeDist
@ -105,11 +105,11 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
else else
{ {
// Pick up all patches on masterMesh ending in "toDDD" where DDD is // Pick up all patches on masterMesh ending in "toDDD" where DDD is
// the processor number procI. // the processor number proci.
const polyBoundaryMesh& masterPatches = masterMesh.boundaryMesh(); const polyBoundaryMesh& masterPatches = masterMesh.boundaryMesh();
const string toProcString("to" + name(procI)); const string toProcString("to" + name(proci));
DynamicList<label> masterFaces DynamicList<label> masterFaces
( (
@ -130,10 +130,10 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
) )
) )
{ {
label meshFaceI = pp.start(); label meshFacei = pp.start();
forAll(pp, i) forAll(pp, i)
{ {
masterFaces.append(meshFaceI++); masterFaces.append(meshFacei++);
} }
} }
} }
@ -141,7 +141,7 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
// Pick up all patches on meshToAdd ending in "procBoundaryDDDtoYYY" // Pick up all patches on meshToAdd ending in "procBoundaryDDDtoYYY"
// where DDD is the processor number procI and YYY is < procI. // where DDD is the processor number proci and YYY is < proci.
const polyBoundaryMesh& addPatches = meshToAdd.boundaryMesh(); const polyBoundaryMesh& addPatches = meshToAdd.boundaryMesh();
@ -159,11 +159,11 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
{ {
bool isConnected = false; bool isConnected = false;
for (label mergedProcI = 0; mergedProcI < procI; mergedProcI++) for (label mergedProci = 0; mergedProci < proci; mergedProci++)
{ {
const word fromProcString const word fromProcString
( (
processorPolyPatch::newName(procI, mergedProcI) processorPolyPatch::newName(proci, mergedProci)
); );
if (pp.name() == fromProcString) if (pp.name() == fromProcString)
@ -175,10 +175,10 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
if (isConnected) if (isConnected)
{ {
label meshFaceI = pp.start(); label meshFacei = pp.start();
forAll(pp, i) forAll(pp, i)
{ {
addFaces.append(meshFaceI++); addFaces.append(meshFacei++);
} }
} }
} }
@ -244,9 +244,9 @@ autoPtr<mapPolyMesh> mergeSharedPoints
// for changed point numbering. // for changed point numbering.
// Adapt constructMaps for merged points. // Adapt constructMaps for merged points.
forAll(pointProcAddressing, procI) forAll(pointProcAddressing, proci)
{ {
labelList& constructMap = pointProcAddressing[procI]; labelList& constructMap = pointProcAddressing[proci];
forAll(constructMap, i) forAll(constructMap, i)
{ {
@ -285,21 +285,21 @@ boundBox procBounds
{ {
boundBox bb = boundBox::invertedBox; boundBox bb = boundBox::invertedBox;
forAll(databases, procI) forAll(databases, proci)
{ {
fileName pointsInstance fileName pointsInstance
( (
databases[procI].findInstance databases[proci].findInstance
( (
regionDir/polyMesh::meshSubDir, regionDir/polyMesh::meshSubDir,
"points" "points"
) )
); );
if (pointsInstance != databases[procI].timeName()) if (pointsInstance != databases[proci].timeName())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Your time was specified as " << databases[procI].timeName() << "Your time was specified as " << databases[proci].timeName()
<< " but there is no polyMesh/points in that time." << endl << " but there is no polyMesh/points in that time." << endl
<< "(there is a points file in " << pointsInstance << "(there is a points file in " << pointsInstance
<< ")" << endl << ")" << endl
@ -310,8 +310,8 @@ boundBox procBounds
} }
Info<< "Reading points from " Info<< "Reading points from "
<< databases[procI].caseName() << databases[proci].caseName()
<< " for time = " << databases[procI].timeName() << " for time = " << databases[proci].timeName()
<< nl << endl; << nl << endl;
pointIOField points pointIOField points
@ -319,13 +319,13 @@ boundBox procBounds
IOobject IOobject
( (
"points", "points",
databases[procI].findInstance databases[proci].findInstance
( (
regionDir/polyMesh::meshSubDir, regionDir/polyMesh::meshSubDir,
"points" "points"
), ),
regionDir/polyMesh::meshSubDir, regionDir/polyMesh::meshSubDir,
databases[procI], databases[proci],
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
@ -366,10 +366,10 @@ void writeCellDistance
masterMesh.nCells() masterMesh.nCells()
); );
forAll(cellProcAddressing, procI) forAll(cellProcAddressing, proci)
{ {
const labelList& pCells = cellProcAddressing[procI]; const labelList& pCells = cellProcAddressing[proci];
UIndirectList<label>(cellDecomposition, pCells) = procI; UIndirectList<label>(cellDecomposition, pCells) = proci;
} }
cellDecomposition.write(); cellDecomposition.write();
@ -542,20 +542,20 @@ int main(int argc, char *argv[])
// Read all time databases // Read all time databases
PtrList<Time> databases(nProcs); PtrList<Time> databases(nProcs);
forAll(databases, procI) forAll(databases, proci)
{ {
Info<< "Reading database " Info<< "Reading database "
<< args.caseName()/fileName(word("processor") + name(procI)) << args.caseName()/fileName(word("processor") + name(proci))
<< endl; << endl;
databases.set databases.set
( (
procI, proci,
new Time new Time
( (
Time::controlDictName, Time::controlDictName,
args.rootPath(), args.rootPath(),
args.caseName()/fileName(word("processor") + name(procI)) args.caseName()/fileName(word("processor") + name(proci))
) )
); );
} }
@ -577,9 +577,9 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
// Set time for all databases // Set time for all databases
forAll(databases, procI) forAll(databases, proci)
{ {
databases[procI].setTime(timeDirs[timeI], timeI); databases[proci].setTime(timeDirs[timeI], timeI);
} }
const fileName meshPath = const fileName meshPath =
@ -636,11 +636,11 @@ int main(int argc, char *argv[])
xferCopy(cellList()) xferCopy(cellList())
); );
for (label procI = 0; procI < nProcs; procI++) for (label proci = 0; proci < nProcs; proci++)
{ {
Info<< "Reading mesh to add from " Info<< "Reading mesh to add from "
<< databases[procI].caseName() << databases[proci].caseName()
<< " for time = " << databases[procI].timeName() << " for time = " << databases[proci].timeName()
<< nl << endl; << nl << endl;
fvMesh meshToAdd fvMesh meshToAdd
@ -648,16 +648,16 @@ int main(int argc, char *argv[])
IOobject IOobject
( (
regionName, regionName,
databases[procI].timeName(), databases[proci].timeName(),
databases[procI] databases[proci]
) )
); );
// Initialize its addressing // Initialize its addressing
cellProcAddressing[procI] = identity(meshToAdd.nCells()); cellProcAddressing[proci] = identity(meshToAdd.nCells());
faceProcAddressing[procI] = identity(meshToAdd.nFaces()); faceProcAddressing[proci] = identity(meshToAdd.nFaces());
pointProcAddressing[procI] = identity(meshToAdd.nPoints()); pointProcAddressing[proci] = identity(meshToAdd.nPoints());
boundaryProcAddressing[procI] = boundaryProcAddressing[proci] =
identity(meshToAdd.boundaryMesh().size()); identity(meshToAdd.boundaryMesh().size());
@ -665,7 +665,7 @@ int main(int argc, char *argv[])
autoPtr<faceCoupleInfo> couples = determineCoupledFaces autoPtr<faceCoupleInfo> couples = determineCoupledFaces
( (
fullMatch, fullMatch,
procI, proci,
masterMesh, masterMesh,
meshToAdd, meshToAdd,
mergeDist mergeDist
@ -686,7 +686,7 @@ int main(int argc, char *argv[])
// item in masterMesh. // item in masterMesh.
// Processors that were already in masterMesh // Processors that were already in masterMesh
for (label mergedI = 0; mergedI < procI; mergedI++) for (label mergedI = 0; mergedI < proci; mergedI++)
{ {
renumber(map().oldCellMap(), cellProcAddressing[mergedI]); renumber(map().oldCellMap(), cellProcAddressing[mergedI]);
renumber(map().oldFaceMap(), faceProcAddressing[mergedI]); renumber(map().oldFaceMap(), faceProcAddressing[mergedI]);
@ -700,10 +700,10 @@ int main(int argc, char *argv[])
} }
// Added processor // Added processor
renumber(map().addedCellMap(), cellProcAddressing[procI]); renumber(map().addedCellMap(), cellProcAddressing[proci]);
renumber(map().addedFaceMap(), faceProcAddressing[procI]); renumber(map().addedFaceMap(), faceProcAddressing[proci]);
renumber(map().addedPointMap(), pointProcAddressing[procI]); renumber(map().addedPointMap(), pointProcAddressing[proci]);
renumber(map().addedPatchMap(), boundaryProcAddressing[procI]); renumber(map().addedPatchMap(), boundaryProcAddressing[proci]);
Info<< endl; Info<< endl;
} }
@ -740,18 +740,18 @@ int main(int argc, char *argv[])
Info<< "Reconstructing the addressing from the processor meshes" Info<< "Reconstructing the addressing from the processor meshes"
<< " to the newly reconstructed mesh" << nl << endl; << " to the newly reconstructed mesh" << nl << endl;
forAll(databases, procI) forAll(databases, proci)
{ {
Info<< "Reading processor " << procI << " mesh from " Info<< "Reading processor " << proci << " mesh from "
<< databases[procI].caseName() << endl; << databases[proci].caseName() << endl;
polyMesh procMesh polyMesh procMesh
( (
IOobject IOobject
( (
regionName, regionName,
databases[procI].timeName(), databases[proci].timeName(),
databases[procI] databases[proci]
) )
); );
@ -759,7 +759,7 @@ int main(int argc, char *argv[])
// From processor point to reconstructed mesh point // From processor point to reconstructed mesh point
Info<< "Writing pointProcAddressing to " Info<< "Writing pointProcAddressing to "
<< databases[procI].caseName() << databases[proci].caseName()
/procMesh.facesInstance() /procMesh.facesInstance()
/polyMesh::meshSubDir /polyMesh::meshSubDir
<< endl; << endl;
@ -776,14 +776,14 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register false // Do not register
), ),
pointProcAddressing[procI] pointProcAddressing[proci]
).write(); ).write();
// From processor face to reconstructed mesh face // From processor face to reconstructed mesh face
Info<< "Writing faceProcAddressing to " Info<< "Writing faceProcAddressing to "
<< databases[procI].caseName() << databases[proci].caseName()
/procMesh.facesInstance() /procMesh.facesInstance()
/polyMesh::meshSubDir /polyMesh::meshSubDir
<< endl; << endl;
@ -800,43 +800,43 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register false // Do not register
), ),
faceProcAddressing[procI] faceProcAddressing[proci]
); );
// Now add turning index to faceProcAddressing. // Now add turning index to faceProcAddressing.
// See reconstructPar for meaning of turning index. // See reconstructPar for meaning of turning index.
forAll(faceProcAddr, procFaceI) forAll(faceProcAddr, procFacei)
{ {
label masterFaceI = faceProcAddr[procFaceI]; label masterFacei = faceProcAddr[procFacei];
if if
( (
!procMesh.isInternalFace(procFaceI) !procMesh.isInternalFace(procFacei)
&& masterFaceI < masterInternalFaces && masterFacei < masterInternalFaces
) )
{ {
// proc face is now external but used to be internal face. // proc face is now external but used to be internal face.
// Check if we have owner or neighbour. // Check if we have owner or neighbour.
label procOwn = procMesh.faceOwner()[procFaceI]; label procOwn = procMesh.faceOwner()[procFacei];
label masterOwn = masterOwner[masterFaceI]; label masterOwn = masterOwner[masterFacei];
if (cellProcAddressing[procI][procOwn] == masterOwn) if (cellProcAddressing[proci][procOwn] == masterOwn)
{ {
// No turning. Offset by 1. // No turning. Offset by 1.
faceProcAddr[procFaceI]++; faceProcAddr[procFacei]++;
} }
else else
{ {
// Turned face. // Turned face.
faceProcAddr[procFaceI] = faceProcAddr[procFacei] =
-1 - faceProcAddr[procFaceI]; -1 - faceProcAddr[procFacei];
} }
} }
else else
{ {
// No turning. Offset by 1. // No turning. Offset by 1.
faceProcAddr[procFaceI]++; faceProcAddr[procFacei]++;
} }
} }
@ -846,7 +846,7 @@ int main(int argc, char *argv[])
// From processor cell to reconstructed mesh cell // From processor cell to reconstructed mesh cell
Info<< "Writing cellProcAddressing to " Info<< "Writing cellProcAddressing to "
<< databases[procI].caseName() << databases[proci].caseName()
/procMesh.facesInstance() /procMesh.facesInstance()
/polyMesh::meshSubDir /polyMesh::meshSubDir
<< endl; << endl;
@ -863,7 +863,7 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register false // Do not register
), ),
cellProcAddressing[procI] cellProcAddressing[proci]
).write(); ).write();
@ -871,7 +871,7 @@ int main(int argc, char *argv[])
// From processor patch to reconstructed mesh patch // From processor patch to reconstructed mesh patch
Info<< "Writing boundaryProcAddressing to " Info<< "Writing boundaryProcAddressing to "
<< databases[procI].caseName() << databases[proci].caseName()
/procMesh.facesInstance() /procMesh.facesInstance()
/polyMesh::meshSubDir /polyMesh::meshSubDir
<< endl; << endl;
@ -888,7 +888,7 @@ int main(int argc, char *argv[])
IOobject::NO_WRITE, IOobject::NO_WRITE,
false // Do not register false // Do not register
), ),
boundaryProcAddressing[procI] boundaryProcAddressing[proci]
).write(); ).write();
Info<< endl; Info<< endl;

View File

@ -150,32 +150,32 @@ void printMeshData(const polyMesh& mesh)
label totProcPatches = 0; label totProcPatches = 0;
label maxProcFaces = 0; label maxProcFaces = 0;
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
Info<< endl Info<< endl
<< "Processor " << procI << nl << "Processor " << proci << nl
<< " Number of cells = " << globalCells.localSize(procI) << " Number of cells = " << globalCells.localSize(proci)
<< endl; << endl;
label nProcFaces = 0; label nProcFaces = 0;
const labelList& nei = patchNeiProcNo[procI]; const labelList& nei = patchNeiProcNo[proci];
forAll(patchNeiProcNo[procI], i) forAll(patchNeiProcNo[proci], i)
{ {
Info<< " Number of faces shared with processor " Info<< " Number of faces shared with processor "
<< patchNeiProcNo[procI][i] << " = " << patchSize[procI][i] << patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
<< endl; << endl;
nProcFaces += patchSize[procI][i]; nProcFaces += patchSize[proci][i];
} }
Info<< " Number of processor patches = " << nei.size() << nl Info<< " Number of processor patches = " << nei.size() << nl
<< " Number of processor faces = " << nProcFaces << nl << " Number of processor faces = " << nProcFaces << nl
<< " Number of boundary faces = " << " Number of boundary faces = "
<< globalBoundaryFaces.localSize(procI) << endl; << globalBoundaryFaces.localSize(proci) << endl;
maxProcCells = max(maxProcCells, globalCells.localSize(procI)); maxProcCells = max(maxProcCells, globalCells.localSize(proci));
totProcFaces += nProcFaces; totProcFaces += nProcFaces;
totProcPatches += nei.size(); totProcPatches += nei.size();
maxProcPatches = max(maxProcPatches, nei.size()); maxProcPatches = max(maxProcPatches, nei.size());
@ -298,11 +298,11 @@ void readFields
tmp<GeoField> tsubfld = subsetterPtr().interpolate(fields[i]); tmp<GeoField> tsubfld = subsetterPtr().interpolate(fields[i]);
// Send to all processors that don't have a mesh // Send to all processors that don't have a mesh
for (label procI = 1; procI < Pstream::nProcs(); procI++) for (label proci = 1; proci < Pstream::nProcs(); proci++)
{ {
if (!haveMesh[procI]) if (!haveMesh[proci])
{ {
OPstream toProc(Pstream::blocking, procI); OPstream toProc(Pstream::blocking, proci);
toProc<< tsubfld(); toProc<< tsubfld();
} }
} }
@ -574,7 +574,7 @@ int main(int argc, char *argv[])
// Find last non-processor patch. // Find last non-processor patch.
const polyBoundaryMesh& patches = mesh.boundaryMesh(); const polyBoundaryMesh& patches = mesh.boundaryMesh();
label nonProcI = -1; label nonProci = -1;
forAll(patches, patchi) forAll(patches, patchi)
{ {
@ -582,10 +582,10 @@ int main(int argc, char *argv[])
{ {
break; break;
} }
nonProcI++; nonProci++;
} }
if (nonProcI == -1) if (nonProci == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Cannot find non-processor patch on processor " << "Cannot find non-processor patch on processor "
@ -596,7 +596,7 @@ int main(int argc, char *argv[])
// Subset 0 cells, no parallel comms. This is used to create zero-sized // Subset 0 cells, no parallel comms. This is used to create zero-sized
// fields. // fields.
subsetterPtr.reset(new fvMeshSubset(mesh)); subsetterPtr.reset(new fvMeshSubset(mesh));
subsetterPtr().setLargeCellSubset(labelHashSet(0), nonProcI, false); subsetterPtr().setLargeCellSubset(labelHashSet(0), nonProci, false);
} }
@ -781,11 +781,11 @@ int main(int argc, char *argv[])
<< " Take care when issuing these" << nl << " Take care when issuing these" << nl
<< "commands." << nl << endl; << "commands." << nl << endl;
forAll(nFaces, procI) forAll(nFaces, proci)
{ {
fileName procDir = "processor" + name(procI); fileName procDir = "processor" + name(proci);
if (nFaces[procI] == 0) if (nFaces[proci] == 0)
{ {
Info<< " rm -r " << procDir.c_str() << nl; Info<< " rm -r " << procDir.c_str() << nl;
} }

View File

@ -133,7 +133,7 @@ bool writePatchField
( (
const Field<Type>& pf, const Field<Type>& pf,
const label patchi, const label patchi,
const label ensightPatchI, const label ensightPatchi,
const faceSets& boundaryFaceSet, const faceSets& boundaryFaceSet,
const ensightMesh::nFacePrimitives& nfp, const ensightMesh::nFacePrimitives& nfp,
ensightStream& ensightFile ensightStream& ensightFile
@ -143,7 +143,7 @@ bool writePatchField
{ {
if (Pstream::master()) if (Pstream::master())
{ {
ensightFile.writePartHeader(ensightPatchI); ensightFile.writePartHeader(ensightPatchi);
} }
writeField writeField
@ -197,7 +197,7 @@ void writePatchField
const HashTable<ensightMesh::nFacePrimitives>& const HashTable<ensightMesh::nFacePrimitives>&
nPatchPrims = eMesh.nPatchPrims(); nPatchPrims = eMesh.nPatchPrims();
label ensightPatchI = eMesh.patchPartOffset(); label ensightPatchi = eMesh.patchPartOffset();
label patchi = -1; label patchi = -1;
@ -208,7 +208,7 @@ void writePatchField
patchi = i; patchi = i;
break; break;
} }
ensightPatchI++; ensightPatchi++;
} }
@ -265,7 +265,7 @@ void writePatchField
( (
pf, pf,
patchi, patchi,
ensightPatchI, ensightPatchi,
boundaryFaceSets[patchi], boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(), nPatchPrims.find(patchName)(),
ensightFile ensightFile
@ -279,7 +279,7 @@ void writePatchField
( (
Field<Type>(), Field<Type>(),
-1, -1,
ensightPatchI, ensightPatchi,
nullFaceSets, nullFaceSets,
nPatchPrims.find(patchName)(), nPatchPrims.find(patchName)(),
ensightFile ensightFile
@ -418,7 +418,7 @@ void ensightField
); );
} }
label ensightPatchI = eMesh.patchPartOffset(); label ensightPatchi = eMesh.patchPartOffset();
forAll(allPatchNames, patchi) forAll(allPatchNames, patchi)
{ {
@ -434,14 +434,14 @@ void ensightField
( (
vf.boundaryField()[patchi], vf.boundaryField()[patchi],
patchi, patchi,
ensightPatchI, ensightPatchi,
boundaryFaceSets[patchi], boundaryFaceSets[patchi],
nPatchPrims.find(patchName)(), nPatchPrims.find(patchName)(),
ensightFile ensightFile
) )
) )
{ {
ensightPatchI++; ensightPatchi++;
} }
} }
} }
@ -494,8 +494,8 @@ void ensightField
{ {
label patchi = mesh.boundaryMesh().whichPatch(facei); label patchi = mesh.boundaryMesh().whichPatch(facei);
const polyPatch& pp = mesh.boundaryMesh()[patchi]; const polyPatch& pp = mesh.boundaryMesh()[patchi];
label patchFaceI = pp.whichFace(facei); label patchFacei = pp.whichFace(facei);
Type value = sf.boundaryField()[patchi][patchFaceI]; Type value = sf.boundaryField()[patchi][patchFacei];
values[j] = value; values[j] = value;
++j; ++j;
} }
@ -508,14 +508,14 @@ void ensightField
( (
values, values,
zoneID, zoneID,
ensightPatchI, ensightPatchi,
faceZoneFaceSets[zoneID], faceZoneFaceSets[zoneID],
nFaceZonePrims.find(faceZoneName)(), nFaceZonePrims.find(faceZoneName)(),
ensightFile ensightFile
) )
) )
{ {
ensightPatchI++; ensightPatchi++;
} }
} }
} }
@ -609,7 +609,7 @@ void ensightPointField
} }
label ensightPatchI = eMesh.patchPartOffset(); label ensightPatchi = eMesh.patchPartOffset();
forAll(allPatchNames, patchi) forAll(allPatchNames, patchi)
{ {
@ -640,7 +640,7 @@ void ensightPointField
if (Pstream::master()) if (Pstream::master())
{ {
ensightFile.writePartHeader(ensightPatchI); ensightFile.writePartHeader(ensightPatchi);
} }
writeField writeField
@ -650,7 +650,7 @@ void ensightPointField
ensightFile ensightFile
); );
ensightPatchI++; ensightPatchi++;
} }
} }
} }
@ -684,7 +684,7 @@ void ensightPointField
if (Pstream::master()) if (Pstream::master())
{ {
ensightFile.writePartHeader(ensightPatchI); ensightFile.writePartHeader(ensightPatchi);
} }
writeField writeField
@ -698,7 +698,7 @@ void ensightPointField
ensightFile ensightFile
); );
ensightPatchI++; ensightPatchi++;
} }
} }
} }

View File

@ -293,10 +293,10 @@ void Foam::ensightMesh::correct()
&& !refCast<const processorPolyPatch>(pp).owner() && !refCast<const processorPolyPatch>(pp).owner()
) )
{ {
label bFaceI = pp.start()-mesh_.nInternalFaces(); label bFacei = pp.start()-mesh_.nInternalFaces();
forAll(pp, i) forAll(pp, i)
{ {
boundaryFaceToBeIncluded_[bFaceI++] = 0; boundaryFaceToBeIncluded_[bFacei++] = 0;
} }
} }
} }
@ -1136,7 +1136,7 @@ void Foam::ensightMesh::write
} }
label ensightPatchI = patchPartOffset_; label ensightPatchi = patchPartOffset_;
forAll(allPatchNames_, patchi) forAll(allPatchNames_, patchi)
{ {
@ -1176,7 +1176,7 @@ void Foam::ensightMesh::write
writeAllPoints writeAllPoints
( (
ensightPatchI++, ensightPatchi++,
patchName, patchName,
uniquePoints, uniquePoints,
globalPointsPtr().size(), globalPointsPtr().size(),
@ -1281,7 +1281,7 @@ void Foam::ensightMesh::write
writeAllPoints writeAllPoints
( (
ensightPatchI++, ensightPatchi++,
faceZoneName, faceZoneName,
uniquePoints, uniquePoints,
globalPointsPtr().size(), globalPointsPtr().size(),

View File

@ -107,8 +107,8 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getFaceField
} }
else else
{ {
label localFaceI = facei - patches[patchi].start(); label localFacei = facei - patches[patchi].start();
fld[i] = sfld.boundaryField()[patchi][localFaceI]; fld[i] = sfld.boundaryField()[patchi][localFacei];
} }
} }

View File

@ -107,15 +107,15 @@ void ReadAndMapFields
else if (index < 0) else if (index < 0)
{ {
label facei = -index-1; label facei = -index-1;
label bFaceI = facei - mesh.nInternalFaces(); label bFacei = facei - mesh.nInternalFaces();
if (bFaceI >= 0) if (bFacei >= 0)
{ {
label patchi = mesh.boundaryMesh().patchID()[bFaceI]; label patchi = mesh.boundaryMesh().patchID()[bFacei];
label localFaceI = mesh.boundaryMesh()[patchi].whichFace label localFacei = mesh.boundaryMesh()[patchi].whichFace
( (
facei facei
); );
fld[pointI] = readField.boundaryField()[patchi][localFaceI]; fld[pointI] = readField.boundaryField()[patchi][localFacei];
} }
//else //else
//{ //{

View File

@ -137,11 +137,11 @@ void Foam::internalWriter::writeCellIDs()
{ {
cellId[labelI++] = cMap[celli]; cellId[labelI++] = cMap[celli];
} }
forAll(superCells, superCellI) forAll(superCells, superCelli)
{ {
label origCellI = cMap[superCells[superCellI]]; label origCelli = cMap[superCells[superCelli]];
cellId[labelI++] = origCellI; cellId[labelI++] = origCelli;
} }
} }
else else
@ -150,11 +150,11 @@ void Foam::internalWriter::writeCellIDs()
{ {
cellId[labelI++] = celli; cellId[labelI++] = celli;
} }
forAll(superCells, superCellI) forAll(superCells, superCelli)
{ {
label origCellI = superCells[superCellI]; label origCelli = superCells[superCelli];
cellId[labelI++] = origCellI; cellId[labelI++] = origCelli;
} }
} }

View File

@ -51,8 +51,8 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
} }
else else
{ {
label localFaceI = facei - patches[patchi].start(); label localFacei = facei - patches[patchi].start();
fld[i] = sfld.boundaryField()[patchi][localFaceI]; fld[i] = sfld.boundaryField()[patchi][localFacei];
} }
} }

View File

@ -87,9 +87,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
{ {
const cell& cFaces = mesh_.cells()[celli]; const cell& cFaces = mesh_.cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh_.faces()[cFaces[cFaceI]]; const face& f = mesh_.faces()[cFaces[cFacei]];
label nQuads = 0; label nQuads = 0;
label nTris = 0; label nTris = 0;
@ -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)
{ {
@ -200,10 +200,10 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
bool substituteCell = true; bool substituteCell = true;
const labelList& cFaces = mesh_.cells()[celli]; const labelList& cFaces = mesh_.cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh_.faces()[cFaces[cFaceI]]; const face& f = mesh_.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFaceI]] == celli); const bool isOwner = (owner[cFaces[cFacei]] == celli);
// Number of triangles and quads in decomposition // Number of triangles and quads in decomposition
label nTris = 0; label nTris = 0;
@ -219,20 +219,20 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
forAll(quadFcs, quadI) forAll(quadFcs, quadI)
{ {
label thisCellI; label thisCelli;
if (substituteCell) if (substituteCell)
{ {
thisCellI = celli; thisCelli = celli;
substituteCell = false; substituteCell = false;
} }
else else
{ {
thisCellI = mesh_.nCells() + addCellI; thisCelli = mesh_.nCells() + addCelli;
superCells_[addCellI++] = celli; superCells_[addCelli++] = celli;
} }
labelList& addVtkVerts = vertLabels_[thisCellI]; labelList& addVtkVerts = vertLabels_[thisCelli];
addVtkVerts.setSize(5); addVtkVerts.setSize(5);
@ -261,26 +261,26 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
} }
addVtkVerts[4] = newVertexLabel; addVtkVerts[4] = newVertexLabel;
cellTypes_[thisCellI] = VTK_PYRAMID; cellTypes_[thisCelli] = VTK_PYRAMID;
} }
forAll(triFcs, triI) forAll(triFcs, triI)
{ {
label thisCellI; label thisCelli;
if (substituteCell) if (substituteCell)
{ {
thisCellI = celli; thisCelli = celli;
substituteCell = false; substituteCell = false;
} }
else else
{ {
thisCellI = mesh_.nCells() + addCellI; thisCelli = mesh_.nCells() + addCelli;
superCells_[addCellI++] = celli; superCells_[addCelli++] = celli;
} }
labelList& addVtkVerts = vertLabels_[thisCellI]; labelList& addVtkVerts = vertLabels_[thisCelli];
const face& tri = triFcs[triI]; const face& tri = triFcs[triI];
@ -301,7 +301,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
} }
addVtkVerts[3] = newVertexLabel; addVtkVerts[3] = newVertexLabel;
cellTypes_[thisCellI] = VTK_TETRA; cellTypes_[thisCelli] = VTK_TETRA;
} }
} }
@ -318,9 +318,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
label nData = 1 + cFaces.size(); label nData = 1 + cFaces.size();
// count total number of face points // count total number of face points
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
nData += f.size(); // space for the face labels nData += f.size(); // space for the face labels
} }
@ -330,10 +330,10 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
vtkVerts[nData++] = cFaces.size(); vtkVerts[nData++] = cFaces.size();
// build face stream // build face stream
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFaceI]] == celli); const bool isOwner = (owner[cFaces[cFacei]] == celli);
// number of labels for this face // number of labels for this face
vtkVerts[nData++] = f.size(); vtkVerts[nData++] = f.size();

View File

@ -61,13 +61,13 @@ void Foam::writeFaceSet
faceList setFaces(set.size()); faceList setFaces(set.size());
labelList setFaceLabels(set.size()); labelList setFaceLabels(set.size());
label setFaceI = 0; label setFacei = 0;
forAllConstIter(faceSet, set, iter) forAllConstIter(faceSet, set, iter)
{ {
setFaceLabels[setFaceI] = iter.key(); setFaceLabels[setFacei] = iter.key();
setFaces[setFaceI] = faces[iter.key()]; setFaces[setFacei] = faces[iter.key()];
setFaceI++; setFacei++;
} }
primitiveFacePatch fp(setFaces, vMesh.mesh().points()); primitiveFacePatch fp(setFaces, vMesh.mesh().points());

View File

@ -81,11 +81,11 @@ void Foam::writeFuns::write
insert(vvf.internalField(), fField); insert(vvf.internalField(), fField);
forAll(superCells, superCellI) forAll(superCells, superCelli)
{ {
label origCellI = superCells[superCellI]; label origCelli = superCells[superCelli];
insert(vvf[origCellI], fField); insert(vvf[origCelli], fField);
} }
write(os, binary, fField); write(os, binary, fField);
} }
@ -115,9 +115,9 @@ void Foam::writeFuns::write
forAll(addPointCellLabels, api) forAll(addPointCellLabels, api)
{ {
label origCellI = addPointCellLabels[api]; label origCelli = addPointCellLabels[api];
insert(interpolatePointToCell(pvf, origCellI), fField); insert(interpolatePointToCell(pvf, origCelli), fField);
} }
write(os, binary, fField); write(os, binary, fField);
} }
@ -148,9 +148,9 @@ void Foam::writeFuns::write
forAll(addPointCellLabels, api) forAll(addPointCellLabels, api)
{ {
label origCellI = addPointCellLabels[api]; label origCelli = addPointCellLabels[api];
insert(vvf[origCellI], fField); insert(vvf[origCelli], fField);
} }
write(os, binary, fField); write(os, binary, fField);
} }

View File

@ -99,9 +99,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
{ {
const cell& cFaces = mesh.cells()[celli]; const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
label nQuads = 0; label nQuads = 0;
label nTris = 0; label nTris = 0;
@ -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
@ -173,7 +173,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
const cellShape& cellShape = cellShapes[celli]; const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model(); const cellModel& cellModel = cellShape.model();
superCells[addCellI++] = celli; superCells[addCelli++] = celli;
if (cellModel == tet) if (cellModel == tet)
{ {
@ -280,9 +280,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
vtkIdType nLabels = nFaces; vtkIdType nLabels = nFaces;
// count size for face stream // count size for face stream
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
nLabels += f.size(); nLabels += f.size();
} }
@ -292,10 +292,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
faceStream.clear(); faceStream.clear();
faceStream.reserve(nLabels + nFaces); faceStream.reserve(nLabels + nFaces);
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFaceI]] == celli); const bool isOwner = (owner[cFaces[cFacei]] == celli);
const label nFacePoints = f.size(); const label nFacePoints = f.size();
// number of labels for this face // number of labels for this face
@ -327,9 +327,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// establish unique node ids used // establish unique node ids used
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256); HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
forAll(f, fp) forAll(f, fp)
{ {
@ -363,10 +363,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
bool substituteCell = true; bool substituteCell = true;
const labelList& cFaces = mesh.cells()[celli]; const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFaceI]] == celli); const bool isOwner = (owner[cFaces[cFacei]] == celli);
// Number of triangles and quads in decomposition // Number of triangles and quads in decomposition
label nTris = 0; label nTris = 0;
@ -388,7 +388,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
} }
else else
{ {
superCells[addCellI++] = celli; superCells[addCelli++] = celli;
} }
const face& quad = quadFcs[quadI]; const face& quad = quadFcs[quadI];
@ -431,7 +431,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
} }
else else
{ {
superCells[addCellI++] = celli; superCells[addCelli++] = celli;
} }
const face& tri = triFcs[triI]; const face& tri = triFcs[triI];

View File

@ -99,9 +99,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
{ {
const cell& cFaces = mesh.cells()[celli]; const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
label nQuads = 0; label nQuads = 0;
label nTris = 0; label nTris = 0;
@ -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
@ -173,7 +173,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
const cellShape& cellShape = cellShapes[celli]; const cellShape& cellShape = cellShapes[celli];
const cellModel& cellModel = cellShape.model(); const cellModel& cellModel = cellShape.model();
superCells[addCellI++] = celli; superCells[addCelli++] = celli;
if (cellModel == tet) if (cellModel == tet)
{ {
@ -280,9 +280,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
vtkIdType nLabels = nFaces; vtkIdType nLabels = nFaces;
// count size for face stream // count size for face stream
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
nLabels += f.size(); nLabels += f.size();
} }
@ -292,10 +292,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
faceStream.clear(); faceStream.clear();
faceStream.reserve(nLabels + nFaces); faceStream.reserve(nLabels + nFaces);
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFaceI]] == celli); const bool isOwner = (owner[cFaces[cFacei]] == celli);
const label nFacePoints = f.size(); const label nFacePoints = f.size();
// number of labels for this face // number of labels for this face
@ -327,9 +327,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
// establish unique node ids used // establish unique node ids used
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256); HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
forAll(f, fp) forAll(f, fp)
{ {
@ -363,10 +363,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
bool substituteCell = true; bool substituteCell = true;
const labelList& cFaces = mesh.cells()[celli]; const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = mesh.faces()[cFaces[cFaceI]]; const face& f = mesh.faces()[cFaces[cFacei]];
const bool isOwner = (owner[cFaces[cFaceI]] == celli); const bool isOwner = (owner[cFaces[cFacei]] == celli);
// Number of triangles and quads in decomposition // Number of triangles and quads in decomposition
label nTris = 0; label nTris = 0;
@ -388,7 +388,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
} }
else else
{ {
superCells[addCellI++] = celli; superCells[addCelli++] = celli;
} }
const face& quad = quadFcs[quadI]; const face& quad = quadFcs[quadI];
@ -431,7 +431,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
} }
else else
{ {
superCells[addCellI++] = celli; superCells[addCelli++] = celli;
} }
const face& tri = triFcs[triI]; const face& tri = triFcs[triI];

View File

@ -103,10 +103,10 @@ int main(int argc, char *argv[])
labelList numIds = maxIds + 1; labelList numIds = maxIds + 1;
Info<< nl << "Particle statistics:" << endl; Info<< nl << "Particle statistics:" << endl;
forAll(maxIds, procI) forAll(maxIds, proci)
{ {
Info<< " Found " << numIds[procI] << " particles originating" Info<< " Found " << numIds[proci] << " particles originating"
<< " from processor " << procI << endl; << " from processor " << proci << endl;
} }
Info<< nl << endl; Info<< nl << endl;
@ -169,13 +169,13 @@ int main(int argc, char *argv[])
Info<< " Constructing tracks" << nl << endl; Info<< " Constructing tracks" << nl << endl;
if (Pstream::master()) if (Pstream::master())
{ {
forAll(allPositions, procI) forAll(allPositions, proci)
{ {
forAll(allPositions[procI], i) forAll(allPositions[proci], i)
{ {
label globalId = label globalId =
startIds[allOrigProcs[procI][i]] startIds[allOrigProcs[proci][i]]
+ allOrigIds[procI][i]; + allOrigIds[proci][i];
if (globalId % sampleFrequency == 0) if (globalId % sampleFrequency == 0)
{ {
@ -184,7 +184,7 @@ int main(int argc, char *argv[])
{ {
allTracks[trackId].append allTracks[trackId].append
( (
allPositions[procI][i] allPositions[proci][i]
); );
} }
} }

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
@ -88,16 +88,16 @@ int main(int argc, char *argv[])
// Create the processor databases // Create the processor databases
databases.setSize(nProcs); databases.setSize(nProcs);
forAll(databases, procI) forAll(databases, proci)
{ {
databases.set databases.set
( (
procI, proci,
new Time new Time
( (
Time::controlDictName, Time::controlDictName,
args.rootPath(), args.rootPath(),
args.caseName()/fileName(word("processor") + name(procI)) args.caseName()/fileName(word("processor") + name(proci))
) )
); );
} }
@ -128,11 +128,11 @@ int main(int argc, char *argv[])
{ {
if (args.optionFound("processor")) if (args.optionFound("processor"))
{ {
for (label procI=0; procI<nProcs; procI++) for (label proci=0; proci<nProcs; proci++)
{ {
fileName procPath fileName procPath
( (
args.path()/(word("processor") + name(procI)) args.path()/(word("processor") + name(proci))
); );
forAll(timeDirs, timeI) forAll(timeDirs, timeI)

View File

@ -109,9 +109,9 @@ void Foam::channelIndex::walkOppositeFaces
{ {
const cell& ownCell = cells[mesh.faceOwner()[facei]]; const cell& ownCell = cells[mesh.faceOwner()[facei]];
label oppositeFaceI = ownCell.opposingFaceLabel(facei, faces); label oppositeFacei = ownCell.opposingFaceLabel(facei, faces);
if (oppositeFaceI == -1) if (oppositeFacei == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Face:" << facei << " owner cell:" << ownCell << "Face:" << facei << " owner cell:" << ownCell
@ -119,10 +119,10 @@ void Foam::channelIndex::walkOppositeFaces
} }
else else
{ {
if (!blockedFace[oppositeFaceI]) if (!blockedFace[oppositeFacei])
{ {
blockedFace[oppositeFaceI] = true; blockedFace[oppositeFacei] = true;
newFrontFaces.append(oppositeFaceI); newFrontFaces.append(oppositeFacei);
} }
} }
} }
@ -131,9 +131,9 @@ void Foam::channelIndex::walkOppositeFaces
{ {
const cell& neiCell = mesh.cells()[mesh.faceNeighbour()[facei]]; const cell& neiCell = mesh.cells()[mesh.faceNeighbour()[facei]];
label oppositeFaceI = neiCell.opposingFaceLabel(facei, faces); label oppositeFacei = neiCell.opposingFaceLabel(facei, faces);
if (oppositeFaceI == -1) if (oppositeFacei == -1)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Face:" << facei << " neighbour cell:" << neiCell << "Face:" << facei << " neighbour cell:" << neiCell
@ -141,10 +141,10 @@ void Foam::channelIndex::walkOppositeFaces
} }
else else
{ {
if (!blockedFace[oppositeFaceI]) if (!blockedFace[oppositeFacei])
{ {
blockedFace[oppositeFaceI] = true; blockedFace[oppositeFacei] = true;
newFrontFaces.append(oppositeFaceI); newFrontFaces.append(oppositeFacei);
} }
} }
} }

View File

@ -118,8 +118,8 @@ void rewriteBoundary
// Add new entries // Add new entries
label addedPatchI = nOldPatches; label addedPatchi = nOldPatches;
label newPatchI = 0; label newPatchi = 0;
forAll(oldPatches, patchi) forAll(oldPatches, patchi)
{ {
const dictionary& patchDict = oldPatches[patchi].dict(); const dictionary& patchDict = oldPatches[patchi].dict();
@ -134,7 +134,7 @@ void rewriteBoundary
if (patchDict.found("neighbourPatch")) if (patchDict.found("neighbourPatch"))
{ {
patches.set(patchi, oldPatches.set(patchi, NULL)); patches.set(patchi, oldPatches.set(patchi, NULL));
oldToNew[patchi] = newPatchI++; oldToNew[patchi] = newPatchi++;
// Check if patches come from automatic conversion // Check if patches come from automatic conversion
word oldName; word oldName;
@ -182,7 +182,7 @@ void rewriteBoundary
// Change entry on this side // Change entry on this side
patches.set(patchi, oldPatches.set(patchi, NULL)); patches.set(patchi, oldPatches.set(patchi, NULL));
oldToNew[patchi] = newPatchI++; oldToNew[patchi] = newPatchi++;
dictionary& thisPatchDict = patches[patchi].dict(); dictionary& thisPatchDict = patches[patchi].dict();
thisPatchDict.add("neighbourPatch", nbrName); thisPatchDict.add("neighbourPatch", nbrName);
thisPatchDict.set("nFaces", nFaces/2); thisPatchDict.set("nFaces", nFaces/2);
@ -191,7 +191,7 @@ void rewriteBoundary
// Add entry on other side // Add entry on other side
patches.set patches.set
( (
addedPatchI, addedPatchi,
new dictionaryEntry new dictionaryEntry
( (
nbrName, nbrName,
@ -199,12 +199,12 @@ void rewriteBoundary
patchDict patchDict
) )
); );
oldToNew[addedPatchI] = newPatchI++; oldToNew[addedPatchi] = newPatchi++;
dictionary& nbrPatchDict = patches[addedPatchI].dict(); dictionary& nbrPatchDict = patches[addedPatchi].dict();
nbrPatchDict.set("neighbourPatch", thisName); nbrPatchDict.set("neighbourPatch", thisName);
nbrPatchDict.set("nFaces", nFaces/2); nbrPatchDict.set("nFaces", nFaces/2);
nbrPatchDict.set("startFace", startFace+nFaces/2); nbrPatchDict.set("startFace", startFace+nFaces/2);
patches[addedPatchI].keyword() = nbrName; patches[addedPatchi].keyword() = nbrName;
Info<< "Replaced with patches" << nl Info<< "Replaced with patches" << nl
<< patches[patchi].keyword() << " with" << nl << patches[patchi].keyword() << " with" << nl
@ -213,7 +213,7 @@ void rewriteBoundary
<< nl << nl
<< " startFace : " << " startFace : "
<< readLabel(thisPatchDict.lookup("startFace")) << nl << readLabel(thisPatchDict.lookup("startFace")) << nl
<< patches[addedPatchI].keyword() << " with" << nl << patches[addedPatchi].keyword() << " with" << nl
<< " nFaces : " << " nFaces : "
<< readLabel(nbrPatchDict.lookup("nFaces")) << readLabel(nbrPatchDict.lookup("nFaces"))
<< nl << nl
@ -221,13 +221,13 @@ void rewriteBoundary
<< readLabel(nbrPatchDict.lookup("startFace")) << readLabel(nbrPatchDict.lookup("startFace"))
<< nl << endl; << nl << endl;
addedPatchI++; addedPatchi++;
} }
} }
else else
{ {
patches.set(patchi, oldPatches.set(patchi, NULL)); patches.set(patchi, oldPatches.set(patchi, NULL));
oldToNew[patchi] = newPatchI++; oldToNew[patchi] = newPatchi++;
} }
} }

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
@ -348,15 +348,15 @@ int main(int argc, char *argv[])
Info<< "Target mesh size: " << meshTarget.nCells() << endl; Info<< "Target mesh size: " << meshTarget.nCells() << endl;
for (int procI=0; procI<nProcs; procI++) for (int proci=0; proci<nProcs; proci++)
{ {
Info<< nl << "Source processor " << procI << endl; Info<< nl << "Source processor " << proci << endl;
Time runTimeSource Time runTimeSource
( (
Time::controlDictName, Time::controlDictName,
rootDirSource, rootDirSource,
caseDirSource/fileName(word("processor") + name(procI)) caseDirSource/fileName(word("processor") + name(proci))
); );
#include "setTimeIndex.H" #include "setTimeIndex.H"
@ -429,15 +429,15 @@ int main(int argc, char *argv[])
Info<< "Source mesh size: " << meshSource.nCells() << endl; Info<< "Source mesh size: " << meshSource.nCells() << endl;
for (int procI=0; procI<nProcs; procI++) for (int proci=0; proci<nProcs; proci++)
{ {
Info<< nl << "Target processor " << procI << endl; Info<< nl << "Target processor " << proci << endl;
Time runTimeTarget Time runTimeTarget
( (
Time::controlDictName, Time::controlDictName,
rootDirTarget, rootDirTarget,
caseDirTarget/fileName(word("processor") + name(procI)) caseDirTarget/fileName(word("processor") + name(proci))
); );
fvMesh meshTarget fvMesh meshTarget

View File

@ -40,12 +40,12 @@ static const scalar perturbFactor = 1e-6;
static label findCell(const Cloud<passiveParticle>& cloud, const point& pt) static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
{ {
label celli = -1; label celli = -1;
label tetFaceI = -1; label tetFacei = -1;
label tetPtI = -1; label tetPtI = -1;
const polyMesh& mesh = cloud.pMesh(); const polyMesh& mesh = cloud.pMesh();
mesh.findCellFacePt(pt, celli, tetFaceI, tetPtI); mesh.findCellFacePt(pt, celli, tetFacei, tetPtI);
if (celli >= 0) if (celli >= 0)
{ {
@ -70,7 +70,7 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc; const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
mesh.findCellFacePt(perturbPt, celli, tetFaceI, tetPtI); mesh.findCellFacePt(perturbPt, celli, tetFacei, tetPtI);
return celli; return celli;
} }

View File

@ -40,12 +40,12 @@ static const scalar perturbFactor = 1e-6;
static label findCell(const Cloud<passiveParticle>& cloud, const point& pt) static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
{ {
label celli = -1; label celli = -1;
label tetFaceI = -1; label tetFacei = -1;
label tetPtI = -1; label tetPtI = -1;
const polyMesh& mesh = cloud.pMesh(); const polyMesh& mesh = cloud.pMesh();
mesh.findCellFacePt(pt, celli, tetFaceI, tetPtI); mesh.findCellFacePt(pt, celli, tetFacei, tetPtI);
if (celli >= 0) if (celli >= 0)
{ {
@ -70,7 +70,7 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc; const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
mesh.findCellFacePt(perturbPt, celli, tetFaceI, tetPtI); mesh.findCellFacePt(perturbPt, celli, tetFacei, tetPtI);
return celli; return celli;
} }

View File

@ -267,9 +267,9 @@ bool setFaceFieldType
} }
else else
{ {
label bFaceI = facei-mesh.nInternalFaces(); label bFacei = facei-mesh.nInternalFaces();
allBoundaryValues[bFaceI] = value; allBoundaryValues[bFacei] = value;
nChanged[mesh.boundaryMesh().patchID()[bFaceI]]++; nChanged[mesh.boundaryMesh().patchID()[bFacei]]++;
} }
} }

View File

@ -7,9 +7,9 @@ const label maxDynListLength
viewFactorDict.lookupOrDefault<label>("maxDynListLength", 100000) viewFactorDict.lookupOrDefault<label>("maxDynListLength", 100000)
); );
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
// Shoot rays from me to procI. Note that even if processor has // Shoot rays from me to proci. Note that even if processor has
// 0 faces we still need to call findLine to keep calls synced. // 0 faces we still need to call findLine to keep calls synced.
DynamicField<point> start(coarseMesh.nFaces()); DynamicField<point> start(coarseMesh.nFaces());
@ -25,9 +25,9 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()]; const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()]; const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()];
const pointField& remoteArea = remoteCoarseSf[procI]; const pointField& remoteArea = remoteCoarseSf[proci];
const pointField& remoteFc = remoteCoarseCf[procI]; const pointField& remoteFc = remoteCoarseCf[proci];
const labelField& remoteAgg = remoteCoarseAgg[procI]; const labelField& remoteAgg = remoteCoarseAgg[proci];
label i = 0; label i = 0;
label j = 0; label j = 0;
@ -41,7 +41,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
for (; j < remoteFc.size(); j++) for (; j < remoteFc.size(); j++)
{ {
if (procI != Pstream::myProcNo() || i != j) if (proci != Pstream::myProcNo() || i != j)
{ {
const point& remFc = remoteFc[j]; const point& remFc = remoteFc[j];
const vector& remA = remoteArea[j]; const vector& remA = remoteArea[j];
@ -53,11 +53,11 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
{ {
start.append(fc + 0.001*d); start.append(fc + 0.001*d);
startIndex.append(i); startIndex.append(i);
startAgg.append(globalNumbering.toGlobal(procI, fAgg)); startAgg.append(globalNumbering.toGlobal(proci, fAgg));
end.append(fc + 0.999*d); end.append(fc + 0.999*d);
label globalI = globalNumbering.toGlobal(procI, j); label globalI = globalNumbering.toGlobal(proci, j);
endIndex.append(globalI); endIndex.append(globalI);
endAgg.append(globalNumbering.toGlobal(procI, remAgg)); endAgg.append(globalNumbering.toGlobal(proci, remAgg));
if (startIndex.size() > maxDynListLength) if (startIndex.size() > maxDynListLength)
{ {
FatalErrorInFunction FatalErrorInFunction

View File

@ -75,8 +75,8 @@ triSurface triangulate
mesh.nFaces() - mesh.nInternalFaces() mesh.nFaces() - mesh.nInternalFaces()
); );
label newPatchI = 0; label newPatchi = 0;
label localTriFaceI = 0; label localTriFacei = 0;
forAllConstIter(labelHashSet, includePatches, iter) forAllConstIter(labelHashSet, includePatches, iter)
{ {
@ -86,9 +86,9 @@ triSurface triangulate
label nTriTotal = 0; label nTriTotal = 0;
forAll(patch, patchFaceI) forAll(patch, patchFacei)
{ {
const face& f = patch[patchFaceI]; const face& f = patch[patchFacei];
faceList triFaces(f.nTriangles(points)); faceList triFaces(f.nTriangles(points));
@ -96,27 +96,27 @@ triSurface triangulate
f.triangles(points, nTri, triFaces); f.triangles(points, nTri, triFaces);
forAll(triFaces, triFaceI) forAll(triFaces, triFacei)
{ {
const face& f = triFaces[triFaceI]; const face& f = triFaces[triFacei];
triangles.append(labelledTri(f[0], f[1], f[2], newPatchI)); triangles.append(labelledTri(f[0], f[1], f[2], newPatchi));
nTriTotal++; nTriTotal++;
triSurfaceToAgglom[localTriFaceI++] = globalNumbering.toGlobal triSurfaceToAgglom[localTriFacei++] = globalNumbering.toGlobal
( (
Pstream::myProcNo(), Pstream::myProcNo(),
finalAgglom[patchi][patchFaceI] finalAgglom[patchi][patchFacei]
+ coarsePatches[patchi].start() + coarsePatches[patchi].start()
); );
} }
} }
newPatchI++; newPatchi++;
} }
triSurfaceToAgglom.resize(localTriFaceI); triSurfaceToAgglom.resize(localTriFacei);
triangles.shrink(); triangles.shrink();
@ -131,20 +131,20 @@ triSurface triangulate
); );
// Add patch names to surface // Add patch names to surface
surface.patches().setSize(newPatchI); surface.patches().setSize(newPatchi);
newPatchI = 0; newPatchi = 0;
forAllConstIter(labelHashSet, includePatches, iter) forAllConstIter(labelHashSet, includePatches, iter)
{ {
const label patchi = iter.key(); const label patchi = iter.key();
const polyPatch& patch = bMesh[patchi]; const polyPatch& patch = bMesh[patchi];
surface.patches()[newPatchI].index() = patchi; surface.patches()[newPatchi].index() = patchi;
surface.patches()[newPatchI].name() = patch.name(); surface.patches()[newPatchi].name() = patch.name();
surface.patches()[newPatchI].geometricType() = patch.type(); surface.patches()[newPatchi].geometricType() = patch.type();
newPatchI++; newPatchi++;
} }
return surface; return surface;
@ -222,7 +222,7 @@ scalar calculateViewFactorFij
void insertMatrixElements void insertMatrixElements
( (
const globalIndex& globalNumbering, const globalIndex& globalNumbering,
const label fromProcI, const label fromProci,
const labelListList& globalFaceFaces, const labelListList& globalFaceFaces,
const scalarListList& viewFactors, const scalarListList& viewFactors,
scalarSquareMatrix& matrix scalarSquareMatrix& matrix
@ -233,7 +233,7 @@ void insertMatrixElements
const scalarList& vf = viewFactors[facei]; const scalarList& vf = viewFactors[facei];
const labelList& globalFaces = globalFaceFaces[facei]; const labelList& globalFaces = globalFaceFaces[facei];
label globalI = globalNumbering.toGlobal(fromProcI, facei); label globalI = globalNumbering.toGlobal(fromProci, facei);
forAll(globalFaces, i) forAll(globalFaces, i)
{ {
matrix[globalI][globalFaces[i]] = vf[i]; matrix[globalI][globalFaces[i]] = vf[i];
@ -401,8 +401,8 @@ int main(int argc, char *argv[])
{ {
point cf = coarseCf[facei]; point cf = coarseCf[facei];
const label coarseFaceI = coarsePatchFace[facei]; const label coarseFacei = coarsePatchFace[facei];
const labelList& fineFaces = coarseToFine[coarseFaceI]; const labelList& fineFaces = coarseToFine[coarseFacei];
const label agglomI = const label agglomI =
agglom[fineFaces[0]] + coarsePatches[patchID].start(); agglom[fineFaces[0]] + coarsePatches[patchID].start();
@ -611,8 +611,8 @@ int main(int argc, char *argv[])
List<point>& fineCf = compactFineCf[compactI]; List<point>& fineCf = compactFineCf[compactI];
List<point>& fineSf = compactFineSf[compactI++]; List<point>& fineSf = compactFineSf[compactI++];
const label coarseFaceI = coarsePatchFace[coarseI]; const label coarseFacei = coarsePatchFace[coarseI];
const labelList& fineFaces = coarseToFine[coarseFaceI]; const labelList& fineFaces = coarseToFine[coarseFacei];
fineCf.setSize(fineFaces.size()); fineCf.setSize(fineFaces.size());
fineSf.setSize(fineFaces.size()); fineSf.setSize(fineFaces.size());
@ -620,12 +620,12 @@ int main(int argc, char *argv[])
fineCf = UIndirectList<point> fineCf = UIndirectList<point>
( (
mesh.Cf().boundaryField()[patchID], mesh.Cf().boundaryField()[patchID],
coarseToFine[coarseFaceI] coarseToFine[coarseFacei]
); );
fineSf = UIndirectList<point> fineSf = UIndirectList<point>
( (
mesh.Sf().boundaryField()[patchID], mesh.Sf().boundaryField()[patchID],
coarseToFine[coarseFaceI] coarseToFine[coarseFacei]
); );
} }
} }
@ -688,20 +688,20 @@ int main(int argc, char *argv[])
if (mesh.nSolutionD() == 3) if (mesh.nSolutionD() == 3)
{ {
forAll(localCoarseSf, coarseFaceI) forAll(localCoarseSf, coarseFacei)
{ {
const List<point>& localFineSf = compactFineSf[coarseFaceI]; const List<point>& localFineSf = compactFineSf[coarseFacei];
const vector Ai = sum(localFineSf); const vector Ai = sum(localFineSf);
const List<point>& localFineCf = compactFineCf[coarseFaceI]; const List<point>& localFineCf = compactFineCf[coarseFacei];
const label fromPatchId = compactPatchId[coarseFaceI]; const label fromPatchId = compactPatchId[coarseFacei];
patchArea[fromPatchId] += mag(Ai); patchArea[fromPatchId] += mag(Ai);
const labelList& visCoarseFaces = visibleFaceFaces[coarseFaceI]; const labelList& visCoarseFaces = visibleFaceFaces[coarseFacei];
forAll(visCoarseFaces, visCoarseFaceI) forAll(visCoarseFaces, visCoarseFacei)
{ {
F[coarseFaceI].setSize(visCoarseFaces.size()); F[coarseFacei].setSize(visCoarseFaces.size());
label compactJ = visCoarseFaces[visCoarseFaceI]; label compactJ = visCoarseFaces[visCoarseFacei];
const List<point>& remoteFineSj = compactFineSf[compactJ]; const List<point>& remoteFineSj = compactFineSf[compactJ];
const List<point>& remoteFineCj = compactFineCf[compactJ]; const List<point>& remoteFineCj = compactFineCf[compactJ];
@ -729,7 +729,7 @@ int main(int argc, char *argv[])
Fij += dIntFij; Fij += dIntFij;
} }
} }
F[coarseFaceI][visCoarseFaceI] = Fij/mag(Ai); F[coarseFacei][visCoarseFacei] = Fij/mag(Ai);
sumViewFactorPatch[fromPatchId][toPatchId] += Fij; sumViewFactorPatch[fromPatchId][toPatchId] += Fij;
} }
} }
@ -749,22 +749,22 @@ int main(int argc, char *argv[])
scalar wideBy2 = (box.span() & emptyDir)*2.0; scalar wideBy2 = (box.span() & emptyDir)*2.0;
forAll(localCoarseSf, coarseFaceI) forAll(localCoarseSf, coarseFacei)
{ {
const vector& Ai = localCoarseSf[coarseFaceI]; const vector& Ai = localCoarseSf[coarseFacei];
const vector& Ci = localCoarseCf[coarseFaceI]; const vector& Ci = localCoarseCf[coarseFacei];
vector Ain = Ai/mag(Ai); vector Ain = Ai/mag(Ai);
vector R1i = Ci + (mag(Ai)/wideBy2)*(Ain ^ emptyDir); vector R1i = Ci + (mag(Ai)/wideBy2)*(Ain ^ emptyDir);
vector R2i = Ci - (mag(Ai)/wideBy2)*(Ain ^ emptyDir) ; vector R2i = Ci - (mag(Ai)/wideBy2)*(Ain ^ emptyDir) ;
const label fromPatchId = compactPatchId[coarseFaceI]; const label fromPatchId = compactPatchId[coarseFacei];
patchArea[fromPatchId] += mag(Ai); patchArea[fromPatchId] += mag(Ai);
const labelList& visCoarseFaces = visibleFaceFaces[coarseFaceI]; const labelList& visCoarseFaces = visibleFaceFaces[coarseFacei];
forAll(visCoarseFaces, visCoarseFaceI) forAll(visCoarseFaces, visCoarseFacei)
{ {
F[coarseFaceI].setSize(visCoarseFaces.size()); F[coarseFacei].setSize(visCoarseFaces.size());
label compactJ = visCoarseFaces[visCoarseFaceI]; label compactJ = visCoarseFaces[visCoarseFacei];
const vector& Aj = compactCoarseSf[compactJ]; const vector& Aj = compactCoarseSf[compactJ];
const vector& Cj = compactCoarseCf[compactJ]; const vector& Cj = compactCoarseCf[compactJ];
@ -781,7 +781,7 @@ int main(int argc, char *argv[])
scalar Fij = mag((d1 + d2) - (s1 + s2))/(4.0*mag(Ai)/wideBy2); scalar Fij = mag((d1 + d2) - (s1 + s2))/(4.0*mag(Ai)/wideBy2);
F[coarseFaceI][visCoarseFaceI] = Fij; F[coarseFacei][visCoarseFacei] = Fij;
sumViewFactorPatch[fromPatchId][toPatchId] += Fij*mag(Ai); sumViewFactorPatch[fromPatchId][toPatchId] += Fij*mag(Ai);
} }
} }
@ -873,15 +873,15 @@ int main(int argc, char *argv[])
} }
forAll(compactMap, procI) forAll(compactMap, proci)
{ {
const Map<label>& localToCompactMap = compactMap[procI]; const Map<label>& localToCompactMap = compactMap[proci];
forAllConstIter(Map<label>, localToCompactMap, iter) forAllConstIter(Map<label>, localToCompactMap, iter)
{ {
compactToGlobal[iter()] = globalNumbering.toGlobal compactToGlobal[iter()] = globalNumbering.toGlobal
( (
procI, proci,
iter.key() iter.key()
); );
} }

View File

@ -244,16 +244,16 @@ int main(int argc, char *argv[])
newPatches.setSize(nRegions1 + nRegions2); newPatches.setSize(nRegions1 + nRegions2);
label newPatchI = 0; label newPatchi = 0;
forAll(surface1.patches(), patchi) forAll(surface1.patches(), patchi)
{ {
newPatches[newPatchI++] = surface1.patches()[patchi]; newPatches[newPatchi++] = surface1.patches()[patchi];
} }
forAll(surface2.patches(), patchi) forAll(surface2.patches(), patchi)
{ {
newPatches[newPatchI++] = surface2.patches()[patchi]; newPatches[newPatchi++] = surface2.patches()[patchi];
} }
} }

View File

@ -83,15 +83,15 @@ bool validTri
// Note: discards normal information - sides of baffle are merged. // Note: discards normal information - sides of baffle are merged.
forAll(fFaces, i) forAll(fFaces, i)
{ {
label nbrFaceI = fFaces[i]; label nbrFacei = fFaces[i];
if (nbrFaceI <= facei) if (nbrFacei <= facei)
{ {
// lower numbered faces already checked // lower numbered faces already checked
continue; continue;
} }
const labelledTri& nbrF = surf[nbrFaceI]; const labelledTri& nbrF = surf[nbrFacei];
if if
( (
@ -102,7 +102,7 @@ bool validTri
{ {
WarningInFunction WarningInFunction
<< "triangle " << facei << " vertices " << f << "triangle " << facei << " vertices " << f
<< " has the same vertices as triangle " << nbrFaceI << " has the same vertices as triangle " << nbrFacei
<< " vertices " << nbrF << " vertices " << nbrF
<< " coords:" << f.points(surf.points()) << " coords:" << f.points(surf.points())
<< endl; << endl;
@ -534,9 +534,9 @@ int main(int argc, char *argv[])
if (myFaces.size() > 2) if (myFaces.size() > 2)
{ {
forAll(myFaces, myFaceI) forAll(myFaces, myFacei)
{ {
problemFaces.append(myFaces[myFaceI]); problemFaces.append(myFaces[myFacei]);
} }
nMultEdges++; nMultEdges++;

View File

@ -405,28 +405,28 @@ static void markRegion
forAll(eFaces, i) forAll(eFaces, i)
{ {
label nbrFaceI = eFaces[i]; label nbrFacei = eFaces[i];
if (faceToEdge[nbrFaceI] != -1) if (faceToEdge[nbrFacei] != -1)
{ {
if (collapseRegion[nbrFaceI] == -1) if (collapseRegion[nbrFacei] == -1)
{ {
markRegion markRegion
( (
surf, surf,
faceToEdge, faceToEdge,
regionI, regionI,
nbrFaceI, nbrFacei,
collapseRegion collapseRegion
); );
} }
else if (collapseRegion[nbrFaceI] != regionI) else if (collapseRegion[nbrFacei] != regionI)
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Edge:" << edgeI << " between face " << facei << "Edge:" << edgeI << " between face " << facei
<< " with region " << regionI << " with region " << regionI
<< " and face " << nbrFaceI << " and face " << nbrFacei
<< " with region " << collapseRegion[nbrFaceI] << " with region " << collapseRegion[nbrFacei]
<< endl; << endl;
} }
} }

View File

@ -752,9 +752,9 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
DynamicList<Foam::vector> normals(2); DynamicList<Foam::vector> normals(2);
DynamicList<labelList> bins(2); DynamicList<labelList> bins(2);
forAll(eFaces, eFaceI) forAll(eFaces, eFacei)
{ {
const Foam::vector& n = surf.faceNormals()[eFaces[eFaceI]]; const Foam::vector& n = surf.faceNormals()[eFaces[eFacei]];
// Find the normal in normals // Find the normal in normals
label index = -1; label index = -1;
@ -769,7 +769,7 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
if (index != -1) if (index != -1)
{ {
bins[index].append(eFaceI); bins[index].append(eFacei);
} }
else if (normals.size() >= 2) else if (normals.size() >= 2)
{ {
@ -783,7 +783,7 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
else else
{ {
normals.append(n); normals.append(n);
bins.append(labelList(1, eFaceI)); bins.append(labelList(1, eFacei));
} }
} }

View File

@ -531,11 +531,11 @@ int main(int argc, char *argv[])
visitedFace[hitSurfI][facei] = true; visitedFace[hitSurfI][facei] = true;
forAll(newFacesFromSplit, newFaceI) forAll(newFacesFromSplit, newFacei)
{ {
const labelledTri& fN = newFacesFromSplit[newFaceI]; const labelledTri& fN = newFacesFromSplit[newFacei];
if (newFaceI == 0) if (newFacei == 0)
{ {
newFaces[hitSurfI][facei] = fN; newFaces[hitSurfI][facei] = fN;
} }

View File

@ -76,19 +76,19 @@ void writeProcStats
Pstream::gatherList(nFaces); Pstream::gatherList(nFaces);
Pstream::scatterList(nFaces); Pstream::scatterList(nFaces);
forAll(surfBb, procI) forAll(surfBb, proci)
{ {
const List<treeBoundBox>& bbs = meshBb[procI]; const List<treeBoundBox>& bbs = meshBb[proci];
Info<< "processor" << procI << nl Info<< "processor" << proci << nl
<< "\tMesh bounds : " << bbs[0] << nl; << "\tMesh bounds : " << bbs[0] << nl;
for (label i = 1; i < bbs.size(); i++) for (label i = 1; i < bbs.size(); i++)
{ {
Info<< "\t " << bbs[i]<< nl; Info<< "\t " << bbs[i]<< nl;
} }
Info<< "\tSurface bounding box : " << surfBb[procI] << nl Info<< "\tSurface bounding box : " << surfBb[proci] << nl
<< "\tTriangles : " << nFaces[procI] << nl << "\tTriangles : " << nFaces[proci] << nl
<< "\tVertices : " << nPoints[procI] << "\tVertices : " << nPoints[proci]
<< endl; << endl;
} }
Info<< endl; Info<< endl;

View File

@ -357,7 +357,7 @@ void walkSplitLine
const boolList& borderEdge, const boolList& borderEdge,
const labelList& borderPoint, const labelList& borderPoint,
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
@ -365,7 +365,7 @@ void walkSplitLine
Map<label>& faceToPoint Map<label>& faceToPoint
) )
{ {
label facei = startFaceI; label facei = startFacei;
label edgeI = startEdgeI; label edgeI = startEdgeI;
label pointI = startPointI; label pointI = startPointI;
@ -446,7 +446,7 @@ void walkSplitLine
label sharedFace label sharedFace
( (
const triSurface& surf, const triSurface& surf,
const label firstFaceI, const label firstFacei,
const label sharedEdgeI const label sharedEdgeI
) )
{ {
@ -454,7 +454,7 @@ label sharedFace
const edge& e = surf.edges()[sharedEdgeI]; const edge& e = surf.edges()[sharedEdgeI];
const triSurface::FaceType& f = surf.localFaces()[firstFaceI]; const triSurface::FaceType& f = surf.localFaces()[firstFacei];
label startIndex = findIndex(f, e.start()); label startIndex = findIndex(f, e.start());
@ -467,16 +467,16 @@ label sharedFace
const labelList& eFaces = surf.sortedEdgeFaces()[sharedEdgeI]; const labelList& eFaces = surf.sortedEdgeFaces()[sharedEdgeI];
// Get position of face in sorted edge faces // Get position of face in sorted edge faces
label faceIndex = findIndex(eFaces, firstFaceI); label faceIndex = findIndex(eFaces, firstFacei);
if (edgeOrder) if (edgeOrder)
{ {
// Get face before firstFaceI // Get face before firstFacei
return eFaces[eFaces.rcIndex(faceIndex)]; return eFaces[eFaces.rcIndex(faceIndex)];
} }
else else
{ {
// Get face after firstFaceI // Get face after firstFacei
return eFaces[eFaces.fcIndex(faceIndex)]; return eFaces[eFaces.fcIndex(faceIndex)];
} }
} }
@ -808,17 +808,17 @@ int main(int argc, char *argv[])
// Pick any face using edge to start from. // Pick any face using edge to start from.
const labelList& eFaces = surf.edgeFaces()[startEdgeI]; const labelList& eFaces = surf.edgeFaces()[startEdgeI];
label firstFaceI = eFaces[0]; label firstFacei = eFaces[0];
// Find second face which is from same surface i.e. has outwards // Find second face which is from same surface i.e. has outwards
// pointing normal as well (actually bit more complex than this) // pointing normal as well (actually bit more complex than this)
label secondFaceI = sharedFace(surf, firstFaceI, startEdgeI); label secondFacei = sharedFace(surf, firstFacei, startEdgeI);
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;
// From face on border edge to edge. // From face on border edge to edge.
@ -826,7 +826,7 @@ int main(int argc, char *argv[])
// From face connected to border point (but not border edge) to point. // From face connected to border point (but not border edge) to point.
Map<label> faceToPoint(2*nBorderPoints); Map<label> faceToPoint(2*nBorderPoints);
faceToEdge.insert(firstFaceI, startEdgeI); faceToEdge.insert(firstFacei, startEdgeI);
walkSplitLine walkSplitLine
( (
@ -834,7 +834,7 @@ int main(int argc, char *argv[])
borderEdge, borderEdge,
borderPoint, borderPoint,
firstFaceI, firstFacei,
startEdgeI, startEdgeI,
startPointI, startPointI,
@ -842,7 +842,7 @@ int main(int argc, char *argv[])
faceToPoint faceToPoint
); );
faceToEdge.insert(secondFaceI, startEdgeI); faceToEdge.insert(secondFacei, startEdgeI);
walkSplitLine walkSplitLine
( (
@ -850,7 +850,7 @@ int main(int argc, char *argv[])
borderEdge, borderEdge,
borderPoint, borderPoint,
secondFaceI, secondFacei,
startEdgeI, startEdgeI,
startPointI, startPointI,

View File

@ -112,12 +112,12 @@ bool repatchFace
{ {
bool changed = false; bool changed = false;
label bFaceI = facei - mesh.nInternalFaces(); label bFacei = facei - mesh.nInternalFaces();
if (nearest[bFaceI] != -1) if (nearest[bFacei] != -1)
{ {
// Use boundary mesh one. // Use boundary mesh one.
label bMeshPatchID = bMesh.whichPatch(nearest[bFaceI]); label bMeshPatchID = bMesh.whichPatch(nearest[bFacei]);
label patchID = surfToMeshPatch[bMeshPatchID]; label patchID = surfToMeshPatch[bMeshPatchID];
@ -255,11 +255,11 @@ int main(int argc, char *argv[])
// Dump unmatched faces to faceSet for debugging. // Dump unmatched faces to faceSet for debugging.
faceSet unmatchedFaces(mesh, "unmatchedFaces", nearest.size()/100); faceSet unmatchedFaces(mesh, "unmatchedFaces", nearest.size()/100);
forAll(nearest, bFaceI) forAll(nearest, bFacei)
{ {
if (nearest[bFaceI] == -1) if (nearest[bFacei] == -1)
{ {
unmatchedFaces.insert(mesh.nInternalFaces() + bFaceI); unmatchedFaces.insert(mesh.nInternalFaces() + bFacei);
} }
} }
@ -293,9 +293,9 @@ int main(int argc, char *argv[])
} }
else else
{ {
forAll(nearest, bFaceI) forAll(nearest, bFacei)
{ {
label facei = mesh.nInternalFaces() + bFaceI; label facei = mesh.nInternalFaces() + bFacei;
if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod)) if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod))
{ {

View File

@ -51,9 +51,9 @@ Foam::treeBoundBox Foam::treeDataCell::calcCellBb(const label celli) const
const cell& cFaces = cells[celli]; const cell& cFaces = cells[celli];
forAll(cFaces, cFaceI) forAll(cFaces, cFacei)
{ {
const face& f = faces[cFaces[cFaceI]]; const face& f = faces[cFaces[cFacei]];
forAll(f, fp) forAll(f, fp)
{ {

View File

@ -97,22 +97,22 @@ void Foam::ParSortableList<Type>::checkAndSend
List<Type>& values, List<Type>& values,
labelList& indices, labelList& indices,
const label bufSize, const label bufSize,
const label destProcI const label destProci
) const ) const
{ {
if (destProcI != Pstream::myProcNo()) if (destProci != Pstream::myProcNo())
{ {
values.setSize(bufSize); values.setSize(bufSize);
indices.setSize(bufSize); indices.setSize(bufSize);
if (debug) if (debug)
{ {
Pout<< "Sending to " << destProcI << " elements:" << values Pout<< "Sending to " << destProci << " elements:" << values
<< endl; << endl;
} }
{ {
OPstream toSlave(Pstream::blocking, destProcI); OPstream toSlave(Pstream::blocking, destProci);
toSlave << values << indices; toSlave << values << indices;
} }
} }
@ -214,7 +214,7 @@ void Foam::ParSortableList<Type>::sort()
// //
label pivotI = 1; label pivotI = 1;
label destProcI = 0; label destProci = 0;
// Buffer for my own data. Keep original index together with value. // Buffer for my own data. Keep original index together with value.
labelList ownValues(sorted.size()); labelList ownValues(sorted.size());
@ -230,7 +230,7 @@ void Foam::ParSortableList<Type>::sort()
{ {
if ((pivotI < Pstream::nProcs()) && (sorted[sortedI] > pivots[pivotI])) if ((pivotI < Pstream::nProcs()) && (sorted[sortedI] > pivots[pivotI]))
{ {
checkAndSend(sendValues, sendIndices, sendI, destProcI); checkAndSend(sendValues, sendIndices, sendI, destProci);
// Reset buffer. // Reset buffer.
sendValues.setSize(sorted.size()); sendValues.setSize(sorted.size());
@ -238,10 +238,10 @@ void Foam::ParSortableList<Type>::sort()
sendI = 0; sendI = 0;
pivotI++; pivotI++;
destProcI++; destProci++;
} }
if (destProcI != Pstream::myProcNo()) if (destProci != Pstream::myProcNo())
{ {
sendValues[sendI] = sorted[sortedI]; sendValues[sendI] = sorted[sortedI];
sendIndices[sendI] = sorted.indices()[sortedI]; sendIndices[sendI] = sorted.indices()[sortedI];
@ -259,7 +259,7 @@ void Foam::ParSortableList<Type>::sort()
// Handle trailing send buffer // Handle trailing send buffer
if (sendI != 0) if (sendI != 0)
{ {
checkAndSend(sendValues, sendIndices, sendI, destProcI); checkAndSend(sendValues, sendIndices, sendI, destProci);
} }
// Print ownValues // Print ownValues
@ -283,9 +283,9 @@ void Foam::ParSortableList<Type>::sort()
label combinedI = 0; label combinedI = 0;
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
if (procI == Pstream::myProcNo()) if (proci == Pstream::myProcNo())
{ {
if (debug & 2) if (debug & 2)
{ {
@ -293,7 +293,7 @@ void Foam::ParSortableList<Type>::sort()
} }
// Copy ownValues,ownIndices into combined buffer // Copy ownValues,ownIndices into combined buffer
copyInto(ownValues, ownIndices, procI, combinedI, combinedValues); copyInto(ownValues, ownIndices, proci, combinedI, combinedValues);
} }
else else
{ {
@ -303,16 +303,16 @@ void Foam::ParSortableList<Type>::sort()
{ {
if (debug) if (debug)
{ {
Pout<< "Receiving from " << procI << endl; Pout<< "Receiving from " << proci << endl;
} }
IPstream fromSlave(Pstream::blocking, procI); IPstream fromSlave(Pstream::blocking, proci);
fromSlave >> recValues >> recIndices; fromSlave >> recValues >> recIndices;
if (debug & 2) if (debug & 2)
{ {
Pout<< "Received from " << procI Pout<< "Received from " << proci
<< " elements:" << recValues << endl; << " elements:" << recValues << endl;
} }
} }
@ -321,7 +321,7 @@ void Foam::ParSortableList<Type>::sort()
{ {
Pout<< "Copying starting at:" << combinedI << endl; Pout<< "Copying starting at:" << combinedI << endl;
} }
copyInto(recValues, recIndices, procI, combinedI, combinedValues); copyInto(recValues, recIndices, proci, combinedI, combinedValues);
} }
} }
combinedValues.setSize(combinedI); combinedValues.setSize(combinedI);

View File

@ -163,7 +163,7 @@ class ParSortableList
List<Type>& values, List<Type>& values,
labelList& indices, labelList& indices,
const label bufSize, const label bufSize,
const label destProcI const label destProci
) const; ) const;

View File

@ -62,14 +62,14 @@ Foam::PstreamBuffers::PstreamBuffers
Foam::PstreamBuffers::~PstreamBuffers() Foam::PstreamBuffers::~PstreamBuffers()
{ {
// Check that all data has been consumed. // Check that all data has been consumed.
forAll(recvBufPos_, procI) forAll(recvBufPos_, proci)
{ {
if (recvBufPos_[procI] < recvBuf_[procI].size()) if (recvBufPos_[proci] < recvBuf_[proci].size())
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Message from processor " << procI << "Message from processor " << proci
<< " not fully consumed. messageSize:" << recvBuf_[procI].size() << " not fully consumed. messageSize:" << recvBuf_[proci].size()
<< " bytes of which only " << recvBufPos_[procI] << " bytes of which only " << recvBufPos_[proci]
<< " consumed." << " consumed."
<< Foam::abort(FatalError); << Foam::abort(FatalError);
} }

View File

@ -37,24 +37,24 @@ Description
PstreamBuffers pBuffers(Pstream::nonBlocking); PstreamBuffers pBuffers(Pstream::nonBlocking);
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
someObject vals; someObject vals;
UOPstream str(procI, pBuffers); UOPstream str(proci, pBuffers);
str << vals; str << vals;
} }
} }
pBuffers.finishedSends(); // no-op for blocking pBuffers.finishedSends(); // no-op for blocking
for (label procI = 0; procI < Pstream::nProcs(); procI++) for (label proci = 0; proci < Pstream::nProcs(); proci++)
{ {
if (procI != Pstream::myProcNo()) if (proci != Pstream::myProcNo())
{ {
UIPstream str(procI, pBuffers); UIPstream str(proci, pBuffers);
someObject vals(str); someObject vals(str);
} }
} }

View File

@ -490,7 +490,7 @@ public:
static void abort(); static void abort();
//- Exchange label with all processors (in the communicator). //- Exchange label with all processors (in the communicator).
// sendData[procI] is the label to send to procI. // sendData[proci] is the label to send to proci.
// After return recvData contains the data from the other processors. // After return recvData contains the data from the other processors.
static void allToAll static void allToAll
( (

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
@ -74,11 +74,11 @@ Foam::UPstream::commsStruct::commsStruct
} }
label notI = 0; label notI = 0;
forAll(inBelow, procI) forAll(inBelow, proci)
{ {
if ((procI != myProcID) && !inBelow[procI]) if ((proci != myProcID) && !inBelow[proci])
{ {
allNotBelow_[notI++] = procI; allNotBelow_[notI++] = proci;
} }
} }
if (notI != allNotBelow_.size()) if (notI != allNotBelow_.size())

View File

@ -68,18 +68,18 @@ void Foam::Pstream::exchange
// Set up receives // Set up receives
// ~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~
forAll(recvSizes, procI) forAll(recvSizes, proci)
{ {
label nRecv = recvSizes[procI]; label nRecv = recvSizes[proci];
if (procI != Pstream::myProcNo(comm) && nRecv > 0) if (proci != Pstream::myProcNo(comm) && nRecv > 0)
{ {
recvBufs[procI].setSize(nRecv); recvBufs[proci].setSize(nRecv);
UIPstream::read UIPstream::read
( (
UPstream::nonBlocking, UPstream::nonBlocking,
procI, proci,
reinterpret_cast<char*>(recvBufs[procI].begin()), reinterpret_cast<char*>(recvBufs[proci].begin()),
nRecv*sizeof(T), nRecv*sizeof(T),
tag, tag,
comm comm
@ -91,18 +91,18 @@ void Foam::Pstream::exchange
// Set up sends // Set up sends
// ~~~~~~~~~~~~ // ~~~~~~~~~~~~
forAll(sendBufs, procI) forAll(sendBufs, proci)
{ {
if (procI != Pstream::myProcNo(comm) && sendBufs[procI].size() > 0) if (proci != Pstream::myProcNo(comm) && sendBufs[proci].size() > 0)
{ {
if if
( (
!UOPstream::write !UOPstream::write
( (
UPstream::nonBlocking, UPstream::nonBlocking,
procI, proci,
reinterpret_cast<const char*>(sendBufs[procI].begin()), reinterpret_cast<const char*>(sendBufs[proci].begin()),
sendBufs[procI].size()*sizeof(T), sendBufs[proci].size()*sizeof(T),
tag, tag,
comm comm
) )
@ -110,8 +110,8 @@ void Foam::Pstream::exchange
{ {
FatalErrorInFunction FatalErrorInFunction
<< "Cannot send outgoing message. " << "Cannot send outgoing message. "
<< "to:" << procI << " nBytes:" << "to:" << proci << " nBytes:"
<< label(sendBufs[procI].size()*sizeof(T)) << label(sendBufs[proci].size()*sizeof(T))
<< Foam::abort(FatalError); << Foam::abort(FatalError);
} }
} }
@ -150,9 +150,9 @@ void Foam::Pstream::exchangeSizes
} }
labelList sendSizes(sendBufs.size()); labelList sendSizes(sendBufs.size());
forAll(sendBufs, procI) forAll(sendBufs, proci)
{ {
sendSizes[procI] = sendBufs[procI].size(); sendSizes[proci] = sendBufs[proci].size();
} }
recvSizes.setSize(sendSizes.size()); recvSizes.setSize(sendSizes.size());
allToAll(sendSizes, recvSizes, comm); allToAll(sendSizes, recvSizes, comm);

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