Standardized cell, patch and face loop index names

This commit is contained in:
Henry Weller
2016-04-25 10:28:32 +01:00
parent 2d5ff31649
commit 43beb06018
849 changed files with 13266 additions and 13266 deletions

View File

@ -250,11 +250,11 @@ void subsetSurfaceFields
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
{
DynamicList<label> nonRegionCells(cellRegion.size());
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (cellRegion[cellI] != regionI)
if (cellRegion[celli] != regionI)
{
nonRegionCells.append(cellI);
nonRegionCells.append(celli);
}
}
return nonRegionCells.shrink();
@ -329,17 +329,17 @@ void getInterfaceSizes
// Internal faces
// ~~~~~~~~~~~~~~
forAll(mesh.faceNeighbour(), faceI)
forAll(mesh.faceNeighbour(), facei)
{
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
if (ownRegion != neiRegion)
{
addToInterface
(
mesh,
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
ownRegion,
neiRegion,
regionsToSize
@ -355,15 +355,15 @@ void getInterfaceSizes
forAll(coupledRegion, i)
{
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[cellI];
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[celli];
}
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
forAll(coupledRegion, i)
{
label faceI = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label facei = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = coupledRegion[i];
if (ownRegion != neiRegion)
@ -371,7 +371,7 @@ void getInterfaceSizes
addToInterface
(
mesh,
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
ownRegion,
neiRegion,
regionsToSize
@ -519,17 +519,17 @@ void getInterfaceSizes
// Mark all inter-region faces.
faceToInterface.setSize(mesh.nFaces(), -1);
forAll(mesh.faceNeighbour(), faceI)
forAll(mesh.faceNeighbour(), facei)
{
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
if (ownRegion != neiRegion)
{
label zoneID = -1;
if (useFaceZones)
{
zoneID = mesh.faceZones().whichZone(faceI);
zoneID = mesh.faceZones().whichZone(facei);
}
edge interface
@ -538,13 +538,13 @@ void getInterfaceSizes
max(ownRegion, neiRegion)
);
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
faceToInterface[facei] = regionsToInterface[interface][zoneID];
}
}
forAll(coupledRegion, i)
{
label faceI = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label facei = i+mesh.nInternalFaces();
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = coupledRegion[i];
if (ownRegion != neiRegion)
@ -552,7 +552,7 @@ void getInterfaceSizes
label zoneID = -1;
if (useFaceZones)
{
zoneID = mesh.faceZones().whichZone(faceI);
zoneID = mesh.faceZones().whichZone(facei);
}
edge interface
@ -561,7 +561,7 @@ void getInterfaceSizes
max(ownRegion, neiRegion)
);
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
faceToInterface[facei] = regionsToInterface[interface][zoneID];
}
}
}
@ -639,8 +639,8 @@ autoPtr<mapPolyMesh> createRegionMesh
forAll(coupledRegion, i)
{
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[cellI];
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
coupledRegion[i] = cellRegion[celli];
}
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
@ -662,19 +662,19 @@ autoPtr<mapPolyMesh> createRegionMesh
labelList exposedPatchIDs(exposedFaces.size());
forAll(exposedFaces, i)
{
label faceI = exposedFaces[i];
label interfaceI = faceToInterface[faceI];
label facei = exposedFaces[i];
label interfacei = faceToInterface[facei];
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
label neiRegion = -1;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
}
else
{
neiRegion = coupledRegion[faceI-mesh.nInternalFaces()];
neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
}
@ -694,8 +694,8 @@ autoPtr<mapPolyMesh> createRegionMesh
else
{
FatalErrorInFunction
<< "Exposed face:" << faceI
<< " fc:" << mesh.faceCentres()[faceI]
<< "Exposed face:" << facei
<< " fc:" << mesh.faceCentres()[facei]
<< " has owner region " << ownRegion
<< " and neighbour region " << neiRegion
<< " when handling region:" << regionI
@ -705,11 +705,11 @@ autoPtr<mapPolyMesh> createRegionMesh
// Find the patch.
if (regionI < otherRegion)
{
exposedPatchIDs[i] = interfacePatches[interfaceI];
exposedPatchIDs[i] = interfacePatches[interfacei];
}
else
{
exposedPatchIDs[i] = interfacePatches[interfaceI]+1;
exposedPatchIDs[i] = interfacePatches[interfacei]+1;
}
}
@ -770,10 +770,10 @@ void createAndWriteRegion
// Make map of all added patches
labelHashSet addedPatches(2*interfacePatches.size());
forAll(interfacePatches, interfaceI)
forAll(interfacePatches, interfacei)
{
addedPatches.insert(interfacePatches[interfaceI]);
addedPatches.insert(interfacePatches[interfaceI]+1);
addedPatches.insert(interfacePatches[interfacei]);
addedPatches.insert(interfacePatches[interfacei]+1);
}
@ -968,23 +968,23 @@ void createAndWriteRegion
),
newMesh().nFaces()
);
forAll(faceProcAddressing, faceI)
forAll(faceProcAddressing, facei)
{
// face + turning index. (see decomposePar)
// Is the face pointing in the same direction?
label oldFaceI = map().faceMap()[faceI];
label oldFaceI = map().faceMap()[facei];
if
(
map().cellMap()[newMesh().faceOwner()[faceI]]
map().cellMap()[newMesh().faceOwner()[facei]]
== mesh.faceOwner()[oldFaceI]
)
{
faceProcAddressing[faceI] = oldFaceI+1;
faceProcAddressing[facei] = oldFaceI+1;
}
else
{
faceProcAddressing[faceI] = -(oldFaceI+1);
faceProcAddressing[facei] = -(oldFaceI+1);
}
}
Info<< "Writing map " << faceProcAddressing.name()
@ -1138,11 +1138,11 @@ label findCorrespondingRegion
// Per region the number of cells in zoneI
labelList cellsInZone(nCellRegions, 0);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (existingZoneID[cellI] == zoneI)
if (existingZoneID[celli] == zoneI)
{
cellsInZone[cellRegion[cellI]]++;
cellsInZone[cellRegion[celli]]++;
}
}
@ -1161,11 +1161,11 @@ label findCorrespondingRegion
else
{
// Check that region contains no cells that aren't in cellZone.
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
if (cellRegion[cellI] == regionI && existingZoneID[cellI] != zoneI)
if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
{
// cellI in regionI but not in zoneI
// celli in regionI but not in zoneI
regionI = -1;
break;
}
@ -1200,18 +1200,18 @@ void getZoneID
forAll(cz, i)
{
label cellI = cz[i];
if (zoneID[cellI] == -1)
label celli = cz[i];
if (zoneID[celli] == -1)
{
zoneID[cellI] = zoneI;
zoneID[celli] = zoneI;
}
else
{
FatalErrorInFunction
<< "Cell " << cellI << " with cell centre "
<< mesh.cellCentres()[cellI]
<< "Cell " << celli << " with cell centre "
<< mesh.cellCentres()[celli]
<< " is multiple zones. This is not allowed." << endl
<< "It is in zone " << cellZones[zoneID[cellI]].name()
<< "It is in zone " << cellZones[zoneID[celli]].name()
<< " and in zone " << cellZones[zoneI].name()
<< exit(FatalError);
}
@ -1386,9 +1386,9 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
dimensionedScalar("zero", dimless, 0),
zeroGradientFvPatchScalarField::typeName
);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
cellToRegion[cellI] = cellRegion[cellI];
cellToRegion[celli] = cellRegion[celli];
}
cellToRegion.write();
@ -1662,25 +1662,25 @@ int main(int argc, char *argv[])
{
blockedFace.setSize(mesh.nFaces(), false);
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
{
label own = mesh.faceOwner()[faceI];
label nei = mesh.faceNeighbour()[faceI];
label own = mesh.faceOwner()[facei];
label nei = mesh.faceNeighbour()[facei];
if (zoneID[own] != zoneID[nei])
{
blockedFace[faceI] = true;
blockedFace[facei] = true;
}
}
// Different cellZones on either side of processor patch.
forAll(neiZoneID, i)
{
label faceI = i+mesh.nInternalFaces();
label facei = i+mesh.nInternalFaces();
if (zoneID[mesh.faceOwner()[faceI]] != neiZoneID[i])
if (zoneID[mesh.faceOwner()[facei]] != neiZoneID[i])
{
blockedFace[faceI] = true;
blockedFace[facei] = true;
}
}
}
@ -1740,9 +1740,9 @@ int main(int argc, char *argv[])
labelList regionSizes(nCellRegions, 0);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
regionSizes[cellRegion[cellI]]++;
regionSizes[cellRegion[celli]]++;
}
forAll(regionSizes, regionI)
{
@ -1992,14 +1992,14 @@ int main(int argc, char *argv[])
(void)mesh.tetBasePtIs();
label cellI = mesh.findCell(insidePoint);
label celli = mesh.findCell(insidePoint);
Info<< nl << "Found point " << insidePoint << " in cell " << cellI
Info<< nl << "Found point " << insidePoint << " in cell " << celli
<< endl;
if (cellI != -1)
if (celli != -1)
{
regionI = cellRegion[cellI];
regionI = cellRegion[celli];
}
reduce(regionI, maxOp<label>());