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

@ -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
@ -107,11 +107,11 @@ void Foam::attachDetach::checkDefinition()
DynamicList<label> bouFacesInZone(addr.size());
forAll(addr, faceI)
forAll(addr, facei)
{
if (!mesh.isInternalFace(addr[faceI]))
if (!mesh.isInternalFace(addr[facei]))
{
bouFacesInZone.append(addr[faceI]);
bouFacesInZone.append(addr[facei]);
}
}
@ -171,10 +171,10 @@ void Foam::attachDetach::checkDefinition()
DynamicList<label> zoneProblemFaces(addr.size());
forAll(addr, faceI)
forAll(addr, facei)
{
label facePatch =
mesh.boundaryMesh().whichPatch(addr[faceI]);
mesh.boundaryMesh().whichPatch(addr[facei]);
if
(
@ -182,7 +182,7 @@ void Foam::attachDetach::checkDefinition()
&& facePatch != slavePatchID_.index()
)
{
zoneProblemFaces.append(addr[faceI]);
zoneProblemFaces.append(addr[facei]);
}
}

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
@ -74,10 +74,10 @@ void Foam::attachDetach::calcPointMatchMap() const
const label slavePatchStart = slavePatch.start();
forAll(reverseSlavePatch, faceI)
forAll(reverseSlavePatch, facei)
{
reverseSlavePatch[faceI] =
faces[slavePatchStart + faceI].reverseFace();
reverseSlavePatch[facei] =
faces[slavePatchStart + facei].reverseFace();
}
// Create point merge list and remove merged points
@ -90,10 +90,10 @@ void Foam::attachDetach::calcPointMatchMap() const
pointMatchMapPtr_ = new Map<label>(2*slaveMeshPoints.size());
Map<label>& removedPointMap = *pointMatchMapPtr_;
forAll(masterLocalFaces, faceI)
forAll(masterLocalFaces, facei)
{
const face& curMasterPoints = masterLocalFaces[faceI];
const face& curSlavePoints = slaveLocalFaces[faceI];
const face& curMasterPoints = masterLocalFaces[facei];
const face& curSlavePoints = slaveLocalFaces[facei];
forAll(curMasterPoints, pointI)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -112,25 +112,25 @@ void Foam::attachDetach::attachInterface
const boolList& mfFlip = mesh.faceZones()[faceZoneID_.index()].flipMap();
forAll(masterFaceCells, faceI)
forAll(masterFaceCells, facei)
{
// If slave neighbour is greater than master, face does not need
// turning. Modify it to become internal
if (masterFaceCells[faceI] < slaveFaceCells[faceI])
if (masterFaceCells[facei] < slaveFaceCells[facei])
{
ref.setAction
(
polyModifyFace
(
faces[masterPatchStart + faceI], // modified face
masterPatchStart + faceI, // label of face being modified
masterFaceCells[faceI], // owner
slaveFaceCells[faceI], // neighbour
faces[masterPatchStart + facei], // modified face
masterPatchStart + facei, // label of face being modified
masterFaceCells[facei], // owner
slaveFaceCells[facei], // neighbour
false, // face flip
-1, // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
mfFlip[faceI] // face flip in zone
mfFlip[facei] // face flip in zone
)
);
}
@ -141,15 +141,15 @@ void Foam::attachDetach::attachInterface
(
polyModifyFace
(
faces[masterPatchStart + faceI].reverseFace(), // mod face
masterPatchStart + faceI, // label of face being modified
slaveFaceCells[faceI], // owner
masterFaceCells[faceI], // neighbour
faces[masterPatchStart + facei].reverseFace(), // mod face
masterPatchStart + facei, // label of face being modified
slaveFaceCells[facei], // owner
masterFaceCells[facei], // neighbour
true, // face flip
-1, // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
!mfFlip[faceI] // face flip in zone
!mfFlip[facei] // face flip in zone
)
);
}
@ -171,11 +171,11 @@ void Foam::attachDetach::attachInterface
{
const labelList& curFaces = pf[slaveMeshPoints[pointI]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
if (!ref.faceRemoved(curFaces[faceI]))
if (!ref.faceRemoved(curFaces[facei]))
{
facesToModifyMap.insert(curFaces[faceI]);
facesToModifyMap.insert(curFaces[facei]);
}
}
}
@ -183,12 +183,12 @@ void Foam::attachDetach::attachInterface
// Grab the faces to be renumbered
const labelList ftm = facesToModifyMap.toc();
forAll(ftm, faceI)
forAll(ftm, facei)
{
// For every face to modify, copy the face and re-map the vertices.
// It is known all the faces will be changed since they hang off
// re-mapped vertices
label curFaceID = ftm[faceI];
label curFaceID = ftm[facei];
face newFace(faces[curFaceID]);

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
@ -124,9 +124,9 @@ void Foam::attachDetach::detachInterface
bool edgeIsInternal = true;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
if (!mesh.isInternalFace(curFaces[faceI]))
if (!mesh.isInternalFace(curFaces[facei]))
{
// The edge belongs to a boundary face
edgeIsInternal = false;
@ -178,12 +178,12 @@ void Foam::attachDetach::detachInterface
const labelList& own = mesh.faceOwner();
const labelList& nei = mesh.faceNeighbour();
forAll(mf, faceI)
forAll(mf, facei)
{
const label curFaceID = mf[faceI];
const label curFaceID = mf[facei];
// Build the face for the slave patch by renumbering
const face oldFace = zoneFaces[faceI].reverseFace();
const face oldFace = zoneFaces[facei].reverseFace();
face newFace(oldFace.size());
@ -192,7 +192,7 @@ void Foam::attachDetach::detachInterface
newFace[pointI] = addedPoints[oldFace[pointI]];
}
if (mfFlip[faceI])
if (mfFlip[facei])
{
// Face needs to be flipped for the master patch
ref.setAction
@ -207,7 +207,7 @@ void Foam::attachDetach::detachInterface
masterPatchID_.index(), // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
!mfFlip[faceI] // face flip in zone
!mfFlip[facei] // face flip in zone
)
);
@ -254,7 +254,7 @@ void Foam::attachDetach::detachInterface
masterPatchID_.index(), // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
mfFlip[faceI] // face flip in zone
mfFlip[facei] // face flip in zone
)
);
@ -310,16 +310,16 @@ void Foam::attachDetach::detachInterface
const cellList& cells = mesh.cells();
forAll(mc, cellI)
forAll(mc, celli)
{
const labelList& curFaces = cells[mc[cellI]];
const labelList& curFaces = cells[mc[celli]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Check if the face belongs to the master patch; if not add it
if (zoneMesh.whichZone(curFaces[faceI]) != faceZoneID_.index())
if (zoneMesh.whichZone(curFaces[facei]) != faceZoneID_.index())
{
masterCellFaceMap.insert(curFaces[faceI]);
masterCellFaceMap.insert(curFaces[facei]);
}
}
}
@ -350,9 +350,9 @@ void Foam::attachDetach::detachInterface
// Cell not found. Add its faces to the map
const cell& curFaces = cells[ownCell];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
masterCellFaceMap.insert(curFaces[faceI]);
masterCellFaceMap.insert(curFaces[facei]);
}
}
@ -366,9 +366,9 @@ void Foam::attachDetach::detachInterface
// Cell not found. Add its faces to the map
const cell& curFaces = cells[neiCell];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
masterCellFaceMap.insert(curFaces[faceI]);
masterCellFaceMap.insert(curFaces[facei]);
}
}
}
@ -390,12 +390,12 @@ void Foam::attachDetach::detachInterface
// Grab the list of faces of the master layer
const labelList masterCellFaces = masterCellFaceMap.toc();
forAll(masterCellFaces, faceI)
forAll(masterCellFaces, facei)
{
// Attempt to renumber the face using the masterLayerPointMap.
// Missing point remain the same
const label curFaceID = masterCellFaces[faceI];
const label curFaceID = masterCellFaces[facei];
const face& oldFace = faces[curFaceID];

View File

@ -256,11 +256,11 @@ Foam::label Foam::boundaryMesh::findPatchID
const word& patchName
) const
{
forAll(patches, patchI)
forAll(patches, patchi)
{
if (patches[patchI].name() == patchName)
if (patches[patchi].name() == patchName)
{
return patchI;
return patchi;
}
}
@ -272,9 +272,9 @@ Foam::wordList Foam::boundaryMesh::patchNames() const
{
wordList names(patches_.size());
forAll(patches_, patchI)
forAll(patches_, patchi)
{
names[patchI] = patches_[patchI].name();
names[patchi] = patches_[patchi].name();
}
return names;
}
@ -283,16 +283,16 @@ Foam::wordList Foam::boundaryMesh::patchNames() const
Foam::label Foam::boundaryMesh::whichPatch
(
const polyPatchList& patches,
const label faceI
const label facei
) const
{
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if ((faceI >= pp.start()) && (faceI < (pp.start() + pp.size())))
if ((facei >= pp.start()) && (facei < (pp.start() + pp.size())))
{
return patchI;
return patchi;
}
}
return -1;
@ -314,9 +314,9 @@ Foam::labelList Foam::boundaryMesh::faceToEdge
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
label facei = changedFaces[i];
const labelList& fEdges = mesh().faceEdges()[faceI];
const labelList& fEdges = mesh().faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
@ -356,13 +356,13 @@ Foam::labelList Foam::boundaryMesh::edgeToFace
forAll(eFaces, eFaceI)
{
label faceI = eFaces[eFaceI];
label facei = eFaces[eFaceI];
if (faceRegion[faceI] == -1)
if (faceRegion[facei] == -1)
{
faceRegion[faceI] = region;
faceRegion[facei] = region;
changedFaces[changedI++] = faceI;
changedFaces[changedI++] = facei;
}
}
}
@ -373,19 +373,19 @@ Foam::labelList Foam::boundaryMesh::edgeToFace
}
// Finds area, starting at faceI, delimited by borderEdge
// Finds area, starting at facei, delimited by borderEdge
void Foam::boundaryMesh::markZone
(
const boolList& borderEdge,
label faceI,
label facei,
label currentZone,
labelList& faceZone
) const
{
faceZone[faceI] = currentZone;
faceZone[facei] = currentZone;
// List of faces whose faceZone has been set.
labelList changedFaces(1, faceI);
labelList changedFaces(1, facei);
// List of edges whose faceZone has been set.
labelList changedEdges;
@ -485,17 +485,17 @@ void Foam::boundaryMesh::read(const polyMesh& mesh)
label bFaceI = 0;
// Collect all boundary faces.
forAll(mesh.boundaryMesh(), patchI)
forAll(mesh.boundaryMesh(), patchi)
{
const polyPatch& pp = mesh.boundaryMesh()[patchI];
const polyPatch& pp = mesh.boundaryMesh()[patchi];
patches_.set
(
patchI,
patchi,
new boundaryPatch
(
pp.name(),
patchI,
patchi,
pp.size(),
bFaceI,
pp.type()
@ -518,9 +518,9 @@ void Foam::boundaryMesh::read(const polyMesh& mesh)
{
Pout<< "read : patches now:" << endl;
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
Pout<< " name : " << bp.name() << endl
<< " size : " << bp.size() << endl
@ -553,9 +553,9 @@ void Foam::boundaryMesh::read(const polyMesh& mesh)
Pout<< "** Start of Faces **" << endl;
forAll(msh, faceI)
forAll(msh, facei)
{
const face& f = msh[faceI];
const face& f = msh[facei];
point ctr(Zero);
@ -565,7 +565,7 @@ void Foam::boundaryMesh::read(const polyMesh& mesh)
}
ctr /= f.size();
Pout<< " " << faceI
Pout<< " " << facei
<< " ctr:" << ctr
<< " verts:" << f
<< endl;
@ -646,17 +646,17 @@ void Foam::boundaryMesh::readTriSurface(const fileName& fName)
patches_.setSize(surfPatches.size());
// Take over patches, setting size to 0 for now.
forAll(surfPatches, patchI)
forAll(surfPatches, patchi)
{
const geometricSurfacePatch& surfPatch = surfPatches[patchI];
const geometricSurfacePatch& surfPatch = surfPatches[patchi];
patches_.set
(
patchI,
patchi,
new boundaryPatch
(
surfPatch.name(),
patchI,
patchi,
0,
0,
surfPatch.geometricType()
@ -670,15 +670,15 @@ void Foam::boundaryMesh::readTriSurface(const fileName& fName)
patches_.setSize(regionToBoundaryPatch.size());
forAll(patches_, patchI)
forAll(patches_, patchi)
{
patches_.set
(
patchI,
patchi,
new boundaryPatch
(
"patch" + name(patchI),
patchI,
"patch" + name(patchi),
patchi,
0,
0,
"empty"
@ -772,16 +772,16 @@ void Foam::boundaryMesh::writeTriSurface(const fileName& fName) const
{
geometricSurfacePatchList surfPatches(patches_.size());
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
surfPatches[patchI] =
surfPatches[patchi] =
geometricSurfacePatch
(
bp.physicalType(),
bp.name(),
patchI
patchi
);
}
@ -799,11 +799,11 @@ void Foam::boundaryMesh::writeTriSurface(const fileName& fName) const
label triI = 0;
forAll(mesh(), faceI)
forAll(mesh(), facei)
{
startTri[faceI] = triI;
startTri[facei] = triI;
triI += nTris[faceI];
triI += nTris[facei];
}
// Triangulate
@ -817,23 +817,23 @@ void Foam::boundaryMesh::writeTriSurface(const fileName& fName) const
triI = 0;
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
forAll(bp, patchFaceI)
{
label faceI = bp.start() + patchFaceI;
label facei = bp.start() + patchFaceI;
label triVertI = 3*startTri[faceI];
label triVertI = 3*startTri[facei];
for (label faceTriI = 0; faceTriI < nTris[faceI]; faceTriI++)
for (label faceTriI = 0; faceTriI < nTris[facei]; faceTriI++)
{
label v0 = triVerts[triVertI++];
label v1 = triVerts[triVertI++];
label v2 = triVerts[triVertI++];
tris[triI++] = labelledTri(v0, v1, v2, patchI);
tris[triI++] = labelledTri(v0, v1, v2, patchi);
}
}
}
@ -1234,9 +1234,9 @@ void Foam::boundaryMesh::patchify
{
Pout<< "Patchify : new polyPatch list:" << endl;
forAll(newPatchPtrList, patchI)
forAll(newPatchPtrList, patchi)
{
const polyPatch& newPatch = *newPatchPtrList[patchI];
const polyPatch& newPatch = *newPatchPtrList[patchi];
if (debug)
{
@ -1244,7 +1244,7 @@ void Foam::boundaryMesh::patchify
<< " type :" << newPatch.typeName << endl
<< " size :" << newPatch.size() << endl
<< " start:" << newPatch.start() << endl
<< " index:" << patchI << endl;
<< " index:" << patchi << endl;
}
}
}
@ -1532,20 +1532,20 @@ void Foam::boundaryMesh::setExtraEdges(const label edgeI)
}
Foam::label Foam::boundaryMesh::whichPatch(const label faceI) const
Foam::label Foam::boundaryMesh::whichPatch(const label facei) const
{
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
if ((faceI >= bp.start()) && (faceI < (bp.start() + bp.size())))
if ((facei >= bp.start()) && (facei < (bp.start() + bp.size())))
{
return patchI;
return patchi;
}
}
FatalErrorInFunction
<< "Cannot find face " << faceI << " in list of boundaryPatches "
<< "Cannot find face " << facei << " in list of boundaryPatches "
<< patches_
<< abort(FatalError);
@ -1555,11 +1555,11 @@ Foam::label Foam::boundaryMesh::whichPatch(const label faceI) const
Foam::label Foam::boundaryMesh::findPatchID(const word& patchName) const
{
forAll(patches_, patchI)
forAll(patches_, patchi)
{
if (patches_[patchI].name() == patchName)
if (patches_[patchi].name() == patchName)
{
return patchI;
return patchi;
}
}
@ -1573,26 +1573,26 @@ void Foam::boundaryMesh::addPatch(const word& patchName)
// Add empty patch at end of patch list.
label patchI = patches_.size()-1;
label patchi = patches_.size()-1;
boundaryPatch* bpPtr = new boundaryPatch
(
patchName,
patchI,
patchi,
0,
mesh().size(),
"empty"
);
patches_.set(patchI, bpPtr);
patches_.set(patchi, bpPtr);
if (debug)
{
Pout<< "addPatch : patches now:" << endl;
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
Pout<< " name : " << bp.name() << endl
<< " size : " << bp.size() << endl
@ -1625,16 +1625,16 @@ void Foam::boundaryMesh::deletePatch(const word& patchName)
PtrList<boundaryPatch> newPatches(patches_.size() - 1);
for (label patchI = 0; patchI < delPatchI; patchI++)
for (label patchi = 0; patchi < delPatchI; patchi++)
{
newPatches.set(patchI, patches_[patchI].clone());
newPatches.set(patchi, patches_[patchi].clone());
}
// Move patches down, starting from delPatchI.
for (label patchI = delPatchI + 1; patchI < patches_.size(); patchI++)
for (label patchi = delPatchI + 1; patchi < patches_.size(); patchi++)
{
newPatches.set(patchI - 1, patches_[patchI].clone());
newPatches.set(patchi - 1, patches_[patchi].clone());
}
patches_.clear();
@ -1645,9 +1645,9 @@ void Foam::boundaryMesh::deletePatch(const word& patchName)
{
Pout<< "deletePatch : patches now:" << endl;
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
Pout<< " name : " << bp.name() << endl
<< " size : " << bp.size() << endl
@ -1681,12 +1681,12 @@ void Foam::boundaryMesh::changePatchType
PtrList<boundaryPatch> newPatches(patches_.size());
forAll(patches_, patchI)
forAll(patches_, patchi)
{
if (patchI == changeI)
if (patchi == changeI)
{
// Create copy but for type
const boundaryPatch& oldBp = patches_[patchI];
const boundaryPatch& oldBp = patches_[patchi];
boundaryPatch* bpPtr = new boundaryPatch
(
@ -1697,12 +1697,12 @@ void Foam::boundaryMesh::changePatchType
patchType
);
newPatches.set(patchI, bpPtr);
newPatches.set(patchi, bpPtr);
}
else
{
// Create copy
newPatches.set(patchI, patches_[patchI].clone());
newPatches.set(patchi, patches_[patchi].clone());
}
}
@ -1729,9 +1729,9 @@ void Foam::boundaryMesh::changeFaces
labelList nFaces(patches_.size(), 0);
forAll(patchIDs, faceI)
forAll(patchIDs, facei)
{
label patchID = patchIDs[faceI];
label patchID = patchIDs[facei];
if (patchID < 0 || patchID >= patches_.size())
{
@ -1749,27 +1749,27 @@ void Foam::boundaryMesh::changeFaces
startFace[0] = 0;
for (label patchI = 1; patchI < patches_.size(); patchI++)
for (label patchi = 1; patchi < patches_.size(); patchi++)
{
startFace[patchI] = startFace[patchI-1] + nFaces[patchI-1];
startFace[patchi] = startFace[patchi-1] + nFaces[patchi-1];
}
// Update patch info
PtrList<boundaryPatch> newPatches(patches_.size());
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
newPatches.set
(
patchI,
patchi,
new boundaryPatch
(
bp.name(),
patchI,
nFaces[patchI],
startFace[patchI],
patchi,
nFaces[patchi],
startFace[patchi],
bp.physicalType()
)
);
@ -1780,9 +1780,9 @@ void Foam::boundaryMesh::changeFaces
{
Pout<< "changeFaces : patches now:" << endl;
forAll(patches_, patchI)
forAll(patches_, patchi)
{
const boundaryPatch& bp = patches_[patchI];
const boundaryPatch& bp = patches_[patchi];
Pout<< " name : " << bp.name() << endl
<< " size : " << bp.size() << endl
@ -1796,11 +1796,11 @@ void Foam::boundaryMesh::changeFaces
// Construct face mapping array
oldToNew.setSize(patchIDs.size());
forAll(patchIDs, faceI)
forAll(patchIDs, facei)
{
int patchID = patchIDs[faceI];
int patchID = patchIDs[facei];
oldToNew[faceI] = startFace[patchID]++;
oldToNew[facei] = startFace[patchID]++;
}
// Copy faces into correct position and maintain label of original face
@ -1808,10 +1808,10 @@ void Foam::boundaryMesh::changeFaces
labelList newMeshFace(mesh().size());
forAll(oldToNew, faceI)
forAll(oldToNew, facei)
{
newFaces[oldToNew[faceI]] = mesh()[faceI];
newMeshFace[oldToNew[faceI]] = meshFace_[faceI];
newFaces[oldToNew[facei]] = mesh()[facei];
newMeshFace[oldToNew[facei]] = meshFace_[facei];
}
// Reconstruct 'mesh' from new faces and (copy of) existing points.
@ -1829,9 +1829,9 @@ void Foam::boundaryMesh::changeFaces
}
Foam::label Foam::boundaryMesh::getNTris(const label faceI) const
Foam::label Foam::boundaryMesh::getNTris(const label facei) const
{
const face& f = mesh()[faceI];
const face& f = mesh()[facei];
return f.nTriangles(mesh().points());
}
@ -1877,9 +1877,9 @@ void Foam::boundaryMesh::triangulate
for (label i = 0; i < nFaces; i++)
{
label faceI = startFaceI + i;
label facei = startFaceI + i;
const face& f = mesh()[faceI];
const face& f = mesh()[facei];
// Have face triangulate itself (results in faceList)
faceList triFaces(f.nTriangles(mesh().points()));
@ -1989,15 +1989,15 @@ void Foam::boundaryMesh::markFaces
// Set in visited all reached ones.
visited.setSize(mesh().size());
forAll(currentZone, faceI)
forAll(currentZone, facei)
{
if (currentZone[faceI] == 0)
if (currentZone[facei] == 0)
{
visited[faceI] = true;
visited[facei] = true;
}
else
{
visited[faceI] = false;
visited[facei] = false;
}
}
}

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
@ -160,12 +160,12 @@ class boundaryMesh
labelList& faceRegion
) const;
//- Finds area, starting at faceI, delimited by borderEdge. Marks all
//- Finds area, starting at facei, delimited by borderEdge. Marks all
// faces thus visited with currentZone.
void markZone
(
const boolList& borderEdge,
label faceI,
label facei,
label currentZone,
labelList& faceZone
) const;
@ -298,7 +298,7 @@ public:
// Patches
//- Get index of patch face is in
label whichPatch(const label faceI) const;
label whichPatch(const label facei) const;
//- Get index of patch by name
label findPatchID(const word& patchName) const;
@ -335,7 +335,7 @@ public:
//- Simple triangulation of face subset. Returns number of triangles
// needed.
label getNTris(const label faceI) const;
label getNTris(const label facei) const;
//- Simple triangulation of face subset. TotalNTris is total number
// of triangles, nTris is per face number of triangles.
@ -377,7 +377,7 @@ public:
void markFaces
(
const labelList& protectedEdges,
const label faceI,
const label facei,
boolList& visited
) const;
};

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
@ -185,9 +185,9 @@ void Foam::createShellMesh::calcPointRegions
// 1. Count
label nMaxRegions = 0;
forAll(patch.localFaces(), faceI)
forAll(patch.localFaces(), facei)
{
const face& f = patch.localFaces()[faceI];
const face& f = patch.localFaces()[facei];
nMaxRegions += f.size();
}
@ -197,10 +197,10 @@ void Foam::createShellMesh::calcPointRegions
label nRegions = 0;
pointGlobalRegions.setSize(patch.size());
forAll(pointGlobalRegions, faceI)
forAll(pointGlobalRegions, facei)
{
const face& f = patch.localFaces()[faceI];
labelList& pRegions = pointGlobalRegions[faceI];
const face& f = patch.localFaces()[facei];
labelList& pRegions = pointGlobalRegions[facei];
pRegions.setSize(f.size());
forAll(pRegions, fp)
{
@ -223,15 +223,15 @@ void Foam::createShellMesh::calcPointRegions
{
// Take over value from one face only.
const edge& e = patch.edges()[edgeI];
label faceI = patch.edgeFaces()[edgeI][0];
const face& f = patch.localFaces()[faceI];
label facei = patch.edgeFaces()[edgeI][0];
const face& f = patch.localFaces()[facei];
label fp0 = findIndex(f, e[0]);
label fp1 = findIndex(f, e[1]);
allEdgeData[edgeI] = labelPair
(
pointGlobalRegions[faceI][fp0],
pointGlobalRegions[faceI][fp1]
pointGlobalRegions[facei][fp0],
pointGlobalRegions[facei][fp1]
);
if (!isChangedEdge[edgeI])
{
@ -279,29 +279,29 @@ void Foam::createShellMesh::calcPointRegions
forAll(eFaces, i)
{
label faceI = eFaces[i];
const face& f = patch.localFaces()[faceI];
label facei = eFaces[i];
const face& f = patch.localFaces()[facei];
// Combine edgeData with face data
label fp0 = findIndex(f, e[0]);
if (pointGlobalRegions[faceI][fp0] > edgeData[0])
if (pointGlobalRegions[facei][fp0] > edgeData[0])
{
pointGlobalRegions[faceI][fp0] = edgeData[0];
if (!isChangedFace[faceI])
pointGlobalRegions[facei][fp0] = edgeData[0];
if (!isChangedFace[facei])
{
isChangedFace[faceI] = true;
changedFaces.append(faceI);
isChangedFace[facei] = true;
changedFaces.append(facei);
}
}
label fp1 = findIndex(f, e[1]);
if (pointGlobalRegions[faceI][fp1] > edgeData[1])
if (pointGlobalRegions[facei][fp1] > edgeData[1])
{
pointGlobalRegions[faceI][fp1] = edgeData[1];
if (!isChangedFace[faceI])
pointGlobalRegions[facei][fp1] = edgeData[1];
if (!isChangedFace[facei])
{
isChangedFace[faceI] = true;
changedFaces.append(faceI);
isChangedFace[facei] = true;
changedFaces.append(facei);
}
}
}
@ -323,9 +323,9 @@ void Foam::createShellMesh::calcPointRegions
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
const face& f = patch.localFaces()[faceI];
const labelList& fEdges = patch.faceEdges()[faceI];
label facei = changedFaces[i];
const face& f = patch.localFaces()[facei];
const labelList& fEdges = patch.faceEdges()[facei];
forAll(fEdges, fp)
{
@ -335,9 +335,9 @@ void Foam::createShellMesh::calcPointRegions
{
const edge& e = patch.edges()[edgeI];
label fp0 = findIndex(f, e[0]);
label region0 = pointGlobalRegions[faceI][fp0];
label region0 = pointGlobalRegions[facei][fp0];
label fp1 = findIndex(f, e[1]);
label region1 = pointGlobalRegions[faceI][fp1];
label region1 = pointGlobalRegions[facei][fp1];
if
(
@ -387,14 +387,14 @@ void Foam::createShellMesh::calcPointRegions
pointLocalRegions.setSize(patch.size());
Map<label> globalToLocalRegion(globalRegions.localSize()/4);
DynamicList<label> dynLocalToGlobalRegion(globalToLocalRegion.size());
forAll(patch.localFaces(), faceI)
forAll(patch.localFaces(), facei)
{
const face& f = patch.localFaces()[faceI];
face& pRegions = pointLocalRegions[faceI];
const face& f = patch.localFaces()[facei];
face& pRegions = pointLocalRegions[facei];
pRegions.setSize(f.size());
forAll(f, fp)
{
label globalRegionI = pointGlobalRegions[faceI][fp];
label globalRegionI = pointGlobalRegions[facei][fp];
Map<label>::iterator fnd = globalToLocalRegion.find(globalRegionI);
@ -501,11 +501,11 @@ void Foam::createShellMesh::setRefinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
labelList addedCells(nLayers*patch_.size());
forAll(patch_, faceI)
forAll(patch_, facei)
{
for (label layerI = 0; layerI < nLayers; layerI++)
{
addedCells[nLayers*faceI+layerI] = meshMod.addCell
addedCells[nLayers*facei+layerI] = meshMod.addCell
(
-1, // masterPointID
-1, // masterEdgeID
@ -513,7 +513,7 @@ void Foam::createShellMesh::setRefinement
cellToFaceMap.size(), // masterCellID
-1 // zoneID
);
cellToFaceMap.append(faceI);
cellToFaceMap.append(facei);
}
}
@ -570,39 +570,39 @@ void Foam::createShellMesh::setRefinement
// Add face on bottom side
forAll(patch_.localFaces(), faceI)
forAll(patch_.localFaces(), facei)
{
meshMod.addFace
(
patch_.localFaces()[faceI].reverseFace(),// vertices
addedCells[nLayers*faceI], // own
patch_.localFaces()[facei].reverseFace(),// vertices
addedCells[nLayers*facei], // own
-1, // nei
-1, // masterPointID
-1, // masterEdgeID
faceToFaceMap.size(), // masterFaceID : current faceI
faceToFaceMap.size(), // masterFaceID : current facei
true, // flipFaceFlux
bottomPatchID[faceI], // patchID
bottomPatchID[facei], // patchID
-1, // zoneID
false // zoneFlip
);
faceToFaceMap.append(-faceI-1); // points to flipped original face
faceToFaceMap.append(-facei-1); // points to flipped original face
faceToEdgeMap.append(-1);
//const face newF(patch_.localFaces()[faceI].reverseFace());
//const face newF(patch_.localFaces()[facei].reverseFace());
//Pout<< "Added bottom face "
// << newF
// << " coords:" << UIndirectList<point>(meshMod.points(), newF)
// << " own " << addedCells[faceI]
// << " patch:" << bottomPatchID[faceI]
// << " at " << patch_.faceCentres()[faceI]
// << " own " << addedCells[facei]
// << " patch:" << bottomPatchID[facei]
// << " at " << patch_.faceCentres()[facei]
// << endl;
}
// Add inbetween faces and face on top
forAll(patch_.localFaces(), faceI)
forAll(patch_.localFaces(), facei)
{
// Get face in original ordering
const face& f = patch_.localFaces()[faceI];
const face& f = patch_.localFaces()[facei];
face newF(f.size());
@ -611,21 +611,21 @@ void Foam::createShellMesh::setRefinement
// Pick up point based on region and layer
forAll(f, fp)
{
label region = pointRegions_[faceI][fp];
label region = pointRegions_[facei][fp];
newF[fp] = addedPoints[region*nLayers+layerI];
}
label own = addedCells[faceI*nLayers+layerI];
label own = addedCells[facei*nLayers+layerI];
label nei;
label patchI;
if (layerI == nLayers-1)
{
nei = -1;
patchI = topPatchID[faceI];
patchI = topPatchID[facei];
}
else
{
nei = addedCells[faceI*nLayers+layerI+1];
nei = addedCells[facei*nLayers+layerI+1];
patchI = -1;
}
@ -636,13 +636,13 @@ void Foam::createShellMesh::setRefinement
nei, // nei
-1, // masterPointID
-1, // masterEdgeID
faceToFaceMap.size(), // masterFaceID : current faceI
faceToFaceMap.size(), // masterFaceID : current facei
false, // flipFaceFlux
patchI, // patchID
-1, // zoneID
false // zoneFlip
);
faceToFaceMap.append(faceI+1); // unflipped
faceToFaceMap.append(facei+1); // unflipped
faceToEdgeMap.append(-1);
//Pout<< "Added inbetween face " << newF
@ -650,7 +650,7 @@ void Foam::createShellMesh::setRefinement
// << " at layer " << layerI
// << " own " << own
// << " nei " << nei
// << " at " << patch_.faceCentres()[faceI]
// << " at " << patch_.faceCentres()[facei]
// << endl;
}
}

View File

@ -110,11 +110,11 @@ extrudePatchMesh::extrudePatchMesh
List<word> patchTypes(regionPatches.size());
PtrList<dictionary> dicts(regionPatches.size());
forAll(dicts, patchI)
forAll(dicts, patchi)
{
if (!dicts.set(patchI))
if (!dicts.set(patchi))
{
dicts.set(patchI, new dictionary());
dicts.set(patchi, new dictionary());
}
}
@ -122,23 +122,23 @@ extrudePatchMesh::extrudePatchMesh
dicts[sidePatchID] = dict_.subDict("sideCoeffs");
dicts[topPatchID] = dict_.subDict("topCoeffs");
forAll(dicts, patchI)
forAll(dicts, patchi)
{
dicts[patchI].lookup("name") >> patchNames[patchI];
dicts[patchI].lookup("type") >> patchTypes[patchI];
dicts[patchi].lookup("name") >> patchNames[patchi];
dicts[patchi].lookup("type") >> patchTypes[patchi];
}
forAll(regionPatches, patchI)
forAll(regionPatches, patchi)
{
dictionary& patchDict = dicts[patchI];
dictionary& patchDict = dicts[patchi];
patchDict.set("nFaces", 0);
patchDict.set("startFace", 0);
regionPatches[patchI] = polyPatch::New
regionPatches[patchi] = polyPatch::New
(
patchNames[patchI],
patchNames[patchi],
patchDict,
patchI,
patchi,
mesh.boundaryMesh()
).ptr();
@ -190,10 +190,10 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
// Per local region an originating point
labelList localRegionPoints(localToGlobalRegion.size());
forAll(pointLocalRegions, faceI)
forAll(pointLocalRegions, facei)
{
const face& f = extrudedPatch_.localFaces()[faceI];
const face& pRegions = pointLocalRegions[faceI];
const face& f = extrudedPatch_.localFaces()[facei];
const face& pRegions = pointLocalRegions[facei];
forAll(pRegions, fp)
{
localRegionPoints[pRegions[fp]] = f[fp];
@ -205,14 +205,14 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
{
pointField localSum(localToGlobalRegion.size(), Zero);
forAll(pointLocalRegions, faceI)
forAll(pointLocalRegions, facei)
{
const face& pRegions = pointLocalRegions[faceI];
const face& pRegions = pointLocalRegions[facei];
forAll(pRegions, fp)
{
label localRegionI = pRegions[fp];
localSum[localRegionI] +=
extrudedPatch_.faceNormals()[faceI];
extrudedPatch_.faceNormals()[facei];
}
}
@ -267,11 +267,11 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
List<word> patchTypes(regionPatches.size());
PtrList<dictionary> dicts(regionPatches.size());
forAll(dicts, patchI)
forAll(dicts, patchi)
{
if (!dicts.set(patchI))
if (!dicts.set(patchi))
{
dicts.set(patchI, new dictionary());
dicts.set(patchi, new dictionary());
}
}
@ -279,23 +279,23 @@ void extrudePatchMesh::extrudeMesh(const List<polyPatch*>& regionPatches)
dicts[sidePatchID] = dict_.subDict("sideCoeffs");
dicts[topPatchID] = dict_.subDict("topCoeffs");
forAll(dicts, patchI)
forAll(dicts, patchi)
{
dicts[patchI].lookup("name") >> patchNames[patchI];
dicts[patchI].lookup("type") >> patchTypes[patchI];
dicts[patchi].lookup("name") >> patchNames[patchi];
dicts[patchi].lookup("type") >> patchTypes[patchi];
}
forAll(regionPatches, patchI)
forAll(regionPatches, patchi)
{
dictionary& patchDict = dicts[patchI];
dictionary& patchDict = dicts[patchi];
patchDict.set("nFaces", 0);
patchDict.set("startFace", 0);
regionPatches[patchI] = polyPatch::New
regionPatches[patchi] = polyPatch::New
(
patchNames[patchI],
patchNames[patchi],
patchDict,
patchI,
patchi,
mesh.boundaryMesh()
).ptr();

View File

@ -86,9 +86,9 @@ Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::fvMeshAdder::add
fvBoundaryMesh& fvPatches = const_cast<fvBoundaryMesh&>(mesh0.boundary());
fvPatches.setSize(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
fvPatches.set(patchI, fvPatch::New(patches[patchI], fvPatches));
fvPatches.set(patchi, fvPatch::New(patches[patchi], fvPatches));
}
// Do the mapping of the stored fields

View File

@ -73,9 +73,9 @@ void Foam::fvMeshAdder::MapVolField
label unusedPatchI = 0;
forAll(oldPatchMap, patchI)
forAll(oldPatchMap, patchi)
{
label newPatchI = oldPatchMap[patchI];
label newPatchI = oldPatchMap[patchi];
if (newPatchI != -1)
{
@ -88,17 +88,17 @@ void Foam::fvMeshAdder::MapVolField
// Reorder list for patchFields
labelList oldToNew(oldPatchMap.size());
forAll(oldPatchMap, patchI)
forAll(oldPatchMap, patchi)
{
label newPatchI = oldPatchMap[patchI];
label newPatchI = oldPatchMap[patchi];
if (newPatchI != -1)
{
oldToNew[patchI] = newPatchI;
oldToNew[patchi] = newPatchI;
}
else
{
oldToNew[patchI] = unusedPatchI++;
oldToNew[patchi] = unusedPatchI++;
}
}
@ -122,9 +122,9 @@ void Foam::fvMeshAdder::MapVolField
// Map old values
// ~~~~~~~~~~~~~~
forAll(oldPatchMap, patchI)
forAll(oldPatchMap, patchi)
{
label newPatchI = oldPatchMap[patchI];
label newPatchI = oldPatchMap[patchi];
if (newPatchI != -1)
{
@ -132,8 +132,8 @@ void Foam::fvMeshAdder::MapVolField
(
calcPatchMap
(
oldPatchStarts[patchI],
oldPatchSizes[patchI],
oldPatchStarts[patchi],
oldPatchSizes[patchi],
meshMap.oldFaceMap(),
mesh.boundaryMesh()[newPatchI],
-1 // unmapped value
@ -174,15 +174,15 @@ void Foam::fvMeshAdder::MapVolField
const labelList& addedPatchMap = meshMap.addedPatchMap();
// Add addedMesh patches
forAll(addedPatchMap, patchI)
forAll(addedPatchMap, patchi)
{
label newPatchI = addedPatchMap[patchI];
label newPatchI = addedPatchMap[patchi];
if (newPatchI != -1)
{
const polyPatch& newPatch = mesh.boundaryMesh()[newPatchI];
const polyPatch& oldPatch =
fldToAdd.mesh().boundaryMesh()[patchI];
fldToAdd.mesh().boundaryMesh()[patchi];
if (!bfld(newPatchI))
{
@ -209,7 +209,7 @@ void Foam::fvMeshAdder::MapVolField
newPatchI,
fvPatchField<Type>::New
(
fldToAdd.boundaryField()[patchI], // added field
fldToAdd.boundaryField()[patchi], // added field
mesh.boundary()[newPatchI], // new fvPatch
fld.dimensionedInternalField(), // new int. field
patchMapper // mapper
@ -235,7 +235,7 @@ void Foam::fvMeshAdder::MapVolField
bfld[newPatchI].rmap
(
fldToAdd.boundaryField()[patchI],
fldToAdd.boundaryField()[patchi],
addedToNew
);
}
@ -351,11 +351,11 @@ void Foam::fvMeshAdder::MapSurfaceField
// Faces that were boundary faces but are not anymore.
// Use owner value (so lowest numbered cell, i.e. from 'old' not 'added'
// mesh)
forAll(bfld, patchI)
forAll(bfld, patchi)
{
const fvsPatchField<Type>& pf = bfld[patchI];
const fvsPatchField<Type>& pf = bfld[patchi];
label start = oldPatchStarts[patchI];
label start = oldPatchStarts[patchi];
forAll(pf, i)
{
@ -381,9 +381,9 @@ void Foam::fvMeshAdder::MapSurfaceField
label unusedPatchI = 0;
forAll(oldPatchMap, patchI)
forAll(oldPatchMap, patchi)
{
label newPatchI = oldPatchMap[patchI];
label newPatchI = oldPatchMap[patchi];
if (newPatchI != -1)
{
@ -396,17 +396,17 @@ void Foam::fvMeshAdder::MapSurfaceField
// Reorder list for patchFields
labelList oldToNew(oldPatchMap.size());
forAll(oldPatchMap, patchI)
forAll(oldPatchMap, patchi)
{
label newPatchI = oldPatchMap[patchI];
label newPatchI = oldPatchMap[patchi];
if (newPatchI != -1)
{
oldToNew[patchI] = newPatchI;
oldToNew[patchi] = newPatchI;
}
else
{
oldToNew[patchI] = unusedPatchI++;
oldToNew[patchi] = unusedPatchI++;
}
}
@ -430,9 +430,9 @@ void Foam::fvMeshAdder::MapSurfaceField
// Map old values
// ~~~~~~~~~~~~~~
forAll(oldPatchMap, patchI)
forAll(oldPatchMap, patchi)
{
label newPatchI = oldPatchMap[patchI];
label newPatchI = oldPatchMap[patchi];
if (newPatchI != -1)
{
@ -440,8 +440,8 @@ void Foam::fvMeshAdder::MapSurfaceField
(
calcPatchMap
(
oldPatchStarts[patchI],
oldPatchSizes[patchI],
oldPatchStarts[patchi],
oldPatchSizes[patchi],
meshMap.oldFaceMap(),
mesh.boundaryMesh()[newPatchI],
-1 // unmapped value
@ -481,15 +481,15 @@ void Foam::fvMeshAdder::MapSurfaceField
const labelList& addedPatchMap = meshMap.addedPatchMap();
// Add addedMesh patches
forAll(addedPatchMap, patchI)
forAll(addedPatchMap, patchi)
{
label newPatchI = addedPatchMap[patchI];
label newPatchI = addedPatchMap[patchi];
if (newPatchI != -1)
{
const polyPatch& newPatch = mesh.boundaryMesh()[newPatchI];
const polyPatch& oldPatch =
fldToAdd.mesh().boundaryMesh()[patchI];
fldToAdd.mesh().boundaryMesh()[patchi];
if (!bfld(newPatchI))
{
@ -516,7 +516,7 @@ void Foam::fvMeshAdder::MapSurfaceField
newPatchI,
fvsPatchField<Type>::New
(
fldToAdd.boundaryField()[patchI],// added field
fldToAdd.boundaryField()[patchi],// added field
mesh.boundary()[newPatchI], // new fvPatch
fld.dimensionedInternalField(), // new int. field
patchMapper // mapper
@ -542,7 +542,7 @@ void Foam::fvMeshAdder::MapSurfaceField
bfld[newPatchI].rmap
(
fldToAdd.boundaryField()[patchI],
fldToAdd.boundaryField()[patchi],
addedToNew
);
}

View File

@ -141,11 +141,11 @@ void Foam::fvMeshDistribute::printMeshInfo(const fvMesh& mesh)
const fvBoundaryMesh& patches = mesh.boundary();
Pout<< "Patches:" << endl;
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI].patch();
const polyPatch& pp = patches[patchi].patch();
Pout<< " " << patchI << " name:" << pp.name()
Pout<< " " << patchi << " name:" << pp.name()
<< " size:" << pp.size()
<< " start:" << pp.start()
<< " type:" << pp.type()
@ -222,13 +222,13 @@ Foam::label Foam::fvMeshDistribute::findNonEmptyPatch() const
label nonEmptyPatchI = -1;
forAllReverse(patches, patchI)
forAllReverse(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (!isA<emptyPolyPatch>(pp) && !pp.coupled())
{
nonEmptyPatchI = patchI;
nonEmptyPatchI = patchi;
break;
}
}
@ -255,11 +255,11 @@ Foam::label Foam::fvMeshDistribute::findNonEmptyPatch() const
// patches.
label procPatchI = -1;
forAll(patches, patchI)
forAll(patches, patchi)
{
if (isA<processorPolyPatch>(patches[patchI]))
if (isA<processorPolyPatch>(patches[patchi]))
{
procPatchI = patchI;
procPatchI = patchi;
}
else if (procPatchI != -1)
{
@ -267,7 +267,7 @@ Foam::label Foam::fvMeshDistribute::findNonEmptyPatch() const
<< "Processor patches should be at end of patch list."
<< endl
<< "Have processor patch " << procPatchI
<< " followed by non-processor patch " << patchI
<< " followed by non-processor patch " << patchi
<< " in patches " << patches.names()
<< abort(FatalError);
}
@ -290,9 +290,9 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
label nProcPatches = 0;
forAll(mesh_.boundaryMesh(), patchI)
forAll(mesh_.boundaryMesh(), patchi)
{
const polyPatch& pp = mesh_.boundaryMesh()[patchI];
const polyPatch& pp = mesh_.boundaryMesh()[patchi];
if (isA<processorPolyPatch>(pp))
{
@ -326,21 +326,21 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::deleteProcPatches
labelList oldToNew(identity(mesh_.boundaryMesh().size()));
label newI = 0;
// Non processor patches first
forAll(mesh_.boundaryMesh(), patchI)
forAll(mesh_.boundaryMesh(), patchi)
{
if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchI]))
if (!isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
{
oldToNew[patchI] = newI++;
oldToNew[patchi] = newI++;
}
}
label nNonProcPatches = newI;
// Processor patches as last
forAll(mesh_.boundaryMesh(), patchI)
forAll(mesh_.boundaryMesh(), patchi)
{
if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchI]))
if (isA<processorPolyPatch>(mesh_.boundaryMesh()[patchi]))
{
oldToNew[patchI] = newI++;
oldToNew[patchi] = newI++;
}
}
fvMeshTools::reorderPatches(mesh_, oldToNew, nNonProcPatches, false);
@ -363,24 +363,24 @@ Foam::autoPtr<Foam::mapPolyMesh> Foam::fvMeshDistribute::repatch
{
if (newPatchID[bFaceI] != -1)
{
label faceI = mesh_.nInternalFaces() + bFaceI;
label facei = mesh_.nInternalFaces() + bFaceI;
label zoneID = mesh_.faceZones().whichZone(faceI);
label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
(
polyModifyFace
(
mesh_.faces()[faceI], // modified face
faceI, // label of face
mesh_.faceOwner()[faceI], // owner
mesh_.faces()[facei], // modified face
facei, // label of face
mesh_.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
newPatchID[bFaceI], // patch for face
@ -550,9 +550,9 @@ void Foam::fvMeshDistribute::getNeighbourData
labelList nbrFaces(nBnd, -1);
labelList nbrNewNbrProc(nBnd, -1);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.coupled())
{
@ -577,9 +577,9 @@ void Foam::fvMeshDistribute::getNeighbourData
syncTools::swapBoundaryFaceList(mesh_, nbrNewNbrProc);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
label offset = pp.start() - mesh_.nInternalFaces();
if (isA<processorPolyPatch>(pp))
@ -613,10 +613,10 @@ void Foam::fvMeshDistribute::getNeighbourData
}
label patchI = -1;
label patchi = -1;
if (isA<processorCyclicPolyPatch>(pp))
{
patchI = refCast<const processorCyclicPolyPatch>
patchi = refCast<const processorCyclicPolyPatch>
(
pp
).referPatchID();
@ -625,7 +625,7 @@ void Foam::fvMeshDistribute::getNeighbourData
forAll(pp, i)
{
label bndI = offset + i;
sourcePatch[bndI] = patchI;
sourcePatch[bndI] = patchi;
}
}
else if (isA<cyclicPolyPatch>(pp))
@ -639,7 +639,7 @@ void Foam::fvMeshDistribute::getNeighbourData
label bndI = offset + i;
sourceFace[bndI] = pp.start()+i;
sourceProc[bndI] = Pstream::myProcNo();
sourcePatch[bndI] = patchI;
sourcePatch[bndI] = patchi;
sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
}
}
@ -650,7 +650,7 @@ void Foam::fvMeshDistribute::getNeighbourData
label bndI = offset + i;
sourceFace[bndI] = nbrFaces[bndI];
sourceProc[bndI] = Pstream::myProcNo();
sourcePatch[bndI] = patchI;
sourcePatch[bndI] = patchi;
sourceNewNbrProc[bndI] = nbrNewNbrProc[bndI];
}
}
@ -663,7 +663,7 @@ void Foam::fvMeshDistribute::getNeighbourData
label bndI = offset + i;
sourceFace[bndI] = -1;
sourceProc[bndI] = -1;
sourcePatch[bndI] = patchI;
sourcePatch[bndI] = patchi;
sourceNewNbrProc[bndI] = -1;
}
}
@ -1236,13 +1236,13 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshDistribute::receiveMesh
List<polyPatch*> patches(patchEntries.size());
forAll(patchEntries, patchI)
forAll(patchEntries, patchi)
{
patches[patchI] = polyPatch::New
patches[patchi] = polyPatch::New
(
patchEntries[patchI].keyword(),
patchEntries[patchI].dict(),
patchI,
patchEntries[patchi].keyword(),
patchEntries[patchi].dict(),
patchi,
domainMesh.boundaryMesh()
).ptr();
}
@ -1310,16 +1310,16 @@ Foam::labelList Foam::fvMeshDistribute::countCells
)
{
labelList nCells(Pstream::nProcs(), 0);
forAll(distribution, cellI)
forAll(distribution, celli)
{
label newProc = distribution[cellI];
label newProc = distribution[celli];
if (newProc < 0 || newProc >= Pstream::nProcs())
{
FatalErrorInFunction
<< "Distribution should be in range 0.." << Pstream::nProcs()-1
<< endl
<< "At index " << cellI << " distribution:" << newProc
<< "At index " << celli << " distribution:" << newProc
<< abort(FatalError);
}
nCells[newProc]++;
@ -1363,10 +1363,10 @@ Foam::autoPtr<Foam::mapDistributePolyMesh> Foam::fvMeshDistribute::distribute
const label nOldCells(mesh_.nCells());
labelList oldPatchStarts(patches.size());
labelList oldPatchNMeshPoints(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
oldPatchStarts[patchI] = patches[patchI].start();
oldPatchNMeshPoints[patchI] = patches[patchI].nPoints();
oldPatchStarts[patchi] = patches[patchi].start();
oldPatchNMeshPoints[patchi] = patches[patchi].nPoints();
}

View File

@ -43,12 +43,12 @@ void Foam::fvMeshDistribute::printFieldInfo(const fvMesh& mesh)
//<< " value:" << fld
<< endl;
forAll(fld.boundaryField(), patchI)
forAll(fld.boundaryField(), patchi)
{
Pout<< " " << patchI
<< ' ' << fld.boundaryField()[patchI].patch().name()
<< ' ' << fld.boundaryField()[patchI].type()
<< ' ' << fld.boundaryField()[patchI].size()
Pout<< " " << patchi
<< ' ' << fld.boundaryField()[patchi].patch().name()
<< ' ' << fld.boundaryField()[patchi].type()
<< ' ' << fld.boundaryField()[patchi].size()
<< endl;
}
}
@ -120,14 +120,14 @@ void Foam::fvMeshDistribute::mapBoundaryFields
// Pull from old boundary field into bfld.
forAll(bfld, patchI)
forAll(bfld, patchi)
{
fvsPatchField<T>& patchFld = bfld[patchI];
label faceI = patchFld.patch().start();
fvsPatchField<T>& patchFld = bfld[patchi];
label facei = patchFld.patch().start();
forAll(patchFld, i)
{
label oldFaceI = faceMap[faceI++];
label oldFaceI = faceMap[facei++];
// Find patch and local patch face oldFaceI was in.
forAll(oldPatchStarts, oldPatchI)
@ -164,11 +164,11 @@ void Foam::fvMeshDistribute::initPatchFields
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryFieldRef();
forAll(bfld, patchI)
forAll(bfld, patchi)
{
if (isA<PatchFieldType>(bfld[patchI]))
if (isA<PatchFieldType>(bfld[patchi]))
{
bfld[patchI] == initVal;
bfld[patchi] == initVal;
}
}
}

View File

@ -40,11 +40,11 @@ Foam::label Foam::fvMeshTools::addPatch
polyBoundaryMesh& polyPatches =
const_cast<polyBoundaryMesh&>(mesh.boundaryMesh());
label patchI = polyPatches.findPatchID(patch.name());
if (patchI != -1)
label patchi = polyPatches.findPatchID(patch.name());
if (patchi != -1)
{
// Already there
return patchI;
return patchi;
}
@ -54,13 +54,13 @@ Foam::label Foam::fvMeshTools::addPatch
if (!isA<processorPolyPatch>(patch))
{
forAll(polyPatches, patchI)
forAll(polyPatches, patchi)
{
const polyPatch& pp = polyPatches[patchI];
const polyPatch& pp = polyPatches[patchi];
if (isA<processorPolyPatch>(pp))
{
insertPatchI = patchI;
insertPatchI = patchi;
startFaceI = pp.start();
break;
}
@ -213,60 +213,60 @@ Foam::label Foam::fvMeshTools::addPatch
void Foam::fvMeshTools::setPatchFields
(
fvMesh& mesh,
const label patchI,
const label patchi,
const dictionary& patchFieldDict
)
{
setPatchFields<volScalarField>(mesh, patchI, patchFieldDict);
setPatchFields<volVectorField>(mesh, patchI, patchFieldDict);
setPatchFields<volSphericalTensorField>(mesh, patchI, patchFieldDict);
setPatchFields<volSymmTensorField>(mesh, patchI, patchFieldDict);
setPatchFields<volTensorField>(mesh, patchI, patchFieldDict);
setPatchFields<surfaceScalarField>(mesh, patchI, patchFieldDict);
setPatchFields<surfaceVectorField>(mesh, patchI, patchFieldDict);
setPatchFields<volScalarField>(mesh, patchi, patchFieldDict);
setPatchFields<volVectorField>(mesh, patchi, patchFieldDict);
setPatchFields<volSphericalTensorField>(mesh, patchi, patchFieldDict);
setPatchFields<volSymmTensorField>(mesh, patchi, patchFieldDict);
setPatchFields<volTensorField>(mesh, patchi, patchFieldDict);
setPatchFields<surfaceScalarField>(mesh, patchi, patchFieldDict);
setPatchFields<surfaceVectorField>(mesh, patchi, patchFieldDict);
setPatchFields<surfaceSphericalTensorField>
(
mesh,
patchI,
patchi,
patchFieldDict
);
setPatchFields<surfaceSymmTensorField>(mesh, patchI, patchFieldDict);
setPatchFields<surfaceTensorField>(mesh, patchI, patchFieldDict);
setPatchFields<surfaceSymmTensorField>(mesh, patchi, patchFieldDict);
setPatchFields<surfaceTensorField>(mesh, patchi, patchFieldDict);
}
void Foam::fvMeshTools::zeroPatchFields(fvMesh& mesh, const label patchI)
void Foam::fvMeshTools::zeroPatchFields(fvMesh& mesh, const label patchi)
{
setPatchFields<volScalarField>(mesh, patchI, Zero);
setPatchFields<volVectorField>(mesh, patchI, Zero);
setPatchFields<volScalarField>(mesh, patchi, Zero);
setPatchFields<volVectorField>(mesh, patchi, Zero);
setPatchFields<volSphericalTensorField>
(
mesh,
patchI,
patchi,
Zero
);
setPatchFields<volSymmTensorField>
(
mesh,
patchI,
patchi,
Zero
);
setPatchFields<volTensorField>(mesh, patchI, Zero);
setPatchFields<surfaceScalarField>(mesh, patchI, Zero);
setPatchFields<surfaceVectorField>(mesh, patchI, Zero);
setPatchFields<volTensorField>(mesh, patchi, Zero);
setPatchFields<surfaceScalarField>(mesh, patchi, Zero);
setPatchFields<surfaceVectorField>(mesh, patchi, Zero);
setPatchFields<surfaceSphericalTensorField>
(
mesh,
patchI,
patchi,
Zero
);
setPatchFields<surfaceSymmTensorField>
(
mesh,
patchI,
patchi,
Zero
);
setPatchFields<surfaceTensorField>(mesh, patchI, Zero);
setPatchFields<surfaceTensorField>(mesh, patchi, Zero);
}
@ -288,9 +288,9 @@ void Foam::fvMeshTools::trimPatches(fvMesh& mesh, const label nPatches)
}
label nFaces = 0;
for (label patchI = nPatches; patchI < polyPatches.size(); patchI++)
for (label patchi = nPatches; patchi < polyPatches.size(); patchi++)
{
nFaces += polyPatches[patchI].size();
nFaces += polyPatches[patchi].size();
}
reduce(nFaces, sumOp<label>());

View File

@ -88,7 +88,7 @@ template<class GeoField>
void Foam::fvMeshTools::setPatchFields
(
fvMesh& mesh,
const label patchI,
const label patchi,
const dictionary& patchFieldDict
)
{
@ -108,10 +108,10 @@ void Foam::fvMeshTools::setPatchFields
{
bfld.set
(
patchI,
patchi,
GeoField::PatchFieldType::New
(
mesh.boundary()[patchI],
mesh.boundary()[patchi],
fld.dimensionedInternalField(),
patchFieldDict.subDict(fld.name())
)
@ -127,7 +127,7 @@ template<class GeoField>
void Foam::fvMeshTools::setPatchFields
(
fvMesh& mesh,
const label patchI,
const label patchi,
const typename GeoField::value_type& value
)
{
@ -143,7 +143,7 @@ void Foam::fvMeshTools::setPatchFields
typename GeoField::GeometricBoundaryField& bfld =
fld.boundaryFieldRef();
bfld[patchI] == value;
bfld[patchi] == value;
}
}

View File

@ -163,19 +163,19 @@ void Foam::layerAdditionRemoval::addCellLayer
labelList addedCells(mf.size());
forAll(mf, faceI)
forAll(mf, facei)
{
label cellI = mc[faceI];
label zoneI = mesh.cellZones().whichZone(cellI);
label celli = mc[facei];
label zoneI = mesh.cellZones().whichZone(celli);
addedCells[faceI] =
addedCells[facei] =
ref.setAction
(
polyAddCell
(
-1, // master point
-1, // master edge
mf[faceI], // master face
mf[facei], // master face
-1, // master cell
zoneI // zone for cell
)
@ -194,9 +194,9 @@ void Foam::layerAdditionRemoval::addCellLayer
// owner: if the master cell is equal to the face owner the flux
// remains the same; otherwise it is flipped
forAll(zoneFaces, faceI)
forAll(zoneFaces, facei)
{
const face oldFace = zoneFaces[faceI].reverseFace();
const face oldFace = zoneFaces[facei].reverseFace();
face newFace(oldFace.size());
@ -210,8 +210,8 @@ void Foam::layerAdditionRemoval::addCellLayer
// Flip the face as necessary
if
(
!mesh.isInternalFace(mf[faceI])
|| mc[faceI] == nei[mf[faceI]]
!mesh.isInternalFace(mf[facei])
|| mc[facei] == nei[mf[facei]]
)
{
flipFaceFlux = true;
@ -223,11 +223,11 @@ void Foam::layerAdditionRemoval::addCellLayer
polyAddFace
(
newFace, // face
mc[faceI], // owner
addedCells[faceI], // neighbour
mc[facei], // owner
addedCells[facei], // neighbour
-1, // master point
-1, // master edge
mf[faceI], // master face for addition
mf[facei], // master face for addition
flipFaceFlux, // flux flip
-1, // patch for face
-1, // zone for face
@ -238,8 +238,8 @@ void Foam::layerAdditionRemoval::addCellLayer
if (debug > 1)
{
Pout<< "adding face: " << newFace
<< " own: " << mc[faceI]
<< " nei: " << addedCells[faceI]
<< " own: " << mc[facei]
<< " nei: " << addedCells[facei]
<< endl;
}
}
@ -250,9 +250,9 @@ void Foam::layerAdditionRemoval::addCellLayer
// Pout<< "mfFlip: " << mfFlip << endl;
forAll(mf, faceI)
forAll(mf, facei)
{
const label curfaceID = mf[faceI];
const label curfaceID = mf[facei];
// If the face is internal, modify its owner to be the newly
// created cell. No flip is necessary
@ -264,20 +264,20 @@ void Foam::layerAdditionRemoval::addCellLayer
(
faces[curfaceID], // modified face
curfaceID, // label of face being modified
addedCells[faceI], // owner
addedCells[facei], // owner
-1, // neighbour
false, // face flip
mesh.boundaryMesh().whichPatch(curfaceID),// patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
mfFlip[faceI] // face flip in zone
mfFlip[facei] // face flip in zone
)
);
if (debug > 1)
{
Pout<< "Modifying a boundary face. Face: " << curfaceID
<< " flip: " << mfFlip[faceI]
<< " flip: " << mfFlip[facei]
<< endl;
}
}
@ -285,7 +285,7 @@ void Foam::layerAdditionRemoval::addCellLayer
// If slave cell is owner, the face remains the same (but with
// a new neighbour - the newly created cell). Otherwise, the
// face is flipped.
else if (sc[faceI] == own[curfaceID])
else if (sc[facei] == own[curfaceID])
{
// Orientation is good, just change neighbour
ref.setAction
@ -295,12 +295,12 @@ void Foam::layerAdditionRemoval::addCellLayer
faces[curfaceID], // modified face
curfaceID, // label of face being modified
own[curfaceID], // owner
addedCells[faceI], // neighbour
addedCells[facei], // neighbour
false, // face flip
mesh.boundaryMesh().whichPatch(curfaceID),// patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
mfFlip[faceI] // face flip in zone
mfFlip[facei] // face flip in zone
)
);
@ -308,7 +308,7 @@ void Foam::layerAdditionRemoval::addCellLayer
{
Pout<< "modify face, no flip " << curfaceID
<< " own: " << own[curfaceID]
<< " nei: " << addedCells[faceI]
<< " nei: " << addedCells[facei]
<< endl;
}
}
@ -322,12 +322,12 @@ void Foam::layerAdditionRemoval::addCellLayer
faces[curfaceID].reverseFace(), // modified face
curfaceID, // label of face being modified
nei[curfaceID], // owner
addedCells[faceI], // neighbour
addedCells[facei], // neighbour
true, // face flip
mesh.boundaryMesh().whichPatch(curfaceID), // patch for face
false, // remove from zone
faceZoneID_.index(), // zone for face
!mfFlip[faceI] // face flip in zone
!mfFlip[facei] // face flip in zone
)
);
@ -335,7 +335,7 @@ void Foam::layerAdditionRemoval::addCellLayer
{
Pout<< "modify face, with flip " << curfaceID
<< " own: " << own[curfaceID]
<< " nei: " << addedCells[faceI]
<< " nei: " << addedCells[facei]
<< endl;
}
}
@ -422,9 +422,9 @@ void Foam::layerAdditionRemoval::addCellLayer
label patchID = -1;
label zoneID = -1;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
const label cf = curFaces[faceI];
const label cf = curFaces[facei];
if (!mesh.isInternalFace(cf))
{
@ -492,16 +492,16 @@ void Foam::layerAdditionRemoval::addCellLayer
const cellList& cells = mesh.cells();
forAll(mc, cellI)
forAll(mc, celli)
{
const labelList& curFaces = cells[mc[cellI]];
const labelList& curFaces = cells[mc[celli]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Check if the face belongs to the master zone; if not add it
if (zoneMesh.whichZone(curFaces[faceI]) != faceZoneID_.index())
if (zoneMesh.whichZone(curFaces[facei]) != faceZoneID_.index())
{
masterCellFaceMap.insert(curFaces[faceI]);
masterCellFaceMap.insert(curFaces[facei]);
}
}
}
@ -521,12 +521,12 @@ void Foam::layerAdditionRemoval::addCellLayer
// Grab the list of faces of the master layer
const labelList masterCellFaces = masterCellFaceMap.toc();
forAll(masterCellFaces, faceI)
forAll(masterCellFaces, facei)
{
// Attempt to renumber the face using the masterLayerPointMap.
// Missing point remain the same
const label curFaceID = masterCellFaces[faceI];
const label curFaceID = masterCellFaces[facei];
const face& oldFace = faces[curFaceID];

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
@ -234,9 +234,9 @@ bool Foam::layerAdditionRemoval::changeTopology() const
if (thicknessFromVolume_)
{
// Thickness calculated from cell volume/face area
forAll(fz, faceI)
forAll(fz, facei)
{
scalar curDelta = V[mc[faceI]]/mag(S[fz[faceI]]);
scalar curDelta = V[mc[facei]]/mag(S[fz[facei]]);
avgDelta += curDelta;
minDelta = min(minDelta, curDelta);
maxDelta = max(maxDelta, curDelta);
@ -250,9 +250,9 @@ bool Foam::layerAdditionRemoval::changeTopology() const
const Map<label>& zoneMeshPointMap = fz().meshPointMap();
// Edges with only one point on zone
forAll(mc, faceI)
forAll(mc, facei)
{
const cell& cFaces = mesh.cells()[mc[faceI]];
const cell& cFaces = mesh.cells()[mc[facei]];
const edgeList cellEdges(cFaces.edges(mesh.faces()));
forAll(cellEdges, i)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,12 +54,12 @@ bool Foam::layerAdditionRemoval::validCollapse() const
label nBoundaryHits = 0;
forAll(mf, faceI)
forAll(mf, facei)
{
if
(
!mesh.isInternalFace(mf[faceI])
&& !mesh.isInternalFace(ftc[faceI])
!mesh.isInternalFace(mf[facei])
&& !mesh.isInternalFace(ftc[facei])
)
{
nBoundaryHits++;
@ -115,18 +115,18 @@ void Foam::layerAdditionRemoval::removeCellLayer
const labelList& mc =
mesh.faceZones()[faceZoneID_.index()].masterCells();
forAll(mc, faceI)
forAll(mc, facei)
{
label slaveSideCell = own[ftc[faceI]];
label slaveSideCell = own[ftc[facei]];
if (mesh.isInternalFace(ftc[faceI]) && slaveSideCell == mc[faceI])
if (mesh.isInternalFace(ftc[facei]) && slaveSideCell == mc[facei])
{
// Owner cell of the face is being removed.
// Grab the neighbour instead
slaveSideCell = nei[ftc[faceI]];
slaveSideCell = nei[ftc[facei]];
}
ref.setAction(polyRemoveCell(mc[faceI], slaveSideCell));
ref.setAction(polyRemoveCell(mc[facei], slaveSideCell));
}
// Remove all the faces from the master layer cells which are not in
@ -135,20 +135,20 @@ void Foam::layerAdditionRemoval::removeCellLayer
const cellList& cells = mesh.cells();
forAll(mc, cellI)
forAll(mc, celli)
{
const cell& curCell = cells[mc[cellI]];
const cell& curCell = cells[mc[celli]];
forAll(curCell, faceI)
forAll(curCell, facei)
{
// Check if the face is in the master zone. If not, remove it
if
(
mesh.faceZones().whichZone(curCell[faceI])
mesh.faceZones().whichZone(curCell[facei])
!= faceZoneID_.index()
)
{
facesToRemoveMap.insert(curCell[faceI]);
facesToRemoveMap.insert(curCell[facei]);
}
}
}
@ -192,11 +192,11 @@ void Foam::layerAdditionRemoval::removeCellLayer
{
const labelList& curFaces = pf[ptc[pointI]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
if (!facesToRemoveMap.found(curFaces[faceI]))
if (!facesToRemoveMap.found(curFaces[facei]))
{
facesToModify.insert(curFaces[faceI]);
facesToModify.insert(curFaces[facei]);
}
}
}
@ -208,12 +208,12 @@ void Foam::layerAdditionRemoval::removeCellLayer
Pout<< "faces to modify: " << ftm << endl;
}
forAll(ftm, faceI)
forAll(ftm, facei)
{
// For every face to modify, copy the face and re-map the vertices.
// It is known all the faces will be changed since they hang off
// re-mapped vertices
label curFaceID = ftm[faceI];
label curFaceID = ftm[facei];
face newFace(faces[curFaceID]);
@ -276,19 +276,19 @@ void Foam::layerAdditionRemoval::removeCellLayer
const labelList& mf = mesh.faceZones()[faceZoneID_.index()];
const boolList& mfFlip = mesh.faceZones()[faceZoneID_.index()].flipMap();
forAll(mf, faceI)
forAll(mf, facei)
{
// Grab the owner and neighbour of the faces to be collapsed and get rid
// of the cell to be removed
label masterSideCell = own[mf[faceI]];
label masterSideCell = own[mf[facei]];
if (masterSideCell == mc[faceI])
if (masterSideCell == mc[facei])
{
if (mesh.isInternalFace(mf[faceI]))
if (mesh.isInternalFace(mf[facei]))
{
// Owner cell of the face is being removed.
// Grab the neighbour instead
masterSideCell = nei[mf[faceI]];
masterSideCell = nei[mf[facei]];
}
else
{
@ -296,15 +296,15 @@ void Foam::layerAdditionRemoval::removeCellLayer
}
}
label slaveSideCell = own[ftc[faceI]];
label slaveSideCell = own[ftc[facei]];
if (slaveSideCell == mc[faceI])
if (slaveSideCell == mc[facei])
{
if (mesh.isInternalFace(ftc[faceI]))
if (mesh.isInternalFace(ftc[facei]))
{
// Owner cell of the face is being removed.
// Grab the neighbour instead
slaveSideCell = nei[ftc[faceI]];
slaveSideCell = nei[ftc[facei]];
}
else
{
@ -323,23 +323,23 @@ void Foam::layerAdditionRemoval::removeCellLayer
// A boundary-to-boundary collapse is checked for in validCollapse()
// and cannot happen here.
if (!mesh.isInternalFace(mf[faceI]))
if (!mesh.isInternalFace(mf[facei]))
{
// Master is the boundary face: it gets a new owner but no flip
newOwner = slaveSideCell;
newNeighbour = -1;
flipFace = false;
newPatchID = mesh.boundaryMesh().whichPatch(mf[faceI]);
newZoneID = mesh.faceZones().whichZone(mf[faceI]);
newPatchID = mesh.boundaryMesh().whichPatch(mf[facei]);
newZoneID = mesh.faceZones().whichZone(mf[facei]);
}
else if (!mesh.isInternalFace(ftc[faceI]))
else if (!mesh.isInternalFace(ftc[facei]))
{
// Slave is the boundary face: grab its patch
newOwner = slaveSideCell;
newNeighbour = -1;
// Find out if the face flip is necessary
if (own[mf[faceI]] == slaveSideCell)
if (own[mf[facei]] == slaveSideCell)
{
flipFace = false;
}
@ -348,10 +348,10 @@ void Foam::layerAdditionRemoval::removeCellLayer
flipFace = true;
}
newPatchID = mesh.boundaryMesh().whichPatch(ftc[faceI]);
newPatchID = mesh.boundaryMesh().whichPatch(ftc[facei]);
// The zone of the master face is preserved
newZoneID = mesh.faceZones().whichZone(mf[faceI]);
newZoneID = mesh.faceZones().whichZone(mf[facei]);
}
else
{
@ -360,7 +360,7 @@ void Foam::layerAdditionRemoval::removeCellLayer
newOwner = min(masterSideCell, slaveSideCell);
newNeighbour = max(masterSideCell, slaveSideCell);
if (newOwner == own[mf[faceI]] || newNeighbour == nei[mf[faceI]])
if (newOwner == own[mf[facei]] || newNeighbour == nei[mf[facei]])
{
flipFace = false;
}
@ -372,12 +372,12 @@ void Foam::layerAdditionRemoval::removeCellLayer
newPatchID = -1;
// The zone of the master face is preserved
newZoneID = mesh.faceZones().whichZone(mf[faceI]);
newZoneID = mesh.faceZones().whichZone(mf[facei]);
}
// Modify the face and flip if necessary
face newFace = faces[mf[faceI]];
bool zoneFlip = mfFlip[faceI];
face newFace = faces[mf[facei]];
bool zoneFlip = mfFlip[facei];
if (flipFace)
{
@ -387,15 +387,15 @@ void Foam::layerAdditionRemoval::removeCellLayer
if (debug > 1)
{
Pout<< "Modifying face " << mf[faceI]
Pout<< "Modifying face " << mf[facei]
<< " newFace: " << newFace << nl
<< " newOwner: " << newOwner
<< " newNeighbour: " << newNeighbour
<< " flipFace: " << flipFace
<< " newPatchID: " << newPatchID
<< " newZoneID: " << newZoneID << nl
<< " oldOwn: " << own[mf[faceI]]
<< " oldNei: " << nei[mf[faceI]] << endl;
<< " oldOwn: " << own[mf[facei]]
<< " oldNei: " << nei[mf[facei]] << endl;
}
ref.setAction
@ -403,7 +403,7 @@ void Foam::layerAdditionRemoval::removeCellLayer
polyModifyFace
(
newFace, // modified face
mf[faceI], // label of face being modified
mf[facei], // label of face being modified
newOwner, // owner
newNeighbour, // neighbour
flipFace, // flip

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
@ -99,20 +99,20 @@ bool Foam::layerAdditionRemoval::setLayerPairing() const
label nPointErrors = 0;
label nFaceErrors = 0;
forAll(mf, faceI)
forAll(mf, facei)
{
// Get the local master face
face curLocalFace = mlf[faceI];
face curLocalFace = mlf[facei];
// Flip face based on flip index to recover original orientation
if (mfFlip[faceI])
if (mfFlip[facei])
{
curLocalFace.flip();
}
// Get the opposing face from the master cell
oppositeFace lidFace =
cells[mc[faceI]].opposingFace(mf[faceI], faces);
cells[mc[facei]].opposingFace(mf[facei], faces);
if (!lidFace.found())
{
@ -123,8 +123,8 @@ bool Foam::layerAdditionRemoval::setLayerPairing() const
if (debug > 1)
{
Pout<< "curMasterFace: " << faces[mf[faceI]] << nl
<< "cell shape: " << mesh.cellShapes()[mc[faceI]] << nl
Pout<< "curMasterFace: " << faces[mf[facei]] << nl
<< "cell shape: " << mesh.cellShapes()[mc[facei]] << nl
<< "curLocalFace: " << curLocalFace << nl
<< "lidFace: " << lidFace
<< " master index: " << lidFace.masterIndex()
@ -132,7 +132,7 @@ bool Foam::layerAdditionRemoval::setLayerPairing() const
}
// Grab the opposite face for face collapse addressing
ftc[faceI] = lidFace.oppositeIndex();
ftc[facei] = lidFace.oppositeIndex();
// Using the local face insert the points into the lid list
forAll(curLocalFace, pointI)

File diff suppressed because it is too large Load Diff

View File

@ -182,13 +182,13 @@ class cellCuts
//- Debugging: write cell's edges and any cut vertices and edges
// (so no cell loop determined yet)
void writeUncutOBJ(const fileName&, const label cellI) const;
void writeUncutOBJ(const fileName&, const label celli) const;
//- Debugging: write cell's edges, loop and anchors to directory.
void writeOBJ
(
const fileName& dir,
const label cellI,
const label celli,
const pointField& loopPoints,
const labelList& anchors
) const;
@ -196,7 +196,7 @@ class cellCuts
//- Find face on cell using the two edges.
label edgeEdgeToFace
(
const label cellI,
const label celli,
const label edgeA,
const label edgeB
) const;
@ -205,7 +205,7 @@ class cellCuts
//- Find face on cell using an edge and a vertex.
label edgeVertexToFace
(
const label cellI,
const label celli,
const label edgeI,
const label vertI
) const;
@ -213,7 +213,7 @@ class cellCuts
//- Find face using two vertices (guaranteed not to be along edge)
label vertexVertexToFace
(
const label cellI,
const label celli,
const label vertA,
const label vertB
) const;
@ -227,21 +227,21 @@ class cellCuts
// Loop (cuts on cell circumference) calculation
//- Find edge (or -1) on faceI using vertices v0,v1
//- Find edge (or -1) on facei using vertices v0,v1
label findEdge
(
const label faceI,
const label facei,
const label v0,
const label v1
) const;
//- Find face on which all cuts are (very rare) or -1.
label loopFace(const label cellI, const labelList& loop) const;
label loopFace(const label celli, const labelList& loop) const;
//- Cross otherCut into next faces (not exclude0, exclude1)
bool walkPoint
(
const label cellI,
const label celli,
const label startCut,
const label exclude0,
@ -253,12 +253,12 @@ class cellCuts
labelList& visited
) const;
//- Cross cut (which is edge on faceI) onto next face
//- Cross cut (which is edge on facei) onto next face
bool crossEdge
(
const label cellI,
const label celli,
const label startCut,
const label faceI,
const label facei,
const label otherCut,
label& nVisited,
@ -269,20 +269,20 @@ class cellCuts
// cuts.
bool addCut
(
const label cellI,
const label celli,
const label cut,
label& nVisited,
labelList& visited
) const;
//- Walk across faceI following cuts, starting at cut. Stores cuts
//- Walk across facei following cuts, starting at cut. Stores cuts
// visited
// Returns true if valid walk.
bool walkFace
(
const label cellI,
const label celli,
const label startCut,
const label faceI,
const label facei,
const label cut,
label& lastCut,
@ -296,9 +296,9 @@ class cellCuts
// vertices found.
bool walkCell
(
const label cellI,
const label celli,
const label startCut, // overall starting cut
const label faceI,
const label facei,
const label prevCut, // current cut
label& nVisited,
labelList& visited
@ -310,10 +310,10 @@ class cellCuts
// Cell anchoring
//- Are there enough faces on anchor side of cellI?
//- Are there enough faces on anchor side of celli?
bool checkFaces
(
const label cellI,
const label celli,
const labelList& anchorPoints
) const;
@ -321,7 +321,7 @@ class cellCuts
// marks visited edges and vertices with status.
void walkEdges
(
const label cellI,
const label celli,
const label pointI,
const label status,
@ -332,7 +332,7 @@ class cellCuts
//- Check anchor points on 'outside' of loop
bool loopAnchorConsistent
(
const label cellI,
const label celli,
const pointField& loopPts,
const labelList& anchorPoints
) const;
@ -342,7 +342,7 @@ class cellCuts
// points determined, false otherwise.
bool calcAnchors
(
const label cellI,
const label celli,
const labelList& loop,
const pointField& loopPts,
@ -371,7 +371,7 @@ class cellCuts
//- Counts number of cuts on face.
label countFaceCuts
(
const label faceI,
const label facei,
const labelList& loop
) const;
@ -379,7 +379,7 @@ class cellCuts
// Does not use cut-addressing (faceCuts_, cutCuts_)
bool conservativeValidLoop
(
const label cellI,
const label celli,
const labelList& loop
) const;
@ -389,7 +389,7 @@ class cellCuts
// points on one side of the loop.
bool validLoop
(
const label cellI,
const label celli,
const labelList& loop,
const scalarField& loopWeights,
Map<edge>& newFaceSplitCut,
@ -404,7 +404,7 @@ class cellCuts
//- Update basic cut information for single cell from cellLoop.
bool setFromCellLoop
(
const label cellI,
const label celli,
const labelList& loop,
const scalarField& loopWeights
);
@ -593,7 +593,7 @@ public:
//- Returns coordinates of points on loop for given cell.
// Uses cellLoops_ and edgeWeight_
pointField loopPoints(const label cellI) const;
pointField loopPoints(const label celli) const;
//- Invert anchor point selection.
labelList nonAnchorPoints
@ -603,12 +603,12 @@ public:
const labelList& loop
) const;
//- Flip loop for cellI. Updates anchor points as well.
void flip(const label cellI);
//- Flip loop for celli. Updates anchor points as well.
void flip(const label celli);
//- Flip loop for cellI. Does not update anchors. Use with care
//- Flip loop for celli. Does not update anchors. Use with care
// (only if you're sure loop orientation is wrong)
void flipLoopOnly(const label cellI);
void flipLoopOnly(const label celli);
// Write
@ -625,7 +625,7 @@ public:
void writeOBJ(Ostream& os) const;
//- debugging:Write edges of cell and loop
void writeCellOBJ(const fileName& dir, const label cellI) const;
void writeCellOBJ(const fileName& dir, const label celli) const;
};

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
@ -67,14 +67,14 @@ Foam::autoPtr<Foam::cellLooper> Foam::cellLooper::New
// Get faces (on cell) connected to vertI which are not using edgeI
Foam::labelList Foam::cellLooper::getVertFacesNonEdge
(
const label cellI,
const label celli,
const label edgeI,
const label vertI
) const
{
// Get faces connected to startEdge
label face0, face1;
meshTools::getEdgeFaces(mesh(), cellI, edgeI, face0, face1);
meshTools::getEdgeFaces(mesh(), celli, edgeI, face0, face1);
const labelList& pFaces = mesh().pointFaces()[vertI];
@ -83,16 +83,16 @@ Foam::labelList Foam::cellLooper::getVertFacesNonEdge
forAll(pFaces, pFaceI)
{
label faceI = pFaces[pFaceI];
label facei = pFaces[pFaceI];
if
(
(faceI != face0)
&& (faceI != face1)
&& (meshTools::faceOnCell(mesh(), cellI, faceI))
(facei != face0)
&& (facei != face1)
&& (meshTools::faceOnCell(mesh(), celli, facei))
)
{
vertFaces[vertFaceI++] = faceI;
vertFaces[vertFaceI++] = facei;
}
}
vertFaces.setSize(vertFaceI);
@ -101,14 +101,14 @@ Foam::labelList Foam::cellLooper::getVertFacesNonEdge
}
// Get first edge connected to vertI and on faceI
// Get first edge connected to vertI and on facei
Foam::label Foam::cellLooper::getFirstVertEdge
(
const label faceI,
const label facei,
const label vertI
) const
{
const labelList& fEdges = mesh().faceEdges()[faceI];
const labelList& fEdges = mesh().faceEdges()[facei];
forAll(fEdges, fEdgeI)
{
@ -123,7 +123,7 @@ Foam::label Foam::cellLooper::getFirstVertEdge
}
FatalErrorInFunction
<< "Can not find edge on face " << faceI
<< "Can not find edge on face " << facei
<< " using vertex " << vertI
<< abort(FatalError);
@ -131,15 +131,15 @@ Foam::label Foam::cellLooper::getFirstVertEdge
}
// Get edges (on cell) connected to vertI which are not on faceI
// Get edges (on cell) connected to vertI which are not on facei
Foam::labelList Foam::cellLooper::getVertEdgesNonFace
(
const label cellI,
const label faceI,
const label celli,
const label facei,
const label vertI
) const
{
const labelList& exclEdges = mesh().faceEdges()[faceI];
const labelList& exclEdges = mesh().faceEdges()[facei];
const labelList& pEdges = mesh().pointEdges()[vertI];
@ -153,7 +153,7 @@ Foam::labelList Foam::cellLooper::getVertEdgesNonFace
if
(
(findIndex(exclEdges, edgeI) == -1)
&& meshTools::edgeOnCell(mesh(), cellI, edgeI)
&& meshTools::edgeOnCell(mesh(), celli, edgeI)
)
{
vertEdges[vertEdgeI++] = edgeI;
@ -171,10 +171,10 @@ Foam::labelList Foam::cellLooper::getVertEdgesNonFace
Foam::label Foam::cellLooper::getMisAlignedEdge
(
const vector& refDir,
const label cellI
const label celli
) const
{
const labelList& cEdges = mesh().cellEdges()[cellI];
const labelList& cEdges = mesh().cellEdges()[celli];
label cutEdgeI = -1;
scalar maxCos = -GREAT;

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
@ -81,29 +81,29 @@ protected:
//- Get faces (on cell) connected to vertI which are not using edgeI
labelList getVertFacesNonEdge
(
const label cellI,
const label celli,
const label edgeI,
const label vertI
) const;
//- Get first edge connected to vertI and on faceI
//- Get first edge connected to vertI and on facei
label getFirstVertEdge
(
const label faceI,
const label facei,
const label vertI
) const;
//- Get edges (on cell) connected to vertI which are not on faceI
//- Get edges (on cell) connected to vertI which are not on facei
labelList getVertEdgesNonFace
(
const label cellI,
const label faceI,
const label celli,
const label facei,
const label vertI
) const;
//- Return edge from cellEdges that is most perpendicular
// to refinement direction.
label getMisAlignedEdge(const vector& refDir, const label cellI) const;
label getMisAlignedEdge(const vector& refDir, const label celli) const;
private:
@ -166,7 +166,7 @@ public:
// Member Functions
//- Create cut along circumference of cellI. Gets current mesh cuts
//- Create cut along circumference of celli. Gets current mesh cuts
// vertIsCut, edgeIsCut, edgeWeight).
// Cut along circumference is expressed as cellVertCut,
// cellEdgeToWeight. Returns true if succesfull. Still might not
@ -175,7 +175,7 @@ public:
virtual bool cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -189,7 +189,7 @@ public:
virtual bool cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,

View File

@ -228,7 +228,7 @@ Foam::geomCellLooper::~geomCellLooper()
bool Foam::geomCellLooper::cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -240,8 +240,8 @@ bool Foam::geomCellLooper::cut
// Cut through cell centre normal to refDir.
return cut
(
plane(mesh().cellCentres()[cellI], refDir),
cellI,
plane(mesh().cellCentres()[celli], refDir),
celli,
vertIsCut,
edgeIsCut,
edgeWeight,
@ -254,7 +254,7 @@ bool Foam::geomCellLooper::cut
bool Foam::geomCellLooper::cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList&,
const boolList&,
const scalarField&,
@ -277,7 +277,7 @@ bool Foam::geomCellLooper::cut
// might not be snapped.
// Size overly big.
label nEstCuts = 2*mesh().cells()[cellI].size();
label nEstCuts = 2*mesh().cells()[celli].size();
DynamicList<label> localLoop(nEstCuts);
DynamicList<scalar> localLoopWeights(nEstCuts);
@ -286,7 +286,7 @@ bool Foam::geomCellLooper::cut
// at the same time.
labelHashSet checkedPoints(nEstCuts);
const labelList& cellEdges = mesh().cellEdges()[cellI];
const labelList& cellEdges = mesh().cellEdges()[celli];
forAll(cellEdges, i)
{
@ -472,7 +472,7 @@ bool Foam::geomCellLooper::cut
if (debug&2)
{
Pout<< "cell:" << cellI << endl;
Pout<< "cell:" << celli << endl;
forAll(loop, i)
{
Pout<< "At angle:" << sortedAngles[i] << endl

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
@ -154,14 +154,14 @@ public:
//- Create cut along circumference of cellI. Gets current mesh cuts.
//- Create cut along circumference of celli. Gets current mesh cuts.
// Cut along circumference is expressed as loop of cuts plus weights
// for cuts along edges (only valid for edge cuts).
// Return true if successful cut.
virtual bool cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -175,7 +175,7 @@ public:
virtual bool cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,

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
@ -48,7 +48,7 @@ addToRunTimeSelectionTable(cellLooper, hexCellLooper, word);
// Starting from cut edge start walking.
bool Foam::hexCellLooper::walkHex
(
const label cellI,
const label celli,
const label startFaceI,
const label startEdgeI,
@ -56,7 +56,7 @@ bool Foam::hexCellLooper::walkHex
scalarField& loopWeights
) const
{
label faceI = startFaceI;
label facei = startFaceI;
label edgeI = startEdgeI;
@ -75,12 +75,12 @@ bool Foam::hexCellLooper::walkHex
loopWeights[cutI] = 0.5;
cutI++;
faceI = meshTools::otherFace(mesh(), cellI, faceI, edgeI);
facei = meshTools::otherFace(mesh(), celli, facei, edgeI);
const edge& e = mesh().edges()[edgeI];
// Walk two edges further
edgeI = meshTools::walkFace(mesh(), faceI, edgeI, e.end(), 2);
edgeI = meshTools::walkFace(mesh(), facei, edgeI, e.end(), 2);
if (edgeI == startEdgeI)
{
@ -92,7 +92,7 @@ bool Foam::hexCellLooper::walkHex
// Checks.
if (cutI > 4)
{
Pout<< "hexCellLooper::walkHex" << "Problem : cell:" << cellI
Pout<< "hexCellLooper::walkHex" << "Problem : cell:" << celli
<< " collected loop:";
writeCuts(Pout, loop, loopWeights);
Pout<< "loopWeights:" << loopWeights << endl;
@ -168,7 +168,7 @@ Foam::hexCellLooper::~hexCellLooper()
bool Foam::hexCellLooper::cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -179,29 +179,29 @@ bool Foam::hexCellLooper::cut
{
bool success = false;
if (mesh().cellShapes()[cellI].model() == hex_)
if (mesh().cellShapes()[celli].model() == hex_)
{
// Get starting edge. Note: should be compatible with way refDir is
// determined.
label edgeI = meshTools::cutDirToEdge(mesh(), cellI, refDir);
label edgeI = meshTools::cutDirToEdge(mesh(), celli, refDir);
// Get any face using edge
label face0;
label face1;
meshTools::getEdgeFaces(mesh(), cellI, edgeI, face0, face1);
meshTools::getEdgeFaces(mesh(), celli, edgeI, face0, face1);
// Walk circumference of hex, cutting edges only
loop.setSize(4);
loopWeights.setSize(4);
success = walkHex(cellI, face0, edgeI, loop, loopWeights);
success = walkHex(celli, face0, edgeI, loop, loopWeights);
}
else
{
success = geomCellLooper::cut
(
refDir,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,
@ -216,9 +216,9 @@ bool Foam::hexCellLooper::cut
if (loop.empty())
{
WarningInFunction
<< "could not cut cell " << cellI << endl;
<< "could not cut cell " << celli << endl;
fileName cutsFile("hexCellLooper_" + name(cellI) + ".obj");
fileName cutsFile("hexCellLooper_" + name(celli) + ".obj");
Pout<< "hexCellLooper : writing cell to " << cutsFile << endl;
@ -230,7 +230,7 @@ bool Foam::hexCellLooper::cut
mesh().cells(),
mesh().faces(),
mesh().points(),
labelList(1, cellI)
labelList(1, celli)
);
return false;
@ -273,7 +273,7 @@ bool Foam::hexCellLooper::cut
bool Foam::hexCellLooper::cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -286,7 +286,7 @@ bool Foam::hexCellLooper::cut
geomCellLooper::cut
(
cutPlane,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,

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
@ -78,7 +78,7 @@ private:
// Return true if successful walk. (should be always!)
bool walkHex
(
const label cellI,
const label celli,
const label startFaceI,
const label startEdgeI,
@ -122,14 +122,14 @@ public:
// Member Functions
//- Create cut along circumference of cellI. Gets current mesh cuts.
//- Create cut along circumference of celli. Gets current mesh cuts.
// Cut along circumference is expressed as loop of cuts plus weights
// for cuts along edges (only valid for edge cuts).
// Return true if successful cut.
virtual bool cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -144,7 +144,7 @@ public:
virtual bool cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,

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
@ -132,7 +132,7 @@ void Foam::topoCellLooper::subsetList
void Foam::topoCellLooper::walkFace
(
const cellFeatures& features,
const label faceI,
const label facei,
const label startEdgeI,
const label startVertI,
const label nFeaturePts,
@ -141,7 +141,7 @@ void Foam::topoCellLooper::walkFace
label& vertI
) const
{
const labelList& fEdges = mesh().faceEdges()[faceI];
const labelList& fEdges = mesh().faceEdges()[facei];
edgeI = startEdgeI;
@ -155,17 +155,17 @@ void Foam::topoCellLooper::walkFace
// Started on edge. Go to one of its endpoints.
vertI = mesh().edges()[edgeI].start();
if (features.isFeatureVertex(faceI, vertI))
if (features.isFeatureVertex(facei, vertI))
{
nVisited++;
}
}
if ((edgeI == -1) || !meshTools::edgeOnFace(mesh(), faceI, edgeI))
if ((edgeI == -1) || !meshTools::edgeOnFace(mesh(), facei, edgeI))
{
// Either edge is not set or not on current face. Just take one of
// the edges on this face as starting edge.
edgeI = getFirstVertEdge(faceI, vertI);
edgeI = getFirstVertEdge(facei, vertI);
}
// Now we should have starting edge on face and a vertex on that edge.
@ -182,7 +182,7 @@ void Foam::topoCellLooper::walkFace
vertI = mesh().edges()[edgeI].otherVertex(vertI);
if (features.isFeatureVertex(faceI, vertI))
if (features.isFeatureVertex(facei, vertI))
{
nVisited++;
}
@ -197,12 +197,12 @@ void Foam::topoCellLooper::walkFace
Foam::labelList Foam::topoCellLooper::getSuperEdge
(
const cellFeatures& features,
const label faceI,
const label facei,
const label startEdgeI,
const label startVertI
) const
{
const labelList& fEdges = mesh().faceEdges()[faceI];
const labelList& fEdges = mesh().faceEdges()[facei];
labelList superVerts(fEdges.size());
label superVertI = 0;
@ -239,13 +239,13 @@ Foam::labelList Foam::topoCellLooper::getSuperEdge
Foam::label Foam::topoCellLooper::getAlignedNonFeatureEdge
(
const vector& refDir,
const label cellI,
const label celli,
const cellFeatures& features
) const
{
const labelList& cEdges = mesh().cellEdges()[cellI];
const labelList& cEdges = mesh().cellEdges()[celli];
const point& ctr = mesh().cellCentres()[cellI];
const point& ctr = mesh().cellCentres()[celli];
label cutEdgeI = -1;
scalar maxCos = -GREAT;
@ -286,7 +286,7 @@ Foam::label Foam::topoCellLooper::getAlignedNonFeatureEdge
void Foam::topoCellLooper::walkAcrossFace
(
const cellFeatures& features,
const label faceI,
const label facei,
const label startEdgeI,
const label startVertI,
const label nFeats,
@ -302,7 +302,7 @@ void Foam::topoCellLooper::walkAcrossFace
walkFace
(
features,
faceI,
facei,
startEdgeI,
startVertI,
nFeats,
@ -317,7 +317,7 @@ void Foam::topoCellLooper::walkAcrossFace
getSuperEdge
(
features,
faceI,
facei,
oppositeEdgeI,
oppositeVertI
);
@ -359,19 +359,19 @@ void Foam::topoCellLooper::walkAcrossFace
//
// Position on face is given by:
//
// vertI == -1, faceI != -1, edgeI != -1
// vertI == -1, facei != -1, edgeI != -1
// on edge of face. Cross edge to neighbouring face.
//
// vertI != -1, edgeI != -1, faceI == -1
// vertI != -1, edgeI != -1, facei == -1
// coming from edge onto vertex vertI. Need to step to one
// of the faces not using edgeI.
//
// vertI != -1, edgeI == -1, faceI != -1
// vertI != -1, edgeI == -1, facei != -1
// coming from vertex on side of face. Step to one of the faces
// using vertI but not faceI
// using vertI but not facei
void Foam::topoCellLooper::walkSplitHex
(
const label cellI,
const label celli,
const cellFeatures& features,
const label fromFaceI,
const label fromEdgeI,
@ -382,7 +382,7 @@ void Foam::topoCellLooper::walkSplitHex
) const
{
// Work vars giving position on cell
label faceI = fromFaceI;
label facei = fromFaceI;
label edgeI = fromEdgeI;
label vertI = fromVertI;
@ -390,10 +390,10 @@ void Foam::topoCellLooper::walkSplitHex
{
if (debug)
{
Pout<< "Entering walk with : cell:" << cellI << " face:" << faceI;
if (faceI != -1)
Pout<< "Entering walk with : cell:" << celli << " face:" << facei;
if (facei != -1)
{
Pout<< " verts:" << mesh().faces()[faceI];
Pout<< " verts:" << mesh().faces()[facei];
}
Pout<< " edge:" << edgeI;
if (edgeI != -1)
@ -466,13 +466,13 @@ void Foam::topoCellLooper::walkSplitHex
loopWeights.append(0.5);
// Cross edge to next face
faceI = meshTools::otherFace(mesh(), cellI, faceI, edgeI);
facei = meshTools::otherFace(mesh(), celli, facei, edgeI);
if (debug)
{
Pout<< " stepped across edge " << mesh().edges()[edgeI]
<< " to face " << faceI << " verts:"
<< mesh().faces()[faceI] << endl;
<< " to face " << facei << " verts:"
<< mesh().faces()[facei] << endl;
}
label nextEdgeI = -1;
@ -482,7 +482,7 @@ void Foam::topoCellLooper::walkSplitHex
walkAcrossFace
(
features,
faceI,
facei,
edgeI,
vertI,
2,
@ -504,11 +504,11 @@ void Foam::topoCellLooper::walkSplitHex
if (edgeI == -1)
{
// Normal vertex on edge of face. Get edges connected to it
// which are not on faceI.
// which are not on facei.
labelList nextEdges = getVertEdgesNonFace
(
cellI,
faceI,
celli,
facei,
vertI
);
@ -523,11 +523,11 @@ void Foam::topoCellLooper::walkSplitHex
if
(
(thisFaceI != faceI)
&& meshTools::faceOnCell(mesh(), cellI, thisFaceI)
(thisFaceI != facei)
&& meshTools::faceOnCell(mesh(), celli, thisFaceI)
)
{
faceI = thisFaceI;
facei = thisFaceI;
break;
}
}
@ -535,8 +535,8 @@ void Foam::topoCellLooper::walkSplitHex
if (debug)
{
Pout<< " stepped from non-edge vertex " << vertI
<< " to face " << faceI << " verts:"
<< mesh().faces()[faceI]
<< " to face " << facei << " verts:"
<< mesh().faces()[facei]
<< " since candidate edges:" << nextEdges << endl;
}
@ -546,7 +546,7 @@ void Foam::topoCellLooper::walkSplitHex
walkAcrossFace
(
features,
faceI,
facei,
edgeI,
vertI,
2, // 2 vertices to cross
@ -574,7 +574,7 @@ void Foam::topoCellLooper::walkSplitHex
vertI = mesh().edges()[edgeI].otherVertex(vertI);
faceI = -1;
facei = -1;
}
else
{
@ -595,7 +595,7 @@ void Foam::topoCellLooper::walkSplitHex
vertI = mesh().edges()[edgeI].otherVertex(vertI);
faceI = -1;
facei = -1;
}
}
else
@ -604,7 +604,7 @@ void Foam::topoCellLooper::walkSplitHex
labelList nextFaces =
getVertFacesNonEdge
(
cellI,
celli,
edgeI,
vertI
);
@ -612,7 +612,7 @@ void Foam::topoCellLooper::walkSplitHex
if (nextFaces.size() == 1)
{
// Only one face to cross.
faceI = nextFaces[0];
facei = nextFaces[0];
label nextEdgeI = -1;
label nextVertI = -1;
@ -620,7 +620,7 @@ void Foam::topoCellLooper::walkSplitHex
walkAcrossFace
(
features,
faceI,
facei,
edgeI,
vertI,
2, // 2 vertices to cross
@ -635,7 +635,7 @@ void Foam::topoCellLooper::walkSplitHex
else if (nextFaces.size() == 2)
{
// Split face. Get edge inbetween.
faceI = -1;
facei = -1;
edgeI =
meshTools::getSharedEdge
@ -653,17 +653,17 @@ void Foam::topoCellLooper::walkSplitHex
<< "Choosing from more than "
<< "two candidates:" << nextFaces
<< " when coming from vertex " << vertI << " on cell "
<< cellI << abort(FatalError);
<< celli << abort(FatalError);
}
}
}
if (debug)
{
Pout<< "Walked to : face:" << faceI;
if (faceI != -1)
Pout<< "Walked to : face:" << facei;
if (facei != -1)
{
Pout<< " verts:" << mesh().faces()[faceI];
Pout<< " verts:" << mesh().faces()[facei];
}
Pout<< " edge:" << edgeI;
if (edgeI != -1)
@ -697,7 +697,7 @@ Foam::topoCellLooper::~topoCellLooper()
bool Foam::topoCellLooper::cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -706,14 +706,14 @@ bool Foam::topoCellLooper::cut
scalarField& loopWeights
) const
{
if (mesh().cellShapes()[cellI].model() == hex_)
if (mesh().cellShapes()[celli].model() == hex_)
{
// Let parent handle hex case.
return
hexCellLooper::cut
(
refDir,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,
@ -723,7 +723,7 @@ bool Foam::topoCellLooper::cut
}
else
{
cellFeatures superCell(mesh(), featureCos, cellI);
cellFeatures superCell(mesh(), featureCos, celli);
if (hexMatcher().isA(superCell.faces()))
{
@ -731,13 +731,13 @@ bool Foam::topoCellLooper::cut
getAlignedNonFeatureEdge
(
refDir,
cellI,
celli,
superCell
);
label vertI = -1;
label faceI = -1;
label facei = -1;
if (edgeI != -1)
{
@ -748,26 +748,26 @@ bool Foam::topoCellLooper::cut
{
// No 'matching' non-feature edge found on cell. Get starting
// normal i.e. feature edge.
edgeI = getMisAlignedEdge(refDir, cellI);
edgeI = getMisAlignedEdge(refDir, celli);
// Get any face using edge
label face0;
label face1;
meshTools::getEdgeFaces(mesh(), cellI, edgeI, face0, face1);
meshTools::getEdgeFaces(mesh(), celli, edgeI, face0, face1);
faceI = face0;
facei = face0;
}
label nEstCuts = 2*mesh().cells()[cellI].size();
label nEstCuts = 2*mesh().cells()[celli].size();
DynamicList<label> localLoop(nEstCuts);
DynamicList<scalar> localLoopWeights(nEstCuts);
walkSplitHex
(
cellI,
celli,
superCell,
faceI,
facei,
edgeI,
vertI,
@ -793,7 +793,7 @@ bool Foam::topoCellLooper::cut
return hexCellLooper::cut
(
refDir,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,
@ -808,7 +808,7 @@ bool Foam::topoCellLooper::cut
bool Foam::topoCellLooper::cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -822,7 +822,7 @@ bool Foam::topoCellLooper::cut
hexCellLooper::cut
(
cutPlane,
cellI,
celli,
vertIsCut,
edgeIsCut,
edgeWeight,

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
@ -84,7 +84,7 @@ class topoCellLooper
void walkFace
(
const cellFeatures& features,
const label faceI,
const label facei,
const label startEdgeI,
const label startVertI,
const label nFeaturePts,
@ -99,7 +99,7 @@ class topoCellLooper
labelList getSuperEdge
(
const cellFeatures& features,
const label faceI,
const label facei,
const label startEdgeI,
const label startVertI
) const;
@ -109,7 +109,7 @@ class topoCellLooper
label getAlignedNonFeatureEdge
(
const vector& refDir,
const label cellI,
const label celli,
const cellFeatures& features
) const;
@ -120,7 +120,7 @@ class topoCellLooper
void walkAcrossFace
(
const cellFeatures& features,
const label faceI,
const label facei,
const label startEdgeI,
const label startVertI,
const label nFeats,
@ -133,7 +133,7 @@ class topoCellLooper
// outside of cell.
void walkSplitHex
(
const label cellI,
const label celli,
const cellFeatures& features,
const label fromFaceI,
const label fromEdgeI,
@ -174,14 +174,14 @@ public:
// Member Functions
//- Create cut along circumference of cellI. Gets current mesh cuts.
//- Create cut along circumference of celli. Gets current mesh cuts.
// Cut along circumference is expressed as loop of cuts plus weights
// for cuts along edges (only valid for edge cuts).
// Return true if successful cut.
virtual bool cut
(
const vector& refDir,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,
@ -195,7 +195,7 @@ public:
virtual bool cut
(
const plane& cutPlane,
const label cellI,
const label celli,
const boolList& vertIsCut,
const boolList& edgeIsCut,
const scalarField& edgeWeight,

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
@ -92,8 +92,8 @@ Foam::label Foam::directionInfo::lowest
Foam::label Foam::directionInfo::edgeToFaceIndex
(
const primitiveMesh& mesh,
const label cellI,
const label faceI,
const label celli,
const label facei,
const label edgeI
)
{
@ -101,19 +101,19 @@ Foam::label Foam::directionInfo::edgeToFaceIndex
{
FatalErrorInFunction
<< "Illegal edge label:" << edgeI
<< " when projecting cut edge from cell " << cellI
<< " to face " << faceI
<< " when projecting cut edge from cell " << celli
<< " to face " << facei
<< abort(FatalError);
}
const edge& e = mesh.edges()[edgeI];
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
// edgeI is either
// - in faceI. Convert into index in face.
// - in facei. Convert into index in face.
// - connected (but not in) to face. Return -1.
// - in face opposite faceI. Convert into index in face.
// - in face opposite facei. Convert into index in face.
label fpA = findIndex(f, e.start());
label fpB = findIndex(f, e.end());
@ -144,17 +144,17 @@ Foam::label Foam::directionInfo::edgeToFaceIndex
// - determine two faces using edge (one is the opposite face,
// one is 'side' face
// - walk on both these faces to opposite edge
// - check if this opposite edge is on faceI
// - check if this opposite edge is on facei
label f0I, f1I;
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0I, f1I);
meshTools::getEdgeFaces(mesh, celli, edgeI, f0I, f1I);
// Walk to opposite edge on face f0
label edge0I =
meshTools::walkFace(mesh, f0I, edgeI, e.start(), 2);
// Check if edge on faceI.
// Check if edge on facei.
const edge& e0 = mesh.edges()[edge0I];
@ -166,14 +166,14 @@ Foam::label Foam::directionInfo::edgeToFaceIndex
return lowest(f.size(), fpA, fpB);
}
// Face0 is doesn't have an edge on faceI (so must be the opposite
// Face0 is doesn't have an edge on facei (so must be the opposite
// face) so try face1.
// Walk to opposite edge on face f1
label edge1I =
meshTools::walkFace(mesh, f1I, edgeI, e.start(), 2);
// Check if edge on faceI.
// Check if edge on facei.
const edge& e1 = mesh.edges()[edge1I];
fpA = findIndex(f, e1.start());
@ -187,7 +187,7 @@ Foam::label Foam::directionInfo::edgeToFaceIndex
FatalErrorInFunction
<< "Found connected faces " << mesh.faces()[f0I] << " and "
<< mesh.faces()[f1I] << " sharing edge " << edgeI << endl
<< "But none seems to be connected to face " << faceI
<< "But none seems to be connected to face " << facei
<< " vertices:" << f
<< abort(FatalError);

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
@ -113,8 +113,8 @@ public:
static label edgeToFaceIndex
(
const primitiveMesh& mesh,
const label cellI,
const label faceI,
const label celli,
const label facei,
const label edgeI
);

View File

@ -166,7 +166,7 @@ inline bool Foam::directionInfo::updateCell
const edge& e = mesh.edges()[edgeI];
// Find face connected to face through edgeI and on same cell.
label faceI =
label facei =
meshTools::otherFace
(
mesh,
@ -175,12 +175,12 @@ inline bool Foam::directionInfo::updateCell
edgeI
);
// Find edge on faceI which is connected to e.start() but not edgeI.
// Find edge on facei which is connected to e.start() but not edgeI.
index_ =
meshTools::otherEdge
(
mesh,
mesh.faceEdges()[faceI],
mesh.faceEdges()[facei],
edgeI,
e.start()
);

View File

@ -94,14 +94,14 @@ void Foam::directions::writeOBJ
label vertI = 0;
forAll(dirs, cellI)
forAll(dirs, celli)
{
const point& ctr = mesh.cellCentres()[cellI];
const point& ctr = mesh.cellCentres()[celli];
// Calculate local length scale
scalar minDist = GREAT;
const labelList& nbrs = mesh.cellCells()[cellI];
const labelList& nbrs = mesh.cellCells()[celli];
forAll(nbrs, nbrI)
{
@ -110,7 +110,7 @@ void Foam::directions::writeOBJ
scalar scale = 0.5*minDist;
writeOBJ(xDirStream, ctr, ctr + scale*dirs[cellI], vertI);
writeOBJ(xDirStream, ctr, ctr + scale*dirs[celli], vertI);
}
}
@ -154,12 +154,12 @@ Foam::vectorField Foam::directions::propagateDirection
{
label meshFaceI = pp.start() + patchFaceI;
label cellI = mesh.faceOwner()[meshFaceI];
label celli = mesh.faceOwner()[meshFaceI];
if (!hexMatcher().isA(mesh, cellI))
if (!hexMatcher().isA(mesh, celli))
{
FatalErrorInFunction
<< "useHexTopology specified but cell " << cellI
<< "useHexTopology specified but cell " << celli
<< " on face " << patchFaceI << " of patch " << pp.name()
<< " is not a hex" << exit(FatalError);
}
@ -167,14 +167,14 @@ Foam::vectorField Foam::directions::propagateDirection
const vector& cutDir = ppField[patchFaceI];
// Get edge(bundle) on cell most in direction of cutdir
label edgeI = meshTools::cutDirToEdge(mesh, cellI, cutDir);
label edgeI = meshTools::cutDirToEdge(mesh, celli, cutDir);
// Convert edge into index on face
label faceIndex =
directionInfo::edgeToFaceIndex
(
mesh,
cellI,
celli,
meshFaceI,
edgeI
);
@ -219,26 +219,26 @@ Foam::vectorField Foam::directions::propagateDirection
label nGeom = 0;
label nTopo = 0;
forAll(cellInfo, cellI)
forAll(cellInfo, celli)
{
label index = cellInfo[cellI].index();
label index = cellInfo[celli].index();
if (index == -3)
{
// Never visited
WarningInFunction
<< "Cell " << cellI << " never visited to determine "
<< "Cell " << celli << " never visited to determine "
<< "local coordinate system" << endl
<< "Using direction " << defaultDir << " instead" << endl;
dirField[cellI] = defaultDir;
dirField[celli] = defaultDir;
nUnset++;
}
else if (index == -2)
{
// Geometric direction
dirField[cellI] = cellInfo[cellI].n();
dirField[celli] = cellInfo[celli].n();
nGeom++;
}
@ -251,7 +251,7 @@ Foam::vectorField Foam::directions::propagateDirection
else
{
// Topological edge cut. Convert into average cut direction.
dirField[cellI] = meshTools::edgeToCutDir(mesh, cellI, index);
dirField[celli] = meshTools::edgeToCutDir(mesh, celli, index);
nTopo++;
}
@ -347,9 +347,9 @@ Foam::directions::directions
const word patchName(patchDict.lookup("patch"));
const label patchI = mesh.boundaryMesh().findPatchID(patchName);
const label patchi = mesh.boundaryMesh().findPatchID(patchName);
if (patchI == -1)
if (patchi == -1)
{
FatalErrorInFunction
<< "Cannot find patch "
@ -358,7 +358,7 @@ Foam::directions::directions
}
// Take zeroth face on patch
const polyPatch& pp = mesh.boundaryMesh()[patchI];
const polyPatch& pp = mesh.boundaryMesh()[patchi];
vector tan1(patchDict.lookup("tan1"));

View File

@ -49,7 +49,7 @@ defineTypeNameAndDebug(boundaryCutter, 0);
void Foam::boundaryCutter::getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
@ -57,12 +57,12 @@ void Foam::boundaryCutter::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;
@ -70,7 +70,7 @@ void Foam::boundaryCutter::getFaceInfo
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
}
@ -79,13 +79,13 @@ void Foam::boundaryCutter::getFaceInfo
// are not split but still might use edge that has been cut.
Foam::face Foam::boundaryCutter::addEdgeCutsToFace
(
const label faceI,
const label facei,
const Map<labelList>& edgeToAddedPoints
) const
{
const edgeList& edges = mesh_.edges();
const face& f = mesh_.faces()[faceI];
const labelList& fEdges = mesh_.faceEdges()[faceI];
const face& f = mesh_.faces()[facei];
const labelList& fEdges = mesh_.faceEdges()[facei];
// Storage for face
DynamicList<label> newFace(2 * f.size());
@ -142,18 +142,18 @@ Foam::face Foam::boundaryCutter::addEdgeCutsToFace
void Foam::boundaryCutter::addFace
(
const label faceI,
const label facei,
const face& newFace,
bool& modifiedFace, // have we already 'used' faceI
bool& modifiedFace, // have we already 'used' facei
polyTopoChange& meshMod
) const
{
// Information about old face
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
label own = mesh_.faceOwner()[faceI];
label masterPoint = mesh_.faces()[faceI][0];
getFaceInfo(facei, patchID, zoneID, zoneFlip);
label own = mesh_.faceOwner()[facei];
label masterPoint = mesh_.faces()[facei][0];
if (!modifiedFace)
{
@ -162,7 +162,7 @@ void Foam::boundaryCutter::addFace
polyModifyFace
(
newFace, // face
faceI,
facei,
own, // owner
-1, // neighbour
false, // flux flip
@ -201,15 +201,15 @@ void Foam::boundaryCutter::addFace
// Splits a face using the cut edges and modified points
bool Foam::boundaryCutter::splitFace
(
const label faceI,
const label facei,
const Map<point>& pointToPos,
const Map<labelList>& edgeToAddedPoints,
polyTopoChange& meshMod
) const
{
const edgeList& edges = mesh_.edges();
const face& f = mesh_.faces()[faceI];
const labelList& fEdges = mesh_.faceEdges()[faceI];
const face& f = mesh_.faces()[facei];
const labelList& fEdges = mesh_.faceEdges()[facei];
// Count number of split edges and total number of splits.
label nSplitEdges = 0;
@ -240,7 +240,7 @@ bool Foam::boundaryCutter::splitFace
if (debug)
{
Pout<< "Face:" << faceI
Pout<< "Face:" << facei
<< " nModPoints:" << nModPoints
<< " nSplitEdges:" << nSplitEdges
<< " nTotalSplits:" << nTotalSplits << endl;
@ -258,7 +258,7 @@ bool Foam::boundaryCutter::splitFace
{
// single or multiple cuts on a single edge or single modified point
// Dont cut and let caller handle this.
Warning << "Face " << faceI << " has only one edge cut " << endl;
Warning << "Face " << facei << " has only one edge cut " << endl;
return false;
}
else
@ -270,10 +270,10 @@ bool Foam::boundaryCutter::splitFace
// Information about old face
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
// Get face with new points on cut edges for ease of looping
face extendedFace(addEdgeCutsToFace(faceI, edgeToAddedPoints));
face extendedFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
// Find first added point. This is the starting vertex for splitting.
label startFp = -1;
@ -356,7 +356,7 @@ bool Foam::boundaryCutter::splitFace
tmpFace.transfer(newFace);
// Add face tmpFace
addFace(faceI, tmpFace, modifiedFace, meshMod);
addFace(facei, tmpFace, modifiedFace, meshMod);
// Starting point is also the starting point for the new face
newFace.append(extendedFace[startFp]);
@ -374,7 +374,7 @@ bool Foam::boundaryCutter::splitFace
tmpFace.transfer(newFace);
// Add face tmpFace
addFace(faceI, tmpFace, modifiedFace, meshMod);
addFace(facei, tmpFace, modifiedFace, meshMod);
}
// Split something
@ -502,23 +502,23 @@ void Foam::boundaryCutter::setRefinement
forAllConstIter(Map<point>, faceToFeaturePoint, iter)
{
label faceI = iter.key();
label facei = iter.key();
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
if (faceToSplit.found(faceI))
if (faceToSplit.found(facei))
{
FatalErrorInFunction
<< "Face " << faceI << " vertices " << f
<< "Face " << facei << " vertices " << f
<< " is both marked for face-centre decomposition and"
<< " diagonal splitting."
<< abort(FatalError);
}
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
FatalErrorInFunction
<< "Face " << faceI << " vertices " << f
<< "Face " << facei << " vertices " << f
<< " is not an external face. Cannot split it"
<< abort(FatalError);
}
@ -534,13 +534,13 @@ void Foam::boundaryCutter::setRefinement
true // supports a cell
)
);
faceAddedPoint_.insert(faceI, addedPointI);
faceAddedPoint_.insert(facei, addedPointI);
if (debug)
{
Pout<< "Added point " << addedPointI << " for feature point "
<< iter() << " on face " << faceI << " with centre "
<< mesh_.faceCentres()[faceI] << endl;
<< iter() << " on face " << facei << " with centre "
<< mesh_.faceCentres()[facei] << endl;
}
}
@ -558,18 +558,18 @@ void Foam::boundaryCutter::setRefinement
// Triangulate faces containing feature points
forAllConstIter(Map<label>, faceAddedPoint_, iter)
{
label faceI = iter.key();
label facei = iter.key();
// Get face with new points on cut edges.
face newFace(addEdgeCutsToFace(faceI, edgeToAddedPoints));
face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
label addedPointI = iter();
// Information about old face
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
label own = mesh_.faceOwner()[faceI];
label masterPoint = mesh_.faces()[faceI][0];
getFaceInfo(facei, patchID, zoneID, zoneFlip);
label own = mesh_.faceOwner()[facei];
label masterPoint = mesh_.faces()[facei][0];
// Triangulate face around mid point
@ -591,7 +591,7 @@ void Foam::boundaryCutter::setRefinement
polyModifyFace
(
tri, // face
faceI,
facei,
own, // owner
-1, // neighbour
false, // flux flip
@ -624,21 +624,21 @@ void Foam::boundaryCutter::setRefinement
}
}
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
// Diagonally split faces
forAllConstIter(Map<labelPair>, faceToSplit, iter)
{
label faceI = iter.key();
label facei = iter.key();
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
if (faceAddedPoint_.found(faceI))
if (faceAddedPoint_.found(facei))
{
FatalErrorInFunction
<< "Face " << faceI << " vertices " << f
<< "Face " << facei << " vertices " << f
<< " is both marked for face-centre decomposition and"
<< " diagonal splitting."
<< abort(FatalError);
@ -646,13 +646,13 @@ void Foam::boundaryCutter::setRefinement
// Get face with new points on cut edges.
face newFace(addEdgeCutsToFace(faceI, edgeToAddedPoints));
face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
// Information about old face
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
label own = mesh_.faceOwner()[faceI];
label masterPoint = mesh_.faces()[faceI][0];
getFaceInfo(facei, patchID, zoneID, zoneFlip);
label own = mesh_.faceOwner()[facei];
label masterPoint = mesh_.faces()[facei][0];
// Split face from one side of diagonal to other.
const labelPair& diag = iter();
@ -663,7 +663,7 @@ void Foam::boundaryCutter::setRefinement
if (fp0 == -1 || fp1 == -1 || fp0 == fp1)
{
FatalErrorInFunction
<< "Problem : Face " << faceI << " vertices " << f
<< "Problem : Face " << facei << " vertices " << f
<< " newFace:" << newFace << " diagonal:" << f[diag[0]]
<< ' ' << f[diag[1]]
<< abort(FatalError);
@ -694,7 +694,7 @@ void Foam::boundaryCutter::setRefinement
polyModifyFace
(
face(newVerts.shrink()), // face
faceI,
facei,
own, // owner
-1, // neighbour
false, // flux flip
@ -738,7 +738,7 @@ void Foam::boundaryCutter::setRefinement
)
);
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
@ -752,15 +752,15 @@ void Foam::boundaryCutter::setRefinement
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
if (!faceUptodate[faceI] && !mesh_.isInternalFace(faceI))
if (!faceUptodate[facei] && !mesh_.isInternalFace(facei))
{
// Is external face so split
if (splitFace(faceI, pointToPos, edgeToAddedPoints, meshMod))
if (splitFace(facei, pointToPos, edgeToAddedPoints, meshMod))
{
// Successfull split
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
}
}
@ -778,31 +778,31 @@ void Foam::boundaryCutter::setRefinement
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
if (!faceUptodate[faceI])
if (!faceUptodate[facei])
{
// Renumber face to include split edges.
face newFace(addEdgeCutsToFace(faceI, edgeToAddedPoints));
face newFace(addEdgeCutsToFace(facei, edgeToAddedPoints));
label own = mesh_.faceOwner()[faceI];
label own = mesh_.faceOwner()[facei];
label nei = -1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
nei = mesh_.faceNeighbour()[faceI];
nei = mesh_.faceNeighbour()[facei];
}
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
meshMod.setAction
(
polyModifyFace
(
newFace, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
@ -813,7 +813,7 @@ void Foam::boundaryCutter::setRefinement
)
);
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
}
}

View File

@ -82,31 +82,31 @@ class boundaryCutter
//- Get patch and zone info for face
void getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
) const;
//- Add cuts of edges to face
face addEdgeCutsToFace(const label faceI, const Map<labelList>&) const;
face addEdgeCutsToFace(const label facei, const Map<labelList>&) const;
//- Splits faces with multiple cut edges. Return true if anything split.
bool splitFace
(
const label faceI,
const label facei,
const Map<point>& pointToPos,
const Map<labelList>& edgeToAddedPoints,
polyTopoChange& meshMod
) const;
//- Add/modify faceI for new vertices.
//- Add/modify facei for new vertices.
void addFace
(
const label faceI,
const label facei,
const face& newFace,
bool& modifiedFace, // have we already 'used' faceI?
bool& modifiedFace, // have we already 'used' facei?
polyTopoChange& meshMod
) const;

View File

@ -97,11 +97,11 @@ Foam::label Foam::meshCutAndRemove::findCutCell
{
forAll(cellLabels, labelI)
{
label cellI = cellLabels[labelI];
label celli = cellLabels[labelI];
if (cuts.cellLoops()[cellI].size())
if (cuts.cellLoops()[celli].size())
{
return cellI;
return celli;
}
}
return -1;
@ -121,9 +121,9 @@ Foam::label Foam::meshCutAndRemove::findInternalFacePoint
forAll(pFaces, pFaceI)
{
label faceI = pFaces[pFaceI];
label facei = pFaces[pFaceI];
if (mesh().isInternalFace(faceI))
if (mesh().isInternalFace(facei))
{
return pointI;
}
@ -174,7 +174,7 @@ void Foam::meshCutAndRemove::faceCells
(
const cellCuts& cuts,
const label exposedPatchI,
const label faceI,
const label facei,
label& own,
label& nei,
label& patchID
@ -183,9 +183,9 @@ void Foam::meshCutAndRemove::faceCells
const labelListList& anchorPts = cuts.cellAnchorPoints();
const labelListList& cellLoops = cuts.cellLoops();
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
own = mesh().faceOwner()[faceI];
own = mesh().faceOwner()[facei];
if (cellLoops[own].size() && firstCommon(f, anchorPts[own]) == -1)
{
@ -195,9 +195,9 @@ void Foam::meshCutAndRemove::faceCells
nei = -1;
if (mesh().isInternalFace(faceI))
if (mesh().isInternalFace(facei))
{
nei = mesh().faceNeighbour()[faceI];
nei = mesh().faceNeighbour()[facei];
if (cellLoops[nei].size() && firstCommon(f, anchorPts[nei]) == -1)
{
@ -205,7 +205,7 @@ void Foam::meshCutAndRemove::faceCells
}
}
patchID = mesh().boundaryMesh().whichPatch(faceI);
patchID = mesh().boundaryMesh().whichPatch(facei);
if (patchID == -1 && (own == -1 || nei == -1))
{
@ -217,12 +217,12 @@ void Foam::meshCutAndRemove::faceCells
void Foam::meshCutAndRemove::getZoneInfo
(
const label faceI,
const label facei,
label& zoneID,
bool& zoneFlip
) const
{
zoneID = mesh().faceZones().whichZone(faceI);
zoneID = mesh().faceZones().whichZone(facei);
zoneFlip = false;
@ -230,7 +230,7 @@ void Foam::meshCutAndRemove::getZoneInfo
{
const faceZone& fZone = mesh().faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
}
@ -238,7 +238,7 @@ void Foam::meshCutAndRemove::getZoneInfo
void Foam::meshCutAndRemove::addFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const label masterPointI,
const face& newFace,
const label own,
@ -249,7 +249,7 @@ void Foam::meshCutAndRemove::addFace
label zoneID;
bool zoneFlip;
getZoneInfo(faceI, zoneID, zoneFlip);
getZoneInfo(facei, zoneID, zoneFlip);
if ((nei == -1) || (own != -1 && own < nei))
{
@ -318,11 +318,11 @@ void Foam::meshCutAndRemove::addFace
}
// Modifies existing faceI for either new owner/neighbour or new face points.
// Modifies existing facei for either new owner/neighbour or new face points.
void Foam::meshCutAndRemove::modFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label own,
const label nei,
@ -332,22 +332,22 @@ void Foam::meshCutAndRemove::modFace
label zoneID;
bool zoneFlip;
getZoneInfo(faceI, zoneID, zoneFlip);
getZoneInfo(facei, zoneID, zoneFlip);
if
(
(own != mesh().faceOwner()[faceI])
(own != mesh().faceOwner()[facei])
|| (
mesh().isInternalFace(faceI)
&& (nei != mesh().faceNeighbour()[faceI])
mesh().isInternalFace(facei)
&& (nei != mesh().faceNeighbour()[facei])
)
|| (newFace != mesh().faces()[faceI])
|| (newFace != mesh().faces()[facei])
)
{
if (debug & 2)
{
Pout<< "Modifying face " << faceI
<< " old vertices:" << mesh().faces()[faceI]
Pout<< "Modifying face " << facei
<< " old vertices:" << mesh().faces()[facei]
<< " new vertices:" << newFace
<< " new owner:" << own
<< " new neighbour:" << nei
@ -364,7 +364,7 @@ void Foam::meshCutAndRemove::modFace
polyModifyFace
(
newFace, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
@ -382,7 +382,7 @@ void Foam::meshCutAndRemove::modFace
polyModifyFace
(
newFace.reverseFace(), // modified face
faceI, // label of face being modified
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
@ -463,9 +463,9 @@ void Foam::meshCutAndRemove::splitFace
}
Foam::face Foam::meshCutAndRemove::addEdgeCutsToFace(const label faceI) const
Foam::face Foam::meshCutAndRemove::addEdgeCutsToFace(const label facei) const
{
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
face newFace(2 * f.size());
@ -495,12 +495,12 @@ Foam::face Foam::meshCutAndRemove::addEdgeCutsToFace(const label faceI) const
}
// Walk loop (loop of cuts) across circumference of cellI. Returns face in
// Walk loop (loop of cuts) across circumference of celli. Returns face in
// new vertices.
// Note: tricky bit is that it can use existing edges which have been split.
Foam::face Foam::meshCutAndRemove::loopToFace
(
const label cellI,
const label celli,
const labelList& loop
) const
{
@ -664,9 +664,9 @@ void Foam::meshCutAndRemove::setRefinement
{
boolList usedPoint(mesh().nPoints(), false);
forAll(cellLoops, cellI)
forAll(cellLoops, celli)
{
const labelList& loop = cellLoops[cellI];
const labelList& loop = cellLoops[celli];
if (loop.size())
{
@ -681,7 +681,7 @@ void Foam::meshCutAndRemove::setRefinement
}
}
const labelList& anchors = anchorPts[cellI];
const labelList& anchors = anchorPts[celli];
forAll(anchors, i)
{
@ -691,7 +691,7 @@ void Foam::meshCutAndRemove::setRefinement
else
{
// Cell is not cut so use all its points
const labelList& cPoints = mesh().cellPoints()[cellI];
const labelList& cPoints = mesh().cellPoints()[celli];
forAll(cPoints, i)
{
@ -767,17 +767,17 @@ void Foam::meshCutAndRemove::setRefinement
// For all cut cells add an internal or external face
//
forAll(cellLoops, cellI)
forAll(cellLoops, celli)
{
const labelList& loop = cellLoops[cellI];
const labelList& loop = cellLoops[celli];
if (loop.size())
{
if (cutPatch[cellI] < 0 || cutPatch[cellI] >= patches.size())
if (cutPatch[celli] < 0 || cutPatch[celli] >= patches.size())
{
FatalErrorInFunction
<< "Illegal patch " << cutPatch[cellI]
<< " provided for cut cell " << cellI
<< "Illegal patch " << cutPatch[celli]
<< " provided for cut cell " << celli
<< abort(FatalError);
}
@ -785,7 +785,7 @@ void Foam::meshCutAndRemove::setRefinement
// Convert loop (=list of cuts) into proper face.
// cellCuts sets orientation is towards anchor side so reverse.
//
face newFace(loopToFace(cellI, loop));
face newFace(loopToFace(celli, loop));
reverse(newFace);
@ -798,26 +798,26 @@ void Foam::meshCutAndRemove::setRefinement
polyAddFace
(
newFace, // face
cellI, // owner
celli, // owner
-1, // neighbour
masterPointI, // master point
-1, // master edge
-1, // master face for addition
false, // flux flip
cutPatch[cellI], // patch for face
cutPatch[celli], // patch for face
-1, // zone for face
false // face zone flip
)
);
addedFaces_.insert(cellI, addedFaceI);
addedFaces_.insert(celli, addedFaceI);
if (debug & 2)
{
Pout<< "Added splitting face " << newFace << " index:"
<< addedFaceI << " from masterPoint:" << masterPointI
<< " to owner " << cellI << " with anchors:"
<< anchorPts[cellI]
<< " to owner " << celli << " with anchors:"
<< anchorPts[celli]
<< " from Loop:";
// Gets edgeweights of loop
@ -854,10 +854,10 @@ void Foam::meshCutAndRemove::setRefinement
forAllConstIter(Map<edge>, faceSplitCuts, iter)
{
label faceI = iter.key();
label facei = iter.key();
// Renumber face to include split edges.
face newFace(addEdgeCutsToFace(faceI));
face newFace(addEdgeCutsToFace(facei));
// Edge splitting the face. Convert edge to new vertex numbering.
const edge& splitEdge = iter();
@ -891,18 +891,18 @@ void Foam::meshCutAndRemove::setRefinement
face f0, f1;
splitFace(newFace, v0, v1, f0, f1);
label own = mesh().faceOwner()[faceI];
label own = mesh().faceOwner()[facei];
label nei = -1;
if (mesh().isInternalFace(faceI))
if (mesh().isInternalFace(facei))
{
nei = mesh().faceNeighbour()[faceI];
nei = mesh().faceNeighbour()[facei];
}
if (debug & 2)
{
Pout<< "Split face " << mesh().faces()[faceI]
Pout<< "Split face " << mesh().faces()[facei]
<< " own:" << own << " nei:" << nei
<< " into f0:" << f0
<< " and f1:" << f1 << endl;
@ -919,7 +919,7 @@ void Foam::meshCutAndRemove::setRefinement
// The face f gets split into two parts, f0 and f1.
// Each of these can have a different owner and or neighbour.
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
label f0Own = -1;
label f1Own = -1;
@ -1023,7 +1023,7 @@ void Foam::meshCutAndRemove::setRefinement
// If faces were internal but now become external set a patch.
// If they were external already keep the patch.
label patchID = patches.whichPatch(faceI);
label patchID = patches.whichPatch(facei);
if (patchID == -1)
{
@ -1031,8 +1031,8 @@ void Foam::meshCutAndRemove::setRefinement
}
// Do as much as possible by modifying faceI. Delay any remove
// face. Keep track of whether faceI has been used.
// Do as much as possible by modifying facei. Delay any remove
// face. Keep track of whether facei has been used.
bool modifiedFaceI = false;
@ -1041,7 +1041,7 @@ void Foam::meshCutAndRemove::setRefinement
if (f0Nei != -1)
{
// f0 becomes external face (note:modFace will reverse face)
modFace(meshMod, faceI, f0, f0Own, f0Nei, patchID);
modFace(meshMod, facei, f0, f0Own, f0Nei, patchID);
modifiedFaceI = true;
}
}
@ -1050,13 +1050,13 @@ void Foam::meshCutAndRemove::setRefinement
if (f0Nei == -1)
{
// f0 becomes external face
modFace(meshMod, faceI, f0, f0Own, f0Nei, patchID);
modFace(meshMod, facei, f0, f0Own, f0Nei, patchID);
modifiedFaceI = true;
}
else
{
// f0 stays internal face.
modFace(meshMod, faceI, f0, f0Own, f0Nei, -1);
modFace(meshMod, facei, f0, f0Own, f0Nei, -1);
modifiedFaceI = true;
}
}
@ -1075,7 +1075,7 @@ void Foam::meshCutAndRemove::setRefinement
// f1 becomes external face (note:modFace will reverse face)
if (!modifiedFaceI)
{
modFace(meshMod, faceI, f1, f1Own, f1Nei, patchID);
modFace(meshMod, facei, f1, f1Own, f1Nei, patchID);
modifiedFaceI = true;
}
else
@ -1085,7 +1085,7 @@ void Foam::meshCutAndRemove::setRefinement
addFace
(
meshMod,
faceI, // face for zone info
facei, // face for zone info
masterPointI, // inflation point
f1, // vertices of face
f1Own,
@ -1102,7 +1102,7 @@ void Foam::meshCutAndRemove::setRefinement
// f1 becomes external face
if (!modifiedFaceI)
{
modFace(meshMod, faceI, f1, f1Own, f1Nei, patchID);
modFace(meshMod, facei, f1, f1Own, f1Nei, patchID);
modifiedFaceI = true;
}
else
@ -1112,7 +1112,7 @@ void Foam::meshCutAndRemove::setRefinement
addFace
(
meshMod,
faceI,
facei,
masterPointI,
f1,
f1Own,
@ -1126,29 +1126,29 @@ void Foam::meshCutAndRemove::setRefinement
// f1 is internal face.
if (!modifiedFaceI)
{
modFace(meshMod, faceI, f1, f1Own, f1Nei, -1);
modFace(meshMod, facei, f1, f1Own, f1Nei, -1);
modifiedFaceI = true;
}
else
{
label masterPointI = findPatchFacePoint(f1, -1);
addFace(meshMod, faceI, masterPointI, f1, f1Own, f1Nei, -1);
addFace(meshMod, facei, masterPointI, f1, f1Own, f1Nei, -1);
}
}
}
if (f0Own == -1 && f0Nei == -1 && !modifiedFaceI)
{
meshMod.setAction(polyRemoveFace(faceI));
meshMod.setAction(polyRemoveFace(facei));
if (debug & 2)
{
Pout<< "Removed face " << faceI << endl;
Pout<< "Removed face " << facei << endl;
}
}
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
@ -1167,44 +1167,44 @@ void Foam::meshCutAndRemove::setRefinement
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
if (!faceUptodate[faceI])
if (!faceUptodate[facei])
{
// So the face has not been split itself (i.e. its owner
// or neighbour have not been split) so it only
// borders by edge a cell which has been split.
// Get (new or original) owner and neighbour of faceI
// Get (new or original) owner and neighbour of facei
label own, nei, patchID;
faceCells(cuts, exposedPatchI, faceI, own, nei, patchID);
faceCells(cuts, exposedPatchI, facei, own, nei, patchID);
if (own == -1 && nei == -1)
{
meshMod.setAction(polyRemoveFace(faceI));
meshMod.setAction(polyRemoveFace(facei));
if (debug & 2)
{
Pout<< "Removed face " << faceI << endl;
Pout<< "Removed face " << facei << endl;
}
}
else
{
// Renumber face to include split edges.
face newFace(addEdgeCutsToFace(faceI));
face newFace(addEdgeCutsToFace(facei));
if (debug & 2)
{
Pout<< "Added edge cuts to face " << faceI
<< " f:" << mesh().faces()[faceI]
Pout<< "Added edge cuts to face " << facei
<< " f:" << mesh().faces()[facei]
<< " newFace:" << newFace << endl;
}
modFace
(
meshMod,
faceI,
facei,
newFace,
own,
nei,
@ -1212,7 +1212,7 @@ void Foam::meshCutAndRemove::setRefinement
);
}
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
}
}
@ -1227,29 +1227,29 @@ void Foam::meshCutAndRemove::setRefinement
const faceList& faces = mesh().faces();
forAll(faces, faceI)
forAll(faces, facei)
{
if (!faceUptodate[faceI])
if (!faceUptodate[facei])
{
// Get (new or original) owner and neighbour of faceI
// Get (new or original) owner and neighbour of facei
label own, nei, patchID;
faceCells(cuts, exposedPatchI, faceI, own, nei, patchID);
faceCells(cuts, exposedPatchI, facei, own, nei, patchID);
if (own == -1 && nei == -1)
{
meshMod.setAction(polyRemoveFace(faceI));
meshMod.setAction(polyRemoveFace(facei));
if (debug & 2)
{
Pout<< "Removed face " << faceI << endl;
Pout<< "Removed face " << facei << endl;
}
}
else
{
modFace(meshMod, faceI, faces[faceI], own, nei, patchID);
modFace(meshMod, facei, faces[facei], own, nei, patchID);
}
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
}
@ -1272,8 +1272,8 @@ void Foam::meshCutAndRemove::updateMesh(const mapPolyMesh& map)
forAllConstIter(Map<label>, addedFaces_, iter)
{
label cellI = iter.key();
label newCellI = map.reverseCellMap()[cellI];
label celli = iter.key();
label newCellI = map.reverseCellMap()[celli];
label addedFaceI = iter();
@ -1284,11 +1284,11 @@ void Foam::meshCutAndRemove::updateMesh(const mapPolyMesh& map)
if
(
(debug & 2)
&& (newCellI != cellI || newAddedFaceI != addedFaceI)
&& (newCellI != celli || newAddedFaceI != addedFaceI)
)
{
Pout<< "meshCutAndRemove::updateMesh :"
<< " updating addedFace for cell " << cellI
<< " updating addedFace for cell " << celli
<< " from " << addedFaceI
<< " to " << newAddedFaceI
<< endl;

View File

@ -102,7 +102,7 @@ class meshCutAndRemove
(
const cellCuts& cuts,
const label exposedPatchI,
const label faceI,
const label facei,
label& own,
label& nei,
label& patchID
@ -111,7 +111,7 @@ class meshCutAndRemove
//- Get zone information for face.
void getZoneInfo
(
const label faceI,
const label facei,
label& zoneID,
bool& zoneFlip
) const;
@ -120,7 +120,7 @@ class meshCutAndRemove
void addFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const label masterPointI,
const face& newFace,
const label owner,
@ -128,13 +128,13 @@ class meshCutAndRemove
const label patchID
);
//- Modifies existing faceI for either new owner/neighbour or
//- Modifies existing facei for either new owner/neighbour or
// new face points. Checks if anything changed and flips face
// if owner>neighbour
void modFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label owner,
const label neighbour,
@ -164,12 +164,12 @@ class meshCutAndRemove
) const;
//- Add cuts of edges to face
face addEdgeCutsToFace(const label faceI) const;
face addEdgeCutsToFace(const label facei) const;
//- Convert loop of cuts into face.
face loopToFace
(
const label cellI,
const label celli,
const labelList& loop
) const;

View File

@ -88,11 +88,11 @@ Foam::label Foam::meshCutter::findCutCell
{
forAll(cellLabels, labelI)
{
label cellI = cellLabels[labelI];
label celli = cellLabels[labelI];
if (cuts.cellLoops()[cellI].size())
if (cuts.cellLoops()[celli].size())
{
return cellI;
return celli;
}
}
return -1;
@ -112,9 +112,9 @@ Foam::label Foam::meshCutter::findInternalFacePoint
forAll(pFaces, pFaceI)
{
label faceI = pFaces[pFaceI];
label facei = pFaces[pFaceI];
if (mesh().isInternalFace(faceI))
if (mesh().isInternalFace(facei))
{
return pointI;
}
@ -134,7 +134,7 @@ Foam::label Foam::meshCutter::findInternalFacePoint
void Foam::meshCutter::faceCells
(
const cellCuts& cuts,
const label faceI,
const label facei,
label& own,
label& nei
) const
@ -142,9 +142,9 @@ void Foam::meshCutter::faceCells
const labelListList& anchorPts = cuts.cellAnchorPoints();
const labelListList& cellLoops = cuts.cellLoops();
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
own = mesh().faceOwner()[faceI];
own = mesh().faceOwner()[facei];
if (cellLoops[own].size() && uses(f, anchorPts[own]))
{
@ -153,9 +153,9 @@ void Foam::meshCutter::faceCells
nei = -1;
if (mesh().isInternalFace(faceI))
if (mesh().isInternalFace(facei))
{
nei = mesh().faceNeighbour()[faceI];
nei = mesh().faceNeighbour()[facei];
if (cellLoops[nei].size() && uses(f, anchorPts[nei]))
{
@ -167,7 +167,7 @@ void Foam::meshCutter::faceCells
void Foam::meshCutter::getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
@ -175,12 +175,12 @@ void Foam::meshCutter::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;
@ -188,7 +188,7 @@ void Foam::meshCutter::getFaceInfo
{
const faceZone& fZone = mesh().faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
}
@ -196,7 +196,7 @@ void Foam::meshCutter::getFaceInfo
void Foam::meshCutter::addFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label own,
const label nei
@ -204,7 +204,7 @@ void Foam::meshCutter::addFace
{
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
if ((nei == -1) || (own < nei))
{
@ -229,7 +229,7 @@ void Foam::meshCutter::addFace
nei, // neighbour
-1, // master point
-1, // master edge
faceI, // master face for addition
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
@ -260,7 +260,7 @@ void Foam::meshCutter::addFace
own, // neighbour
-1, // master point
-1, // master edge
faceI, // master face for addition
facei, // master face for addition
false, // flux flip
patchID, // patch for face
zoneID, // zone for face
@ -274,7 +274,7 @@ void Foam::meshCutter::addFace
void Foam::meshCutter::modFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label own,
const label nei
@ -282,22 +282,22 @@ void Foam::meshCutter::modFace
{
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
if
(
(own != mesh().faceOwner()[faceI])
(own != mesh().faceOwner()[facei])
|| (
mesh().isInternalFace(faceI)
&& (nei != mesh().faceNeighbour()[faceI])
mesh().isInternalFace(facei)
&& (nei != mesh().faceNeighbour()[facei])
)
|| (newFace != mesh().faces()[faceI])
|| (newFace != mesh().faces()[facei])
)
{
if (debug & 2)
{
Pout<< "Modifying face " << faceI
<< " old vertices:" << mesh().faces()[faceI]
Pout<< "Modifying face " << facei
<< " old vertices:" << mesh().faces()[facei]
<< " new vertices:" << newFace
<< " new owner:" << own
<< " new neighbour:" << nei
@ -313,7 +313,7 @@ void Foam::meshCutter::modFace
polyModifyFace
(
newFace, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
@ -331,7 +331,7 @@ void Foam::meshCutter::modFace
polyModifyFace
(
newFace.reverseFace(), // modified face
faceI, // label of face being modified
facei, // label of face being modified
nei, // owner
own, // neighbour
false, // face flip
@ -408,9 +408,9 @@ void Foam::meshCutter::splitFace
}
Foam::face Foam::meshCutter::addEdgeCutsToFace(const label faceI) const
Foam::face Foam::meshCutter::addEdgeCutsToFace(const label facei) const
{
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
face newFace(2 * f.size());
@ -442,7 +442,7 @@ Foam::face Foam::meshCutter::addEdgeCutsToFace(const label faceI) const
Foam::face Foam::meshCutter::loopToFace
(
const label cellI,
const label celli,
const labelList& loop
) const
{
@ -602,9 +602,9 @@ void Foam::meshCutter::setRefinement
// Add cells (on 'anchor' side of cell)
//
forAll(cellLoops, cellI)
forAll(cellLoops, celli)
{
if (cellLoops[cellI].size())
if (cellLoops[celli].size())
{
// Add a cell to the existing cell
label addedCellI =
@ -615,17 +615,17 @@ void Foam::meshCutter::setRefinement
-1, // master point
-1, // master edge
-1, // master face
cellI, // master cell
mesh().cellZones().whichZone(cellI) // zone for cell
celli, // master cell
mesh().cellZones().whichZone(celli) // zone for cell
)
);
addedCells_.insert(cellI, addedCellI);
addedCells_.insert(celli, addedCellI);
if (debug & 2)
{
Pout<< "Added cell " << addedCells_[cellI] << " to cell "
<< cellI << endl;
Pout<< "Added cell " << addedCells_[celli] << " to cell "
<< celli << endl;
}
}
}
@ -635,19 +635,19 @@ void Foam::meshCutter::setRefinement
// For all cut cells add an internal face
//
forAll(cellLoops, cellI)
forAll(cellLoops, celli)
{
const labelList& loop = cellLoops[cellI];
const labelList& loop = cellLoops[celli];
if (loop.size())
{
// Convert loop (=list of cuts) into proper face.
// Orientation should already be ok. (done by cellCuts)
//
face newFace(loopToFace(cellI, loop));
face newFace(loopToFace(celli, loop));
// Pick any anchor point on cell
label masterPointI = findInternalFacePoint(anchorPts[cellI]);
label masterPointI = findInternalFacePoint(anchorPts[celli]);
label addedFaceI =
meshMod.setAction
@ -655,8 +655,8 @@ void Foam::meshCutter::setRefinement
polyAddFace
(
newFace, // face
cellI, // owner
addedCells_[cellI], // neighbour
celli, // owner
addedCells_[celli], // neighbour
masterPointI, // master point
-1, // master edge
-1, // master face for addition
@ -667,7 +667,7 @@ void Foam::meshCutter::setRefinement
)
);
addedFaces_.insert(cellI, addedFaceI);
addedFaces_.insert(celli, addedFaceI);
if (debug & 2)
{
@ -687,8 +687,8 @@ void Foam::meshCutter::setRefinement
Pout<< "Added splitting face " << newFace << " index:"
<< addedFaceI
<< " to owner " << cellI
<< " neighbour " << addedCells_[cellI]
<< " to owner " << celli
<< " neighbour " << addedCells_[celli]
<< " from Loop:";
writeCuts(Pout, loop, weights);
Pout<< endl;
@ -710,10 +710,10 @@ void Foam::meshCutter::setRefinement
forAllConstIter(Map<edge>, faceSplitCuts, iter)
{
label faceI = iter.key();
label facei = iter.key();
// Renumber face to include split edges.
face newFace(addEdgeCutsToFace(faceI));
face newFace(addEdgeCutsToFace(facei));
// Edge splitting the face. Convert cuts to new vertex numbering.
const edge& splitEdge = iter();
@ -747,18 +747,18 @@ void Foam::meshCutter::setRefinement
face f0, f1;
splitFace(newFace, v0, v1, f0, f1);
label own = mesh().faceOwner()[faceI];
label own = mesh().faceOwner()[facei];
label nei = -1;
if (mesh().isInternalFace(faceI))
if (mesh().isInternalFace(facei))
{
nei = mesh().faceNeighbour()[faceI];
nei = mesh().faceNeighbour()[facei];
}
if (debug & 2)
{
Pout<< "Split face " << mesh().faces()[faceI]
Pout<< "Split face " << mesh().faces()[facei]
<< " own:" << own << " nei:" << nei
<< " into f0:" << f0
<< " and f1:" << f1 << endl;
@ -772,7 +772,7 @@ void Foam::meshCutter::setRefinement
// the one that cuts it (this face cut might not be the one splitting
// the cell)
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
label f0Owner = -1;
label f1Owner = -1;
@ -859,11 +859,11 @@ void Foam::meshCutter::setRefinement
}
// f0 is the added face, f1 the modified one
addFace(meshMod, faceI, f0, f0Owner, f0Neighbour);
addFace(meshMod, facei, f0, f0Owner, f0Neighbour);
modFace(meshMod, faceI, f1, f1Owner, f1Neighbour);
modFace(meshMod, facei, f1, f1Owner, f1Neighbour);
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
@ -882,27 +882,27 @@ void Foam::meshCutter::setRefinement
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
if (!faceUptodate[faceI])
if (!faceUptodate[facei])
{
// Renumber face to include split edges.
face newFace(addEdgeCutsToFace(faceI));
face newFace(addEdgeCutsToFace(facei));
if (debug & 2)
{
Pout<< "Added edge cuts to face " << faceI
<< " f:" << mesh().faces()[faceI]
Pout<< "Added edge cuts to face " << facei
<< " f:" << mesh().faces()[facei]
<< " newFace:" << newFace << endl;
}
// Get (new or original) owner and neighbour of faceI
// Get (new or original) owner and neighbour of facei
label own, nei;
faceCells(cuts, faceI, own, nei);
faceCells(cuts, facei, own, nei);
modFace(meshMod, faceI, newFace, own, nei);
modFace(meshMod, facei, newFace, own, nei);
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
}
}
@ -913,46 +913,46 @@ void Foam::meshCutter::setRefinement
// Correct any original faces on split cell for new neighbour/owner
//
forAll(cellLoops, cellI)
forAll(cellLoops, celli)
{
if (cellLoops[cellI].size())
if (cellLoops[celli].size())
{
const labelList& cllFaces = mesh().cells()[cellI];
const labelList& cllFaces = mesh().cells()[celli];
forAll(cllFaces, cllFaceI)
{
label faceI = cllFaces[cllFaceI];
label facei = cllFaces[cllFaceI];
if (!faceUptodate[faceI])
if (!faceUptodate[facei])
{
// Update face with new owner/neighbour (if any)
const face& f = mesh().faces()[faceI];
const face& f = mesh().faces()[facei];
if (debug && (f != addEdgeCutsToFace(faceI)))
if (debug && (f != addEdgeCutsToFace(facei)))
{
FatalErrorInFunction
<< "Problem: edges added to face which does "
<< " not use a marked cut" << endl
<< "faceI:" << faceI << endl
<< "facei:" << facei << endl
<< "face:" << f << endl
<< "newFace:" << addEdgeCutsToFace(faceI)
<< "newFace:" << addEdgeCutsToFace(facei)
<< abort(FatalError);
}
// Get (new or original) owner and neighbour of faceI
// Get (new or original) owner and neighbour of facei
label own, nei;
faceCells(cuts, faceI, own, nei);
faceCells(cuts, facei, own, nei);
modFace
(
meshMod,
faceI,
facei,
f,
own,
nei
);
faceUptodate[faceI] = true;
faceUptodate[facei] = true;
}
}
}
@ -980,8 +980,8 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
forAllConstIter(Map<label>, addedCells_, iter)
{
label cellI = iter.key();
label newCellI = morphMap.reverseCellMap()[cellI];
label celli = iter.key();
label newCellI = morphMap.reverseCellMap()[celli];
label addedCellI = iter();
@ -992,11 +992,11 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
if
(
(debug & 2)
&& (newCellI != cellI || newAddedCellI != addedCellI)
&& (newCellI != celli || newAddedCellI != addedCellI)
)
{
Pout<< "meshCutter::updateMesh :"
<< " updating addedCell for cell " << cellI
<< " updating addedCell for cell " << celli
<< " from " << addedCellI
<< " to " << newAddedCellI << endl;
}
@ -1013,8 +1013,8 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
forAllConstIter(Map<label>, addedFaces_, iter)
{
label cellI = iter.key();
label newCellI = morphMap.reverseCellMap()[cellI];
label celli = iter.key();
label newCellI = morphMap.reverseCellMap()[celli];
label addedFaceI = iter();
@ -1025,11 +1025,11 @@ void Foam::meshCutter::updateMesh(const mapPolyMesh& morphMap)
if
(
(debug & 2)
&& (newCellI != cellI || newAddedFaceI != addedFaceI)
&& (newCellI != celli || newAddedFaceI != addedFaceI)
)
{
Pout<< "meshCutter::updateMesh :"
<< " updating addedFace for cell " << cellI
<< " updating addedFace for cell " << celli
<< " from " << addedFaceI
<< " to " << newAddedFaceI
<< endl;

View File

@ -175,7 +175,7 @@ class meshCutter
void faceCells
(
const cellCuts& cuts,
const label faceI,
const label facei,
label& own,
label& nei
) const;
@ -183,30 +183,30 @@ class meshCutter
//- Get patch information for face.
void getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
) const;
//- Adds a face on top of existing faceI. Flips face
//- Adds a face on top of existing facei. Flips face
// if owner>neighbour
void addFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label owner,
const label neighbour
);
//- Modifies existing faceI for either new owner/neighbour or
//- Modifies existing facei for either new owner/neighbour or
// new face points. Checks if anything changed and flips face
// if owner>neighbour
void modFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label owner,
const label neighbour
@ -236,12 +236,12 @@ class meshCutter
) const;
//- Add cuts of edges to face
face addEdgeCutsToFace(const label faceI) const;
face addEdgeCutsToFace(const label facei) const;
//- Convert loop of cuts into face.
face loopToFace
(
const label cellI,
const label celli,
const labelList& loop
) const;
@ -249,7 +249,7 @@ class meshCutter
//- Get elements of cell.
void getFacesEdgesPoints
(
const label cellI,
const label celli,
labelHashSet& faces,
labelHashSet& edges,
labelHashSet& points

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
@ -126,9 +126,9 @@ void Foam::multiDirRefinement::addCells
// Construct inverse addressing: from new to original cell.
labelList origCell(mesh.nCells(), -1);
forAll(addedCells_, cellI)
forAll(addedCells_, celli)
{
const labelList& added = addedCells_[cellI];
const labelList& added = addedCells_[celli];
forAll(added, i)
{
@ -136,13 +136,13 @@ void Foam::multiDirRefinement::addCells
if (origCell[slave] == -1)
{
origCell[slave] = cellI;
origCell[slave] = celli;
}
else if (origCell[slave] != cellI)
else if (origCell[slave] != celli)
{
FatalErrorInFunction
<< "Added cell " << slave << " has two different masters:"
<< origCell[slave] << " , " << cellI
<< origCell[slave] << " , " << celli
<< abort(FatalError);
}
}
@ -203,15 +203,15 @@ Foam::labelList Foam::multiDirRefinement::splitOffHex(const primitiveMesh& mesh)
forAll(cellLabels_, i)
{
label cellI = cellLabels_[i];
label celli = cellLabels_[i];
if (cellShapes[cellI].model() == hex)
if (cellShapes[celli].model() == hex)
{
hexLabels[hexI++] = cellI;
hexLabels[hexI++] = celli;
}
else
{
nonHexLabels[nonHexI++] = cellI;
nonHexLabels[nonHexI++] = celli;
}
}
@ -283,15 +283,15 @@ void Foam::multiDirRefinement::refineHex8
// Increment count
forAll(consistentCells, i)
{
const label cellI = consistentCells[i];
const label celli = consistentCells[i];
Map<label>::iterator iter = hexCellSet.find(cellI);
Map<label>::iterator iter = hexCellSet.find(celli);
if (iter == hexCellSet.end())
{
FatalErrorInFunction
<< "Resulting mesh would not satisfy 2:1 ratio"
<< " when refining cell " << cellI << abort(FatalError);
<< " when refining cell " << celli << abort(FatalError);
}
else
{
@ -348,13 +348,13 @@ void Foam::multiDirRefinement::refineHex8
const labelList& cellMap = morphMap.cellMap();
forAll(cellMap, cellI)
forAll(cellMap, celli)
{
const label oldCellI = cellMap[cellI];
const label oldCellI = cellMap[celli];
if (addedCells_[oldCellI].size())
{
addedCells_[oldCellI][nAddedCells[oldCellI]++] = cellI;
addedCells_[oldCellI][nAddedCells[oldCellI]++] = celli;
}
}
}
@ -399,9 +399,9 @@ void Foam::multiDirRefinement::refineAllDirs
forAll(refCells, refI)
{
label cellI = cellLabels_[refI];
label celli = cellLabels_[refI];
refCells[refI] = refineCell(cellI, dirField[0]);
refCells[refI] = refineCell(celli, dirField[0]);
}
}
else
@ -409,9 +409,9 @@ void Foam::multiDirRefinement::refineAllDirs
// Non uniform directions.
forAll(refCells, refI)
{
const label cellI = cellLabels_[refI];
const label celli = cellLabels_[refI];
refCells[refI] = refineCell(cellI, dirField[cellI]);
refCells[refI] = refineCell(celli, dirField[celli]);
}
}

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
@ -120,9 +120,9 @@ void Foam::undoableMeshCutter::updateLabels
<< abort(FatalError);
}
label cellI = splitPtr->cellLabel();
label celli = splitPtr->cellLabel();
if (cellI != map[cellI])
if (celli != map[celli])
{
changed = true;
@ -143,20 +143,20 @@ void Foam::undoableMeshCutter::updateLabels
{
splitCell* splitPtr = iter();
label cellI = splitPtr->cellLabel();
label celli = splitPtr->cellLabel();
label newCellI = map[cellI];
label newCellI = map[celli];
if (debug && (cellI != newCellI))
if (debug && (celli != newCellI))
{
Pout<< "undoableMeshCutter::updateLabels :"
<< " Updating live (split)cell from " << cellI
<< " Updating live (split)cell from " << celli
<< " to " << newCellI << endl;
}
if (newCellI >= 0)
{
// Update splitCell. Can do inplace since only one cellI will
// Update splitCell. Can do inplace since only one celli will
// refer to this structure.
splitPtr->cellLabel() = newCellI;
@ -239,16 +239,16 @@ void Foam::undoableMeshCutter::setRefinement
// Use cells cut in this iteration to update splitCell tree.
forAllConstIter(Map<label>, addedCells(), iter)
{
label cellI = iter.key();
label celli = iter.key();
label addedCellI = iter();
// Newly created split cell. (cellI -> cellI + addedCellI)
// Newly created split cell. (celli -> celli + addedCellI)
// Check if cellI already part of split.
// Check if celli already part of split.
Map<splitCell*>::iterator findCell =
liveSplitCells_.find(cellI);
liveSplitCells_.find(celli);
if (findCell == liveSplitCells_.end())
{
@ -257,9 +257,9 @@ void Foam::undoableMeshCutter::setRefinement
// place.
// Create 0th level. Null parent to denote this.
splitCell* parentPtr = new splitCell(cellI, NULL);
splitCell* parentPtr = new splitCell(celli, NULL);
splitCell* masterPtr = new splitCell(cellI, parentPtr);
splitCell* masterPtr = new splitCell(celli, parentPtr);
splitCell* slavePtr = new splitCell(addedCellI, parentPtr);
@ -277,7 +277,7 @@ void Foam::undoableMeshCutter::setRefinement
<< abort(FatalError);
}
liveSplitCells_.insert(cellI, masterPtr);
liveSplitCells_.insert(celli, masterPtr);
liveSplitCells_.insert(addedCellI, slavePtr);
}
else
@ -288,7 +288,7 @@ void Foam::undoableMeshCutter::setRefinement
// It is no longer live
liveSplitCells_.erase(findCell);
splitCell* masterPtr = new splitCell(cellI, parentPtr);
splitCell* masterPtr = new splitCell(celli, parentPtr);
splitCell* slavePtr = new splitCell(addedCellI, parentPtr);
@ -306,7 +306,7 @@ void Foam::undoableMeshCutter::setRefinement
<< abort(FatalError);
}
liveSplitCells_.insert(cellI, masterPtr);
liveSplitCells_.insert(celli, masterPtr);
liveSplitCells_.insert(addedCellI, slavePtr);
}
}
@ -377,7 +377,7 @@ Foam::labelList Foam::undoableMeshCutter::getSplitFaces() const
// Both master and slave are live and are not refined.
// Find common face.
label cellI = splitPtr->cellLabel();
label celli = splitPtr->cellLabel();
label slaveCellI = slavePtr->cellLabel();
@ -385,7 +385,7 @@ Foam::labelList Foam::undoableMeshCutter::getSplitFaces() const
meshTools::getSharedFace
(
mesh(),
cellI,
celli,
slaveCellI
);
@ -487,18 +487,18 @@ Foam::labelList Foam::undoableMeshCutter::removeSplitFaces
// into owner.
forAll(facesToRemove, facesToRemoveI)
{
label faceI = facesToRemove[facesToRemoveI];
label facei = facesToRemove[facesToRemoveI];
if (!mesh().isInternalFace(faceI))
if (!mesh().isInternalFace(facei))
{
FatalErrorInFunction
<< "Trying to remove face that is not internal"
<< abort(FatalError);
}
label own = mesh().faceOwner()[faceI];
label own = mesh().faceOwner()[facei];
label nbr = mesh().faceNeighbour()[faceI];
label nbr = mesh().faceNeighbour()[facei];
Map<splitCell*>::iterator ownFind = liveSplitCells_.find(own);
@ -527,7 +527,7 @@ Foam::labelList Foam::undoableMeshCutter::removeSplitFaces
if (debug)
{
Pout<< "Updating for removed splitFace " << faceI
Pout<< "Updating for removed splitFace " << facei
<< " own:" << own << " nbr:" << nbr
<< " ownPtr:" << ownPtr->cellLabel()
<< " nbrPtr:" << nbrPtr->cellLabel()
@ -551,7 +551,7 @@ Foam::labelList Foam::undoableMeshCutter::removeSplitFaces
{
FatalErrorInFunction
<< "Owner and neighbour liveSplitCell entries do not have"
<< " same parent. faceI:" << faceI << " owner:" << own
<< " same parent. facei:" << facei << " owner:" << own
<< " ownparent:" << parentPtr->cellLabel()
<< " neighbour:" << nbr
<< " nbrparent:" << nbrPtr->parent()->cellLabel()

View File

@ -35,9 +35,9 @@ Foam::refineCell::refineCell()
{}
Foam::refineCell::refineCell(const label cellI, const vector& direction)
Foam::refineCell::refineCell(const label celli, const vector& direction)
:
cellNo_(cellI),
cellNo_(celli),
direction_(direction)
{
scalar magDir = mag(direction_);

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
@ -29,9 +29,9 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct from cell number and parent
Foam::splitCell::splitCell(const label cellI, splitCell* parent)
Foam::splitCell::splitCell(const label celli, splitCell* parent)
:
cellI_(cellI),
celli_(celli),
parent_(parent),
master_(NULL),
slave_(NULL)

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
@ -55,7 +55,7 @@ class splitCell
//- Unsplit cell label. Only uptodate if this cell is 'live'
// (i.e. no master or slave)
label cellI_;
label celli_;
//- Parent splitCell or null
splitCell* parent_;
@ -80,7 +80,7 @@ public:
// Constructors
//- Construct from cell number and parent
splitCell(const label cellI, splitCell* parent);
splitCell(const label celli, splitCell* parent);
//- Destructor
@ -93,12 +93,12 @@ public:
label cellLabel() const
{
return cellI_;
return celli_;
}
label& cellLabel()
{
return cellI_;
return celli_;
}
splitCell* parent() const

View File

@ -39,17 +39,17 @@ namespace Foam
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
bool Foam::wallLayerCells::usesCoupledPatch(const label cellI) const
bool Foam::wallLayerCells::usesCoupledPatch(const label celli) const
{
const polyBoundaryMesh& patches = mesh().boundaryMesh();
const cell& cFaces = mesh().cells()[cellI];
const cell& cFaces = mesh().cells()[celli];
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
label facei = cFaces[cFaceI];
label patchID = patches.whichPatch(faceI);
label patchID = patches.whichPatch(facei);
if ((patchID >= 0) && (patches[patchID].coupled()))
{
@ -78,9 +78,9 @@ Foam::wallLayerCells::wallLayerCells
// Make map from name to local patch ID
HashTable<label> patchNameToIndex(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patchNameToIndex.insert(patches[patchI].name(), patchI);
patchNameToIndex.insert(patches[patchi].name(), patchi);
}
@ -93,9 +93,9 @@ Foam::wallLayerCells::wallLayerCells
if (patchNameToIndex.found(name))
{
label patchI = patchNameToIndex[name];
label patchi = patchNameToIndex[name];
nWalls += patches[patchI].size();
nWalls += patches[patchi].size();
}
}
@ -112,9 +112,9 @@ Foam::wallLayerCells::wallLayerCells
if (patchNameToIndex.found(name))
{
label patchI = patchNameToIndex[name];
label patchi = patchNameToIndex[name];
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
forAll(pp, patchFaceI)
{
@ -162,13 +162,13 @@ Foam::wallLayerCells::wallLayerCells
label vertI = 0;
forAll(faceInfo, faceI)
forAll(faceInfo, facei)
{
const wallNormalInfo& info = faceInfo[faceI];
const wallNormalInfo& info = faceInfo[facei];
if (info.valid(regionCalc.data()))
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
point mid(0.0, 0.0, 0.0);
@ -206,13 +206,13 @@ Foam::wallLayerCells::wallLayerCells
const List<wallNormalInfo>& cellInfo = regionCalc.allCellInfo();
forAll(cellInfo, cellI)
forAll(cellInfo, celli)
{
const wallNormalInfo& info = cellInfo[cellI];
const wallNormalInfo& info = cellInfo[celli];
if (info.valid(regionCalc.data()) && !usesCoupledPatch(cellI))
if (info.valid(regionCalc.data()) && !usesCoupledPatch(celli))
{
refineCells.append(refineCell(cellI, info.normal()));
refineCells.append(refineCell(celli, info.normal()));
}
}

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
@ -57,8 +57,8 @@ class wallLayerCells
{
// Private Member Functions
//- Check if any of the faces of cellI is on processorPatch
bool usesCoupledPatch(const label cellI) const;
//- Check if any of the faces of celli is on processorPatch
bool usesCoupledPatch(const label celli) const;
public:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,11 +61,11 @@ void Foam::badQualityToCell::combine(topoSet& set, const bool add) const
forAllConstIter(faceSet, faces, iter)
{
label faceI = iter.key();
addOrDelete(set, mesh_.faceOwner()[faceI], add);
if (mesh_.isInternalFace(faceI))
label facei = iter.key();
addOrDelete(set, mesh_.faceOwner()[facei], add);
if (mesh_.isInternalFace(facei))
{
addOrDelete(set, mesh_.faceNeighbour()[faceI], add);
addOrDelete(set, mesh_.faceNeighbour()[facei], add);
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,8 +61,8 @@ void Foam::badQualityToFace::combine(topoSet& set, const bool add) const
forAllConstIter(faceSet, faces, iter)
{
label faceI = iter.key();
addOrDelete(set, faceI, add);
label facei = iter.key();
addOrDelete(set, facei, add);
}
}

View File

@ -117,71 +117,71 @@ void Foam::polyMeshGeometry::updateCellCentresAndVols
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
cEst[own[faceI]] += faceCentres_[faceI];
nCellFaces[own[faceI]] += 1;
label facei = changedFaces[i];
cEst[own[facei]] += faceCentres_[facei];
nCellFaces[own[facei]] += 1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
cEst[nei[faceI]] += faceCentres_[faceI];
nCellFaces[nei[faceI]] += 1;
cEst[nei[facei]] += faceCentres_[facei];
nCellFaces[nei[facei]] += 1;
}
}
forAll(changedCells, i)
{
label cellI = changedCells[i];
cEst[cellI] /= nCellFaces[cellI];
label celli = changedCells[i];
cEst[celli] /= nCellFaces[celli];
}
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
label facei = changedFaces[i];
// Calculate 3*face-pyramid volume
scalar pyr3Vol = max
(
faceAreas_[faceI] & (faceCentres_[faceI] - cEst[own[faceI]]),
faceAreas_[facei] & (faceCentres_[facei] - cEst[own[facei]]),
VSMALL
);
// Calculate face-pyramid centre
vector pc = (3.0/4.0)*faceCentres_[faceI] + (1.0/4.0)*cEst[own[faceI]];
vector pc = (3.0/4.0)*faceCentres_[facei] + (1.0/4.0)*cEst[own[facei]];
// Accumulate volume-weighted face-pyramid centre
cellCentres_[own[faceI]] += pyr3Vol*pc;
cellCentres_[own[facei]] += pyr3Vol*pc;
// Accumulate face-pyramid volume
cellVolumes_[own[faceI]] += pyr3Vol;
cellVolumes_[own[facei]] += pyr3Vol;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
// Calculate 3*face-pyramid volume
scalar pyr3Vol = max
(
faceAreas_[faceI] & (cEst[nei[faceI]] - faceCentres_[faceI]),
faceAreas_[facei] & (cEst[nei[facei]] - faceCentres_[facei]),
VSMALL
);
// Calculate face-pyramid centre
vector pc =
(3.0/4.0)*faceCentres_[faceI]
+ (1.0/4.0)*cEst[nei[faceI]];
(3.0/4.0)*faceCentres_[facei]
+ (1.0/4.0)*cEst[nei[facei]];
// Accumulate volume-weighted face-pyramid centre
cellCentres_[nei[faceI]] += pyr3Vol*pc;
cellCentres_[nei[facei]] += pyr3Vol*pc;
// Accumulate face-pyramid volume
cellVolumes_[nei[faceI]] += pyr3Vol;
cellVolumes_[nei[facei]] += pyr3Vol;
}
}
forAll(changedCells, i)
{
label cellI = changedCells[i];
label celli = changedCells[i];
cellCentres_[cellI] /= cellVolumes_[cellI] + VSMALL;
cellVolumes_[cellI] *= (1.0/3.0);
cellCentres_[celli] /= cellVolumes_[celli] + VSMALL;
cellVolumes_[celli] *= (1.0/3.0);
}
}
@ -199,13 +199,13 @@ Foam::labelList Foam::polyMeshGeometry::affectedCells
forAll(changedFaces, i)
{
label faceI = changedFaces[i];
label facei = changedFaces[i];
affectedCells.insert(own[faceI]);
affectedCells.insert(own[facei]);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
affectedCells.insert(nei[faceI]);
affectedCells.insert(nei[facei]);
}
}
return affectedCells.toc();
@ -217,7 +217,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
const polyMesh& mesh,
const bool report,
const scalar severeNonorthogonalityThreshold,
const label faceI,
const label facei,
const vector& s, // face area vector
const vector& d, // cc-cc vector
@ -232,9 +232,9 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
{
label nei = -1;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
nei = mesh.faceNeighbour()[faceI];
nei = mesh.faceNeighbour()[facei];
}
if (dDotS > SMALL)
@ -242,8 +242,8 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
if (report)
{
// Severe non-orthogonality but mesh still OK
Pout<< "Severe non-orthogonality for face " << faceI
<< " between cells " << mesh.faceOwner()[faceI]
Pout<< "Severe non-orthogonality for face " << facei
<< " between cells " << mesh.faceOwner()[facei]
<< " and " << nei
<< ": Angle = "
<< radToDeg(::acos(dDotS))
@ -259,8 +259,8 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
{
WarningInFunction
<< "Severe non-orthogonality detected for face "
<< faceI
<< " between cells " << mesh.faceOwner()[faceI]
<< facei
<< " between cells " << mesh.faceOwner()[facei]
<< " and " << nei
<< ": Angle = "
<< radToDeg(::acos(dDotS))
@ -272,7 +272,7 @@ Foam::scalar Foam::polyMeshGeometry::checkNonOrtho
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
}
return dDotS;
@ -286,14 +286,14 @@ bool Foam::polyMeshGeometry::checkFaceTet
const bool report,
const scalar minTetQuality,
const pointField& p,
const label faceI,
const label facei,
const point& fc, // face centre
const point& cc, // cell centre
labelHashSet* setPtr
)
{
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
forAll(f, fp)
{
@ -313,17 +313,17 @@ bool Foam::polyMeshGeometry::checkFaceTet
<< "const bool, const scalar, const pointField&"
<< ", const pointField&"
<< ", const labelList&, labelHashSet*) : "
<< "face " << faceI
<< "face " << facei
<< " has a triangle that points the wrong way."
<< endl
<< "Tet quality: " << tetQual
<< " Face " << faceI
<< " Face " << facei
<< endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
return true;
}
@ -392,9 +392,9 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
// Calculate coupled cell centre
pointField neiCc(mesh.nFaces() - mesh.nInternalFaces());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
neiCc[faceI-mesh.nInternalFaces()] = cellCentres[own[faceI]];
neiCc[facei-mesh.nInternalFaces()] = cellCentres[own[facei]];
}
syncTools::swapBoundaryFacePositions(mesh, neiCc);
@ -410,20 +410,20 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
const point& ownCc = cellCentres[own[faceI]];
const point& ownCc = cellCentres[own[facei]];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
scalar dDotS = checkNonOrtho
(
mesh,
report,
severeNonorthogonalityThreshold,
faceI,
faceAreas[faceI],
cellCentres[nei[faceI]] - ownCc,
facei,
faceAreas[facei],
cellCentres[nei[facei]] - ownCc,
severeNonOrth,
errorNonOrth,
@ -440,18 +440,18 @@ bool Foam::polyMeshGeometry::checkFaceDotProduct
}
else
{
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(facei);
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
scalar dDotS = checkNonOrtho
(
mesh,
report,
severeNonorthogonalityThreshold,
faceI,
faceAreas[faceI],
neiCc[faceI-mesh.nInternalFaces()] - ownCc,
facei,
faceAreas[facei],
neiCc[facei-mesh.nInternalFaces()] - ownCc,
severeNonOrth,
errorNonOrth,
@ -571,13 +571,13 @@ bool Foam::polyMeshGeometry::checkFacePyramids
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
// Create the owner pyramid - it will have negative volume
scalar pyrVol = pyramidPointFaceRef
(
f[faceI],
cellCentres[own[faceI]]
f[facei],
cellCentres[own[facei]]
).mag(p);
if (pyrVol > -minPyrVol)
@ -587,29 +587,29 @@ bool Foam::polyMeshGeometry::checkFacePyramids
Pout<< "bool polyMeshGeometry::checkFacePyramids("
<< "const bool, const scalar, const pointField&"
<< ", const labelList&, labelHashSet*): "
<< "face " << faceI << " points the wrong way. " << endl
<< "face " << facei << " points the wrong way. " << endl
<< "Pyramid volume: " << -pyrVol
<< " Face " << f[faceI] << " area: " << f[faceI].mag(p)
<< " Owner cell: " << own[faceI] << endl
<< " Face " << f[facei] << " area: " << f[facei].mag(p)
<< " Owner cell: " << own[facei] << endl
<< "Owner cell vertex labels: "
<< mesh.cells()[own[faceI]].labels(f)
<< mesh.cells()[own[facei]].labels(f)
<< endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorPyrs++;
}
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
// Create the neighbour pyramid - it will have positive volume
scalar pyrVol =
pyramidPointFaceRef(f[faceI], cellCentres[nei[faceI]]).mag(p);
pyramidPointFaceRef(f[facei], cellCentres[nei[facei]]).mag(p);
if (pyrVol < minPyrVol)
{
@ -618,18 +618,18 @@ bool Foam::polyMeshGeometry::checkFacePyramids
Pout<< "bool polyMeshGeometry::checkFacePyramids("
<< "const bool, const scalar, const pointField&"
<< ", const labelList&, labelHashSet*): "
<< "face " << faceI << " points the wrong way. " << endl
<< "face " << facei << " points the wrong way. " << endl
<< "Pyramid volume: " << -pyrVol
<< " Face " << f[faceI] << " area: " << f[faceI].mag(p)
<< " Neighbour cell: " << nei[faceI] << endl
<< " Face " << f[facei] << " area: " << f[facei].mag(p)
<< " Neighbour cell: " << nei[facei] << endl
<< "Neighbour cell vertex labels: "
<< mesh.cells()[nei[faceI]].labels(f)
<< mesh.cells()[nei[facei]].labels(f)
<< endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorPyrs++;
@ -752,9 +752,9 @@ bool Foam::polyMeshGeometry::checkFaceTets
// Calculate coupled cell centre
pointField neiCc(mesh.nFaces() - mesh.nInternalFaces());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
neiCc[faceI - mesh.nInternalFaces()] = cellCentres[own[faceI]];
neiCc[facei - mesh.nInternalFaces()] = cellCentres[own[facei]];
}
syncTools::swapBoundaryFacePositions(mesh, neiCc);
@ -763,7 +763,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
// Create the owner pyramid - note: exchange cell and face centre
// to get positive volume.
@ -773,9 +773,9 @@ bool Foam::polyMeshGeometry::checkFaceTets
report,
minTetQuality,
p,
faceI,
cellCentres[own[faceI]], // face centre
faceCentres[faceI], // cell centre
facei,
cellCentres[own[facei]], // face centre
faceCentres[facei], // cell centre
setPtr
);
@ -784,7 +784,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
nErrorTets++;
}
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
// Create the neighbour tets - they will have positive volume
bool tetError = checkFaceTet
@ -793,9 +793,9 @@ bool Foam::polyMeshGeometry::checkFaceTets
report,
minTetQuality,
p,
faceI,
faceCentres[faceI], // face centre
cellCentres[nei[faceI]], // cell centre
facei,
faceCentres[facei], // face centre
cellCentres[nei[facei]], // cell centre
setPtr
);
@ -809,7 +809,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
polyMeshTetDecomposition::findSharedBasePoint
(
mesh,
faceI,
facei,
minTetQuality,
report
) == -1
@ -817,7 +817,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -825,17 +825,17 @@ bool Foam::polyMeshGeometry::checkFaceTets
}
else
{
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(facei);
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
if
(
polyMeshTetDecomposition::findSharedBasePoint
(
mesh,
faceI,
neiCc[faceI - mesh.nInternalFaces()],
facei,
neiCc[facei - mesh.nInternalFaces()],
minTetQuality,
report
) == -1
@ -843,7 +843,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -856,7 +856,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
polyMeshTetDecomposition::findBasePoint
(
mesh,
faceI,
facei,
minTetQuality,
report
) == -1
@ -864,7 +864,7 @@ bool Foam::polyMeshGeometry::checkFaceTets
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nErrorTets++;
@ -991,9 +991,9 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
scalar skewness = primitiveMeshTools::faceSkewness
(
@ -1002,9 +1002,9 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
faceCentres,
faceAreas,
faceI,
cellCentres[own[faceI]],
cellCentres[nei[faceI]]
facei,
cellCentres[own[facei]],
cellCentres[nei[facei]]
);
// Check if the skewness vector is greater than the PN vector.
@ -1014,13 +1014,13 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
{
if (report)
{
Pout<< "Severe skewness for face " << faceI
Pout<< "Severe skewness for face " << facei
<< " skewness = " << skewness << endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnSkew++;
@ -1028,7 +1028,7 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
maxSkew = max(maxSkew, skewness);
}
else if (patches[patches.whichPatch(faceI)].coupled())
else if (patches[patches.whichPatch(facei)].coupled())
{
scalar skewness = primitiveMeshTools::faceSkewness
(
@ -1037,9 +1037,9 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
faceCentres,
faceAreas,
faceI,
cellCentres[own[faceI]],
neiCc[faceI-mesh.nInternalFaces()]
facei,
cellCentres[own[facei]],
neiCc[facei-mesh.nInternalFaces()]
);
// Check if the skewness vector is greater than the PN vector.
@ -1049,13 +1049,13 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
{
if (report)
{
Pout<< "Severe skewness for coupled face " << faceI
Pout<< "Severe skewness for coupled face " << facei
<< " skewness = " << skewness << endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnSkew++;
@ -1072,8 +1072,8 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
faceCentres,
faceAreas,
faceI,
cellCentres[own[faceI]]
facei,
cellCentres[own[facei]]
);
@ -1084,13 +1084,13 @@ bool Foam::polyMeshGeometry::checkFaceSkewness
{
if (report)
{
Pout<< "Severe skewness for boundary face " << faceI
Pout<< "Severe skewness for boundary face " << facei
<< " skewness = " << skewness << endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnSkew++;
@ -1194,9 +1194,9 @@ bool Foam::polyMeshGeometry::checkFaceWeights
// Calculate coupled cell centre
pointField neiCc(mesh.nFaces()-mesh.nInternalFaces());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
neiCc[faceI-mesh.nInternalFaces()] = cellCentres[own[faceI]];
neiCc[facei-mesh.nInternalFaces()] = cellCentres[own[facei]];
}
syncTools::swapBoundaryFacePositions(mesh, neiCc);
@ -1207,29 +1207,29 @@ bool Foam::polyMeshGeometry::checkFaceWeights
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
const point& fc = faceCentres[faceI];
const vector& fa = faceAreas[faceI];
const point& fc = faceCentres[facei];
const vector& fa = faceAreas[facei];
scalar dOwn = mag(fa & (fc-cellCentres[own[faceI]]));
scalar dOwn = mag(fa & (fc-cellCentres[own[facei]]));
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
scalar dNei = mag(fa & (cellCentres[nei[faceI]]-fc));
scalar dNei = mag(fa & (cellCentres[nei[facei]]-fc));
scalar weight = min(dNei,dOwn)/(dNei+dOwn+VSMALL);
if (weight < warnWeight)
{
if (report)
{
Pout<< "Small weighting factor for face " << faceI
Pout<< "Small weighting factor for face " << facei
<< " weight = " << weight << endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnWeight++;
@ -1239,24 +1239,24 @@ bool Foam::polyMeshGeometry::checkFaceWeights
}
else
{
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(facei);
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
scalar dNei = mag(fa & (neiCc[faceI-mesh.nInternalFaces()]-fc));
scalar dNei = mag(fa & (neiCc[facei-mesh.nInternalFaces()]-fc));
scalar weight = min(dNei,dOwn)/(dNei+dOwn+VSMALL);
if (weight < warnWeight)
{
if (report)
{
Pout<< "Small weighting factor for face " << faceI
Pout<< "Small weighting factor for face " << facei
<< " weight = " << weight << endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnWeight++;
@ -1347,9 +1347,9 @@ bool Foam::polyMeshGeometry::checkVolRatio
// Calculate coupled cell vol
scalarField neiVols(mesh.nFaces()-mesh.nInternalFaces());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
neiVols[faceI-mesh.nInternalFaces()] = cellVolumes[own[faceI]];
neiVols[facei-mesh.nInternalFaces()] = cellVolumes[own[facei]];
}
syncTools::swapBoundaryFaceList(mesh, neiVols);
@ -1360,23 +1360,23 @@ bool Foam::polyMeshGeometry::checkVolRatio
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
scalar ownVol = mag(cellVolumes[own[faceI]]);
scalar ownVol = mag(cellVolumes[own[facei]]);
scalar neiVol = -GREAT;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
neiVol = mag(cellVolumes[nei[faceI]]);
neiVol = mag(cellVolumes[nei[facei]]);
}
else
{
label patchI = patches.whichPatch(faceI);
label patchi = patches.whichPatch(facei);
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
neiVol = mag(neiVols[faceI-mesh.nInternalFaces()]);
neiVol = mag(neiVols[facei-mesh.nInternalFaces()]);
}
}
@ -1388,13 +1388,13 @@ bool Foam::polyMeshGeometry::checkVolRatio
{
if (report)
{
Pout<< "Small ratio for face " << faceI
Pout<< "Small ratio for face " << facei
<< " ratio = " << ratio << endl;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nWarnRatio++;
@ -1499,11 +1499,11 @@ bool Foam::polyMeshGeometry::checkFaceAngles
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
const face& f = fcs[faceI];
const face& f = fcs[facei];
vector faceNormal = faceAreas[faceI];
vector faceNormal = faceAreas[facei];
faceNormal /= mag(faceNormal) + VSMALL;
// Get edge from f[0] to f[size-1];
@ -1537,16 +1537,16 @@ bool Foam::polyMeshGeometry::checkFaceAngles
if ((edgeNormal & faceNormal) < SMALL)
{
if (faceI != errorFaceI)
if (facei != errorFaceI)
{
// Count only one error per face.
errorFaceI = faceI;
errorFaceI = facei;
nConcave++;
}
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
maxEdgeSin = max(maxEdgeSin, magEdgeNormal);
@ -1630,17 +1630,17 @@ bool Foam::polyMeshGeometry::checkFaceTwist
// forAll(checkFaces, i)
// {
// label faceI = checkFaces[i];
// label facei = checkFaces[i];
//
// const face& f = fcs[faceI];
// const face& f = fcs[facei];
//
// scalar magArea = mag(faceAreas[faceI]);
// scalar magArea = mag(faceAreas[facei]);
//
// if (f.size() > 3 && magArea > VSMALL)
// {
// const vector nf = faceAreas[faceI] / magArea;
// const vector nf = faceAreas[facei] / magArea;
//
// const point& fc = faceCentres[faceI];
// const point& fc = faceCentres[facei];
//
// forAll(f, fpI)
// {
@ -1662,7 +1662,7 @@ bool Foam::polyMeshGeometry::checkFaceTwist
//
// if (setPtr)
// {
// setPtr->insert(faceI);
// setPtr->insert(facei);
// }
//
// break;
@ -1679,43 +1679,43 @@ bool Foam::polyMeshGeometry::checkFaceTwist
// Calculate coupled cell centre
pointField neiCc(mesh.nFaces()-mesh.nInternalFaces());
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
{
neiCc[faceI-mesh.nInternalFaces()] = cellCentres[own[faceI]];
neiCc[facei-mesh.nInternalFaces()] = cellCentres[own[facei]];
}
syncTools::swapBoundaryFacePositions(mesh, neiCc);
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
const face& f = fcs[faceI];
const face& f = fcs[facei];
if (f.size() > 3)
{
vector nf(Zero);
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
nf = cellCentres[nei[faceI]] - cellCentres[own[faceI]];
nf = cellCentres[nei[facei]] - cellCentres[own[facei]];
nf /= mag(nf) + VSMALL;
}
else if (patches[patches.whichPatch(faceI)].coupled())
else if (patches[patches.whichPatch(facei)].coupled())
{
nf =
neiCc[faceI-mesh.nInternalFaces()]
- cellCentres[own[faceI]];
neiCc[facei-mesh.nInternalFaces()]
- cellCentres[own[facei]];
nf /= mag(nf) + VSMALL;
}
else
{
nf = faceCentres[faceI] - cellCentres[own[faceI]];
nf = faceCentres[facei] - cellCentres[own[facei]];
nf /= mag(nf) + VSMALL;
}
if (nf != vector::zero)
{
const point& fc = faceCentres[faceI];
const point& fc = faceCentres[facei];
forAll(f, fpI)
{
@ -1737,7 +1737,7 @@ bool Foam::polyMeshGeometry::checkFaceTwist
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
break;
@ -1812,13 +1812,13 @@ bool Foam::polyMeshGeometry::checkTriangleTwist
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
const face& f = fcs[faceI];
const face& f = fcs[facei];
if (f.size() > 3)
{
const point& fc = faceCentres[faceI];
const point& fc = faceCentres[facei];
// Find starting triangle (at startFp) with non-zero area
label startFp = -1;
@ -1872,7 +1872,7 @@ bool Foam::polyMeshGeometry::checkTriangleTwist
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
break;
@ -1886,7 +1886,7 @@ bool Foam::polyMeshGeometry::checkTriangleTwist
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
break;
@ -1962,13 +1962,13 @@ bool Foam::polyMeshGeometry::checkFaceFlatness
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
const face& f = fcs[faceI];
const face& f = fcs[facei];
if (f.size() > 3)
{
const point& fc = faceCentres[faceI];
const point& fc = faceCentres[facei];
// Sum triangle areas
scalar sumArea = 0.0;
@ -1983,13 +1983,13 @@ bool Foam::polyMeshGeometry::checkFaceFlatness
).mag();
}
if (sumArea/mag(faceAreas[faceI]) < minFlatness)
if (sumArea/mag(faceAreas[facei]) < minFlatness)
{
nWarped++;
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
}
}
@ -2049,13 +2049,13 @@ bool Foam::polyMeshGeometry::checkFaceArea
forAll(checkFaces, i)
{
label faceI = checkFaces[i];
label facei = checkFaces[i];
if (mag(faceAreas[faceI]) < minArea)
if (mag(faceAreas[facei]) < minArea)
{
if (setPtr)
{
setPtr->insert(faceI);
setPtr->insert(facei);
}
nZeroArea++;
}
@ -2123,12 +2123,12 @@ bool Foam::polyMeshGeometry::checkCellDeterminant
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
label facei = cFaces[cFaceI];
scalar magArea = mag(faceAreas[faceI]);
scalar magArea = mag(faceAreas[facei]);
magAreaSum += magArea;
areaSum += faceAreas[faceI]*(faceAreas[faceI]/(magArea+VSMALL));
areaSum += faceAreas[facei]*(faceAreas[facei]/(magArea+VSMALL));
}
scalar scaledDet = det(areaSum/(magAreaSum+VSMALL))/0.037037037037037;
@ -2144,8 +2144,8 @@ bool Foam::polyMeshGeometry::checkCellDeterminant
// Insert all faces of the cell.
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
setPtr->insert(faceI);
label facei = cFaces[cFaceI];
setPtr->insert(facei);
}
}
nWarnDet++;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,7 +91,7 @@ class polyMeshGeometry
const polyMesh& mesh,
const bool report,
const scalar severeNonorthogonalityThreshold,
const label faceI,
const label facei,
const vector& s, // face area vector
const vector& d, // cc-cc vector
@ -115,7 +115,7 @@ class polyMeshGeometry
const bool report,
const scalar minTetQuality,
const pointField& p,
const label faceI,
const label facei,
const point& fc, // face centre
const point& cc, // cell centre
labelHashSet* setPtr

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
@ -280,13 +280,13 @@ void Foam::perfectInterface::setRefinement
// never be sure what the user is doing.
forAll(pp0, i)
{
label faceI = pp0.addressing()[i];
label facei = pp0.addressing()[i];
if (affectedFaces.erase(faceI))
if (affectedFaces.erase(facei))
{
WarningInFunction
<< "Found face " << faceI << " vertices "
<< mesh.faces()[faceI] << " whose points are"
<< "Found face " << facei << " vertices "
<< mesh.faces()[facei] << " whose points are"
<< " used both by master patch and slave patch" << endl;
}
}
@ -295,8 +295,8 @@ void Foam::perfectInterface::setRefinement
// 2. Renumber (non patch0/1) faces.
forAllConstIter(labelHashSet, affectedFaces, iter)
{
const label faceI = iter.key();
const face& f = mesh.faces()[faceI];
const label facei = iter.key();
const face& f = mesh.faces()[facei];
face newFace(f.size());
@ -309,16 +309,16 @@ void Foam::perfectInterface::setRefinement
label patchI = -1;
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
nbr = mesh.faceNeighbour()[faceI];
nbr = mesh.faceNeighbour()[facei];
}
else
{
patchI = patches.whichPatch(faceI);
patchI = patches.whichPatch(facei);
}
label zoneID = mesh.faceZones().whichZone(faceI);
label zoneID = mesh.faceZones().whichZone(facei);
bool zoneFlip = false;
@ -326,7 +326,7 @@ void Foam::perfectInterface::setRefinement
{
const faceZone& fZone = mesh.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
ref.setAction
@ -334,8 +334,8 @@ void Foam::perfectInterface::setRefinement
polyModifyFace
(
newFace, // modified face
faceI, // label of face being modified
mesh.faceOwner()[faceI], // owner
facei, // label of face being modified
mesh.faceOwner()[facei], // owner
nbr, // neighbour
false, // face flip
patchI, // patch for face
@ -362,8 +362,8 @@ void Foam::perfectInterface::setRefinement
// 4. Remove patch1 faces
forAll(pp1, i)
{
label faceI = pp1.addressing()[i];
ref.setAction(polyRemoveFace(faceI));
label facei = pp1.addressing()[i];
ref.setAction(polyRemoveFace(facei));
}
@ -375,9 +375,9 @@ void Foam::perfectInterface::setRefinement
forAll(pp0, i)
{
label faceI = pp0.addressing()[i];
label facei = pp0.addressing()[i];
const face& f = mesh.faces()[faceI];
const face& f = mesh.faces()[facei];
face newFace(f.size());
@ -386,7 +386,7 @@ void Foam::perfectInterface::setRefinement
newFace[fp] = renumberPoints[f[fp]];
}
label own = mesh.faceOwner()[faceI];
label own = mesh.faceOwner()[facei];
label pp1FaceI = pp1.addressing()[from0To1Faces[i]];
@ -399,7 +399,7 @@ void Foam::perfectInterface::setRefinement
polyModifyFace
(
newFace, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
nbr, // neighbour
false, // face flip
@ -417,7 +417,7 @@ void Foam::perfectInterface::setRefinement
polyModifyFace
(
newFace.reverseFace(), // modified face
faceI, // label of face being modified
facei, // label of face being modified
nbr, // owner
own, // neighbour
true, // face flip

View File

@ -72,8 +72,8 @@ void Foam::pointPatchDist::correct()
forAllConstIter(labelHashSet, patchIDs_, iter)
{
label patchI = iter.key();
nPoints += pbm[patchI].meshPoints().size();
label patchi = iter.key();
nPoints += pbm[patchi].meshPoints().size();
}
externalPointEdgePoint::trackingData td(points_);
@ -85,10 +85,10 @@ void Foam::pointPatchDist::correct()
forAllConstIter(labelHashSet, patchIDs_, iter)
{
label patchI = iter.key();
label patchi = iter.key();
// Retrieve the patch now we have its index in patches.
const labelList& mp = pbm[patchI].meshPoints();
const labelList& mp = pbm[patchi].meshPoints();
forAll(mp, ppI)
{

View File

@ -348,9 +348,9 @@ bool Foam::faceCoupleInfo::regionEdge
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
label meshFaceI = slavePatch().addressing()[faceI];
label meshFaceI = slavePatch().addressing()[facei];
label patchI = slaveMesh.boundaryMesh().whichPatch(meshFaceI);
@ -1109,15 +1109,15 @@ Foam::label Foam::faceCoupleInfo::growCutFaces
forAll(eFaces, j)
{
const label faceI = eFaces[j];
const label facei = eFaces[j];
if (cutToMasterFaces_[faceI] == -1)
if (cutToMasterFaces_[facei] == -1)
{
cutToMasterFaces_[faceI] = masterFaceI;
candidates.erase(faceI);
cutToMasterFaces_[facei] = masterFaceI;
candidates.erase(facei);
nChanged++;
}
else if (cutToMasterFaces_[faceI] != masterFaceI)
else if (cutToMasterFaces_[facei] != masterFaceI)
{
const pointField& cutPoints =
cutFaces().points();
@ -1126,14 +1126,14 @@ Foam::label Foam::faceCoupleInfo::growCutFaces
const edge& e = cutFaces().edges()[cutEdgeI];
label myMaster = cutToMasterFaces_[faceI];
label myMaster = cutToMasterFaces_[facei];
const face& myF = masterPatch()[myMaster];
const face& nbrF = masterPatch()[masterFaceI];
FatalErrorInFunction
<< "Cut face "
<< cutFaces()[faceI].points(cutPoints)
<< cutFaces()[facei].points(cutPoints)
<< " has master "
<< myMaster
<< " but also connects to nbr face "
@ -2051,11 +2051,11 @@ Foam::labelList Foam::faceCoupleInfo::faceLabels(const polyPatch& pp)
{
labelList faces(pp.size());
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
faces[i] = faceI++;
faces[i] = facei++;
}
return faces;
}

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
@ -39,11 +39,11 @@ Foam::pointField Foam::faceCoupleInfo::calcFaceCentres
{
pointField fc(size);
label faceI = start;
label facei = start;
forAll(fc, i)
{
fc[i] = faces[faceI++].centre(points);
fc[i] = faces[facei++].centre(points);
}
return fc;
}

View File

@ -51,9 +51,9 @@ Foam::label Foam::polyMeshAdder::patchIndex
const word& pType = p.type();
const word& pName = p.name();
label patchI = findIndex(allPatchNames, pName);
label patchi = findIndex(allPatchNames, pName);
if (patchI == -1)
if (patchi == -1)
{
// Patch not found. Append to the list
allPatchNames.append(pName);
@ -61,10 +61,10 @@ Foam::label Foam::polyMeshAdder::patchIndex
return allPatchNames.size() - 1;
}
else if (allPatchTypes[patchI] == pType)
else if (allPatchTypes[patchi] == pType)
{
// Found name and types match
return patchI;
return patchi;
}
else
{
@ -138,11 +138,11 @@ void Foam::polyMeshAdder::mergePatchNames
// Add mesh1 patches and build map both ways.
from1ToAllPatches.setSize(patches1.size());
forAll(patches1, patchI)
forAll(patches1, patchi)
{
from1ToAllPatches[patchI] = patchIndex
from1ToAllPatches[patchi] = patchIndex
(
patches1[patchI],
patches1[patchi],
allPatchNames,
allPatchTypes
);
@ -167,9 +167,9 @@ Foam::labelList Foam::polyMeshAdder::getPatchStarts
)
{
labelList patchStarts(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patchStarts[patchI] = patches[patchI].start();
patchStarts[patchi] = patches[patchi].start();
}
return patchStarts;
}
@ -181,9 +181,9 @@ Foam::labelList Foam::polyMeshAdder::getPatchSizes
)
{
labelList patchSizes(patches.size());
forAll(patches, patchI)
forAll(patches, patchi)
{
patchSizes[patchI] = patches[patchI].size();
patchSizes[patchi] = patches[patchi].size();
}
return patchSizes;
}
@ -220,16 +220,16 @@ Foam::List<Foam::polyPatch*> Foam::polyMeshAdder::combinePatches
// Copy patches0 with new sizes. First patches always come from
// mesh0 and will always be present.
forAll(patches0, patchI)
forAll(patches0, patchi)
{
// Originates from mesh0. Clone with new size & filter out empty
// patch.
label filteredPatchI;
if (nFaces[patchI] == 0 && isA<processorPolyPatch>(patches0[patchI]))
if (nFaces[patchi] == 0 && isA<processorPolyPatch>(patches0[patchi]))
{
//Pout<< "Removing zero sized mesh0 patch "
// << patches0[patchI].name() << endl;
// << patches0[patchi].name() << endl;
filteredPatchI = -1;
}
else
@ -238,31 +238,31 @@ Foam::List<Foam::polyPatch*> Foam::polyMeshAdder::combinePatches
allPatches.append
(
patches0[patchI].clone
patches0[patchi].clone
(
allBoundaryMesh,
filteredPatchI,
nFaces[patchI],
nFaces[patchi],
startFaceI
).ptr()
);
startFaceI += nFaces[patchI];
startFaceI += nFaces[patchi];
}
// Record new index in allPatches
from0ToAllPatches[patchI] = filteredPatchI;
from0ToAllPatches[patchi] = filteredPatchI;
// Check if patch was also in mesh1 and update its addressing if so.
if (fromAllTo1Patches[patchI] != -1)
if (fromAllTo1Patches[patchi] != -1)
{
from1ToAllPatches[fromAllTo1Patches[patchI]] = filteredPatchI;
from1ToAllPatches[fromAllTo1Patches[patchi]] = filteredPatchI;
}
}
// Copy unique patches of mesh1.
forAll(from1ToAllPatches, patchI)
forAll(from1ToAllPatches, patchi)
{
label allPatchI = from1ToAllPatches[patchI];
label allPatchI = from1ToAllPatches[patchi];
if (allPatchI >= patches0.size())
{
@ -273,11 +273,11 @@ Foam::List<Foam::polyPatch*> Foam::polyMeshAdder::combinePatches
if
(
nFaces[allPatchI] == 0
&& isA<processorPolyPatch>(patches1[patchI])
&& isA<processorPolyPatch>(patches1[patchi])
)
{
//Pout<< "Removing zero sized mesh1 patch "
// << patches1[patchI].name() << endl;
// << patches1[patchi].name() << endl;
filteredPatchI = -1;
}
else
@ -286,7 +286,7 @@ Foam::List<Foam::polyPatch*> Foam::polyMeshAdder::combinePatches
allPatches.append
(
patches1[patchI].clone
patches1[patchi].clone
(
allBoundaryMesh,
filteredPatchI,
@ -297,7 +297,7 @@ Foam::List<Foam::polyPatch*> Foam::polyMeshAdder::combinePatches
startFaceI += nFaces[allPatchI];
}
from1ToAllPatches[patchI] = filteredPatchI;
from1ToAllPatches[patchi] = filteredPatchI;
}
}
@ -318,35 +318,35 @@ Foam::labelList Foam::polyMeshAdder::getFaceOrder
labelList oldToNew(owner.size(), -1);
// Leave boundary faces in order
for (label faceI = nInternalFaces; faceI < owner.size(); ++faceI)
for (label facei = nInternalFaces; facei < owner.size(); ++facei)
{
oldToNew[faceI] = faceI;
oldToNew[facei] = facei;
}
// First unassigned face
label newFaceI = 0;
forAll(cells, cellI)
forAll(cells, celli)
{
const labelList& cFaces = cells[cellI];
const labelList& cFaces = cells[celli];
SortableList<label> nbr(cFaces.size());
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
label nbrCellI = neighbour[faceI];
label nbrCellI = neighbour[facei];
if (nbrCellI != -1)
{
// 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
nbr[i] = nbrCellI;
@ -377,13 +377,13 @@ Foam::labelList Foam::polyMeshAdder::getFaceOrder
// Check done all faces.
forAll(oldToNew, faceI)
forAll(oldToNew, facei)
{
if (oldToNew[faceI] == -1)
if (oldToNew[facei] == -1)
{
FatalErrorInFunction
<< "Did not determine new position"
<< " for face " << faceI
<< " for face " << facei
<< abort(FatalError);
}
}
@ -622,12 +622,12 @@ void Foam::polyMeshAdder::mergePrimitives
from1ToAllFaces = -1;
// Copy mesh0 internal faces (always uncoupled)
for (label faceI = 0; faceI < mesh0.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh0.nInternalFaces(); facei++)
{
allFaces[allFaceI] = renumber(from0ToAllPoints, mesh0.faces()[faceI]);
allOwner[allFaceI] = mesh0.faceOwner()[faceI];
allNeighbour[allFaceI] = mesh0.faceNeighbour()[faceI];
from0ToAllFaces[faceI] = allFaceI++;
allFaces[allFaceI] = renumber(from0ToAllPoints, mesh0.faces()[facei]);
allOwner[allFaceI] = mesh0.faceOwner()[facei];
allNeighbour[allFaceI] = mesh0.faceNeighbour()[facei];
from0ToAllFaces[facei] = allFaceI++;
}
// Copy coupled faces. Every coupled face has an equivalent master and
@ -673,12 +673,12 @@ void Foam::polyMeshAdder::mergePrimitives
}
// Copy mesh1 internal faces (always uncoupled)
for (label faceI = 0; faceI < mesh1.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh1.nInternalFaces(); facei++)
{
allFaces[allFaceI] = renumber(from1ToAllPoints, mesh1.faces()[faceI]);
allOwner[allFaceI] = mesh1.faceOwner()[faceI] + mesh0.nCells();
allNeighbour[allFaceI] = mesh1.faceNeighbour()[faceI] + mesh0.nCells();
from1ToAllFaces[faceI] = allFaceI++;
allFaces[allFaceI] = renumber(from1ToAllPoints, mesh1.faces()[facei]);
allOwner[allFaceI] = mesh1.faceOwner()[facei] + mesh0.nCells();
allNeighbour[allFaceI] = mesh1.faceNeighbour()[facei] + mesh0.nCells();
from1ToAllFaces[facei] = allFaceI++;
}
nInternalFaces = allFaceI;
@ -693,24 +693,24 @@ void Foam::polyMeshAdder::mergePrimitives
nFacesPerPatch[allPatchI] += pp.size();
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
if (from0ToAllFaces[faceI] == -1)
if (from0ToAllFaces[facei] == -1)
{
// Is uncoupled face since has not yet been dealt with
allFaces[allFaceI] = renumber
(
from0ToAllPoints,
mesh0.faces()[faceI]
mesh0.faces()[facei]
);
allOwner[allFaceI] = mesh0.faceOwner()[faceI];
allOwner[allFaceI] = mesh0.faceOwner()[facei];
allNeighbour[allFaceI] = -1;
from0ToAllFaces[faceI] = allFaceI++;
from0ToAllFaces[facei] = allFaceI++;
}
faceI++;
facei++;
}
}
if (fromAllTo1Patches[allPatchI] != -1)
@ -720,26 +720,26 @@ void Foam::polyMeshAdder::mergePrimitives
nFacesPerPatch[allPatchI] += pp.size();
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
if (from1ToAllFaces[faceI] == -1)
if (from1ToAllFaces[facei] == -1)
{
// Is uncoupled face
allFaces[allFaceI] = renumber
(
from1ToAllPoints,
mesh1.faces()[faceI]
mesh1.faces()[facei]
);
allOwner[allFaceI] =
mesh1.faceOwner()[faceI]
mesh1.faceOwner()[facei]
+ mesh0.nCells();
allNeighbour[allFaceI] = -1;
from1ToAllFaces[faceI] = allFaceI++;
from1ToAllFaces[facei] = allFaceI++;
}
faceI++;
facei++;
}
}
}
@ -2233,9 +2233,9 @@ void Foam::polyMeshAdder::mergePoints
// avoid addressing calculation.
const faceList& faces = mesh.faces();
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
bool hasMerged = false;
@ -2271,15 +2271,15 @@ void Foam::polyMeshAdder::mergePoints
}
}
label patchID = mesh.boundaryMesh().whichPatch(faceI);
label nei = (patchID == -1 ? mesh.faceNeighbour()[faceI] : -1);
label zoneID = mesh.faceZones().whichZone(faceI);
label patchID = mesh.boundaryMesh().whichPatch(facei);
label nei = (patchID == -1 ? mesh.faceNeighbour()[facei] : -1);
label zoneID = mesh.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = mesh.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -2287,8 +2287,8 @@ void Foam::polyMeshAdder::mergePoints
polyModifyFace
(
newF, // modified face
faceI, // label of face
mesh.faceOwner()[faceI], // owner
facei, // label of face
mesh.faceOwner()[facei], // owner
nei, // neighbour
false, // face flip
patchID, // patch for face

View File

@ -630,9 +630,9 @@ void Foam::polyMeshFilter::checkMeshFacesAndRelaxEdges
{
const faceList& faces = mesh_.faces();
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
forAll(f, fpI)
{
@ -640,12 +640,12 @@ void Foam::polyMeshFilter::checkMeshFacesAndRelaxEdges
if (pointErrorCount[f[fpI]] >= maxPointErrorCount())
{
faceFilterFactor_[faceI] = -1;
faceFilterFactor_[facei] = -1;
}
if (isErrorPoint[ptIndex])
{
faceFilterFactor_[faceI] *= faceReductionFactor();
faceFilterFactor_[facei] *= faceReductionFactor();
break;
}
@ -657,9 +657,9 @@ void Foam::polyMeshFilter::checkMeshFacesAndRelaxEdges
for (label smoothIter = 0; smoothIter < maxSmoothIters(); ++smoothIter)
{
// Smooth faceFilterFactor
forAll(faces, faceI)
forAll(faces, facei)
{
const labelList& fEdges = mesh_.faceEdges()[faceI];
const labelList& fEdges = mesh_.faceEdges()[facei];
scalar sumFaceFilterFactors = 0;
label nFaces = 0;
@ -689,7 +689,7 @@ void Foam::polyMeshFilter::checkMeshFacesAndRelaxEdges
}
}
if (eFace != faceI)
if (eFace != facei)
{
sumFaceFilterFactors += faceFilterFactor_[eFace];
nFaces++;
@ -702,9 +702,9 @@ void Foam::polyMeshFilter::checkMeshFacesAndRelaxEdges
continue;
}
faceFilterFactor_[faceI] = min
faceFilterFactor_[facei] = min
(
faceFilterFactor_[faceI],
faceFilterFactor_[facei],
sumFaceFilterFactors/nFaces
);
}

View File

@ -81,16 +81,16 @@ void Foam::attachPolyTopoChanger::attach(const bool removeEmptyPatches)
List<polyPatch*> newPatches(oldPatches.size());
label nNewPatches = 0;
forAll(oldPatches, patchI)
forAll(oldPatches, patchi)
{
if (oldPatches[patchI].size())
if (oldPatches[patchi].size())
{
newPatches[nNewPatches] = oldPatches[patchI].clone
newPatches[nNewPatches] = oldPatches[patchi].clone
(
mesh_.boundaryMesh(),
nNewPatches,
oldPatches[patchI].size(),
oldPatches[patchI].start()
oldPatches[patchi].size(),
oldPatches[patchi].start()
).ptr();
nNewPatches++;
@ -99,8 +99,8 @@ void Foam::attachPolyTopoChanger::attach(const bool removeEmptyPatches)
{
if (debug)
{
Pout<< "Removing zero-sized patch " << patchI
<< " named " << oldPatches[patchI].name() << endl;
Pout<< "Removing zero-sized patch " << patchi
<< " named " << oldPatches[patchi].name() << endl;
}
}
}

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
@ -49,14 +49,14 @@ Foam::label Foam::addPatchCellLayer::nbrFace
(
const labelListList& edgeFaces,
const label edgeI,
const label faceI
const label facei
)
{
const labelList& eFaces = edgeFaces[edgeI];
if (eFaces.size() == 2)
{
return (eFaces[0] != faceI ? eFaces[0] : eFaces[1]);
return (eFaces[0] != facei ? eFaces[0] : eFaces[1]);
}
else
{
@ -278,22 +278,22 @@ Foam::label Foam::addPatchCellLayer::addSideFace
forAll(meshFaces, k)
{
label faceI = meshFaces[k];
label facei = meshFaces[k];
if
(
(faceI != meshFaceI)
&& (patches.whichPatch(faceI) == newPatchID)
(facei != meshFaceI)
&& (patches.whichPatch(facei) == newPatchID)
)
{
// Found the patch face. Use it to inflate from
inflateEdgeI = -1;
inflateFaceI = faceI;
inflateFaceI = facei;
zoneI = mesh_.faceZones().whichZone(faceI);
zoneI = mesh_.faceZones().whichZone(facei);
if (zoneI != -1)
{
label index = mesh_.faceZones()[zoneI].whichFace(faceI);
label index = mesh_.faceZones()[zoneI].whichFace(facei);
flip = mesh_.faceZones()[zoneI].flipMap()[index];
}
break;
@ -432,15 +432,15 @@ Foam::label Foam::addPatchCellLayer::findProcPatch
forAll(mesh.globalData().processorPatches(), i)
{
label patchI = mesh.globalData().processorPatches()[i];
label patchi = mesh.globalData().processorPatches()[i];
if
(
refCast<const processorPolyPatch>(patches[patchI]).neighbProcNo()
refCast<const processorPolyPatch>(patches[patchi]).neighbProcNo()
== nbrProcID
)
{
return patchI;
return patchi;
}
}
return -1;
@ -450,18 +450,18 @@ Foam::label Foam::addPatchCellLayer::findProcPatch
void Foam::addPatchCellLayer::setFaceProps
(
const polyMesh& mesh,
const label faceI,
const label facei,
label& patchI,
label& patchi,
label& zoneI,
bool& zoneFlip
)
{
patchI = mesh.boundaryMesh().whichPatch(faceI);
zoneI = mesh.faceZones().whichZone(faceI);
patchi = mesh.boundaryMesh().whichPatch(facei);
zoneI = mesh.faceZones().whichZone(facei);
if (zoneI != -1)
{
label index = mesh.faceZones()[zoneI].whichFace(faceI);
label index = mesh.faceZones()[zoneI].whichFace(facei);
zoneFlip = mesh.faceZones()[zoneI].flipMap()[index];
}
}
@ -673,20 +673,20 @@ void Foam::addPatchCellLayer::calcSidePatch
forAll(meshFaces, k)
{
label faceI = meshFaces[k];
label facei = meshFaces[k];
if (faceI != myFaceI && !mesh.isInternalFace(faceI))
if (facei != myFaceI && !mesh.isInternalFace(facei))
{
setFaceProps
(
mesh,
faceI,
facei,
sidePatchID[edgeI],
sideZoneID[edgeI],
sideFlip[edgeI]
);
inflateFaceI[edgeI] = faceI;
inflateFaceI[edgeI] = facei;
inflateEdgeI[edgeI] = -1;
break;
@ -741,28 +741,28 @@ void Foam::addPatchCellLayer::calcSidePatch
forAll(meshFaces, k)
{
label faceI = meshFaces[k];
label facei = meshFaces[k];
if (faceI != myFaceI)
if (facei != myFaceI)
{
if (mesh.isInternalFace(faceI))
if (mesh.isInternalFace(facei))
{
inflateEdgeI[edgeI] = meshEdgeI;
}
else
{
if (patches.whichPatch(faceI) == sidePatchID[edgeI])
if (patches.whichPatch(facei) == sidePatchID[edgeI])
{
setFaceProps
(
mesh,
faceI,
facei,
sidePatchID[edgeI],
sideZoneID[edgeI],
sideFlip[edgeI]
);
inflateFaceI[edgeI] = faceI;
inflateFaceI[edgeI] = facei;
inflateEdgeI[edgeI] = -1;
break;
@ -1003,15 +1003,15 @@ void Foam::addPatchCellLayer::setRefinement
forAll(meshFaces, i)
{
label faceI = meshFaces[i];
label facei = meshFaces[i];
if (faceI != myFaceI)
if (facei != myFaceI)
{
if (!mesh_.isInternalFace(faceI))
if (!mesh_.isInternalFace(facei))
{
if (bFaceI == -1)
{
bFaceI = faceI;
bFaceI = facei;
}
else
{
@ -1024,9 +1024,9 @@ void Foam::addPatchCellLayer::setRefinement
<< bFaceI << " fc:"
<< mesh_.faceCentres()[bFaceI]
<< " patch:" << patches.whichPatch(bFaceI)
<< " and " << faceI << " fc:"
<< mesh_.faceCentres()[faceI]
<< " patch:" << patches.whichPatch(faceI)
<< " and " << facei << " fc:"
<< mesh_.faceCentres()[facei]
<< " patch:" << patches.whichPatch(facei)
<< abort(FatalError);
}
}
@ -1230,7 +1230,7 @@ void Foam::addPatchCellLayer::setRefinement
// Get new neighbour
label nei;
label patchI;
label patchi;
label zoneI = -1;
bool flip = false;
@ -1239,7 +1239,7 @@ void Foam::addPatchCellLayer::setRefinement
{
// Top layer so is patch face.
nei = -1;
patchI = patchID[patchFaceI];
patchi = patchID[patchFaceI];
zoneI = mesh_.faceZones().whichZone(meshFaceI);
if (zoneI != -1)
{
@ -1251,7 +1251,7 @@ void Foam::addPatchCellLayer::setRefinement
{
// Internal face between layer i and i+1
nei = addedCells[patchFaceI][i+1];
patchI = -1;
patchi = -1;
}
@ -1266,7 +1266,7 @@ void Foam::addPatchCellLayer::setRefinement
-1, // master edge
(addToMesh_ ? meshFaceI : -1), // master face
false, // flux flip
patchI, // patch for face
patchi, // patch for face
zoneI, // zone for face
flip // face zone flip
)

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
@ -186,7 +186,7 @@ class addPatchCellLayer
(
const labelListList& edgeFaces,
const label edgeI,
const label faceI
const label facei
);
//- Add vertex to face if unique.

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
@ -128,7 +128,7 @@ bool Foam::combineFaces::validFace
void Foam::combineFaces::regioniseFaces
(
const scalar minCos,
const label cellI,
const label celli,
const labelList& cEdges,
Map<label>& faceRegion
) const
@ -140,7 +140,7 @@ void Foam::combineFaces::regioniseFaces
label edgeI = cEdges[i];
label f0, f1;
meshTools::getEdgeFaces(mesh_, cellI, edgeI, f0, f1);
meshTools::getEdgeFaces(mesh_, celli, edgeI, f0, f1);
label p0 = patches.whichPatch(f0);
label p1 = patches.whichPatch(f1);
@ -215,7 +215,7 @@ void Foam::combineFaces::regioniseFaces
bool Foam::combineFaces::faceNeighboursValid
(
const label cellI,
const label celli,
const Map<label>& faceRegion
) const
{
@ -224,20 +224,20 @@ bool Foam::combineFaces::faceNeighboursValid
return true;
}
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
DynamicList<label> storage;
// Test for face collapsing to edge since too many neighbours merged.
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
label facei = cFaces[cFaceI];
if (!faceRegion.found(faceI))
if (!faceRegion.found(facei))
{
const labelList& fEdges = mesh_.faceEdges(faceI, storage);
const labelList& fEdges = mesh_.faceEdges(facei, storage);
// Count number of remaining faces neighbouring faceI. This has
// Count number of remaining faces neighbouring facei. This has
// to be 3 or more.
// Unregioned neighbouring faces
@ -248,7 +248,7 @@ bool Foam::combineFaces::faceNeighboursValid
forAll(fEdges, i)
{
label edgeI = fEdges[i];
label nbrI = meshTools::otherFace(mesh_, cellI, faceI, edgeI);
label nbrI = meshTools::otherFace(mesh_, celli, facei, edgeI);
Map<label>::const_iterator iter = faceRegion.find(nbrI);
@ -310,15 +310,15 @@ Foam::labelListList Foam::combineFaces::getMergeSets
// On all cells regionise the faces
forAllConstIter(labelHashSet, boundaryCells, iter)
{
label cellI = iter.key();
label celli = iter.key();
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
const labelList& cEdges = mesh_.cellEdges(cellI, storage);
const labelList& cEdges = mesh_.cellEdges(celli, storage);
// Region per face
Map<label> faceRegion(cFaces.size());
regioniseFaces(featureCos, cellI, cEdges, faceRegion);
regioniseFaces(featureCos, celli, cEdges, faceRegion);
// Now we have in faceRegion for every face the region with planar
// face sharing the same region. We now check whether the resulting
@ -326,14 +326,14 @@ Foam::labelListList Foam::combineFaces::getMergeSets
// - to become a set of edges since too many faces are merged.
// - to become convex
if (faceNeighboursValid(cellI, faceRegion))
if (faceNeighboursValid(celli, faceRegion))
{
// Create region-to-faces addressing
Map<labelList> regionToFaces(faceRegion.size());
forAllConstIter(Map<label>, faceRegion, iter)
{
label faceI = iter.key();
label facei = iter.key();
label region = iter();
Map<labelList>::iterator regionFnd = regionToFaces.find(region);
@ -343,11 +343,11 @@ Foam::labelListList Foam::combineFaces::getMergeSets
labelList& setFaces = regionFnd();
label sz = setFaces.size();
setFaces.setSize(sz+1);
setFaces[sz] = faceI;
setFaces[sz] = facei;
}
else
{
regionToFaces.insert(region, labelList(1, faceI));
regionToFaces.insert(region, labelList(1, facei));
}
}
@ -390,9 +390,9 @@ Foam::labelListList Foam::combineFaces::getMergeSets
// Pick up all cells on boundary
labelHashSet boundaryCells(mesh_.nFaces()-mesh_.nInternalFaces());
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& patch = patches[patchI];
const polyPatch& patch = patches[patchi];
if (!patch.coupled())
{
@ -582,9 +582,9 @@ void Foam::combineFaces::setRefinement
{
forAll(setFaces, i)
{
label patchI = patches.whichPatch(setFaces[i]);
label patchi = patches.whichPatch(setFaces[i]);
if (patchI == -1 || patches[patchI].coupled())
if (patchi == -1 || patches[patchi].coupled())
{
FatalErrorInFunction
<< "Can only merge non-coupled boundary faces"
@ -639,7 +639,7 @@ void Foam::combineFaces::setRefinement
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)];
}
label patchI = mesh_.boundaryMesh().whichPatch(masterFaceI);
label patchi = mesh_.boundaryMesh().whichPatch(masterFaceI);
meshMod.setAction
(
@ -650,7 +650,7 @@ void Foam::combineFaces::setRefinement
mesh_.faceOwner()[masterFaceI], // owner
-1, // neighbour
false, // face flip
patchI, // patch for face
patchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
@ -922,13 +922,13 @@ void Foam::combineFaces::setUnrefinement
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)];
}
label patchI = mesh_.boundaryMesh().whichPatch(masterFaceI);
label patchi = mesh_.boundaryMesh().whichPatch(masterFaceI);
if (mesh_.boundaryMesh()[patchI].coupled())
if (mesh_.boundaryMesh()[patchi].coupled())
{
FatalErrorInFunction
<< "Master face " << masterFaceI << " is on coupled patch "
<< mesh_.boundaryMesh()[patchI].name()
<< mesh_.boundaryMesh()[patchi].name()
<< abort(FatalError);
}
@ -945,7 +945,7 @@ void Foam::combineFaces::setUnrefinement
own, // owner
-1, // neighbour
false, // face flip
patchI, // patch for face
patchi, // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
@ -959,7 +959,7 @@ void Foam::combineFaces::setUnrefinement
//Pout<< "Restoring removed face with vertices " << faces[i]
// << endl;
label faceI = meshMod.setAction
label facei = meshMod.setAction
(
polyAddFace
(
@ -970,12 +970,12 @@ void Foam::combineFaces::setUnrefinement
-1, // masterEdgeID,
masterFaceI, // masterFaceID,
false, // flipFaceFlux,
patchI, // patchID,
patchi, // patchID,
zoneID, // zoneID,
zoneFlip // zoneFlip
)
);
restoredFaces.insert(faceI, masterFaceI);
restoredFaces.insert(facei, masterFaceI);
}
// Clear out restored set

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
@ -101,7 +101,7 @@ class combineFaces
void regioniseFaces
(
const scalar minCos,
const label cellI,
const label celli,
const labelList& cEdges,
Map<label>& faceRegion
) const;
@ -109,7 +109,7 @@ class combineFaces
//- Does merging faces invalidate (unmerged) neighbouring faces?
bool faceNeighboursValid
(
const label cellI,
const label celli,
const Map<label>& faceRegion
) const;

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
@ -111,12 +111,12 @@ void Foam::duplicatePoints::setRefinement
forAllConstIter(Map<label>, meshFaceMap, iter)
{
label faceI = iter.key();
label facei = iter.key();
label localI = iter();
// Replace points with duplicated ones.
const face& fRegion = faceRegions[localI];
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
newFace.setSize(f.size());
forAll(f, fp)
@ -146,23 +146,23 @@ void Foam::duplicatePoints::setRefinement
}
// Get current zone info
label zoneID = mesh_.faceZones().whichZone(faceI);
label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
meshMod.modifyFace
(
newFace, // modified face
faceI, // label of face being modified
mesh_.faceOwner()[faceI], // owner
mesh_.faceNeighbour()[faceI], // neighbour
facei, // label of face being modified
mesh_.faceOwner()[facei], // owner
mesh_.faceNeighbour()[facei], // neighbour
false, // face flip
-1, // patch for face
zoneID, // zone for face
@ -174,11 +174,11 @@ void Foam::duplicatePoints::setRefinement
meshMod.modifyFace
(
newFace, // modified face
faceI, // label of face being modified
mesh_.faceOwner()[faceI], // owner
facei, // label of face being modified
mesh_.faceOwner()[facei], // owner
-1, // neighbour
false, // face flip
patches.whichPatch(faceI), // patch for face
patches.whichPatch(facei), // patch for face
zoneID, // zone for face
zoneFlip // face flip in zone
);

View File

@ -119,13 +119,13 @@ Foam::label Foam::edgeCollapser::checkMeshQuality
Foam::labelList Foam::edgeCollapser::edgesFromPoints
(
const label& faceI,
const label& facei,
const labelList& pointLabels
) const
{
labelList edgeLabels(pointLabels.size() - 1, -1);
const labelList& faceEdges = mesh_.faceEdges()[faceI];
const labelList& faceEdges = mesh_.faceEdges()[facei];
const edgeList& edges = mesh_.edges();
label count = 0;
@ -168,7 +168,7 @@ Foam::labelList Foam::edgeCollapser::edgesFromPoints
void Foam::edgeCollapser::collapseToEdge
(
const label faceI,
const label facei,
const pointField& pts,
const labelList& pointPriority,
const vector& collapseAxis,
@ -223,7 +223,7 @@ void Foam::edgeCollapser::collapseToEdge
maxPriority = labelMin;
maxPriorityPts.clear();
labelList faceEdgesNeg = edgesFromPoints(faceI, facePtsNeg);
labelList faceEdgesNeg = edgesFromPoints(facei, facePtsNeg);
forAll(faceEdgesNeg, edgeI)
{
@ -270,7 +270,7 @@ void Foam::edgeCollapser::collapseToEdge
// collapseToPtB = pts[maxPriorityPts.first()];
}
labelList faceEdgesPos = edgesFromPoints(faceI, facePtsPos);
labelList faceEdgesPos = edgesFromPoints(facei, facePtsPos);
forAll(faceEdgesPos, edgeI)
{
@ -286,7 +286,7 @@ void Foam::edgeCollapser::collapseToEdge
void Foam::edgeCollapser::collapseToPoint
(
const label& faceI,
const label& facei,
const pointField& pts,
const labelList& pointPriority,
const point& fC,
@ -295,7 +295,7 @@ void Foam::edgeCollapser::collapseToPoint
Map<point>& collapsePointToLocation
) const
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
Foam::point collapseToPt = fC;
@ -371,7 +371,7 @@ void Foam::edgeCollapser::collapseToPoint
// }
// }
const labelList& faceEdges = mesh_.faceEdges()[faceI];
const labelList& faceEdges = mesh_.faceEdges()[facei];
forAll(faceEdges, eI)
{
@ -498,9 +498,9 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
scalarField neiCellVolumes(nBoundaryFaces, -1);
// Now do boundary faces
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& patch = patches[patchI];
const polyPatch& patch = patches[patchi];
label bFaceI = patch.start() - mesh_.nInternalFaces();
@ -531,9 +531,9 @@ Foam::scalarField Foam::edgeCollapser::calcTargetFaceSizes() const
syncTools::swapBoundaryFaceList(mesh_, neiCellVolumes);
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& patch = patches[patchI];
const polyPatch& patch = patches[patchi];
label bFaceI = patch.start() - mesh_.nInternalFaces();
@ -563,14 +563,14 @@ Foam::edgeCollapser::collapseType Foam::edgeCollapser::collapseFace
(
const labelList& pointPriority,
const face& f,
const label faceI,
const label facei,
const scalar targetFaceSize,
PackedBoolList& collapseEdge,
Map<point>& collapsePointToLocation,
const scalarField& faceFilterFactor
) const
{
const scalar collapseSizeLimitCoeff = faceFilterFactor[faceI];
const scalar collapseSizeLimitCoeff = faceFilterFactor[facei];
const pointField& pts = mesh_.points();
@ -714,7 +714,7 @@ Foam::edgeCollapser::collapseType Foam::edgeCollapser::collapseFace
{
collapseToPoint
(
faceI,
facei,
pts,
pointPriority,
fC,
@ -727,7 +727,7 @@ Foam::edgeCollapser::collapseType Foam::edgeCollapser::collapseFace
{
collapseToEdge
(
faceI,
facei,
pts,
pointPriority,
collapseAxis,
@ -1426,33 +1426,33 @@ bool Foam::edgeCollapser::setRefinement
do
{
forAll(newFaces, faceI)
forAll(newFaces, facei)
{
filterFace(collapseStrings, allPointInfo, newFaces[faceI]);
filterFace(collapseStrings, allPointInfo, newFaces[facei]);
}
// Check if faces to be collapsed cause cells to become collapsed.
label nCellCollapsed = 0;
forAll(cells, cellI)
forAll(cells, celli)
{
if (!cellRemoved[cellI])
if (!cellRemoved[celli])
{
const cell& cFaces = cells[cellI];
const cell& cFaces = cells[celli];
label nFaces = cFaces.size();
forAll(cFaces, i)
{
label faceI = cFaces[i];
label facei = cFaces[i];
if (newFaces[faceI].size() < 3)
if (newFaces[facei].size() < 3)
{
--nFaces;
if (nFaces < 4)
{
Pout<< "Cell:" << cellI
Pout<< "Cell:" << celli
<< " uses faces:" << cFaces
<< " of which too many are marked for removal:"
<< endl
@ -1468,10 +1468,10 @@ bool Foam::edgeCollapser::setRefinement
}
Pout<< endl;
cellRemoved[cellI] = true;
cellRemoved[celli] = true;
// Collapse all edges of cell to nothing
// collapseEdges(cellEdges[cellI]);
// collapseEdges(cellEdges[celli]);
nCellCollapsed++;
@ -1500,26 +1500,26 @@ bool Foam::edgeCollapser::setRefinement
// Mark points used.
boolList usedPoint(mesh_.nPoints(), false);
forAll(cellRemoved, cellI)
forAll(cellRemoved, celli)
{
if (cellRemoved[cellI])
if (cellRemoved[celli])
{
meshMod.removeCell(cellI, -1);
meshMod.removeCell(celli, -1);
}
}
// Remove faces
forAll(newFaces, faceI)
forAll(newFaces, facei)
{
const face& f = newFaces[faceI];
const face& f = newFaces[facei];
if (f.size() < 3)
{
meshMod.removeFace(faceI, -1);
meshMod.removeFace(facei, -1);
meshChanged = true;
// Mark face as been done.
doneFace[faceI] = true;
doneFace[facei] = true;
}
else
{
@ -1579,14 +1579,14 @@ bool Foam::edgeCollapser::setRefinement
forAll(changedFaces, changedFaceI)
{
label faceI = changedFaces[changedFaceI];
label facei = changedFaces[changedFaceI];
if (!doneFace[faceI])
if (!doneFace[facei])
{
doneFace[faceI] = true;
doneFace[facei] = true;
// Get current zone info
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
@ -1594,27 +1594,27 @@ bool Foam::edgeCollapser::setRefinement
{
const faceZone& fZone = faceZones[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
// Get current connectivity
label own = faceOwner[faceI];
label own = faceOwner[facei];
label nei = -1;
label patchID = -1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
nei = faceNeighbour[faceI];
nei = faceNeighbour[facei];
}
else
{
patchID = boundaryMesh.whichPatch(faceI);
patchID = boundaryMesh.whichPatch(facei);
}
meshMod.modifyFace
(
newFaces[faceI], // face
faceI, // faceI to change
newFaces[facei], // face
facei, // facei to change
own, // owner
nei, // neighbour
false, // flipFaceFlux
@ -1683,13 +1683,13 @@ void Foam::edgeCollapser::consistentCollapse
PackedBoolList isCollapsedFace(mesh_.nFaces());
PackedBoolList markedPoints(mesh_.nPoints());
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
isCollapsedFace[faceI] = isFaceCollapsed(f, allPointInfo);
isCollapsedFace[facei] = isFaceCollapsed(f, allPointInfo);
if (isCollapsedFace[faceI] < 1)
if (isCollapsedFace[facei] < 1)
{
determineDuplicatePointsOnFace
(
@ -1741,17 +1741,17 @@ void Foam::edgeCollapser::consistentCollapse
if (!allowCellCollapse)
{
// Check collapsed cells
forAll(cells, cellI)
forAll(cells, celli)
{
const cell& cFaces = cells[cellI];
const cell& cFaces = cells[celli];
label nFaces = cFaces.size();
forAll(cFaces, fI)
{
label faceI = cFaces[fI];
label facei = cFaces[fI];
if (isCollapsedFace[faceI])
if (isCollapsedFace[facei])
{
nFaces--;
}
@ -1761,9 +1761,9 @@ void Foam::edgeCollapser::consistentCollapse
{
forAll(cFaces, fI)
{
label faceI = cFaces[fI];
label facei = cFaces[fI];
const labelList& fEdges = faceEdges[faceI];
const labelList& fEdges = faceEdges[facei];
// Unmark this face for collapse
forAll(fEdges, fEdgeI)
@ -1780,7 +1780,7 @@ void Foam::edgeCollapser::consistentCollapse
}
// Uncollapsed this face.
isCollapsedFace[faceI] = false;
isCollapsedFace[facei] = false;
nFaces++;
}
}
@ -1788,7 +1788,7 @@ void Foam::edgeCollapser::consistentCollapse
if (nFaces < 4)
{
FatalErrorInFunction
<< "Cell " << cellI << " " << cFaces << nl
<< "Cell " << celli << " " << cFaces << nl
<< "is " << nFaces << ", "
<< "but cell collapse has been disabled."
<< abort(FatalError);

View File

@ -101,11 +101,11 @@ private:
// Private Member Functions
//- Create an edgeList of edges in faceI which have both their points
//- Create an edgeList of edges in facei which have both their points
// in pointLabels
labelList edgesFromPoints
(
const label& faceI,
const label& facei,
const labelList& pointLabels
) const;
@ -113,7 +113,7 @@ private:
// locations for points that will move as a result of the collapse
void collapseToEdge
(
const label faceI,
const label facei,
const pointField& pts,
const labelList& pointPriority,
const vector& collapseAxis,
@ -131,7 +131,7 @@ private:
// locations for points that will move as a result of the collapse
void collapseToPoint
(
const label& faceI,
const label& facei,
const pointField& pts,
const labelList& pointPriority,
const point& fC,
@ -159,7 +159,7 @@ private:
(
const labelList& pointPriority,
const face& f,
const label faceI,
const label facei,
const scalar targetFaceSize,
PackedBoolList& collapseEdge,
Map<point>& collapsePointToLocation,

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
@ -93,12 +93,12 @@ Foam::label Foam::faceCollapser::findEdge
void Foam::faceCollapser::filterFace
(
const Map<labelList>& splitEdges,
const label faceI,
const label facei,
polyTopoChange& meshMod
) const
{
const face& f = mesh_.faces()[faceI];
const labelList& fEdges = mesh_.faceEdges()[faceI];
const face& f = mesh_.faces()[facei];
const labelList& fEdges = mesh_.faceEdges()[facei];
// Space for replaced vertices and split edges.
DynamicList<label> newFace(10 * f.size());
@ -146,7 +146,7 @@ void Foam::faceCollapser::filterFace
}
face newF(newFace.shrink());
//Pout<< "Modifying face:" << faceI << " from " << f << " to " << newFace
//Pout<< "Modifying face:" << facei << " from " << f << " to " << newFace
// << endl;
if (newF != f)
@ -155,17 +155,17 @@ void Foam::faceCollapser::filterFace
label patchI = -1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
nei = mesh_.faceNeighbour()[faceI];
nei = mesh_.faceNeighbour()[facei];
}
else
{
patchI = mesh_.boundaryMesh().whichPatch(faceI);
patchI = mesh_.boundaryMesh().whichPatch(facei);
}
// Get current zone info
label zoneID = mesh_.faceZones().whichZone(faceI);
label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
@ -173,7 +173,7 @@ void Foam::faceCollapser::filterFace
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -181,8 +181,8 @@ void Foam::faceCollapser::filterFace
polyModifyFace
(
newF, // modified face
faceI, // label of face being modified
mesh_.faceOwner()[faceI], // owner
facei, // label of face being modified
mesh_.faceOwner()[facei], // owner
nei, // neighbour
false, // face flip
patchI, // patch for face
@ -235,9 +235,9 @@ void Foam::faceCollapser::setRefinement
forAll(faceLabels, i)
{
const label faceI = faceLabels[i];
const label facei = faceLabels[i];
const face& f = faces[faceI];
const face& f = faces[facei];
const label fpA = fpStart[i];
const label fpB = fpEnd[i];
@ -375,7 +375,7 @@ void Foam::faceCollapser::setRefinement
meshTools::writeOBJ(str, faceList(1, f), points);
FatalErrorInFunction
<< "Trying to collapse face:" << faceI << " vertices:" << f
<< "Trying to collapse face:" << facei << " vertices:" << f
<< " to edges between vertices " << f[fpA] << " and "
<< f[fpB] << " but " << f[fpB] << " does not seem to be the"
<< " vertex furthest away from " << f[fpA] << endl
@ -397,7 +397,7 @@ void Foam::faceCollapser::setRefinement
sortedFp[fp] = i;
}
const labelList& fEdges = mesh_.faceEdges()[faceI];
const labelList& fEdges = mesh_.faceEdges()[facei];
// Now look up all edges in the face and see if they get extra
// vertices inserted and build an edge-to-intersected-points table.
@ -457,7 +457,7 @@ void Foam::faceCollapser::setRefinement
}
// Mark all faces affected
insert(edgeFaces[edgeI], faceI, affectedFaces);
insert(edgeFaces[edgeI], facei, affectedFaces);
}
}
}
@ -482,12 +482,12 @@ void Foam::faceCollapser::setRefinement
forAll(faceLabels, i)
{
const label faceI = faceLabels[i];
const label facei = faceLabels[i];
meshMod.setAction(polyRemoveFace(faceI));
meshMod.setAction(polyRemoveFace(facei));
// Update list of faces we still have to modify
affectedFaces.erase(faceI);
affectedFaces.erase(facei);
}

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
@ -107,7 +107,7 @@ class faceCollapser
void filterFace
(
const Map<labelList>& splitEdges,
const label faceI,
const label facei,
polyTopoChange& meshMod
) const;

File diff suppressed because it is too large Load Diff

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
@ -108,17 +108,17 @@ class hexRef8
//- Get patch and zone info
void getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip
) const;
//- Adds a face on top of existing faceI. Reverses if necessary.
//- Adds a face on top of existing facei. Reverses if necessary.
label addFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label own,
const label nei
@ -135,12 +135,12 @@ class hexRef8
const label nei
) const;
//- Modifies existing faceI for either new owner/neighbour or new face
//- Modifies existing facei for either new owner/neighbour or new face
// points. Reverses if necessary.
void modFace
(
polyTopoChange& meshMod,
const label faceI,
const label facei,
const face& newFace,
const label own,
const label nei
@ -148,23 +148,23 @@ class hexRef8
scalar getLevel0EdgeLength() const;
//- Get cell added to point of cellI (if any)
//- Get cell added to point of celli (if any)
label getAnchorCell
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label cellI,
const label faceI,
const label celli,
const label facei,
const label pointI
) const;
//- Get new owner and neighbour (in unspecified order) of pointI
// on faceI.
// on facei.
void getFaceNeighbours
(
const labelListList& cellAnchorPoints,
const labelListList& cellAddedCells,
const label faceI,
const label facei,
const label pointI,
label& own,
@ -179,11 +179,11 @@ class hexRef8
//- Count number of vertices <= anchorLevel
label countAnchors(const labelList&, const label) const;
//- Debugging: dump cell as .obj file
void dumpCell(const label cellI) const;
void dumpCell(const label celli) const;
//- Find index of point with wantedLevel, starting from fp.
label findLevel
(
const label faceI,
const label facei,
const face& f,
const label startFp,
const bool searchForward,
@ -197,8 +197,8 @@ class hexRef8
static void checkInternalOrientation
(
polyTopoChange& meshMod,
const label cellI,
const label faceI,
const label celli,
const label facei,
const point& ownPt,
const point& neiPt,
const face& newFace
@ -208,8 +208,8 @@ class hexRef8
static void checkBoundaryOrientation
(
polyTopoChange& meshMod,
const label cellI,
const label faceI,
const label celli,
const label facei,
const point& ownPt,
const point& boundaryPt,
const face& newFace
@ -232,8 +232,8 @@ class hexRef8
const labelListList& cellAddedCells,
const labelList& cellMidPoint,
const labelList& edgeMidPoint,
const label cellI,
const label faceI,
const label celli,
const label facei,
const bool faceOrder,
const label midPointI,
const label anchorPointI,
@ -252,8 +252,8 @@ class hexRef8
const labelList& cellMidPoint,
const labelList& faceMidPoint,
const labelList& edgeMidPoint,
const label cellI,
const label faceI,
const label celli,
const label facei,
Map<edge>& midPointToAnchors,
Map<edge>& midPointToFaceMids,
@ -261,7 +261,7 @@ class hexRef8
label& nFacesAdded
) const;
//- Create all internal faces to split cellI into 8.
//- Create all internal faces to split celli into 8.
void createInternalFaces
(
const labelListList& cellAnchorPoints,
@ -270,7 +270,7 @@ class hexRef8
const labelList& faceMidPoint,
const labelList& faceAnchorLevel,
const labelList& edgeMidPoint,
const label cellI,
const label celli,
polyTopoChange& meshMod
) const;
@ -280,7 +280,7 @@ class hexRef8
(
const labelList& edgeMidPoint,
const label cLevel,
const label faceI,
const label facei,
const label startFp,
DynamicList<label>& faceVerts
) const;
@ -290,7 +290,7 @@ class hexRef8
(
const labelList& edgeMidPoint,
const label cLevel,
const label faceI,
const label facei,
const label startFp,
DynamicList<label>& faceVerts
) const;
@ -330,7 +330,7 @@ class hexRef8
// hex was matched (6 faces of each four corner points)
bool matchHexShape
(
const label cellI,
const label celli,
const label cellLevel,
DynamicList<face>& quads
) const;
@ -411,7 +411,7 @@ public:
// Refinement
//- Gets level such that the face has four points <= level.
label getAnchorLevel(const label faceI) const;
label getAnchorLevel(const label facei) const;
//- Given valid mesh and current cell level and proposed
// cells to refine calculate any clashes (due to 2:1) and return

View File

@ -249,7 +249,7 @@ class polyTopoChange
void checkFace
(
const face&,
const label faceI,
const label facei,
const label own,
const label nei,
const label patchI,
@ -448,10 +448,10 @@ public:
inline bool pointRemoved(const label pointI) const;
//- Is face removed?
inline bool faceRemoved(const label faceI) const;
inline bool faceRemoved(const label facei) const;
//- Is cell removed?
inline bool cellRemoved(const label cellI) const;
inline bool cellRemoved(const label celli) const;
// Edit
@ -531,7 +531,7 @@ public:
void modifyFace
(
const face& f,
const label faceI,
const label facei,
const label own,
const label nei,
const bool flipFaceFlux,

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
@ -38,15 +38,15 @@ inline bool Foam::polyTopoChange::pointRemoved(const label pointI) const
}
inline bool Foam::polyTopoChange::faceRemoved(const label faceI) const
inline bool Foam::polyTopoChange::faceRemoved(const label facei) const
{
return faces_[faceI].empty();
return faces_[facei].empty();
}
inline bool Foam::polyTopoChange::cellRemoved(const label cellI) const
inline bool Foam::polyTopoChange::cellRemoved(const label celli) const
{
return cellMap_[cellI] == -2;
return cellMap_[celli] == -2;
}

View File

@ -81,13 +81,13 @@ void Foam::refinementHistory::writeDebug
string oldPrefix = Pout.prefix();
Pout.prefix() = "";
forAll(visibleCells, cellI)
forAll(visibleCells, celli)
{
label index = visibleCells[cellI];
label index = visibleCells[celli];
if (index >= 0)
{
Pout<< "Cell from refinement:" << cellI << " index:" << index
Pout<< "Cell from refinement:" << celli << " index:" << index
<< endl;
string oldPrefix = Pout.prefix();
@ -97,7 +97,7 @@ void Foam::refinementHistory::writeDebug
}
else
{
Pout<< "Unrefined cell:" << cellI << " index:" << index << endl;
Pout<< "Unrefined cell:" << celli << " index:" << index << endl;
}
}
Pout.prefix() = oldPrefix;
@ -436,9 +436,9 @@ Foam::refinementHistory::refinementHistory
visibleCells_.setSize(nCells);
splitCells_.setCapacity(nCells);
for (label cellI = 0; cellI < nCells; cellI++)
for (label celli = 0; celli < nCells; celli++)
{
visibleCells_[cellI] = cellI;
visibleCells_[celli] = celli;
splitCells_.append(splitCell8());
}
}
@ -531,11 +531,11 @@ void Foam::refinementHistory::updateMesh(const mapPolyMesh& map)
labelList newVisibleCells(map.cellMap().size(), -1);
forAll(visibleCells_, cellI)
forAll(visibleCells_, celli)
{
if (visibleCells_[cellI] != -1)
if (visibleCells_[celli] != -1)
{
label index = visibleCells_[cellI];
label index = visibleCells_[celli];
// Check not already set
if (splitCells_[index].addedCellsPtr_.valid())
@ -544,7 +544,7 @@ void Foam::refinementHistory::updateMesh(const mapPolyMesh& map)
<< "Problem" << abort(FatalError);
}
label newCellI = reverseCellMap[cellI];
label newCellI = reverseCellMap[celli];
if (newCellI >= 0)
{
@ -578,9 +578,9 @@ void Foam::refinementHistory::subset
{
labelList newVisibleCells(cellMap.size(), -1);
forAll(newVisibleCells, cellI)
forAll(newVisibleCells, celli)
{
label oldCellI = cellMap[cellI];
label oldCellI = cellMap[celli];
label index = visibleCells_[oldCellI];
@ -591,7 +591,7 @@ void Foam::refinementHistory::subset
<< "Problem" << abort(FatalError);
}
newVisibleCells[cellI] = index;
newVisibleCells[celli] = index;
}
if (debug)
@ -706,16 +706,16 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
// Per splitCell entry the number of live cells that move to that processor
labelList splitCellNum(splitCells_.size(), 0);
forAll(visibleCells_, cellI)
forAll(visibleCells_, celli)
{
label index = visibleCells_[cellI];
label index = visibleCells_[celli];
if (index >= 0)
{
countProc
(
splitCells_[index].parent_,
destination[cellI],
destination[celli],
splitCellProc,
splitCellNum
);
@ -765,15 +765,15 @@ void Foam::refinementHistory::distribute(const mapDistributePolyMesh& map)
}
// Add live cells that are subsetted.
forAll(visibleCells_, cellI)
forAll(visibleCells_, celli)
{
label index = visibleCells_[cellI];
label index = visibleCells_[celli];
if (index >= 0 && destination[cellI] == procI)
if (index >= 0 && destination[celli] == procI)
{
label parent = splitCells_[index].parent_;
//Pout<< "Adding refined cell " << cellI
//Pout<< "Adding refined cell " << celli
// << " since moves to "
// << procI << " old parent:" << parent << endl;
@ -938,16 +938,16 @@ void Foam::refinementHistory::compact()
}
// Check none of the visible cells are marked as free
forAll(visibleCells_, cellI)
forAll(visibleCells_, celli)
{
if
(
visibleCells_[cellI] >= 0
&& splitCells_[visibleCells_[cellI]].parent_ == -2
visibleCells_[celli] >= 0
&& splitCells_[visibleCells_[celli]].parent_ == -2
)
{
FatalErrorInFunction
<< "Problem : visible cell:" << cellI
<< "Problem : visible cell:" << celli
<< " is marked as being free." << abort(FatalError);
}
}
@ -962,9 +962,9 @@ void Foam::refinementHistory::compact()
// or indexed from other splitCell entries.
// Mark from visibleCells
forAll(visibleCells_, cellI)
forAll(visibleCells_, celli)
{
label index = visibleCells_[cellI];
label index = visibleCells_[celli];
if (index >= 0)
{
@ -1053,14 +1053,14 @@ void Foam::refinementHistory::compact()
// Adapt indices in visibleCells_
forAll(visibleCells_, cellI)
forAll(visibleCells_, celli)
{
label index = visibleCells_[cellI];
label index = visibleCells_[celli];
if (index >= 0)
{
// Note that oldToNew can be -1 so it resets newVisibleCells.
visibleCells_[cellI] = oldToNew[index];
visibleCells_[celli] = oldToNew[index];
}
else
{
@ -1078,22 +1078,22 @@ void Foam::refinementHistory::writeDebug() const
void Foam::refinementHistory::storeSplit
(
const label cellI,
const label celli,
const labelList& addedCells
)
{
label parentIndex = -1;
if (visibleCells_[cellI] != -1)
if (visibleCells_[celli] != -1)
{
// Was already live. The current live cell becomes the
// parent of the cells split off from it.
parentIndex = visibleCells_[cellI];
parentIndex = visibleCells_[celli];
// It is no longer live (note that actually cellI gets alive
// It is no longer live (note that actually celli gets alive
// again below since is addedCells[0])
visibleCells_[cellI] = -1;
visibleCells_[celli] = -1;
}
else
{
@ -1126,10 +1126,10 @@ void Foam::refinementHistory::combineCells
// Remove the information for the combined cells
forAll(combinedCells, i)
{
label cellI = combinedCells[i];
label celli = combinedCells[i];
freeSplitCell(visibleCells_[cellI]);
visibleCells_[cellI] = -1;
freeSplitCell(visibleCells_[celli]);
visibleCells_[celli] = -1;
}
splitCell8& parentSplit = splitCells_[parentIndex];

View File

@ -287,14 +287,14 @@ public:
}
//- Get parent of cell
label parentIndex(const label cellI) const
label parentIndex(const label celli) const
{
label index = visibleCells_[cellI];
label index = visibleCells_[celli];
if (index < 0)
{
FatalErrorInFunction
<< "Cell " << cellI << " is not visible"
<< "Cell " << celli << " is not visible"
<< abort(FatalError);
}
return splitCells_[index].parent_;
@ -303,7 +303,7 @@ public:
//- Store splitting of cell into 8
void storeSplit
(
const label cellI,
const label celli,
const labelList& addedCells
);

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
@ -90,28 +90,28 @@ Foam::labelList Foam::removeCells::getExposedFaces
// Count cells using face.
labelList nCellsUsingFace(mesh_.nFaces(), 0);
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
label own = faceOwner[faceI];
label nei = faceNeighbour[faceI];
label own = faceOwner[facei];
label nei = faceNeighbour[facei];
if (!removedCell[own])
{
nCellsUsingFace[faceI]++;
nCellsUsingFace[facei]++;
}
if (!removedCell[nei])
{
nCellsUsingFace[faceI]++;
nCellsUsingFace[facei]++;
}
}
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
{
label own = faceOwner[faceI];
label own = faceOwner[facei];
if (!removedCell[own])
{
nCellsUsingFace[faceI]++;
nCellsUsingFace[facei]++;
}
}
@ -137,36 +137,36 @@ Foam::labelList Foam::removeCells::getExposedFaces
DynamicList<label> exposedFaces(mesh_.nFaces()/10);
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
if (nCellsUsingFace[faceI] == 1)
if (nCellsUsingFace[facei] == 1)
{
exposedFaces.append(faceI);
exposedFaces.append(facei);
}
}
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.coupled())
{
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
label own = faceOwner[faceI];
label own = faceOwner[facei];
if (nCellsUsingFace[faceI] == 1 && !removedCell[own])
if (nCellsUsingFace[facei] == 1 && !removedCell[own])
{
// My owner not removed but other side is so has to become
// normal, uncoupled, boundary face
exposedFaces.append(faceI);
exposedFaces.append(facei);
}
faceI++;
facei++;
}
}
}
@ -199,28 +199,28 @@ void Foam::removeCells::setRefinement
forAll(exposedFaceLabels, i)
{
label patchI = exposedPatchIDs[i];
label patchi = exposedPatchIDs[i];
if (patchI < 0 || patchI >= patches.size())
if (patchi < 0 || patchi >= patches.size())
{
FatalErrorInFunction
<< "Invalid patch " << patchI
<< "Invalid patch " << patchi
<< " for exposed face " << exposedFaceLabels[i] << endl
<< "Valid patches 0.." << patches.size()-1
<< abort(FatalError);
}
if (patches[patchI].coupled())
if (patches[patchi].coupled())
{
FatalErrorInFunction
<< "Trying to put exposed face " << exposedFaceLabels[i]
<< " into a coupled patch : " << patches[patchI].name()
<< " into a coupled patch : " << patches[patchi].name()
<< endl
<< "This is illegal."
<< abort(FatalError);
}
newPatchID[exposedFaceLabels[i]] = patchI;
newPatchID[exposedFaceLabels[i]] = patchi;
}
@ -231,14 +231,14 @@ void Foam::removeCells::setRefinement
// cells mentioned.
forAll(cellLabels, i)
{
label cellI = cellLabels[i];
label celli = cellLabels[i];
removedCell[cellI] = true;
removedCell[celli] = true;
//Pout<< "Removing cell " << cellI
// << " cc:" << mesh_.cellCentres()[cellI] << endl;
//Pout<< "Removing cell " << celli
// << " cc:" << mesh_.cellCentres()[celli] << endl;
meshMod.setAction(polyRemoveCell(cellI));
meshMod.setAction(polyRemoveCell(celli));
}
@ -254,9 +254,9 @@ void Foam::removeCells::setRefinement
// removing a face.
labelList nFacesUsingPoint(mesh_.nPoints(), 0);
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
forAll(f, fp)
{
@ -265,29 +265,29 @@ void Foam::removeCells::setRefinement
}
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
const face& f = faces[faceI];
label own = faceOwner[faceI];
label nei = faceNeighbour[faceI];
const face& f = faces[facei];
label own = faceOwner[facei];
label nei = faceNeighbour[facei];
if (removedCell[own])
{
if (removedCell[nei])
{
// Face no longer used
//Pout<< "Removing internal face " << faceI
// << " fc:" << mesh_.faceCentres()[faceI] << endl;
//Pout<< "Removing internal face " << facei
// << " fc:" << mesh_.faceCentres()[facei] << endl;
meshMod.setAction(polyRemoveFace(faceI));
meshMod.setAction(polyRemoveFace(facei));
uncount(f, nFacesUsingPoint);
}
else
{
if (newPatchID[faceI] == -1)
if (newPatchID[facei] == -1)
{
FatalErrorInFunction
<< "No patchID provided for exposed face " << faceI
<< "No patchID provided for exposed face " << facei
<< " on cell " << nei << nl
<< "Did you provide patch IDs for all exposed faces?"
<< abort(FatalError);
@ -295,7 +295,7 @@ void Foam::removeCells::setRefinement
// nei is remaining cell. FaceI becomes external cell
label zoneID = faceZones.whichZone(faceI);
label zoneID = faceZones.whichZone(facei);
bool zoneFlip = false;
if (zoneID >= 0)
@ -303,23 +303,23 @@ void Foam::removeCells::setRefinement
const faceZone& fZone = faceZones[zoneID];
// Note: we reverse the owner/neighbour of the face
// so should also select the other side of the zone
zoneFlip = !fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = !fZone.flipMap()[fZone.whichFace(facei)];
}
//Pout<< "Putting exposed internal face " << faceI
// << " fc:" << mesh_.faceCentres()[faceI]
// << " into patch " << newPatchID[faceI] << endl;
//Pout<< "Putting exposed internal face " << facei
// << " fc:" << mesh_.faceCentres()[facei]
// << " into patch " << newPatchID[facei] << endl;
meshMod.setAction
(
polyModifyFace
(
f.reverseFace(), // modified face
faceI, // label of face being modified
facei, // label of face being modified
nei, // owner
-1, // neighbour
true, // face flip
newPatchID[faceI], // patch for face
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
@ -329,27 +329,27 @@ void Foam::removeCells::setRefinement
}
else if (removedCell[nei])
{
if (newPatchID[faceI] == -1)
if (newPatchID[facei] == -1)
{
FatalErrorInFunction
<< "No patchID provided for exposed face " << faceI
<< "No patchID provided for exposed face " << facei
<< " on cell " << own << nl
<< "Did you provide patch IDs for all exposed faces?"
<< abort(FatalError);
}
//Pout<< "Putting exposed internal face " << faceI
// << " fc:" << mesh_.faceCentres()[faceI]
// << " into patch " << newPatchID[faceI] << endl;
//Pout<< "Putting exposed internal face " << facei
// << " fc:" << mesh_.faceCentres()[facei]
// << " into patch " << newPatchID[facei] << endl;
// own is remaining cell. FaceI becomes external cell.
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
@ -357,11 +357,11 @@ void Foam::removeCells::setRefinement
polyModifyFace
(
f, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
-1, // neighbour
false, // face flip
newPatchID[faceI], // patch for face
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
@ -370,87 +370,87 @@ void Foam::removeCells::setRefinement
}
}
forAll(patches, patchI)
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchI];
const polyPatch& pp = patches[patchi];
if (pp.coupled())
{
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
if (newPatchID[faceI] != -1)
if (newPatchID[facei] != -1)
{
//Pout<< "Putting uncoupled coupled face " << faceI
// << " fc:" << mesh_.faceCentres()[faceI]
// << " into patch " << newPatchID[faceI] << endl;
//Pout<< "Putting uncoupled coupled face " << facei
// << " fc:" << mesh_.faceCentres()[facei]
// << " into patch " << newPatchID[facei] << endl;
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
(
polyModifyFace
(
faces[faceI], // modified face
faceI, // label of face
faceOwner[faceI], // owner
faces[facei], // modified face
facei, // label of face
faceOwner[facei], // owner
-1, // neighbour
false, // face flip
newPatchID[faceI], // patch for face
newPatchID[facei], // patch for face
false, // remove from zone
zoneID, // zone for face
zoneFlip // face flip in zone
)
);
}
else if (removedCell[faceOwner[faceI]])
else if (removedCell[faceOwner[facei]])
{
// Face no longer used
//Pout<< "Removing boundary face " << faceI
// << " fc:" << mesh_.faceCentres()[faceI]
//Pout<< "Removing boundary face " << facei
// << " fc:" << mesh_.faceCentres()[facei]
// << endl;
meshMod.setAction(polyRemoveFace(faceI));
uncount(faces[faceI], nFacesUsingPoint);
meshMod.setAction(polyRemoveFace(facei));
uncount(faces[facei], nFacesUsingPoint);
}
faceI++;
facei++;
}
}
else
{
label faceI = pp.start();
label facei = pp.start();
forAll(pp, i)
{
if (newPatchID[faceI] != -1)
if (newPatchID[facei] != -1)
{
FatalErrorInFunction
<< "new patchID provided for boundary face " << faceI
<< "new patchID provided for boundary face " << facei
<< " even though it is not on a coupled face."
<< abort(FatalError);
}
if (removedCell[faceOwner[faceI]])
if (removedCell[faceOwner[facei]])
{
// Face no longer used
//Pout<< "Removing boundary face " << faceI
// << " fc:" << mesh_.faceCentres()[faceI]
//Pout<< "Removing boundary face " << facei
// << " fc:" << mesh_.faceCentres()[facei]
// << endl;
meshMod.setAction(polyRemoveFace(faceI));
uncount(faces[faceI], nFacesUsingPoint);
meshMod.setAction(polyRemoveFace(facei));
uncount(faces[facei], nFacesUsingPoint);
}
faceI++;
facei++;
}
}
}

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
@ -52,19 +52,19 @@ defineTypeNameAndDebug(removeFaces, 0);
// only small area of faces removed in one go.
void Foam::removeFaces::changeCellRegion
(
const label cellI,
const label celli,
const label oldRegion,
const label newRegion,
labelList& cellRegion
) const
{
if (cellRegion[cellI] == oldRegion)
if (cellRegion[celli] == oldRegion)
{
cellRegion[cellI] = newRegion;
cellRegion[celli] = newRegion;
// Step to neighbouring cells
const labelList& cCells = mesh_.cellCells()[cellI];
const labelList& cCells = mesh_.cellCells()[celli];
forAll(cCells, i)
{
@ -80,7 +80,7 @@ Foam::label Foam::removeFaces::changeFaceRegion
const labelList& cellRegion,
const boolList& removedFace,
const labelList& nFacesPerEdge,
const label faceI,
const label facei,
const label newRegion,
const labelList& fEdges,
labelList& faceRegion
@ -88,9 +88,9 @@ Foam::label Foam::removeFaces::changeFaceRegion
{
label nChanged = 0;
if (faceRegion[faceI] == -1 && !removedFace[faceI])
if (faceRegion[facei] == -1 && !removedFace[facei])
{
faceRegion[faceI] = newRegion;
faceRegion[facei] = newRegion;
nChanged = 1;
@ -148,13 +148,13 @@ Foam::boolList Foam::removeFaces::getFacesAffected
boolList affectedFace(mesh_.nFaces(), false);
// Mark faces affected by removal of cells
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
label region = cellRegion[cellI];
label region = cellRegion[celli];
if (region != -1 && (cellI != cellRegionMaster[region]))
if (region != -1 && (celli != cellRegionMaster[region]))
{
const labelList& cFaces = mesh_.cells()[cellI];
const labelList& cFaces = mesh_.cells()[celli];
forAll(cFaces, cFaceI)
{
@ -279,9 +279,9 @@ void Foam::removeFaces::mergeFaces
// Find face among pFaces which uses edgeLoop[1]
forAll(pFaces, i)
{
label faceI = pFaces[i];
label facei = pFaces[i];
const face& f = fp.localFaces()[faceI];
const face& f = fp.localFaces()[facei];
label index1 = findIndex(f, edgeLoop[1]);
@ -294,13 +294,13 @@ void Foam::removeFaces::mergeFaces
{
if (index1 == f.fcIndex(index0))
{
masterIndex = faceI;
masterIndex = facei;
reverseLoop = false;
break;
}
else if (index1 == f.rcIndex(index0))
{
masterIndex = faceI;
masterIndex = facei;
reverseLoop = true;
break;
}
@ -320,9 +320,9 @@ void Foam::removeFaces::mergeFaces
// ~~~~~~~~~~~~~~~~~~~~~~~
// Modify first face.
label faceI = faceLabels[masterIndex];
label facei = faceLabels[masterIndex];
label own = mesh_.faceOwner()[faceI];
label own = mesh_.faceOwner()[facei];
if (cellRegion[own] != -1)
{
@ -331,13 +331,13 @@ void Foam::removeFaces::mergeFaces
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
label nei = -1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
nei = mesh_.faceNeighbour()[faceI];
nei = mesh_.faceNeighbour()[facei];
if (cellRegion[nei] != -1)
{
@ -372,7 +372,7 @@ void Foam::removeFaces::mergeFaces
}
//{
// Pout<< "Modifying masterface " << faceI
// Pout<< "Modifying masterface " << facei
// << " from faces:" << faceLabels
// << " old verts:" << UIndirectList<face>(mesh_.faces(), faceLabels)
// << " for new verts:"
@ -385,7 +385,7 @@ void Foam::removeFaces::mergeFaces
modFace
(
mergedFace, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip
@ -405,16 +405,16 @@ void Foam::removeFaces::mergeFaces
{
//Pout<< "Removing face " << faceLabels[patchFaceI] << endl;
meshMod.setAction(polyRemoveFace(faceLabels[patchFaceI], faceI));
meshMod.setAction(polyRemoveFace(faceLabels[patchFaceI], facei));
}
}
}
// Get patch, zone info for faceI
// Get patch, zone info for facei
void Foam::removeFaces::getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
@ -423,12 +423,12 @@ void Foam::removeFaces::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;
@ -436,7 +436,7 @@ void Foam::removeFaces::getFaceInfo
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
}
@ -445,10 +445,10 @@ void Foam::removeFaces::getFaceInfo
Foam::face Foam::removeFaces::filterFace
(
const labelHashSet& pointsToRemove,
const label faceI
const label facei
) const
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
labelList newFace(f.size(), -1);
@ -491,7 +491,7 @@ void Foam::removeFaces::modFace
// if (debug)
// {
// Pout<< "ModifyFace (unreversed) :"
// << " faceI:" << masterFaceID
// << " facei:" << masterFaceID
// << " f:" << f
// << " own:" << own
// << " nei:" << nei
@ -524,7 +524,7 @@ void Foam::removeFaces::modFace
// if (debug)
// {
// Pout<< "ModifyFace (!reversed) :"
// << " faceI:" << masterFaceID
// << " facei:" << masterFaceID
// << " f:" << f.reverseFace()
// << " own:" << nei
// << " nei:" << own
@ -598,17 +598,17 @@ Foam::label Foam::removeFaces::compatibleRemoves
forAll(facesToRemove, i)
{
label faceI = facesToRemove[i];
label facei = facesToRemove[i];
if (!mesh_.isInternalFace(faceI))
if (!mesh_.isInternalFace(facei))
{
FatalErrorInFunction
<< "Not internal face:" << faceI << abort(FatalError);
<< "Not internal face:" << facei << abort(FatalError);
}
label own = faceOwner[faceI];
label nei = faceNeighbour[faceI];
label own = faceOwner[facei];
label nei = faceNeighbour[facei];
label region0 = cellRegion[own];
label region1 = cellRegion[nei];
@ -693,18 +693,18 @@ Foam::label Foam::removeFaces::compatibleRemoves
{
labelList nCells(regionMaster.size(), 0);
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
label r = cellRegion[cellI];
label r = cellRegion[celli];
if (r != -1)
{
nCells[r]++;
if (cellI < regionMaster[r])
if (celli < regionMaster[r])
{
FatalErrorInFunction
<< "Not lowest numbered : cell:" << cellI
<< "Not lowest numbered : cell:" << celli
<< " region:" << r
<< " regionmaster:" << regionMaster[r]
<< abort(FatalError);
@ -739,16 +739,16 @@ Foam::label Foam::removeFaces::compatibleRemoves
// Recreate facesToRemove to be consistent with the cellRegions.
DynamicList<label> allFacesToRemove(facesToRemove.size());
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
{
label own = faceOwner[faceI];
label nei = faceNeighbour[faceI];
label own = faceOwner[facei];
label nei = faceNeighbour[facei];
if (cellRegion[own] != -1 && cellRegion[own] == cellRegion[nei])
{
// Both will become the same cell so add face to list of faces
// to be removed.
allFacesToRemove.append(faceI);
allFacesToRemove.append(facei);
}
}
@ -779,16 +779,16 @@ void Foam::removeFaces::setRefinement
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
label facei = faceLabels[i];
if (!mesh_.isInternalFace(faceI))
if (!mesh_.isInternalFace(facei))
{
FatalErrorInFunction
<< "Face to remove is not internal face:" << faceI
<< "Face to remove is not internal face:" << facei
<< abort(FatalError);
}
removedFace[faceI] = true;
removedFace[facei] = true;
}
@ -821,9 +821,9 @@ void Foam::removeFaces::setRefinement
// Count usage of edges by non-removed faces.
forAll(faceLabels, i)
{
label faceI = faceLabels[i];
label facei = faceLabels[i];
const labelList& fEdges = mesh_.faceEdges(faceI, fe);
const labelList& fEdges = mesh_.faceEdges(facei, fe);
forAll(fEdges, i)
{
@ -920,17 +920,17 @@ void Foam::removeFaces::setRefinement
forAll(eFaces, i)
{
label faceI = eFaces[i];
label facei = eFaces[i];
if (!removedFace[faceI] && !mesh_.isInternalFace(faceI))
if (!removedFace[facei] && !mesh_.isInternalFace(facei))
{
if (f0 == -1)
{
f0 = faceI;
f0 = facei;
}
else
{
f1 = faceI;
f1 = facei;
break;
}
}
@ -1181,14 +1181,14 @@ void Foam::removeFaces::setRefinement
for
(
label faceI = mesh_.nInternalFaces();
faceI < mesh_.nFaces();
faceI++
label facei = mesh_.nInternalFaces();
facei < mesh_.nFaces();
facei++
)
{
// Get the neighbouring region.
label nbrRegion = nbrFaceRegion[faceI];
label myRegion = faceRegion[faceI];
label nbrRegion = nbrFaceRegion[facei];
label myRegion = faceRegion[facei];
if (myRegion <= -1 || nbrRegion <= -1)
{
@ -1197,7 +1197,7 @@ void Foam::removeFaces::setRefinement
FatalErrorInFunction
<< "Inconsistent face region across coupled patches."
<< endl
<< "This side has for faceI:" << faceI
<< "This side has for facei:" << facei
<< " region:" << myRegion << endl
<< "The other side has region:" << nbrRegion
<< endl
@ -1218,7 +1218,7 @@ void Foam::removeFaces::setRefinement
FatalErrorInFunction
<< "Inconsistent face region across coupled patches."
<< endl
<< "This side has for faceI:" << faceI
<< "This side has for facei:" << facei
<< " region:" << myRegion
<< " with coupled neighbouring regions:"
<< toNbrRegion[myRegion] << " and "
@ -1360,15 +1360,15 @@ void Foam::removeFaces::setRefinement
// Remove split faces.
forAll(faceLabels, labelI)
{
label faceI = faceLabels[labelI];
label facei = faceLabels[labelI];
// Remove face if not yet uptodate (which is never; but want to be
// consistent with rest of face removals/modifications)
if (affectedFace[faceI])
if (affectedFace[facei])
{
affectedFace[faceI] = false;
affectedFace[facei] = false;
meshMod.setAction(polyRemoveFace(faceI, -1));
meshMod.setAction(polyRemoveFace(facei, -1));
}
}
@ -1383,13 +1383,13 @@ void Foam::removeFaces::setRefinement
// Remove cells.
forAll(cellRegion, cellI)
forAll(cellRegion, celli)
{
label region = cellRegion[cellI];
label region = cellRegion[celli];
if (region != -1 && (cellI != cellRegionMaster[region]))
if (region != -1 && (celli != cellRegionMaster[region]))
{
meshMod.setAction(polyRemoveCell(cellI, cellRegionMaster[region]));
meshMod.setAction(polyRemoveCell(celli, cellRegionMaster[region]));
}
}
@ -1437,15 +1437,15 @@ void Foam::removeFaces::setRefinement
// Check if any remaining faces have not been updated for new slave/master
// or points removed.
forAll(affectedFace, faceI)
forAll(affectedFace, facei)
{
if (affectedFace[faceI])
if (affectedFace[facei])
{
affectedFace[faceI] = false;
affectedFace[facei] = false;
face f(filterFace(pointsToRemove, faceI));
face f(filterFace(pointsToRemove, facei));
label own = mesh_.faceOwner()[faceI];
label own = mesh_.faceOwner()[facei];
if (cellRegion[own] != -1)
{
@ -1454,13 +1454,13 @@ void Foam::removeFaces::setRefinement
label patchID, zoneID, zoneFlip;
getFaceInfo(faceI, patchID, zoneID, zoneFlip);
getFaceInfo(facei, patchID, zoneID, zoneFlip);
label nei = -1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
nei = mesh_.faceNeighbour()[faceI];
nei = mesh_.faceNeighbour()[facei];
if (cellRegion[nei] != -1)
{
@ -1470,8 +1470,8 @@ void Foam::removeFaces::setRefinement
// if (debug)
// {
// Pout<< "Modifying " << faceI
// << " old verts:" << mesh_.faces()[faceI]
// Pout<< "Modifying " << facei
// << " old verts:" << mesh_.faces()[facei]
// << " for new verts:" << f
// << " or for new owner " << own << " or for new nei "
// << nei
@ -1481,7 +1481,7 @@ void Foam::removeFaces::setRefinement
modFace
(
f, // modified face
faceI, // label of face being modified
facei, // label of face being modified
own, // owner
nei, // neighbour
false, // face flip

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
@ -78,7 +78,7 @@ class removeFaces
// Recurses to cell neighbours.
void changeCellRegion
(
const label cellI,
const label celli,
const label oldRegion,
const label newRegion,
labelList& cellRegion
@ -90,7 +90,7 @@ class removeFaces
const labelList& cellRegion,
const boolList& removedFace,
const labelList& nFacesPerEdge,
const label faceI,
const label facei,
const label newRegion,
const labelList& fEdges,
labelList& faceRegion
@ -126,10 +126,10 @@ class removeFaces
polyTopoChange& meshMod
) const;
//- Get patch, zone info for faceI
//- Get patch, zone info for facei
void getFaceInfo
(
const label faceI,
const label facei,
label& patchID,
label& zoneID,
label& zoneFlip

View File

@ -78,26 +78,26 @@ public:
void Foam::removePoints::modifyFace
(
const label faceI,
const label facei,
const face& newFace,
polyTopoChange& meshMod
) const
{
// Get other face data.
label patchI = -1;
label owner = mesh_.faceOwner()[faceI];
label owner = mesh_.faceOwner()[facei];
label neighbour = -1;
if (mesh_.isInternalFace(faceI))
if (mesh_.isInternalFace(facei))
{
neighbour = mesh_.faceNeighbour()[faceI];
neighbour = mesh_.faceNeighbour()[facei];
}
else
{
patchI = mesh_.boundaryMesh().whichPatch(faceI);
patchI = mesh_.boundaryMesh().whichPatch(facei);
}
label zoneID = mesh_.faceZones().whichZone(faceI);
label zoneID = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
@ -105,7 +105,7 @@ void Foam::removePoints::modifyFace
{
const faceZone& fZone = mesh_.faceZones()[zoneID];
zoneFlip = fZone.flipMap()[fZone.whichFace(faceI)];
zoneFlip = fZone.flipMap()[fZone.whichFace(facei)];
}
meshMod.setAction
@ -113,7 +113,7 @@ void Foam::removePoints::modifyFace
polyModifyFace
(
newFace, // modified face
faceI, // label of face being modified
facei, // label of face being modified
owner, // owner
neighbour, // neighbour
false, // face flip
@ -238,9 +238,9 @@ Foam::label Foam::removePoints::countPointUsage
// Protect any points on faces that would collapse down to nothing
// No particular intelligence so might protect too many points
forAll(mesh_.faces(), faceI)
forAll(mesh_.faces(), facei)
{
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
label nCollapse = 0;
forAll(f, fp)
@ -365,9 +365,9 @@ void Foam::removePoints::setRefinement
forAllConstIter(labelHashSet, facesAffected, iter)
{
label faceI = iter.key();
label facei = iter.key();
const face& f = mesh_.faces()[faceI];
const face& f = mesh_.faces()[facei];
face newFace(f.size());
@ -385,12 +385,12 @@ void Foam::removePoints::setRefinement
newFace.setSize(newI);
// Actually change the face to the new vertices
modifyFace(faceI, newFace, meshMod);
modifyFace(facei, newFace, meshMod);
// Save the face. Negative indices are into savedPoints_
if (undoable_)
{
savedFaceLabels_[nSaved] = faceI;
savedFaceLabels_[nSaved] = facei;
face& savedFace = savedFaces_[nSaved++];
savedFace.setSize(f.size());
@ -442,7 +442,7 @@ void Foam::removePoints::setRefinement
if (meshPoints != keptPoints)
{
FatalErrorInFunction
<< "faceI:" << savedFaceLabels_[saveI] << nl
<< "facei:" << savedFaceLabels_[saveI] << nl
<< "meshPoints:" << meshPoints << nl
<< "keptPoints:" << keptPoints << nl
<< abort(FatalError);
@ -532,7 +532,7 @@ void Foam::removePoints::updateMesh(const mapPolyMesh& map)
if (keptFace != f)
{
FatalErrorInFunction
<< "faceI:" << savedFaceLabels_[saveI] << nl
<< "facei:" << savedFaceLabels_[saveI] << nl
<< "face:" << f << nl
<< "keptFace:" << keptFace << nl
<< "saved points:"

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
@ -84,7 +84,7 @@ class removePoints
// (patch, zone) the same.
void modifyFace
(
const label faceI,
const label facei,
const face&,
polyTopoChange&
) const;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -54,7 +54,7 @@ void Foam::tetDecomposer::modifyFace
(
polyTopoChange& meshMod,
const face& f,
const label faceI,
const label facei,
const label own,
const label nei,
const label patchI,
@ -68,7 +68,7 @@ void Foam::tetDecomposer::modifyFace
meshMod.modifyFace
(
f, // modified face
faceI, // label of face
facei, // label of face
own, // owner
nei, // neighbour
false, // face flip
@ -82,7 +82,7 @@ void Foam::tetDecomposer::modifyFace
meshMod.modifyFace
(
f.reverseFace(), // modified face
faceI, // label of face
facei, // label of face
nei, // owner
own, // neighbour
true, // face flip
@ -145,11 +145,11 @@ void Foam::tetDecomposer::addFace
// Work out triangle index given the starting vertex in the face
Foam::label Foam::tetDecomposer::triIndex(const label faceI, const label fp)
Foam::label Foam::tetDecomposer::triIndex(const label facei, const label fp)
const
{
const face& f = mesh_.faces()[faceI];
const label fp0 = mesh_.tetBasePtIs()[faceI];
const face& f = mesh_.faces()[facei];
const label fp0 = mesh_.tetBasePtIs()[facei];
// Work out triangle index on this face
label thisTriI;
@ -186,14 +186,14 @@ void Foam::tetDecomposer::setRefinement
)
{
cellToPoint_.setSize(mesh_.nCells());
forAll(mesh_.cellCentres(), cellI)
forAll(mesh_.cellCentres(), celli)
{
// Any point on the cell
label masterPointI = mesh_.faces()[mesh_.cells()[cellI][0]][0];
label masterPointI = mesh_.faces()[mesh_.cells()[celli][0]][0];
cellToPoint_[cellI] = meshMod.addPoint
cellToPoint_[celli] = meshMod.addPoint
(
mesh_.cellCentres()[cellI],
mesh_.cellCentres()[celli],
masterPointI,
-1,
true
@ -205,14 +205,14 @@ void Foam::tetDecomposer::setRefinement
if (decomposeType == FACE_CENTRE_TRIS)
{
faceToPoint_.setSize(mesh_.nFaces());
forAll(mesh_.faceCentres(), faceI)
forAll(mesh_.faceCentres(), facei)
{
// Any point on the face
const label masterPointI = mesh_.faces()[faceI][0];
const label masterPointI = mesh_.faces()[facei][0];
faceToPoint_[faceI] = meshMod.addPoint
faceToPoint_[facei] = meshMod.addPoint
(
mesh_.faceCentres()[faceI],
mesh_.faceCentres()[facei],
masterPointI,
-1,
true
@ -227,11 +227,11 @@ void Foam::tetDecomposer::setRefinement
if (decomposeType == FACE_CENTRE_TRIS)
{
forAll(faceOwnerCells_, faceI)
forAll(faceOwnerCells_, facei)
{
const face& f = mesh_.faces()[faceI];
faceOwnerCells_[faceI].setSize(f.size(), -1);
faceNeighbourCells_[faceI].setSize(f.size(), -1);
const face& f = mesh_.faces()[facei];
faceOwnerCells_[facei].setSize(f.size(), -1);
faceNeighbourCells_[facei].setSize(f.size(), -1);
}
}
else
@ -239,32 +239,32 @@ void Foam::tetDecomposer::setRefinement
// Force construction of diagonal decomposition
(void)mesh_.tetBasePtIs();
forAll(faceOwnerCells_, faceI)
forAll(faceOwnerCells_, facei)
{
const face& f = mesh_.faces()[faceI];
faceOwnerCells_[faceI].setSize(f.size()-2, -1);
faceNeighbourCells_[faceI].setSize(f.size()-2, -1);
const face& f = mesh_.faces()[facei];
faceOwnerCells_[facei].setSize(f.size()-2, -1);
faceNeighbourCells_[facei].setSize(f.size()-2, -1);
}
}
forAll(mesh_.cells(), cellI)
forAll(mesh_.cells(), celli)
{
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
EdgeMap<label> edgeToFace(8*cFaces.size());
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
const face& f = mesh_.faces()[faceI];
label facei = cFaces[cFaceI];
const face& f = mesh_.faces()[facei];
// Get reference to either owner or neighbour
labelList& added =
(
(mesh_.faceOwner()[faceI] == cellI)
? faceOwnerCells_[faceI]
: faceNeighbourCells_[faceI]
(mesh_.faceOwner()[facei] == celli)
? faceOwnerCells_[facei]
: faceNeighbourCells_[facei]
);
if (decomposeType == FACE_CENTRE_TRIS)
@ -274,7 +274,7 @@ void Foam::tetDecomposer::setRefinement
if (cFaceI == 0 && fp == 0)
{
// Reuse cell itself
added[fp] = cellI;
added[fp] = celli;
}
else
{
@ -283,8 +283,8 @@ void Foam::tetDecomposer::setRefinement
-1, // masterPoint
-1, // masterEdge
-1, // masterFace
cellI, // masterCell
mesh_.cellZones().whichZone(cellI)
celli, // masterCell
mesh_.cellZones().whichZone(celli)
);
}
}
@ -296,7 +296,7 @@ void Foam::tetDecomposer::setRefinement
if (cFaceI == 0 && triI == 0)
{
// Reuse cell itself
added[triI] = cellI;
added[triI] = celli;
}
else
{
@ -305,8 +305,8 @@ void Foam::tetDecomposer::setRefinement
-1, // masterPoint
-1, // masterEdge
-1, // masterFace
cellI, // masterCell
mesh_.cellZones().whichZone(cellI)
celli, // masterCell
mesh_.cellZones().whichZone(celli)
);
}
}
@ -319,25 +319,25 @@ void Foam::tetDecomposer::setRefinement
// Add triangle faces
face triangle(3);
forAll(mesh_.faces(), faceI)
forAll(mesh_.faces(), facei)
{
label own = mesh_.faceOwner()[faceI];
const labelList& addedOwn = faceOwnerCells_[faceI];
const labelList& addedNei = faceNeighbourCells_[faceI];
const face& f = mesh_.faces()[faceI];
label own = mesh_.faceOwner()[facei];
const labelList& addedOwn = faceOwnerCells_[facei];
const labelList& addedNei = faceNeighbourCells_[facei];
const face& f = mesh_.faces()[facei];
label patchI = -1;
if (faceI >= mesh_.nInternalFaces())
if (facei >= mesh_.nInternalFaces())
{
patchI = mesh_.boundaryMesh().whichPatch(faceI);
patchI = mesh_.boundaryMesh().whichPatch(facei);
}
label zoneI = mesh_.faceZones().whichZone(faceI);
label zoneI = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneI != -1)
{
const faceZone& fz = mesh_.faceZones()[zoneI];
zoneFlip = fz.flipMap()[fz.whichFace(faceI)];
zoneFlip = fz.flipMap()[fz.whichFace(facei)];
}
@ -350,7 +350,7 @@ void Foam::tetDecomposer::setRefinement
{
triangle[0] = f[fp];
triangle[1] = f[f.fcIndex(fp)];
triangle[2] = faceToPoint_[faceI];
triangle[2] = faceToPoint_[facei];
if (fp == 0)
{
@ -358,7 +358,7 @@ void Foam::tetDecomposer::setRefinement
(
meshMod,
triangle,
faceI,
facei,
addedOwn[fp],
addedNei[fp],
patchI,
@ -376,7 +376,7 @@ void Foam::tetDecomposer::setRefinement
addedNei[fp],
-1, //point
-1, //edge
faceI, //face
facei, //face
patchI,
zoneI,
zoneFlip
@ -392,7 +392,7 @@ void Foam::tetDecomposer::setRefinement
triangle[0] = f[fp];
triangle[1] = cellToPoint_[own];
triangle[2] = faceToPoint_[faceI];
triangle[2] = faceToPoint_[facei];
addFace
(
@ -409,14 +409,14 @@ void Foam::tetDecomposer::setRefinement
);
}
// 2b. Within neighbour cell - to cell centre
if (faceI < mesh_.nInternalFaces())
if (facei < mesh_.nInternalFaces())
{
label newOwn = addedNei[f.rcIndex(fp)];
label newNei = addedNei[fp];
triangle[0] = f[fp];
triangle[1] = faceToPoint_[faceI];
triangle[2] = cellToPoint_[mesh_.faceNeighbour()[faceI]];
triangle[1] = faceToPoint_[facei];
triangle[2] = cellToPoint_[mesh_.faceNeighbour()[facei]];
addFace
(
@ -436,7 +436,7 @@ void Foam::tetDecomposer::setRefinement
}
else
{
label fp0 = mesh_.tetBasePtIs()[faceI];
label fp0 = mesh_.tetBasePtIs()[facei];
label fp = f.fcIndex(fp0);
for (label triI = 0; triI < f.size()-2; triI++)
@ -465,7 +465,7 @@ void Foam::tetDecomposer::setRefinement
(
meshMod,
triangle,
faceI,
facei,
addedOwn[triI],
addedNei[triI],
patchI,
@ -483,7 +483,7 @@ void Foam::tetDecomposer::setRefinement
addedNei[triI],
-1, //point
-1, //edge
faceI, //face
facei, //face
patchI,
zoneI,
zoneFlip
@ -517,7 +517,7 @@ void Foam::tetDecomposer::setRefinement
);
// 2b. Within neighbour cell - to cell centre
if (faceI < mesh_.nInternalFaces())
if (facei < mesh_.nInternalFaces())
{
label newOwn = addedNei[triI];
label newNei = addedNei[nextTri];
@ -525,7 +525,7 @@ void Foam::tetDecomposer::setRefinement
triangle[0] = f[nextFp];
triangle[1] = f[fp0];
triangle[2] =
cellToPoint_[mesh_.faceNeighbour()[faceI]];
cellToPoint_[mesh_.faceNeighbour()[facei]];
addFace
(
@ -554,26 +554,26 @@ void Foam::tetDecomposer::setRefinement
// Add triangles for all edges.
EdgeMap<label> edgeToFace;
forAll(mesh_.cells(), cellI)
forAll(mesh_.cells(), celli)
{
const cell& cFaces = mesh_.cells()[cellI];
const cell& cFaces = mesh_.cells()[celli];
edgeToFace.clear();
forAll(cFaces, cFaceI)
{
label faceI = cFaces[cFaceI];
label facei = cFaces[cFaceI];
label zoneI = mesh_.faceZones().whichZone(faceI);
label zoneI = mesh_.faceZones().whichZone(facei);
bool zoneFlip = false;
if (zoneI != -1)
{
const faceZone& fz = mesh_.faceZones()[zoneI];
zoneFlip = fz.flipMap()[fz.whichFace(faceI)];
zoneFlip = fz.flipMap()[fz.whichFace(facei)];
}
const face& f = mesh_.faces()[faceI];
//const labelList& fEdges = mesh_.faceEdges()[faceI];
const face& f = mesh_.faces()[facei];
//const labelList& fEdges = mesh_.faceEdges()[facei];
forAll(f, fp)
{
label p0 = f[fp];
@ -583,7 +583,7 @@ void Foam::tetDecomposer::setRefinement
EdgeMap<label>::const_iterator edgeFnd = edgeToFace.find(e);
if (edgeFnd == edgeToFace.end())
{
edgeToFace.insert(e, faceI);
edgeToFace.insert(e, facei);
}
else
{
@ -593,7 +593,7 @@ void Foam::tetDecomposer::setRefinement
// Found the other face on the edge. Note that since
// we are looping in the same order the tets added for
// otherFaceI will be before those of faceI
// otherFaceI will be before those of facei
label otherFp = findIndex(otherF, p0);
if (otherF.nextLabel(otherFp) == p1)
@ -612,17 +612,17 @@ void Foam::tetDecomposer::setRefinement
// Triangle from edge to cell centre
if (mesh_.faceOwner()[faceI] == cellI)
if (mesh_.faceOwner()[facei] == celli)
{
triangle[0] = p0;
triangle[1] = p1;
triangle[2] = cellToPoint_[cellI];
triangle[2] = cellToPoint_[celli];
}
else
{
triangle[0] = p1;
triangle[1] = p0;
triangle[2] = cellToPoint_[cellI];
triangle[2] = cellToPoint_[celli];
}
// Determine tets on either side
@ -630,16 +630,16 @@ void Foam::tetDecomposer::setRefinement
if (decomposeType == FACE_CENTRE_TRIS)
{
if (mesh_.faceOwner()[faceI] == cellI)
if (mesh_.faceOwner()[facei] == celli)
{
thisTet = faceOwnerCells_[faceI][fp];
thisTet = faceOwnerCells_[facei][fp];
}
else
{
thisTet = faceNeighbourCells_[faceI][fp];
thisTet = faceNeighbourCells_[facei][fp];
}
if (mesh_.faceOwner()[otherFaceI] == cellI)
if (mesh_.faceOwner()[otherFaceI] == celli)
{
otherTet = faceOwnerCells_[otherFaceI][otherFp];
}
@ -651,18 +651,18 @@ void Foam::tetDecomposer::setRefinement
}
else
{
label thisTriI = triIndex(faceI, fp);
if (mesh_.faceOwner()[faceI] == cellI)
label thisTriI = triIndex(facei, fp);
if (mesh_.faceOwner()[facei] == celli)
{
thisTet = faceOwnerCells_[faceI][thisTriI];
thisTet = faceOwnerCells_[facei][thisTriI];
}
else
{
thisTet = faceNeighbourCells_[faceI][thisTriI];
thisTet = faceNeighbourCells_[facei][thisTriI];
}
label otherTriI = triIndex(otherFaceI, otherFp);
if (mesh_.faceOwner()[otherFaceI] == cellI)
if (mesh_.faceOwner()[otherFaceI] == celli)
{
otherTet = faceOwnerCells_[otherFaceI][otherTriI];
}
@ -682,7 +682,7 @@ void Foam::tetDecomposer::setRefinement
thisTet,
-1, //masterPoint
-1, //fEdges[fp], //masterEdge
faceI, //masterFace
facei, //masterFace
-1, //patchI
zoneI,
zoneFlip
@ -699,13 +699,13 @@ void Foam::tetDecomposer::updateMesh(const mapPolyMesh& map)
inplaceRenumber(map.reversePointMap(), cellToPoint_);
inplaceRenumber(map.reversePointMap(), faceToPoint_);
forAll(faceOwnerCells_, faceI)
forAll(faceOwnerCells_, facei)
{
inplaceRenumber(map.reverseCellMap(), faceOwnerCells_[faceI]);
inplaceRenumber(map.reverseCellMap(), faceOwnerCells_[facei]);
}
forAll(faceNeighbourCells_, faceI)
forAll(faceNeighbourCells_, facei)
{
inplaceRenumber(map.reverseCellMap(), faceNeighbourCells_[faceI]);
inplaceRenumber(map.reverseCellMap(), faceNeighbourCells_[facei]);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,7 +100,7 @@ private:
(
polyTopoChange& meshMod,
const face& f,
const label faceI,
const label facei,
const label own,
const label nei,
const label patchI,
@ -124,7 +124,7 @@ private:
) const;
//- Work out triangle index given the starting vertex in the face
label triIndex(const label faceI, const label fp) const;
label triIndex(const label facei, const label fp) const;
//- Disallow default bitwise copy construct
tetDecomposer(const tetDecomposer&);

View File

@ -565,15 +565,15 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// Pout<< "curFaces: " << curFaces << endl;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Pout<< "face: " << curFaces[faceI] << " "
// << masterPatch[curFaces[faceI]]
// Pout<< "face: " << curFaces[facei] << " "
// << masterPatch[curFaces[facei]]
// << " local: "
// << masterPatch.localFaces()[curFaces[faceI]]
// << masterPatch.localFaces()[curFaces[facei]]
// << endl;
const labelList& me = masterFaceEdges[curFaces[faceI]];
const labelList& me = masterFaceEdges[curFaces[facei]];
forAll(me, meI)
{
@ -847,13 +847,13 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
boolList orphanedMaster(masterPatch.size(), false);
boolList orphanedSlave(slavePatch.size(), false);
forAll(cutFaces, faceI)
forAll(cutFaces, facei)
{
const face& curCutFace = cutFaces[faceI];
const label curMaster = cutFaceMaster[faceI];
const label curSlave = cutFaceSlave[faceI];
const face& curCutFace = cutFaces[facei];
const label curMaster = cutFaceMaster[facei];
const label curSlave = cutFaceSlave[facei];
// Pout<< "Doing insertion of face " << faceI << ": ";
// Pout<< "Doing insertion of face " << facei << ": ";
// Check if the face has changed topologically
bool insertedFace = false;
@ -1040,7 +1040,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
else
{
FatalErrorInFunction
<< "Face " << faceI << " in cut faces has neither a master "
<< "Face " << facei << " in cut faces has neither a master "
<< "nor a slave. Error in the cutting algorithm on modify."
<< abort(FatalError);
}
@ -1165,7 +1165,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
else
{
FatalErrorInFunction
<< "Face " << faceI << " in cut faces has neither a master "
<< "Face " << facei << " in cut faces has neither a master "
<< "nor a slave. Error in the cutting algorithm on add."
<< abort(FatalError);
}
@ -1178,9 +1178,9 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
label nOrphanedMasters = 0;
forAll(orphanedMaster, faceI)
forAll(orphanedMaster, facei)
{
if (orphanedMaster[faceI])
if (orphanedMaster[facei])
{
nOrphanedMasters++;
@ -1189,8 +1189,8 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
//(
// polyModifyFace
// (
// masterPatch[faceI], // new face
// masterPatchAddr[faceI], // master face index
// masterPatch[facei], // new face
// masterPatchAddr[facei], // master face index
// -1, // owner
// -1, // neighbour
// false, // flux flip
@ -1201,17 +1201,17 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// )
//);
//Pout<< "**MJ:deleting master face " << masterPatchAddr[faceI]
// << " old verts:" << masterPatch[faceI] << endl;
ref.setAction(polyRemoveFace(masterPatchAddr[faceI]));
//Pout<< "**MJ:deleting master face " << masterPatchAddr[facei]
// << " old verts:" << masterPatch[facei] << endl;
ref.setAction(polyRemoveFace(masterPatchAddr[facei]));
}
}
label nOrphanedSlaves = 0;
forAll(orphanedSlave, faceI)
forAll(orphanedSlave, facei)
{
if (orphanedSlave[faceI])
if (orphanedSlave[facei])
{
nOrphanedSlaves++;
@ -1220,8 +1220,8 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
//(
// polyModifyFace
// (
// slavePatch[faceI], // new face
// slavePatchAddr[faceI], // slave face index
// slavePatch[facei], // new face
// slavePatchAddr[facei], // slave face index
// -1, // owner
// -1, // neighbour
// false, // flux flip
@ -1232,9 +1232,9 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// )
//);
//Pout<< "**MJ:deleting slave face " << slavePatchAddr[faceI]
// << " old verts:" << slavePatch[faceI] << endl;
ref.setAction(polyRemoveFace(slavePatchAddr[faceI]));
//Pout<< "**MJ:deleting slave face " << slavePatchAddr[facei]
// << " old verts:" << slavePatch[facei] << endl;
ref.setAction(polyRemoveFace(slavePatchAddr[facei]));
}
}
@ -1268,11 +1268,11 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// Pout<< "masterStickOuts: " << masterStickOuts << endl;
// Re-create the master stick-out faces
forAll(masterStickOuts, faceI)
forAll(masterStickOuts, facei)
{
// Renumber the face and remove additional points
const label curFaceID = masterStickOuts[faceI];
const label curFaceID = masterStickOuts[facei];
const face& oldRichFace = faces[curFaceID];
@ -1540,10 +1540,10 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// Re-create the slave stick-out faces
forAll(slaveStickOuts, faceI)
forAll(slaveStickOuts, facei)
{
// Renumber the face and remove additional points
const label curFaceID = slaveStickOuts[faceI];
const label curFaceID = slaveStickOuts[facei];
const face& oldRichFace = faces[curFaceID];

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
@ -82,12 +82,12 @@ void Foam::slidingInterface::decoupleInterface
// Recover faces in master patch
forAll(masterPatchAddr, faceI)
forAll(masterPatchAddr, facei)
{
// Make a copy of the face and turn it if necessary
face newFace = faces[masterPatchAddr[faceI]];
face newFace = faces[masterPatchAddr[facei]];
if (masterPatchFlip[faceI])
if (masterPatchFlip[facei])
{
newFace.flip();
}
@ -97,8 +97,8 @@ void Foam::slidingInterface::decoupleInterface
polyModifyFace
(
newFace, // new face
masterPatchAddr[faceI], // master face index
masterFc[faceI], // owner
masterPatchAddr[facei], // master face index
masterFc[facei], // owner
-1, // neighbour
false, // flux flip
masterPatchID_.index(), // patch ID
@ -109,10 +109,10 @@ void Foam::slidingInterface::decoupleInterface
);
// Pout<< "Modifying master patch face no "
// << masterPatchAddr[faceI]
// << " face: " << faces[masterPatchAddr[faceI]]
// << " old owner: " << own[masterPatchAddr[faceI]]
// << " new owner: " << masterFc[faceI]
// << masterPatchAddr[facei]
// << " face: " << faces[masterPatchAddr[facei]]
// << " old owner: " << own[masterPatchAddr[facei]]
// << " new owner: " << masterFc[facei]
// << endl;
}
@ -134,12 +134,12 @@ void Foam::slidingInterface::decoupleInterface
// Recover faces in slave patch
forAll(slavePatchAddr, faceI)
forAll(slavePatchAddr, facei)
{
// Make a copy of face and turn it if necessary
face newFace = faces[slavePatchAddr[faceI]];
face newFace = faces[slavePatchAddr[facei]];
if (slavePatchFlip[faceI])
if (slavePatchFlip[facei])
{
newFace.flip();
}
@ -164,8 +164,8 @@ void Foam::slidingInterface::decoupleInterface
polyModifyFace
(
newFace, // new face
slavePatchAddr[faceI], // master face index
slaveFc[faceI], // owner
slavePatchAddr[facei], // master face index
slaveFc[facei], // owner
-1, // neighbour
false, // flux flip
slavePatchID_.index(), // patch ID
@ -181,11 +181,11 @@ void Foam::slidingInterface::decoupleInterface
// Grab the list of faces in the layer
const labelList& masterStickOuts = masterStickOutFaces();
forAll(masterStickOuts, faceI)
forAll(masterStickOuts, facei)
{
// Renumber the face and remove additional points
const label curFaceID = masterStickOuts[faceI];
const label curFaceID = masterStickOuts[facei];
const face& oldFace = faces[curFaceID];
@ -265,23 +265,23 @@ void Foam::slidingInterface::decoupleInterface
primitiveMesh::facesPerCell_*(masterPatch.size() + slavePatch.size())
);
forAll(slaveFc, faceI)
forAll(slaveFc, facei)
{
const labelList& curFaces = cells[slaveFc[faceI]];
const labelList& curFaces = cells[slaveFc[facei]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Check if the face belongs to the slave face zone; and
// if it has been removed; if not add it
if
(
mesh.faceZones().whichZone(curFaces[faceI])
mesh.faceZones().whichZone(curFaces[facei])
!= slaveFaceZoneID_.index()
&& !ref.faceRemoved(curFaces[faceI])
&& !ref.faceRemoved(curFaces[facei])
)
{
slaveLayerCellFaceMap.insert(curFaces[faceI]);
slaveLayerCellFaceMap.insert(curFaces[facei]);
}
}
}
@ -292,11 +292,11 @@ void Foam::slidingInterface::decoupleInterface
// Grab master point mapping
const Map<label>& masterPm = masterPatch.meshPointMap();
forAll(slaveStickOuts, faceI)
forAll(slaveStickOuts, facei)
{
// Renumber the face and remove additional points
const label curFaceID = slaveStickOuts[faceI];
const label curFaceID = slaveStickOuts[facei];
const face& oldFace = faces[curFaceID];

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
@ -78,11 +78,11 @@ void Foam::enrichedPatch::calcLocalFaces() const
localFacesPtr_ = new faceList(faces.size());
faceList& lf = *localFacesPtr_;
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
face& curlf = lf[faceI];
face& curlf = lf[facei];
curlf.setSize(f.size());
@ -225,16 +225,16 @@ bool Foam::enrichedPatch::checkSupport() const
bool error = false;
forAll(faces, faceI)
forAll(faces, facei)
{
const face& curFace = faces[faceI];
const face& curFace = faces[facei];
forAll(curFace, pointI)
{
if (!pointMap().found(curFace[pointI]))
{
WarningInFunction
<< "Point " << pointI << " of face " << faceI
<< "Point " << pointI << " of face " << facei
<< " global point index: " << curFace[pointI]
<< " not supported in point map. This is not allowed."
<< endl;
@ -261,9 +261,9 @@ void Foam::enrichedPatch::writeOBJ(const fileName& fName) const
const faceList& faces = localFaces();
forAll(faces, faceI)
forAll(faces, facei)
{
const face& f = faces[faceI];
const face& f = faces[facei];
str << 'f';
forAll(f, fp)

View File

@ -99,26 +99,26 @@ void Foam::enrichedPatch::calcCutFaces() const
(pp.size()*primitiveMesh::edgesPerPoint_);
forAll(lf, faceI)
forAll(lf, facei)
{
const face& curLocalFace = lf[faceI];
const face& curGlobalFace = enFaces[faceI];
const face& curLocalFace = lf[facei];
const face& curGlobalFace = enFaces[facei];
// Pout<< "Doing face " << faceI
// Pout<< "Doing face " << facei
// << " local: " << curLocalFace
// << " or " << curGlobalFace
// << endl;
// if (faceI < slavePatch_.size())
// if (facei < slavePatch_.size())
// {
// Pout<< "original slave: " << slavePatch_[faceI]
// << " local: " << slavePatch_.localFaces()[faceI] << endl;
// Pout<< "original slave: " << slavePatch_[facei]
// << " local: " << slavePatch_.localFaces()[facei] << endl;
// }
// else
// {
// Pout<< "original master: "
// << masterPatch_[faceI - slavePatch_.size()] << " "
// << masterPatch_.localFaces()[faceI - slavePatch_.size()]
// << masterPatch_[facei - slavePatch_.size()] << " "
// << masterPatch_.localFaces()[facei - slavePatch_.size()]
// << endl;
// }
// {
@ -332,7 +332,7 @@ void Foam::enrichedPatch::calcCutFaces() const
if (debug)
{
Pout<< " local: " << cutFaceLocalPoints
<< " one side: " << faceI;
<< " one side: " << facei;
}
// Append the face
@ -433,7 +433,7 @@ void Foam::enrichedPatch::calcCutFaces() const
// is the other side. If this is not the case, there is no
// face on the other side.
if (faceI < slavePatch_.size())
if (facei < slavePatch_.size())
{
Map<labelList>::const_iterator mpfAddrIter =
masterPointFaceAddr.find(cutFaceGlobal[0]);
@ -511,7 +511,7 @@ void Foam::enrichedPatch::calcCutFaces() const
masterFacesOfPZero[pointI]
);
cfSlave.append(faceI);
cfSlave.append(facei);
// Reverse the face such that it
// points out of the master patch
@ -536,7 +536,7 @@ void Foam::enrichedPatch::calcCutFaces() const
}
cfMaster.append(-1);
cfSlave.append(faceI);
cfSlave.append(facei);
}
}
else
@ -548,7 +548,7 @@ void Foam::enrichedPatch::calcCutFaces() const
}
cfMaster.append(-1);
cfSlave.append(faceI);
cfSlave.append(facei);
}
}
else
@ -558,7 +558,7 @@ void Foam::enrichedPatch::calcCutFaces() const
Pout<< " master side" << endl;
}
cfMaster.append(faceI - slavePatch_.size());
cfMaster.append(facei - slavePatch_.size());
cfSlave.append(-1);
}
}
@ -596,21 +596,21 @@ void Foam::enrichedPatch::calcCutFaces() const
face origFace;
face origFaceLocal;
if (faceI < slavePatch_.size())
if (facei < slavePatch_.size())
{
origFace = slavePatch_[faceI];
origFace = slavePatch_[facei];
origFaceLocal =
slavePatch_.localFaces()[faceI];
slavePatch_.localFaces()[facei];
}
else
{
origFace =
masterPatch_
[faceI - slavePatch_.size()];
[facei - slavePatch_.size()];
origFaceLocal =
masterPatch_.localFaces()
[faceI - slavePatch_.size()];
[facei - slavePatch_.size()];
}
FatalErrorInFunction
@ -622,7 +622,7 @@ void Foam::enrichedPatch::calcCutFaces() const
<< "Slave size: " << slavePatch_.size()
<< " Master size: "
<< masterPatch_.size()
<< " index: " << faceI << ".\n"
<< " index: " << facei << ".\n"
<< "Face: " << curGlobalFace << nl
<< "Cut face: " << cutFaceGlobalPoints
<< " local: " << cutFaceLocalPoints
@ -639,7 +639,7 @@ void Foam::enrichedPatch::calcCutFaces() const
if (debug)
{
Pout<< " Finished face " << faceI << endl;
Pout<< " Finished face " << facei << endl;
}
} // end of local faces

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
@ -77,12 +77,12 @@ void Foam::enrichedPatch::calcEnrichedFaces
// Add slave faces into the enriched faces list
forAll(slavePatch_, faceI)
forAll(slavePatch_, facei)
{
const face oldFace = slavePatch_[faceI];
const face oldLocalFace = slaveLocalFaces[faceI];
// Info<< "old slave face " << faceI << ": " << oldFace << endl;
const labelList& curEdges = slaveFaceEdges[faceI];
const face oldFace = slavePatch_[facei];
const face oldLocalFace = slaveLocalFaces[facei];
// Info<< "old slave face " << facei << ": " << oldFace << endl;
const labelList& curEdges = slaveFaceEdges[facei];
DynamicList<label> newFace(oldFace.size()*enrichedFaceRatio_);
@ -172,7 +172,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
{
FatalErrorInFunction
<< " not on the edge for edge " << curEdges[i]
<< " of face " << faceI << " in slave patch." << nl
<< " of face " << facei << " in slave patch." << nl
<< "Min weight: " << min(edgePointWeights)
<< " Max weight: " << max(edgePointWeights)
<< abort(FatalError);
@ -212,7 +212,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
}
}
}
// Info<< "New slave face " << faceI << ": " << newFace << endl;
// Info<< "New slave face " << facei << ": " << newFace << endl;
// Add the new face to the list
enrichedFaces[nEnrichedFaces].transfer(newFace);
@ -221,12 +221,12 @@ void Foam::enrichedPatch::calcEnrichedFaces
// Add master faces into the enriched faces list
forAll(masterPatch_, faceI)
forAll(masterPatch_, facei)
{
const face& oldFace = masterPatch_[faceI];
const face& oldLocalFace = masterLocalFaces[faceI];
const face& oldFace = masterPatch_[facei];
const face& oldLocalFace = masterLocalFaces[facei];
// Info<< "old master face: " << oldFace << endl;
const labelList& curEdges = masterFaceEdges[faceI];
const labelList& curEdges = masterFaceEdges[facei];
DynamicList<label> newFace(oldFace.size()*enrichedFaceRatio_);
@ -308,7 +308,7 @@ void Foam::enrichedPatch::calcEnrichedFaces
{
FatalErrorInFunction
<< " not on the edge for edge " << curEdges[i]
<< " of face " << faceI << " in master patch." << nl
<< " of face " << facei << " in master patch." << nl
<< "Min weight: " << min(edgePointWeights)
<< " Max weight: " << max(edgePointWeights)
<< abort(FatalError);

View File

@ -56,9 +56,9 @@ void Foam::enrichedPatch::calcMasterPointFaces() const
const faceList& ef = enrichedFaces();
// Add the original face points
forAll(masterPatch_, faceI)
forAll(masterPatch_, facei)
{
const face& curFace = ef[faceI + slavePatch_.size()];
const face& curFace = ef[facei + slavePatch_.size()];
// Pout<< "Cur face in pfAddr: " << curFace << endl;
forAll(curFace, pointI)
{
@ -75,11 +75,11 @@ void Foam::enrichedPatch::calcMasterPointFaces() const
);
// Iterator is invalidated - have to find again
mpf.find(curFace[pointI])().append(faceI);
mpf.find(curFace[pointI])().append(facei);
}
else
{
mpfIter().append(faceI);
mpfIter().append(facei);
}
}
}

View File

@ -53,9 +53,9 @@ void Foam::enrichedPatch::calcPointPoints() const
bool found = false;
forAll(lf, faceI)
forAll(lf, facei)
{
const face& curFace = lf[faceI];
const face& curFace = lf[facei];
forAll(curFace, pointI)
{

View File

@ -64,15 +64,15 @@ void Foam::slidingInterface::calcAttachedAddressing() const
masterFaceCellsPtr_ = new labelList(masterPatchFaces.size());
labelList& mfc = *masterFaceCellsPtr_;
forAll(masterPatchFaces, faceI)
forAll(masterPatchFaces, facei)
{
if (masterFlip[faceI])
if (masterFlip[facei])
{
mfc[faceI] = nei[masterPatchFaces[faceI]];
mfc[facei] = nei[masterPatchFaces[facei]];
}
else
{
mfc[faceI] = own[masterPatchFaces[faceI]];
mfc[facei] = own[masterPatchFaces[facei]];
}
}
@ -90,15 +90,15 @@ void Foam::slidingInterface::calcAttachedAddressing() const
slaveFaceCellsPtr_ = new labelList(slavePatchFaces.size());
labelList& sfc = *slaveFaceCellsPtr_;
forAll(slavePatchFaces, faceI)
forAll(slavePatchFaces, facei)
{
if (slaveFlip[faceI])
if (slaveFlip[facei])
{
sfc[faceI] = nei[slavePatchFaces[faceI]];
sfc[facei] = nei[slavePatchFaces[facei]];
}
else
{
sfc[faceI] = own[slavePatchFaces[faceI]];
sfc[facei] = own[slavePatchFaces[facei]];
}
}
@ -107,27 +107,27 @@ void Foam::slidingInterface::calcAttachedAddressing() const
{
if (debug)
{
forAll(mfc, faceI)
forAll(mfc, facei)
{
if (mfc[faceI] < 0)
if (mfc[facei] < 0)
{
Pout<< "No cell next to master patch face " << faceI
<< ". Global face no: " << mfc[faceI]
<< " own: " << own[masterPatchFaces[faceI]]
<< " nei: " << nei[masterPatchFaces[faceI]]
<< " flip: " << masterFlip[faceI] << endl;
Pout<< "No cell next to master patch face " << facei
<< ". Global face no: " << mfc[facei]
<< " own: " << own[masterPatchFaces[facei]]
<< " nei: " << nei[masterPatchFaces[facei]]
<< " flip: " << masterFlip[facei] << endl;
}
}
forAll(sfc, faceI)
forAll(sfc, facei)
{
if (sfc[faceI] < 0)
if (sfc[facei] < 0)
{
Pout<< "No cell next to slave patch face " << faceI
<< ". Global face no: " << sfc[faceI]
<< " own: " << own[slavePatchFaces[faceI]]
<< " nei: " << nei[slavePatchFaces[faceI]]
<< " flip: " << slaveFlip[faceI] << endl;
Pout<< "No cell next to slave patch face " << facei
<< ". Global face no: " << sfc[facei]
<< " own: " << own[slavePatchFaces[facei]]
<< " nei: " << nei[slavePatchFaces[facei]]
<< " flip: " << slaveFlip[facei] << endl;
}
}
}
@ -152,17 +152,17 @@ void Foam::slidingInterface::calcAttachedAddressing() const
{
const labelList& curFaces = pointFaces[masterMeshPoints[pointI]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Check if the face belongs to the master face zone;
// if not add it
if
(
faceZones.whichZone(curFaces[faceI])
faceZones.whichZone(curFaces[facei])
!= masterFaceZoneID_.index()
)
{
masterStickOutFaceMap.insert(curFaces[faceI]);
masterStickOutFaceMap.insert(curFaces[facei]);
}
}
}
@ -181,17 +181,17 @@ void Foam::slidingInterface::calcAttachedAddressing() const
{
const labelList& curFaces = pointFaces[slaveMeshPoints[pointI]];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
// Check if the face belongs to the slave face zone;
// if not add it
if
(
faceZones.whichZone(curFaces[faceI])
faceZones.whichZone(curFaces[facei])
!= slaveFaceZoneID_.index()
)
{
slaveStickOutFaceMap.insert(curFaces[faceI]);
slaveStickOutFaceMap.insert(curFaces[facei]);
}
}
}
@ -265,13 +265,13 @@ void Foam::slidingInterface::renumberAttachedAddressing
const labelList& mfzRenumber =
m.faceZoneFaceMap()[masterFaceZoneID_.index()];
forAll(mfc, faceI)
forAll(mfc, facei)
{
label newCellI = reverseCellMap[mfc[mfzRenumber[faceI]]];
label newCellI = reverseCellMap[mfc[mfzRenumber[facei]]];
if (newCellI >= 0)
{
newMfc[faceI] = newCellI;
newMfc[facei] = newCellI;
}
}
@ -282,13 +282,13 @@ void Foam::slidingInterface::renumberAttachedAddressing
const labelList& sfzRenumber =
m.faceZoneFaceMap()[slaveFaceZoneID_.index()];
forAll(sfc, faceI)
forAll(sfc, facei)
{
label newCellI = reverseCellMap[sfc[sfzRenumber[faceI]]];
label newCellI = reverseCellMap[sfc[sfzRenumber[facei]]];
if (newCellI >= 0)
{
newSfc[faceI] = newCellI;
newSfc[facei] = newCellI;
}
}
@ -315,13 +315,13 @@ void Foam::slidingInterface::renumberAttachedAddressing
labelList* newMsofPtr = new labelList(msof.size(), -1);
labelList& newMsof = *newMsofPtr;
forAll(msof, faceI)
forAll(msof, facei)
{
label newFaceI = reverseFaceMap[msof[faceI]];
label newFaceI = reverseFaceMap[msof[facei]];
if (newFaceI >= 0)
{
newMsof[faceI] = newFaceI;
newMsof[facei] = newFaceI;
}
}
// Pout<< "newMsof: " << newMsof << endl;
@ -331,13 +331,13 @@ void Foam::slidingInterface::renumberAttachedAddressing
labelList* newSsofPtr = new labelList(ssof.size(), -1);
labelList& newSsof = *newSsofPtr;
forAll(ssof, faceI)
forAll(ssof, facei)
{
label newFaceI = reverseFaceMap[ssof[faceI]];
label newFaceI = reverseFaceMap[ssof[facei]];
if (newFaceI >= 0)
{
newSsof[faceI] = newFaceI;
newSsof[facei] = newFaceI;
}
}
// Pout<< "newSsof: " << newSsof << endl;

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
@ -60,9 +60,9 @@ void Foam::slidingInterface::clearCouple
const labelList& cutFaceZoneLabels =
mesh.faceZones()[cutFaceZoneID_.index()];
forAll(cutFaceZoneLabels, faceI)
forAll(cutFaceZoneLabels, facei)
{
ref.setAction(polyRemoveFace(cutFaceZoneLabels[faceI]));
ref.setAction(polyRemoveFace(cutFaceZoneLabels[facei]));
}
if (debug)

View File

@ -151,12 +151,12 @@ bool Foam::slidingInterface::projectPoints() const
// Do faces
const labelList& curFaces = masterEdgeFaces[edgeI];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
minMasterFaceLength[curFaces[faceI]] =
minMasterFaceLength[curFaces[facei]] =
min
(
minMasterFaceLength[curFaces[faceI]],
minMasterFaceLength[curFaces[facei]],
curLength
);
}
@ -194,12 +194,12 @@ bool Foam::slidingInterface::projectPoints() const
// Do faces
const labelList& curFaces = slaveEdgeFaces[edgeI];
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
minSlaveFaceLength[curFaces[faceI]] =
minSlaveFaceLength[curFaces[facei]] =
min
(
minSlaveFaceLength[curFaces[faceI]],
minSlaveFaceLength[curFaces[facei]],
curLength
);
}
@ -889,9 +889,9 @@ bool Foam::slidingInterface::projectPoints() const
const labelList curFaces = curFaceMap.toc();
// Pout<< "curFaces: " << curFaces << endl;
forAll(curFaces, faceI)
forAll(curFaces, facei)
{
const face& f = masterLocalFaces[curFaces[faceI]];
const face& f = masterLocalFaces[curFaces[facei]];
forAll(f, pointI)
{