Standardized cell, patch and face loop index names

This commit is contained in:
Henry Weller
2016-04-25 10:28:32 +01:00
parent 6a27f7af46
commit 8c4f6b8fcb
849 changed files with 13266 additions and 13266 deletions

View File

@ -68,7 +68,7 @@ void modifyOrAddFace
(
polyTopoChange& meshMod,
const face& f,
const label faceI,
const label facei,
const label own,
const bool flipFaceFlux,
const label newPatchI,
@ -78,7 +78,7 @@ void modifyOrAddFace
PackedBoolList& modifiedFace
)
{
if (!modifiedFace[faceI])
if (!modifiedFace[facei])
{
// First usage of face. Modify.
meshMod.setAction
@ -86,7 +86,7 @@ void modifyOrAddFace
polyModifyFace
(
f, // modified face
faceI, // label of face
facei, // label of face
own, // owner
-1, // neighbour
flipFaceFlux, // face flip
@ -96,7 +96,7 @@ void modifyOrAddFace
zoneFlip // face flip in zone
)
);
modifiedFace[faceI] = 1;
modifiedFace[facei] = 1;
}
else
{
@ -110,7 +110,7 @@ void modifyOrAddFace
-1, // neighbour
-1, // master point
-1, // master edge
faceI, // master face
facei, // master face
flipFaceFlux, // face flip
newPatchI, // patch for face
zoneID, // zone for face
@ -321,18 +321,18 @@ void createCoupledBaffles
{
const faceZoneMesh& faceZones = mesh.faceZones();
forAll(coupledWantedPatch, faceI)
forAll(coupledWantedPatch, facei)
{
if (coupledWantedPatch[faceI] != -1)
if (coupledWantedPatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
label zoneID = faceZones.whichZone(faceI);
const face& f = mesh.faces()[facei];
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Use owner side of face
@ -340,34 +340,34 @@ void createCoupledBaffles
(
meshMod,
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
false, // face flip
coupledWantedPatch[faceI], // patch for face
coupledWantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add status
);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Use neighbour side of face
modifyOrAddFace
(
meshMod,
f.reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI],// owner
facei, // label of face
mesh.faceNeighbour()[facei],// owner
false, // face flip
coupledWantedPatch[faceI], // patch for face
coupledWantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add status
@ -389,29 +389,29 @@ void createCyclicCoupledBaffles
{
const faceZoneMesh& faceZones = mesh.faceZones();
forAll(cyclicMasterPatch, faceI)
forAll(cyclicMasterPatch, facei)
{
if (cyclicMasterPatch[faceI] != -1)
if (cyclicMasterPatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
modifyOrAddFace
(
meshMod,
f.reverseFace(), // modified face
faceI, // label of face
mesh.faceNeighbour()[faceI], // owner
facei, // label of face
mesh.faceNeighbour()[facei], // owner
false, // face flip
cyclicMasterPatch[faceI], // patch for face
cyclicMasterPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add
@ -419,30 +419,30 @@ void createCyclicCoupledBaffles
}
}
forAll(cyclicSlavePatch, faceI)
forAll(cyclicSlavePatch, facei)
{
if (cyclicSlavePatch[faceI] != -1)
if (cyclicSlavePatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
if (mesh.isInternalFace(faceI))
const face& f = mesh.faces()[facei];
if (mesh.isInternalFace(facei))
{
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Use owner side of face
modifyOrAddFace
(
meshMod,
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
false, // face flip
cyclicSlavePatch[faceI], // patch for face
cyclicSlavePatch[facei], // patch for face
zoneID, // zone for face
zoneFlip, // face flip in zone
modifiedFace // modify or add status
@ -462,19 +462,19 @@ void createBaffles
{
const faceZoneMesh& faceZones = mesh.faceZones();
Info << "faceZone:createBaffle " << faceZones << endl;
forAll(wantedPatch, faceI)
forAll(wantedPatch, facei)
{
if (wantedPatch[faceI] != -1)
if (wantedPatch[facei] != -1)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -482,26 +482,26 @@ void createBaffles
polyModifyFace
(
f, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
wantedPatch[faceI], // patch for face
wantedPatch[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -509,13 +509,13 @@ void createBaffles
polyAddFace
(
f.reverseFace(), // modified face
mesh.faceNeighbour()[faceI],// owner
mesh.faceNeighbour()[facei],// owner
-1, // neighbour
-1, // masterPointID
-1, // masterEdgeID
faceI, // masterFaceID,
facei, // masterFaceID,
false, // face flip
wantedPatch[faceI], // patch for face
wantedPatch[facei], // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
)

View File

@ -299,20 +299,20 @@ void addCutNeighbours
forAllConstIter(labelHashSet, cutCells, iter)
{
const label cellI = iter.key();
const labelList& cFaces = mesh.cells()[cellI];
const label celli = iter.key();
const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
const label faceI = cFaces[i];
const label facei = cFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
label nbr = mesh.faceOwner()[faceI];
label nbr = mesh.faceOwner()[facei];
if (nbr == cellI)
if (nbr == celli)
{
nbr = mesh.faceNeighbour()[faceI];
nbr = mesh.faceNeighbour()[facei];
}
if (selectInside && inside.found(nbr))
@ -351,11 +351,11 @@ bool limitRefinementLevel
)
{
// Do simple check on validity of refinement level.
forAll(refLevel, cellI)
forAll(refLevel, celli)
{
if (!excludeCells.found(cellI))
if (!excludeCells.found(celli))
{
const labelList& cCells = mesh.cellCells()[cellI];
const labelList& cCells = mesh.cellCells()[celli];
forAll(cCells, i)
{
@ -363,13 +363,13 @@ bool limitRefinementLevel
if (!excludeCells.found(nbr))
{
if (refLevel[cellI] - refLevel[nbr] >= limitDiff)
if (refLevel[celli] - refLevel[nbr] >= limitDiff)
{
FatalErrorInFunction
<< "Level difference between neighbouring cells "
<< cellI << " and " << nbr
<< celli << " and " << nbr
<< " greater than or equal to " << limitDiff << endl
<< "refLevels:" << refLevel[cellI] << ' '
<< "refLevels:" << refLevel[celli] << ' '
<< refLevel[nbr] << abort(FatalError);
}
}
@ -382,9 +382,9 @@ bool limitRefinementLevel
forAllConstIter(labelHashSet, cutCells, iter)
{
// cellI will be refined.
const label cellI = iter.key();
const labelList& cCells = mesh.cellCells()[cellI];
// celli will be refined.
const label celli = iter.key();
const labelList& cCells = mesh.cellCells()[celli];
forAll(cCells, i)
{
@ -392,7 +392,7 @@ bool limitRefinementLevel
if (!excludeCells.found(nbr) && !cutCells.found(nbr))
{
if (refLevel[cellI] + 1 - refLevel[nbr] >= limitDiff)
if (refLevel[celli] + 1 - refLevel[nbr] >= limitDiff)
{
addCutCells.insert(nbr);
}
@ -451,9 +451,9 @@ void doRefinement
refLevel.setSize(mesh.nCells());
for (label cellI = oldCells; cellI < mesh.nCells(); cellI++)
for (label celli = oldCells; celli < mesh.nCells(); celli++)
{
refLevel[cellI] = 0;
refLevel[celli] = 0;
}
const labelListList& addedCells = multiRef.addedCells();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -46,7 +46,7 @@ defineTypeNameAndDebug(cellSplitter, 0);
void Foam::cellSplitter::getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
@ -54,12 +54,12 @@ void Foam::cellSplitter::getFaceInfo
{
patchID = -1;
if (!mesh_.isInternalFace(faceI))
if (!mesh_.isInternalFace(facei))
{
patchID = mesh_.boundaryMesh().whichPatch(faceI);
patchID = mesh_.boundaryMesh().whichPatch(facei);
}
zoneID = mesh_.faceZones().whichZone(faceI);
zoneID = mesh_.faceZones().whichZone(facei);
zoneFlip = false;
@ -67,20 +67,20 @@ void Foam::cellSplitter::getFaceInfo
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
}
// Find the new owner of faceI (since the original cell has been split into
// Find the new owner of facei (since the original cell has been split into
// newCells
Foam::label Foam::cellSplitter::newOwner
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const
{
label oldOwn = mesh_.faceOwner()[faceI];
label oldOwn = mesh_.faceOwner()[facei];
Map<labelList>::const_iterator fnd = cellToCells.find(oldOwn);
@ -97,18 +97,18 @@ Foam::label Foam::cellSplitter::newOwner
const cell& cFaces = mesh_.cells()[oldOwn];
return newCells[findIndex(cFaces, faceI)];
return newCells[findIndex(cFaces, facei)];
}
}
Foam::label Foam::cellSplitter::newNeighbour
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const
{
label oldNbr = mesh_.faceNeighbour()[faceI];
label oldNbr = mesh_.faceNeighbour()[facei];
Map<labelList>::const_iterator fnd = cellToCells.find(oldNbr);
@ -125,7 +125,7 @@ Foam::label Foam::cellSplitter::newNeighbour
const cell& cFaces = mesh_.cells()[oldNbr];
return newCells[findIndex(cFaces, faceI)];
return newCells[findIndex(cFaces, facei)];
}
}
@ -164,9 +164,9 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
label anchorPoint = mesh_.cellPoints()[cellI][0];
label anchorPoint = mesh_.cellPoints()[celli][0];
label addedPointI =
meshMod.setAction
@ -179,11 +179,11 @@ void Foam::cellSplitter::setRefinement
true // supports a cell
)
);
addedPoints_.insert(cellI, addedPointI);
addedPoints_.insert(celli, addedPointI);
//Pout<< "Added point " << addedPointI
// << iter() << " in cell " << cellI << " with centre "
// << mesh_.cellCentres()[cellI] << endl;
// << iter() << " in cell " << celli << " with centre "
// << mesh_.cellCentres()[celli] << endl;
}
@ -195,15 +195,15 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
// Cells created for this cell.
labelList newCells(cFaces.size());
// First pyramid is the original cell
newCells[0] = cellI;
newCells[0] = celli;
// Add other pyramids
for (label i = 1; i < cFaces.size(); i++)
@ -216,7 +216,7 @@ void Foam::cellSplitter::setRefinement
-1, // master point
-1, // master edge
-1, // master face
cellI, // master cell
celli, // master cell
-1 // zone
)
);
@ -224,10 +224,10 @@ void Foam::cellSplitter::setRefinement
newCells[i] = addedCellI;
}
cellToCells.insert(cellI, newCells);
cellToCells.insert(celli, newCells);
//Pout<< "Split cell " << cellI
// << " with centre " << mesh_.cellCentres()[cellI] << nl
//Pout<< "Split cell " << celli
// << " with centre " << mesh_.cellCentres()[celli] << nl
// << " faces:" << cFaces << nl
// << " into :" << newCells << endl;
}
@ -240,13 +240,13 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
label midPointI = addedPoints_[cellI];
label midPointI = addedPoints_[celli];
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
const labelList& cEdges = mesh_.cellEdges()[cellI];
const labelList& cEdges = mesh_.cellEdges()[celli];
forAll(cEdges, i)
{
@ -255,11 +255,11 @@ void Foam::cellSplitter::setRefinement
// Get the faces on the cell using the edge
label face0, face1;
meshTools::getEdgeFaces(mesh_, cellI, edgeI, face0, face1);
meshTools::getEdgeFaces(mesh_, celli, edgeI, face0, face1);
// Get the cells on both sides of the face by indexing into cFaces.
// (since newly created cells are stored in cFaces order)
const labelList& newCells = cellToCells[cellI];
const labelList& newCells = cellToCells[celli];
label cell0 = newCells[findIndex(cFaces, face0)];
label cell1 = newCells[findIndex(cFaces, face1)];
@ -267,7 +267,7 @@ void Foam::cellSplitter::setRefinement
if (cell0 < cell1)
{
// Construct face to midpoint that is pointing away from
// (pyramid split off from) cellI
// (pyramid split off from) celli
const face& f0 = mesh_.faces()[face0];
@ -275,10 +275,10 @@ void Foam::cellSplitter::setRefinement
bool edgeInFaceOrder = (f0[f0.fcIndex(index)] == e[1]);
// Check if cellI is the face owner
// Check if celli is the face owner
face newF(3);
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == cellI))
if (edgeInFaceOrder == (mesh_.faceOwner()[face0] == celli))
{
// edge used in face order.
newF[0] = e[1];
@ -313,7 +313,7 @@ void Foam::cellSplitter::setRefinement
else
{
// Construct face to midpoint that is pointing away from
// (pyramid split off from) cellI
// (pyramid split off from) celli
const face& f1 = mesh_.faces()[face1];
@ -321,10 +321,10 @@ void Foam::cellSplitter::setRefinement
bool edgeInFaceOrder = (f1[f1.fcIndex(index)] == e[1]);
// Check if cellI is the face owner
// Check if celli is the face owner
face newF(3);
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == cellI))
if (edgeInFaceOrder == (mesh_.faceOwner()[face1] == celli))
{
// edge used in face order.
newF[0] = e[1];
@ -370,28 +370,28 @@ void Foam::cellSplitter::setRefinement
forAllConstIter(Map<point>, cellToMidPoint, iter)
{
label cellI = iter.key();
label celli = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
faceUpToDate[faceI] = false;
faceUpToDate[facei] = false;
}
}
forAll(faceUpToDate, faceI)
forAll(faceUpToDate, facei)
{
if (!faceUpToDate[faceI])
if (!faceUpToDate[facei])
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
label newOwn = newOwner(faceI, cellToCells);
label newNbr = newNeighbour(faceI, cellToCells);
label newOwn = newOwner(facei, cellToCells);
label newNbr = newNeighbour(facei, cellToCells);
if (newOwn < newNbr)
{
@ -400,7 +400,7 @@ void Foam::cellSplitter::setRefinement
polyModifyFace
(
f,
faceI,
facei,
newOwn, // owner
newNbr, // neighbour
false, // flux flip
@ -418,7 +418,7 @@ void Foam::cellSplitter::setRefinement
polyModifyFace
(
f.reverseFace(),
faceI,
facei,
newNbr, // owner
newOwn, // neighbour
false, // flux flip
@ -433,17 +433,17 @@ void Foam::cellSplitter::setRefinement
}
else
{
label newOwn = newOwner(faceI, cellToCells);
label newOwn = newOwner(facei, cellToCells);
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
meshMod.setAction
(
polyModifyFace
(
mesh_.faces()[faceI],
faceI,
mesh_.faces()[facei],
facei,
newOwn, // owner
-1, // neighbour
false, // flux flip
@ -455,7 +455,7 @@ void Foam::cellSplitter::setRefinement
);
}
faceUpToDate[faceI] = true;
faceUpToDate[facei] = true;
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -71,7 +71,7 @@ class cellSplitter
//- Get patch and zone info for face
void getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
@ -80,14 +80,14 @@ class cellSplitter
//- Find the new owner (if any) of the face.
label newOwner
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const;
//- Find the new neighbour (if any) of the face.
label newNeighbour
(
const label faceI,
const label facei,
const Map<labelList>& cellToCells
) const;

View File

@ -279,13 +279,13 @@ label findFace
// Find cell with cell centre close to given point.
label findCell(const primitiveMesh& mesh, const point& nearPoint)
{
label cellI = mesh.findCell(nearPoint);
label celli = mesh.findCell(nearPoint);
if (cellI != -1)
if (celli != -1)
{
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[cellI]);
scalar distToCcSqr = magSqr(nearPoint - mesh.cellCentres()[celli]);
const labelList& cPoints = mesh.cellPoints()[cellI];
const labelList& cPoints = mesh.cellPoints()[celli];
label minI = -1;
scalar minDistSqr = GREAT;
@ -305,9 +305,9 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
// Decide if nearPoint unique enough.
Info<< "Found to point " << nearPoint << nl
<< " nearest cell : " << cellI
<< " nearest cell : " << celli
<< " distance " << Foam::sqrt(distToCcSqr)
<< " to cell centre " << mesh.cellCentres()[cellI] << nl
<< " to cell centre " << mesh.cellCentres()[celli] << nl
<< " nearest mesh point : " << minI
<< " distance " << Foam::sqrt(minDistSqr)
<< " to " << mesh.points()[minI] << nl
@ -318,11 +318,11 @@ label findCell(const primitiveMesh& mesh, const point& nearPoint)
Info<< "Mesh point too close to nearest cell centre. Aborting"
<< endl;
cellI = -1;
celli = -1;
}
}
return cellI;
return celli;
}
@ -470,11 +470,11 @@ int main(int argc, char *argv[])
{
const Pair<point>& pts = facesToTriangulate[i];
label faceI = findFace(mesh, allBoundary, pts.first());
label facei = findFace(mesh, allBoundary, pts.first());
if (faceI == -1 || !faceToDecompose.insert(faceI, pts.second()))
if (facei == -1 || !faceToDecompose.insert(facei, pts.second()))
{
Info<< "Could not insert mesh face " << faceI
Info<< "Could not insert mesh face " << facei
<< " for input point " << pts.first() << nl
<< "Perhaps the face is already marked for splitting?" << endl;
@ -491,11 +491,11 @@ int main(int argc, char *argv[])
{
const Pair<point>& pts = cellsToPyramidise[i];
label cellI = findCell(mesh, pts.first());
label celli = findCell(mesh, pts.first());
if (cellI == -1 || !cellToPyrCentre.insert(cellI, pts.second()))
if (celli == -1 || !cellToPyrCentre.insert(celli, pts.second()))
{
Info<< "Could not insert mesh cell " << cellI
Info<< "Could not insert mesh cell " << celli
<< " for input point " << pts.first() << nl
<< "Perhaps the cell is already marked for splitting?" << endl;

View File

@ -64,17 +64,17 @@ bool limitRefinementLevel
label oldNCells = refCells.size();
forAll(cellCells, cellI)
forAll(cellCells, celli)
{
const labelList& cCells = cellCells[cellI];
const labelList& cCells = cellCells[celli];
forAll(cCells, i)
{
if (refLevel[cCells[i]] > (refLevel[cellI]+1))
if (refLevel[cCells[i]] > (refLevel[celli]+1))
{
// Found neighbour with >=2 difference in refLevel.
refCells.insert(cellI);
refLevel[cellI]++;
refCells.insert(celli);
refLevel[celli]++;
break;
}
}
@ -308,11 +308,11 @@ int main(int argc, char *argv[])
Info<< "Setting field for patch "<< endl;
forAll(bField, faceI)
forAll(bField, facei)
{
label own = mesh.faceOwner()[pp.start() + faceI];
label own = mesh.faceOwner()[pp.start() + facei];
bField[faceI] = postRefLevel[own];
bField[facei] = postRefLevel[own];
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -135,41 +135,41 @@ void cutBySurface
// Is a bit of a hack but allows us to reuse all the functionality
// in cellClassification.
forAll(cellType, cellI)
forAll(cellType, celli)
{
label cType = cellType[cellI];
label cType = cellType[celli];
if (cType == cellClassification::CUT)
{
if (selectCut)
{
cellType[cellI] = MESH;
cellType[celli] = MESH;
}
else
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
}
}
else if (cType == cellClassification::INSIDE)
{
if (selectInside)
{
cellType[cellI] = MESH;
cellType[celli] = MESH;
}
else
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
}
}
else if (cType == cellClassification::OUTSIDE)
{
if (selectOutside)
{
cellType[cellI] = MESH;
cellType[celli] = MESH;
}
else
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
}
}
else
@ -269,27 +269,27 @@ label selectOutsideCells
forAll(outsidePts, outsidePtI)
{
// Find cell containing point. Linear search.
label cellI = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
label celli = queryMesh.findCell(outsidePts[outsidePtI], -1, false);
if (cellI != -1 && cellType[cellI] == MESH)
if (celli != -1 && cellType[celli] == MESH)
{
Info<< "Marking cell " << cellI << " containing outside point "
<< outsidePts[outsidePtI] << " with type " << cellType[cellI]
Info<< "Marking cell " << celli << " containing outside point "
<< outsidePts[outsidePtI] << " with type " << cellType[celli]
<< " ..." << endl;
//
// Mark this cell and its faces to start walking from
//
// Mark faces of cellI
const labelList& cFaces = mesh.cells()[cellI];
// Mark faces of celli
const labelList& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (outsideFacesMap.insert(faceI))
if (outsideFacesMap.insert(facei))
{
outsideFaces.append(faceI);
outsideFaces.append(facei);
outsideFacesInfo.append(meshInfo);
}
}
@ -311,15 +311,15 @@ label selectOutsideCells
label nChanged = 0;
forAll(allCellInfo, cellI)
forAll(allCellInfo, celli)
{
if (cellType[cellI] == MESH)
if (cellType[celli] == MESH)
{
// Original cell was selected for meshing. Check if cell was
// reached from outsidePoints
if (allCellInfo[cellI].type() != MESH)
if (allCellInfo[celli].type() != MESH)
{
cellType[cellI] = NONMESH;
cellType[celli] = NONMESH;
nChanged++;
}
}
@ -390,8 +390,8 @@ int main(int argc, char *argv[])
{
const point& outsidePoint = outsidePts[outsideI];
label cellI = queryMesh.findCell(outsidePoint, -1, false);
if (returnReduce(cellI, maxOp<label>()) == -1)
label celli = queryMesh.findCell(outsidePoint, -1, false);
if (returnReduce(celli, maxOp<label>()) == -1)
{
FatalErrorInFunction
<< "outsidePoint " << outsidePoint
@ -428,7 +428,7 @@ int main(int argc, char *argv[])
// Search engine on surface.
querySurf.reset(new triSurfaceSearch(surf));
// Set cellType[cellI] according to relation to surface
// Set cellType[celli] according to relation to surface
cutBySurface
(
mesh,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,14 +100,14 @@ scalarField pack(const boolList& lst, const scalarField& elems)
// Given sin and cos of max angle between normals calculate whether f0 and f1
// on cellI make larger angle. Uses sinAngle only for quadrant detection.
// on celli make larger angle. Uses sinAngle only for quadrant detection.
bool largerAngle
(
const primitiveMesh& mesh,
const scalar cosAngle,
const scalar sinAngle,
const label cellI,
const label celli,
const label f0, // face label
const label f1,
@ -117,7 +117,7 @@ bool largerAngle
{
const labelList& own = mesh.faceOwner();
bool sameFaceOrder = !((own[f0] == cellI) ^ (own[f1] == cellI));
bool sameFaceOrder = !((own[f0] == celli) ^ (own[f1] == celli));
// Get cos between faceArea vectors. Correct so flat angle (180 degrees)
// gives -1.
@ -137,7 +137,7 @@ bool largerAngle
scalar fcCosAngle = n0 & c1c0;
if (own[f0] != cellI)
if (own[f0] != celli)
{
fcCosAngle = -fcCosAngle;
}
@ -190,7 +190,7 @@ bool largerAngle
bool splitHex
(
const polyMesh& mesh,
const label cellI,
const label celli,
const label edgeI,
DynamicList<label>& cutCells,
@ -214,13 +214,13 @@ bool splitHex
label leftFp = -1;
label rightFp = -1;
const cell& cFaces = mesh.cells()[cellI];
const cell& cFaces = mesh.cells()[celli];
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
const face& f = faces[faceI];
const face& f = faces[facei];
label fp0 = findIndex(f, e[0]);
label fp1 = findIndex(f, e[1]);
@ -230,7 +230,7 @@ bool splitHex
if (fp1 != -1)
{
// Face uses e[1] but not e[0]
rightI = faceI;
rightI = facei;
rightFp = fp1;
if (leftI != -1)
@ -248,7 +248,7 @@ bool splitHex
}
else
{
leftI = faceI;
leftI = facei;
leftFp = fp0;
if (rightI != -1)
@ -287,7 +287,7 @@ bool splitHex
loopWeights[2] = -GREAT;
loopWeights[3] = -GREAT;
cutCells.append(cellI);
cutCells.append(celli);
cellLoops.append(loop);
cellEdgeWeights.append(loopWeights);
@ -295,13 +295,13 @@ bool splitHex
}
// Split cellI along edgeI with a plane along halfNorm direction.
// Split celli along edgeI with a plane along halfNorm direction.
bool splitCell
(
const polyMesh& mesh,
const geomCellLooper& cellCutter,
const label cellI,
const label celli,
const label edgeI,
const vector& halfNorm,
@ -339,7 +339,7 @@ bool splitCell
cellCutter.cut
(
cutPlane,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,
@ -349,7 +349,7 @@ bool splitCell
)
{
// Did manage to cut cell. Copy into overall list.
cutCells.append(cellI);
cutCells.append(celli);
cellLoops.append(loop);
cellEdgeWeights.append(loopWeights);
@ -397,15 +397,15 @@ void collectCuts
forAllConstIter(cellSet, cellsToCut, iter)
{
const label cellI = iter.key();
const labelList& cEdges = cellEdges[cellI];
const label celli = iter.key();
const labelList& cEdges = cellEdges[celli];
forAll(cEdges, i)
{
label edgeI = cEdges[i];
label f0, f1;
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0, f1);
meshTools::getEdgeFaces(mesh, celli, edgeI, f0, f1);
vector n0 = faceAreas[f0];
n0 /= mag(n0);
@ -421,7 +421,7 @@ void collectCuts
minCos,
minSin,
cellI,
celli,
f0,
f1,
n0,
@ -431,13 +431,13 @@ void collectCuts
{
bool splitOk = false;
if (!geometry && cellShapes[cellI].model() == hex)
if (!geometry && cellShapes[celli].model() == hex)
{
splitOk =
splitHex
(
mesh,
cellI,
celli,
edgeI,
cutCells,
@ -449,7 +449,7 @@ void collectCuts
{
vector halfNorm;
if ((own[f0] == cellI) ^ (own[f1] == cellI))
if ((own[f0] == celli) ^ (own[f1] == celli))
{
// Opposite owner orientation
halfNorm = 0.5*(n0 - n1);
@ -466,7 +466,7 @@ void collectCuts
(
mesh,
cellCutter,
cellI,
celli,
edgeI,
halfNorm,
@ -603,9 +603,9 @@ int main(int argc, char *argv[])
if (!readSet)
{
// Try all cells for cutting
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
for (label celli = 0; celli < mesh.nCells(); celli++)
{
cellsToCut.insert(cellI);
cellsToCut.insert(celli);
}
}
@ -658,13 +658,13 @@ int main(int argc, char *argv[])
}
// Remove cut cells from cellsToCut (Note:only relevant if -readSet)
forAll(cuts.cellLoops(), cellI)
forAll(cuts.cellLoops(), celli)
{
if (cuts.cellLoops()[cellI].size())
if (cuts.cellLoops()[celli].size())
{
//Info<< "Removing cut cell " << cellI << " from wishlist"
//Info<< "Removing cut cell " << celli << " from wishlist"
// << endl;
cellsToCut.erase(cellI);
cellsToCut.erase(celli);
}
}