mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Standardized cell, patch and face loop index names
This commit is contained in:
@ -157,13 +157,13 @@ int main(int argc, char *argv[])
|
||||
// Assign all visited faces to current patch
|
||||
label nVisited = 0;
|
||||
|
||||
forAll(visited, faceI)
|
||||
forAll(visited, facei)
|
||||
{
|
||||
if (visited[faceI])
|
||||
if (visited[facei])
|
||||
{
|
||||
nVisited++;
|
||||
|
||||
patchIDs[faceI] = newPatchI;
|
||||
patchIDs[facei] = newPatchI;
|
||||
}
|
||||
}
|
||||
|
||||
@ -234,11 +234,11 @@ int main(int argc, char *argv[])
|
||||
// have to do the geometric stuff.
|
||||
const labelList& meshFace = bMesh.meshFace();
|
||||
|
||||
forAll(patchIDs, faceI)
|
||||
forAll(patchIDs, facei)
|
||||
{
|
||||
label meshFaceI = meshFace[faceI];
|
||||
label meshFaceI = meshFace[facei];
|
||||
|
||||
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[faceI]);
|
||||
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[facei]);
|
||||
}
|
||||
|
||||
polyMeshRepatcher.repatch();
|
||||
|
||||
@ -156,9 +156,9 @@ bool Foam::checkWedges
|
||||
// Check all non-wedge faces
|
||||
label nEdgesInError = 0;
|
||||
|
||||
forAll(fcs, faceI)
|
||||
forAll(fcs, facei)
|
||||
{
|
||||
const face& f = fcs[faceI];
|
||||
const face& f = fcs[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -200,7 +200,7 @@ bool Foam::checkWedges
|
||||
// Ok if purely in empty directions.
|
||||
if (nNonEmptyDirs > 0)
|
||||
{
|
||||
if (edgesInError.insert(edge(p0, p1), faceI))
|
||||
if (edgesInError.insert(edge(p0, p1), facei))
|
||||
{
|
||||
nEdgesInError++;
|
||||
}
|
||||
@ -209,7 +209,7 @@ bool Foam::checkWedges
|
||||
else if (nEmptyDirs > 1)
|
||||
{
|
||||
// Always an error
|
||||
if (edgesInError.insert(edge(p0, p1), faceI))
|
||||
if (edgesInError.insert(edge(p0, p1), facei))
|
||||
{
|
||||
nEdgesInError++;
|
||||
}
|
||||
@ -274,9 +274,9 @@ namespace Foam
|
||||
// lists of size cpp to transform.
|
||||
|
||||
List<pointField> newPts(pts.size());
|
||||
forAll(pts, faceI)
|
||||
forAll(pts, facei)
|
||||
{
|
||||
newPts[faceI].setSize(pts[faceI].size());
|
||||
newPts[facei].setSize(pts[facei].size());
|
||||
}
|
||||
|
||||
label index = 0;
|
||||
@ -286,12 +286,12 @@ namespace Foam
|
||||
|
||||
// Extract for every face the i'th position
|
||||
pointField ptsAtIndex(pts.size(), Zero);
|
||||
forAll(cpp, faceI)
|
||||
forAll(cpp, facei)
|
||||
{
|
||||
const pointField& facePts = pts[faceI];
|
||||
const pointField& facePts = pts[facei];
|
||||
if (facePts.size() > index)
|
||||
{
|
||||
ptsAtIndex[faceI] = facePts[index];
|
||||
ptsAtIndex[facei] = facePts[index];
|
||||
n++;
|
||||
}
|
||||
}
|
||||
@ -306,12 +306,12 @@ namespace Foam
|
||||
cpp.transformPosition(ptsAtIndex);
|
||||
|
||||
// Extract back from ptsAtIndex into newPts
|
||||
forAll(cpp, faceI)
|
||||
forAll(cpp, facei)
|
||||
{
|
||||
pointField& facePts = newPts[faceI];
|
||||
pointField& facePts = newPts[facei];
|
||||
if (facePts.size() > index)
|
||||
{
|
||||
facePts[index] = ptsAtIndex[faceI];
|
||||
facePts[index] = ptsAtIndex[facei];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -97,19 +97,19 @@ Foam::label Foam::checkTopology
|
||||
{
|
||||
cellSet cells(mesh, "illegalCells", mesh.nCells()/100);
|
||||
|
||||
forAll(mesh.cells(), cellI)
|
||||
forAll(mesh.cells(), celli)
|
||||
{
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
if (cFaces.size() <= 3)
|
||||
{
|
||||
cells.insert(cellI);
|
||||
cells.insert(celli);
|
||||
}
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
if (cFaces[i] < 0 || cFaces[i] >= mesh.nFaces())
|
||||
{
|
||||
cells.insert(cellI);
|
||||
cells.insert(celli);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -223,10 +223,10 @@ Foam::label Foam::checkTopology
|
||||
{
|
||||
labelList nInternalFaces(mesh.nCells(), 0);
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
nInternalFaces[mesh.faceOwner()[faceI]]++;
|
||||
nInternalFaces[mesh.faceNeighbour()[faceI]]++;
|
||||
nInternalFaces[mesh.faceOwner()[facei]]++;
|
||||
nInternalFaces[mesh.faceNeighbour()[facei]]++;
|
||||
}
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
forAll(patches, patchi)
|
||||
@ -245,15 +245,15 @@ Foam::label Foam::checkTopology
|
||||
cellSet oneCells(mesh, "oneInternalFaceCells", mesh.nCells()/100);
|
||||
cellSet twoCells(mesh, "twoInternalFacesCells", mesh.nCells()/100);
|
||||
|
||||
forAll(nInternalFaces, cellI)
|
||||
forAll(nInternalFaces, celli)
|
||||
{
|
||||
if (nInternalFaces[cellI] <= 1)
|
||||
if (nInternalFaces[celli] <= 1)
|
||||
{
|
||||
oneCells.insert(cellI);
|
||||
oneCells.insert(celli);
|
||||
}
|
||||
else if (nInternalFaces[cellI] == 2)
|
||||
else if (nInternalFaces[celli] == 2)
|
||||
{
|
||||
twoCells.insert(cellI);
|
||||
twoCells.insert(celli);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -97,36 +97,36 @@ void Foam::printMeshStats(const polyMesh& mesh, const bool allTopology)
|
||||
|
||||
Map<label> polyhedralFaces;
|
||||
|
||||
for (label cellI = 0; cellI < mesh.nCells(); cellI++)
|
||||
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||
{
|
||||
if (hex.isA(mesh, cellI))
|
||||
if (hex.isA(mesh, celli))
|
||||
{
|
||||
nHex++;
|
||||
}
|
||||
else if (tet.isA(mesh, cellI))
|
||||
else if (tet.isA(mesh, celli))
|
||||
{
|
||||
nTet++;
|
||||
}
|
||||
else if (pyr.isA(mesh, cellI))
|
||||
else if (pyr.isA(mesh, celli))
|
||||
{
|
||||
nPyr++;
|
||||
}
|
||||
else if (prism.isA(mesh, cellI))
|
||||
else if (prism.isA(mesh, celli))
|
||||
{
|
||||
nPrism++;
|
||||
}
|
||||
else if (wedge.isA(mesh, cellI))
|
||||
else if (wedge.isA(mesh, celli))
|
||||
{
|
||||
nWedge++;
|
||||
}
|
||||
else if (tetWedge.isA(mesh, cellI))
|
||||
else if (tetWedge.isA(mesh, celli))
|
||||
{
|
||||
nTetWedge++;
|
||||
}
|
||||
else
|
||||
{
|
||||
nUnknown++;
|
||||
polyhedralFaces(mesh.cells()[cellI].size())++;
|
||||
polyhedralFaces(mesh.cells()[celli].size())++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -110,7 +110,7 @@ void modifyOrAddFace
|
||||
(
|
||||
polyTopoChange& meshMod,
|
||||
const face& f,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label own,
|
||||
const bool flipFaceFlux,
|
||||
const label newPatchI,
|
||||
@ -120,7 +120,7 @@ void modifyOrAddFace
|
||||
PackedBoolList& modifiedFace
|
||||
)
|
||||
{
|
||||
if (!modifiedFace[faceI])
|
||||
if (!modifiedFace[facei])
|
||||
{
|
||||
// First usage of face. Modify.
|
||||
meshMod.setAction
|
||||
@ -128,7 +128,7 @@ void modifyOrAddFace
|
||||
polyModifyFace
|
||||
(
|
||||
f, // modified face
|
||||
faceI, // label of face
|
||||
facei, // label of face
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
flipFaceFlux, // face flip
|
||||
@ -138,7 +138,7 @@ void modifyOrAddFace
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
);
|
||||
modifiedFace[faceI] = 1;
|
||||
modifiedFace[facei] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -152,7 +152,7 @@ void modifyOrAddFace
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
faceI, // master face
|
||||
facei, // master face
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
zoneID, // zone for face
|
||||
@ -184,9 +184,9 @@ void createFaces
|
||||
// Pass 1. Do selected side of zone
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label zoneFaceI = fZone.whichFace(faceI);
|
||||
label zoneFaceI = fZone.whichFace(facei);
|
||||
|
||||
if (zoneFaceI != -1)
|
||||
{
|
||||
@ -196,9 +196,9 @@ void createFaces
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
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
|
||||
false, // face flip
|
||||
newMasterPatches[i], // patch for face
|
||||
fZone.index(), // zone for face
|
||||
@ -215,9 +215,9 @@ void createFaces
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
mesh.faces()[faceI].reverseFace(), // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceNeighbour()[faceI],// owner
|
||||
mesh.faces()[facei].reverseFace(), // modified face
|
||||
facei, // label of face
|
||||
mesh.faceNeighbour()[facei],// owner
|
||||
true, // face flip
|
||||
newMasterPatches[i], // patch for face
|
||||
fZone.index(), // zone for face
|
||||
@ -234,9 +234,9 @@ void createFaces
|
||||
// Pass 2. Do other side of zone
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label zoneFaceI = fZone.whichFace(faceI);
|
||||
label zoneFaceI = fZone.whichFace(facei);
|
||||
|
||||
if (zoneFaceI != -1)
|
||||
{
|
||||
@ -246,9 +246,9 @@ void createFaces
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
mesh.faces()[faceI].reverseFace(), // modified face
|
||||
faceI, // label of face
|
||||
mesh.faceNeighbour()[faceI], // owner
|
||||
mesh.faces()[facei].reverseFace(), // modified face
|
||||
facei, // label of face
|
||||
mesh.faceNeighbour()[facei], // owner
|
||||
true, // face flip
|
||||
newSlavePatches[i], // patch for face
|
||||
fZone.index(), // zone for face
|
||||
@ -262,9 +262,9 @@ void createFaces
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
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
|
||||
false, // face flip
|
||||
newSlavePatches[i], // patch for face
|
||||
fZone.index(), // zone for face
|
||||
@ -305,9 +305,9 @@ void createFaces
|
||||
{
|
||||
forAll(pp, i)
|
||||
{
|
||||
label faceI = pp.start()+i;
|
||||
label facei = pp.start()+i;
|
||||
|
||||
label zoneFaceI = fZone.whichFace(faceI);
|
||||
label zoneFaceI = fZone.whichFace(facei);
|
||||
|
||||
if (zoneFaceI != -1)
|
||||
{
|
||||
@ -328,9 +328,9 @@ void createFaces
|
||||
modifyOrAddFace
|
||||
(
|
||||
meshMod,
|
||||
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
|
||||
false, // face flip
|
||||
newPatchI, // patch for face
|
||||
fZone.index(), // zone for face
|
||||
@ -494,9 +494,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Add faces to faceZones
|
||||
labelList nFaces(mesh.faceZones().size(), 0);
|
||||
forAll(faceToZoneID, faceI)
|
||||
forAll(faceToZoneID, facei)
|
||||
{
|
||||
label zoneID = faceToZoneID[faceI];
|
||||
label zoneID = faceToZoneID[facei];
|
||||
if (zoneID != -1)
|
||||
{
|
||||
nFaces[zoneID]++;
|
||||
@ -512,13 +512,13 @@ int main(int argc, char *argv[])
|
||||
labelList addr(n);
|
||||
boolList flip(n);
|
||||
n = 0;
|
||||
forAll(faceToZoneID, faceI)
|
||||
forAll(faceToZoneID, facei)
|
||||
{
|
||||
label zone = faceToZoneID[faceI];
|
||||
label zone = faceToZoneID[facei];
|
||||
if (zone == zoneID)
|
||||
{
|
||||
addr[n] = faceI;
|
||||
flip[n] = faceToFlip[faceI];
|
||||
addr[n] = facei;
|
||||
flip[n] = faceToFlip[facei];
|
||||
n++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -94,11 +94,11 @@ void Foam::faceSelection::select
|
||||
{
|
||||
if (flip_)
|
||||
{
|
||||
forAll(faceToZoneID, faceI)
|
||||
forAll(faceToZoneID, facei)
|
||||
{
|
||||
if (faceToZoneID[faceI] == zoneID)
|
||||
if (faceToZoneID[facei] == zoneID)
|
||||
{
|
||||
faceToFlip[faceI] = !faceToFlip[faceI];
|
||||
faceToFlip[facei] = !faceToFlip[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -81,18 +81,18 @@ void Foam::faceSelections::faceZoneSelection::select
|
||||
|
||||
forAll(fZone, i)
|
||||
{
|
||||
label faceI = fZone[i];
|
||||
label facei = fZone[i];
|
||||
|
||||
if (faceToZoneID[faceI] == -1)
|
||||
if (faceToZoneID[facei] == -1)
|
||||
{
|
||||
faceToZoneID[faceI] = zoneID;
|
||||
faceToFlip[faceI] = fZone.flipMap()[i];
|
||||
faceToZoneID[facei] = zoneID;
|
||||
faceToFlip[facei] = fZone.flipMap()[i];
|
||||
}
|
||||
else if (faceToZoneID[faceI] != zoneID)
|
||||
else if (faceToZoneID[facei] != zoneID)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " already in faceZone "
|
||||
<< faceToZoneID[faceI]
|
||||
<< "Face " << facei << " already in faceZone "
|
||||
<< faceToZoneID[facei]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -98,10 +98,10 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
||||
pointField end(mesh_.nFaces());
|
||||
|
||||
// Internal faces
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
||||
end[faceI] = mesh_.cellCentres()[mesh_.faceNeighbour()[faceI]];
|
||||
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||
end[facei] = mesh_.cellCentres()[mesh_.faceNeighbour()[facei]];
|
||||
}
|
||||
|
||||
// Boundary faces
|
||||
@ -123,18 +123,18 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
||||
{
|
||||
forAll(pp, i)
|
||||
{
|
||||
label faceI = pp.start()+i;
|
||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
||||
end[faceI] = neighbourCellCentres[faceI-mesh_.nInternalFaces()];
|
||||
label facei = pp.start()+i;
|
||||
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||
end[facei] = neighbourCellCentres[facei-mesh_.nInternalFaces()];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(pp, i)
|
||||
{
|
||||
label faceI = pp.start()+i;
|
||||
start[faceI] = mesh_.cellCentres()[mesh_.faceOwner()[faceI]];
|
||||
end[faceI] = mesh_.faceCentres()[faceI];
|
||||
label facei = pp.start()+i;
|
||||
start[facei] = mesh_.cellCentres()[mesh_.faceOwner()[facei]];
|
||||
end[facei] = mesh_.faceCentres()[facei];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -146,13 +146,13 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
||||
|
||||
//- Note: do not select boundary faces.
|
||||
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
if (hits[faceI].hit())
|
||||
if (hits[facei].hit())
|
||||
{
|
||||
faceToZoneID[faceI] = zoneID;
|
||||
vector d = end[faceI]-start[faceI];
|
||||
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
|
||||
faceToZoneID[facei] = zoneID;
|
||||
vector d = end[facei]-start[facei];
|
||||
faceToFlip[facei] = ((normals[facei] & d) < 0);
|
||||
}
|
||||
}
|
||||
forAll(pbm, patchi)
|
||||
@ -163,12 +163,12 @@ void Foam::faceSelections::searchableSurfaceSelection::select
|
||||
{
|
||||
forAll(pp, i)
|
||||
{
|
||||
label faceI = pp.start()+i;
|
||||
if (hits[faceI].hit())
|
||||
label facei = pp.start()+i;
|
||||
if (hits[facei].hit())
|
||||
{
|
||||
faceToZoneID[faceI] = zoneID;
|
||||
vector d = end[faceI]-start[faceI];
|
||||
faceToFlip[faceI] = ((normals[faceI] & d) < 0);
|
||||
faceToZoneID[facei] = zoneID;
|
||||
vector d = end[facei]-start[facei];
|
||||
faceToFlip[facei] = ((normals[facei] & d) < 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -244,12 +244,12 @@ void dumpCyclicMatch(const fileName& prefix, const polyMesh& mesh)
|
||||
Pout<< "Dumping cyclic match as lines between face centres to "
|
||||
<< str.name() << endl;
|
||||
|
||||
forAll(cycPatch, faceI)
|
||||
forAll(cycPatch, facei)
|
||||
{
|
||||
const point& fc0 = mesh.faceCentres()[cycPatch.start()+faceI];
|
||||
const point& fc0 = mesh.faceCentres()[cycPatch.start()+facei];
|
||||
meshTools::writeOBJ(str, fc0);
|
||||
vertI++;
|
||||
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+faceI];
|
||||
const point& fc1 = mesh.faceCentres()[nbrPatch.start()+facei];
|
||||
meshTools::writeOBJ(str, fc1);
|
||||
vertI++;
|
||||
|
||||
@ -716,12 +716,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(patchFaces, i)
|
||||
{
|
||||
label faceI = patchFaces[i];
|
||||
label facei = patchFaces[i];
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face " << faceI << " specified in set "
|
||||
<< "Face " << facei << " specified in set "
|
||||
<< faces.name()
|
||||
<< " is not an external face of the mesh." << endl
|
||||
<< "This application can only repatch existing boundary"
|
||||
@ -731,7 +731,7 @@ int main(int argc, char *argv[])
|
||||
changePatchID
|
||||
(
|
||||
mesh,
|
||||
faceI,
|
||||
facei,
|
||||
destPatchI,
|
||||
meshMod
|
||||
);
|
||||
|
||||
@ -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
|
||||
@ -75,11 +75,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
boolList inside(querySurf.calcInside(mesh.cellCentres()));
|
||||
|
||||
forAll(inside, cellI)
|
||||
forAll(inside, celli)
|
||||
{
|
||||
if (inside[cellI])
|
||||
if (inside[celli])
|
||||
{
|
||||
insideCells.insert(cellI);
|
||||
insideCells.insert(celli);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -244,10 +244,10 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
cellZoneIndices[zoneI] = zoneIndex(cellZoneNames_, cz[zoneI].name());
|
||||
}
|
||||
|
||||
forAll(c, cellI)
|
||||
forAll(c, celli)
|
||||
{
|
||||
// Grab zone ID. If a cell is not in a zone, it will return -1
|
||||
zoneID = cz.whichZone(cellI);
|
||||
zoneID = cz.whichZone(celli);
|
||||
|
||||
if (zoneID >= 0)
|
||||
{
|
||||
@ -255,7 +255,7 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
zoneID = cellZoneIndices[zoneID];
|
||||
}
|
||||
|
||||
renumberCells[cellI] =
|
||||
renumberCells[celli] =
|
||||
meshMod_.setAction
|
||||
(
|
||||
polyAddCell
|
||||
@ -303,9 +303,9 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
label newOwn, newNei, newPatch, newZone;
|
||||
bool newZoneFlip;
|
||||
|
||||
forAll(f, faceI)
|
||||
forAll(f, facei)
|
||||
{
|
||||
const face& curFace = f[faceI];
|
||||
const face& curFace = f[facei];
|
||||
|
||||
face newFace(curFace.size());
|
||||
|
||||
@ -320,22 +320,22 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
if (min(newFace) < 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Error in point mapping for face " << faceI
|
||||
<< "Error in point mapping for face " << facei
|
||||
<< ". Old face: " << curFace << " New face: " << newFace
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
if (faceI < m.nInternalFaces() || faceI >= m.nFaces())
|
||||
if (facei < m.nInternalFaces() || facei >= m.nFaces())
|
||||
{
|
||||
newPatch = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
newPatch = patchIndices[bm.whichPatch(faceI)];
|
||||
newPatch = patchIndices[bm.whichPatch(facei)];
|
||||
}
|
||||
|
||||
newOwn = own[faceI];
|
||||
newOwn = own[facei];
|
||||
if (newOwn > -1) newOwn = renumberCells[newOwn];
|
||||
|
||||
if (newPatch > -1)
|
||||
@ -344,23 +344,23 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
}
|
||||
else
|
||||
{
|
||||
newNei = nei[faceI];
|
||||
newNei = nei[facei];
|
||||
newNei = renumberCells[newNei];
|
||||
}
|
||||
|
||||
|
||||
newZone = fz.whichZone(faceI);
|
||||
newZone = fz.whichZone(facei);
|
||||
newZoneFlip = false;
|
||||
|
||||
if (newZone >= 0)
|
||||
{
|
||||
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(faceI)];
|
||||
newZoneFlip = fz[newZone].flipMap()[fz[newZone].whichFace(facei)];
|
||||
|
||||
// Grab the new zone
|
||||
newZone = faceZoneIndices[newZone];
|
||||
}
|
||||
|
||||
renumberFaces[faceI] =
|
||||
renumberFaces[facei] =
|
||||
meshMod_.setAction
|
||||
(
|
||||
polyAddFace
|
||||
|
||||
@ -170,16 +170,16 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
|
||||
{
|
||||
if (duplicates[bFaceI] != -1)
|
||||
{
|
||||
label faceI = mesh.nInternalFaces() + bFaceI;
|
||||
label patchi = patches.whichPatch(faceI);
|
||||
label facei = mesh.nInternalFaces() + bFaceI;
|
||||
label patchi = patches.whichPatch(facei);
|
||||
|
||||
if (isA<processorPolyPatch>(patches[patchi]))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Duplicate face " << faceI
|
||||
<< "Duplicate face " << facei
|
||||
<< " is on a processorPolyPatch."
|
||||
<< "This is not allowed." << nl
|
||||
<< "Face:" << faceI
|
||||
<< "Face:" << facei
|
||||
<< " is on patch:" << patches[patchi].name()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -130,12 +130,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
|
||||
const labelUList& oldOwnerStart = lduAddr().ownerStartAddr();
|
||||
|
||||
forAll(newCellFaces, cellI)
|
||||
forAll(newCellFaces, celli)
|
||||
{
|
||||
labelList& curFaces = newCellFaces[cellI];
|
||||
labelList& curFaces = newCellFaces[celli];
|
||||
|
||||
const label s = oldOwnerStart[cellI];
|
||||
const label e = oldOwnerStart[cellI + 1];
|
||||
const label s = oldOwnerStart[celli];
|
||||
const label e = oldOwnerStart[celli + 1];
|
||||
|
||||
curFaces.setSize(e - s);
|
||||
|
||||
@ -171,12 +171,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
const labelUList& curFaceCells = curPatch.faceCells();
|
||||
const label curStart = curPatch.start();
|
||||
|
||||
forAll(curPatch, faceI)
|
||||
forAll(curPatch, facei)
|
||||
{
|
||||
// Find out if the mirrored face is identical to the
|
||||
// original. If so, the face needs to become internal and
|
||||
// added to its owner cell
|
||||
const face& origFace = curPatch[faceI];
|
||||
const face& origFace = curPatch[facei];
|
||||
|
||||
face mirrorFace(origFace.size());
|
||||
forAll(mirrorFace, pointI)
|
||||
@ -188,12 +188,12 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
{
|
||||
// The mirror is identical to current face. This will
|
||||
// become an internal face
|
||||
const label oldSize = newCellFaces[curFaceCells[faceI]].size();
|
||||
const label oldSize = newCellFaces[curFaceCells[facei]].size();
|
||||
|
||||
newCellFaces[curFaceCells[faceI]].setSize(oldSize + 1);
|
||||
newCellFaces[curFaceCells[faceI]][oldSize] = curStart + faceI;
|
||||
newCellFaces[curFaceCells[facei]].setSize(oldSize + 1);
|
||||
newCellFaces[curFaceCells[facei]][oldSize] = curStart + facei;
|
||||
|
||||
curInsBouFace[faceI] = true;
|
||||
curInsBouFace[facei] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -210,9 +210,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
label nNewFaces = 0;
|
||||
|
||||
// Insert original (internal) faces
|
||||
forAll(newCellFaces, cellI)
|
||||
forAll(newCellFaces, celli)
|
||||
{
|
||||
const labelList& curCellFaces = newCellFaces[cellI];
|
||||
const labelList& curCellFaces = newCellFaces[celli];
|
||||
|
||||
forAll(curCellFaces, cfI)
|
||||
{
|
||||
@ -224,9 +224,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
}
|
||||
|
||||
// Mirror internal faces
|
||||
for (label faceI = 0; faceI < nOldInternalFaces; faceI++)
|
||||
for (label facei = 0; facei < nOldInternalFaces; facei++)
|
||||
{
|
||||
const face& oldFace = oldFaces[faceI];
|
||||
const face& oldFace = oldFaces[facei];
|
||||
face& nf = newFaces[nNewFaces];
|
||||
nf.setSize(oldFace.size());
|
||||
|
||||
@ -237,7 +237,7 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
|
||||
}
|
||||
|
||||
mirrorFaceLookup[faceI] = nNewFaces;
|
||||
mirrorFaceLookup[facei] = nNewFaces;
|
||||
nNewFaces++;
|
||||
}
|
||||
|
||||
@ -258,27 +258,27 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
newPatchStarts[nNewPatches] = nNewFaces;
|
||||
|
||||
// Master side
|
||||
for (label faceI = 0; faceI < curPatchSize; faceI++)
|
||||
for (label facei = 0; facei < curPatchSize; facei++)
|
||||
{
|
||||
// Check if the face has already been added. If not, add it and
|
||||
// insert the numbering details.
|
||||
if (!curInserted[faceI])
|
||||
if (!curInserted[facei])
|
||||
{
|
||||
newFaces[nNewFaces] = oldFaces[curPatchStart + faceI];
|
||||
newFaces[nNewFaces] = oldFaces[curPatchStart + facei];
|
||||
|
||||
masterFaceLookup[curPatchStart + faceI] = nNewFaces;
|
||||
masterFaceLookup[curPatchStart + facei] = nNewFaces;
|
||||
nNewFaces++;
|
||||
}
|
||||
}
|
||||
|
||||
// Mirror side
|
||||
for (label faceI = 0; faceI < curPatchSize; faceI++)
|
||||
for (label facei = 0; facei < curPatchSize; facei++)
|
||||
{
|
||||
// Check if the face has already been added. If not, add it and
|
||||
// insert the numbering details.
|
||||
if (!curInserted[faceI])
|
||||
if (!curInserted[facei])
|
||||
{
|
||||
const face& oldFace = oldFaces[curPatchStart + faceI];
|
||||
const face& oldFace = oldFaces[curPatchStart + facei];
|
||||
face& nf = newFaces[nNewFaces];
|
||||
nf.setSize(oldFace.size());
|
||||
|
||||
@ -289,14 +289,14 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
nf[i] = mirrorPointLookup[oldFace[oldFace.size() - i]];
|
||||
}
|
||||
|
||||
mirrorFaceLookup[curPatchStart + faceI] = nNewFaces;
|
||||
mirrorFaceLookup[curPatchStart + facei] = nNewFaces;
|
||||
nNewFaces++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Grab the index of the master face for the mirror side
|
||||
mirrorFaceLookup[curPatchStart + faceI] =
|
||||
masterFaceLookup[curPatchStart + faceI];
|
||||
mirrorFaceLookup[curPatchStart + facei] =
|
||||
masterFaceLookup[curPatchStart + facei];
|
||||
}
|
||||
}
|
||||
|
||||
@ -330,9 +330,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
label nNewCells = 0;
|
||||
|
||||
// Grab the original cells. Take care of face renumbering.
|
||||
forAll(oldCells, cellI)
|
||||
forAll(oldCells, celli)
|
||||
{
|
||||
const cell& oc = oldCells[cellI];
|
||||
const cell& oc = oldCells[celli];
|
||||
|
||||
cell& nc = newCells[nNewCells];
|
||||
nc.setSize(oc.size());
|
||||
@ -346,9 +346,9 @@ Foam::mirrorFvMesh::mirrorFvMesh(const IOobject& io)
|
||||
}
|
||||
|
||||
// Mirror the cells
|
||||
forAll(oldCells, cellI)
|
||||
forAll(oldCells, celli)
|
||||
{
|
||||
const cell& oc = oldCells[cellI];
|
||||
const cell& oc = oldCells[celli];
|
||||
|
||||
cell& nc = newCells[nNewCells];
|
||||
nc.setSize(oc.size());
|
||||
|
||||
@ -99,9 +99,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
label nProtected = 0;
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label meshFaceI = faceLabels[faceI];
|
||||
const label meshFaceI = faceLabels[facei];
|
||||
const label patchi = bm.whichPatch(meshFaceI);
|
||||
|
||||
if
|
||||
@ -112,7 +112,7 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
{
|
||||
// Slave side. Mark so doesn't get visited.
|
||||
allFaceInfo[faceI] = orientedSurface::NOFLIP;
|
||||
allFaceInfo[facei] = orientedSurface::NOFLIP;
|
||||
nProtected++;
|
||||
}
|
||||
}
|
||||
@ -125,13 +125,13 @@ int main(int argc, char *argv[])
|
||||
// Number of (master)faces per edge
|
||||
labelList nMasterFaces(patch.nEdges(), 0);
|
||||
|
||||
forAll(faceLabels, faceI)
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label meshFaceI = faceLabels[faceI];
|
||||
const label meshFaceI = faceLabels[facei];
|
||||
|
||||
if (isMasterFace[meshFaceI])
|
||||
{
|
||||
const labelList& fEdges = patch.faceEdges()[faceI];
|
||||
const labelList& fEdges = patch.faceEdges()[facei];
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
nMasterFaces[fEdges[fEdgeI]]++;
|
||||
@ -184,11 +184,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// Pick an unset face
|
||||
label unsetFaceI = labelMax;
|
||||
forAll(allFaceInfo, faceI)
|
||||
forAll(allFaceInfo, facei)
|
||||
{
|
||||
if (allFaceInfo[faceI] == orientedSurface::UNVISITED)
|
||||
if (allFaceInfo[facei] == orientedSurface::UNVISITED)
|
||||
{
|
||||
unsetFaceI = globalFaces.toGlobal(faceI);
|
||||
unsetFaceI = globalFaces.toGlobal(facei);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -347,25 +347,25 @@ int main(int argc, char *argv[])
|
||||
|
||||
boolList newFlipMap(allFaceInfo.size(), false);
|
||||
label nChanged = 0;
|
||||
forAll(allFaceInfo, faceI)
|
||||
forAll(allFaceInfo, facei)
|
||||
{
|
||||
if (allFaceInfo[faceI] == orientedSurface::NOFLIP)
|
||||
if (allFaceInfo[facei] == orientedSurface::NOFLIP)
|
||||
{
|
||||
newFlipMap[faceI] = false;
|
||||
newFlipMap[facei] = false;
|
||||
}
|
||||
else if (allFaceInfo[faceI] == orientedSurface::FLIP)
|
||||
else if (allFaceInfo[facei] == orientedSurface::FLIP)
|
||||
{
|
||||
newFlipMap[faceI] = true;
|
||||
newFlipMap[facei] = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem : unvisited face " << faceI
|
||||
<< " centre:" << mesh.faceCentres()[faceLabels[faceI]]
|
||||
<< "Problem : unvisited face " << facei
|
||||
<< " centre:" << mesh.faceCentres()[faceLabels[facei]]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (fZone.flipMap()[faceI] != newFlipMap[faceI])
|
||||
if (fZone.flipMap()[facei] != newFlipMap[facei])
|
||||
{
|
||||
nChanged++;
|
||||
}
|
||||
|
||||
@ -102,9 +102,9 @@ void Foam::meshDualiser::dumpPolyTopoChange
|
||||
|
||||
const DynamicList<face>& faces = meshMod.faces();
|
||||
|
||||
forAll(faces, faceI)
|
||||
forAll(faces, facei)
|
||||
{
|
||||
const face& f = faces[faceI];
|
||||
const face& f = faces[facei];
|
||||
|
||||
str1<< 'f';
|
||||
forAll(f, fp)
|
||||
@ -125,7 +125,7 @@ void Foam::meshDualiser::dumpPolyTopoChange
|
||||
|
||||
Foam::label Foam::meshDualiser::findDualCell
|
||||
(
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label pointI
|
||||
) const
|
||||
{
|
||||
@ -137,7 +137,7 @@ Foam::label Foam::meshDualiser::findDualCell
|
||||
}
|
||||
else
|
||||
{
|
||||
label index = findIndex(mesh_.pointCells()[pointI], cellI);
|
||||
label index = findIndex(mesh_.pointCells()[pointI], celli);
|
||||
|
||||
return dualCells[index];
|
||||
}
|
||||
@ -177,19 +177,19 @@ void Foam::meshDualiser::generateDualBoundaryEdges
|
||||
// sides.
|
||||
bool Foam::meshDualiser::sameDualCell
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label pointI
|
||||
) const
|
||||
{
|
||||
if (!mesh_.isInternalFace(faceI))
|
||||
if (!mesh_.isInternalFace(facei))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "face:" << faceI << " is not internal face."
|
||||
<< "face:" << facei << " is not internal face."
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
return findDualCell(own, pointI) == findDualCell(nei, pointI);
|
||||
}
|
||||
@ -436,19 +436,19 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
|
||||
while (true)
|
||||
{
|
||||
label faceI = ie.faceLabel();
|
||||
label facei = ie.faceLabel();
|
||||
|
||||
// Mark face as visited.
|
||||
doneEFaces[findIndex(eFaces, faceI)] = true;
|
||||
doneEFaces[findIndex(eFaces, facei)] = true;
|
||||
|
||||
if (faceToDualPoint_[faceI] != -1)
|
||||
if (faceToDualPoint_[facei] != -1)
|
||||
{
|
||||
verts.append(faceToDualPoint_[faceI]);
|
||||
verts.append(faceToDualPoint_[facei]);
|
||||
}
|
||||
|
||||
label cellI = ie.cellLabel();
|
||||
label celli = ie.cellLabel();
|
||||
|
||||
if (cellI == -1)
|
||||
if (celli == -1)
|
||||
{
|
||||
// At ending boundary face. We've stored the face point above
|
||||
// so this is the whole face.
|
||||
@ -456,8 +456,8 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
}
|
||||
|
||||
|
||||
label dualCell0 = findDualCell(cellI, e[0]);
|
||||
label dualCell1 = findDualCell(cellI, e[1]);
|
||||
label dualCell0 = findDualCell(celli, e[0]);
|
||||
label dualCell1 = findDualCell(celli, e[1]);
|
||||
|
||||
// Generate face. (always if splitFace=true; only if needed to
|
||||
// separate cells otherwise)
|
||||
@ -492,15 +492,15 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
{
|
||||
verts.append(edgeToDualPoint_[edgeI]);
|
||||
}
|
||||
if (faceToDualPoint_[faceI] != -1)
|
||||
if (faceToDualPoint_[facei] != -1)
|
||||
{
|
||||
verts.append(faceToDualPoint_[faceI]);
|
||||
verts.append(faceToDualPoint_[facei]);
|
||||
}
|
||||
}
|
||||
|
||||
if (cellToDualPoint_[cellI] != -1)
|
||||
if (cellToDualPoint_[celli] != -1)
|
||||
{
|
||||
verts.append(cellToDualPoint_[cellI]);
|
||||
verts.append(cellToDualPoint_[celli]);
|
||||
}
|
||||
|
||||
++ie;
|
||||
@ -537,22 +537,22 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
}
|
||||
|
||||
|
||||
// Walks around circumference of faceI. Creates single face. Gets given
|
||||
// Walks around circumference of facei. Creates single face. Gets given
|
||||
// starting (feature) edge to start from. Returns ending edge. (all edges
|
||||
// in form of index in faceEdges)
|
||||
void Foam::meshDualiser::createFaceFromInternalFace
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
label& fp,
|
||||
polyTopoChange& meshMod
|
||||
) const
|
||||
{
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||
label own = mesh_.faceOwner()[faceI];
|
||||
label nei = mesh_.faceNeighbour()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||
label own = mesh_.faceOwner()[facei];
|
||||
label nei = mesh_.faceNeighbour()[facei];
|
||||
|
||||
//Pout<< "createFaceFromInternalFace : At face:" << faceI
|
||||
//Pout<< "createFaceFromInternalFace : At face:" << facei
|
||||
// << " verts:" << f
|
||||
// << " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||
// << " started walking at edge:" << fEdges[fp]
|
||||
@ -563,7 +563,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
||||
// Walk and collect face.
|
||||
DynamicList<label> verts(100);
|
||||
|
||||
verts.append(faceToDualPoint_[faceI]);
|
||||
verts.append(faceToDualPoint_[facei]);
|
||||
verts.append(edgeToDualPoint_[fEdges[fp]]);
|
||||
|
||||
// Step to vertex after edge mid
|
||||
@ -602,7 +602,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
||||
if (edgeToDualPoint_[edgeI] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "face:" << faceI << " verts:" << f
|
||||
<< "face:" << facei << " verts:" << f
|
||||
<< " points:" << UIndirectList<point>(mesh_.points(), f)()
|
||||
<< " no feature edge between " << f[fp]
|
||||
<< " and " << f[nextFp] << " although have different"
|
||||
@ -621,7 +621,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
||||
(
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
faceI, // masterFaceI
|
||||
facei, // masterFaceI
|
||||
true, // edgeOrder,
|
||||
currentDualCell0,
|
||||
currentDualCell1,
|
||||
@ -660,13 +660,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
// pointFaces.
|
||||
|
||||
// Starting face
|
||||
label faceI = startFaceI;
|
||||
label facei = startFaceI;
|
||||
|
||||
DynamicList<label> verts(4);
|
||||
|
||||
while (true)
|
||||
{
|
||||
label index = findIndex(pFaces, faceI-pp.start());
|
||||
label index = findIndex(pFaces, facei-pp.start());
|
||||
|
||||
// Has face been visited already?
|
||||
if (donePFaces[index])
|
||||
@ -676,15 +676,15 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
donePFaces[index] = true;
|
||||
|
||||
// Insert face centre
|
||||
verts.append(faceToDualPoint_[faceI]);
|
||||
verts.append(faceToDualPoint_[facei]);
|
||||
|
||||
label dualCellI = findDualCell(own[faceI], pointI);
|
||||
label dualCellI = findDualCell(own[facei], pointI);
|
||||
|
||||
// Get the edge before the patchPointI
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
label fp = findIndex(f, pointI);
|
||||
label prevFp = f.rcIndex(fp);
|
||||
label edgeI = mesh_.faceEdges()[faceI][prevFp];
|
||||
label edgeI = mesh_.faceEdges()[facei][prevFp];
|
||||
|
||||
if (edgeToDualPoint_[edgeI] != -1)
|
||||
{
|
||||
@ -695,7 +695,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
edgeFaceCirculator circ
|
||||
(
|
||||
mesh_,
|
||||
faceI,
|
||||
facei,
|
||||
true, // ownerSide
|
||||
prevFp, // index of edge in face
|
||||
true // isBoundaryEdge
|
||||
@ -708,20 +708,20 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
while (mesh_.isInternalFace(circ.faceLabel()));
|
||||
|
||||
// Step to next face
|
||||
faceI = circ.faceLabel();
|
||||
facei = circ.faceLabel();
|
||||
|
||||
if (faceI < pp.start() || faceI >= pp.start()+pp.size())
|
||||
if (facei < pp.start() || facei >= pp.start()+pp.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Walked from face on patch:" << patchi
|
||||
<< " to face:" << faceI
|
||||
<< " fc:" << mesh_.faceCentres()[faceI]
|
||||
<< " on patch:" << patches.whichPatch(faceI)
|
||||
<< " to face:" << facei
|
||||
<< " fc:" << mesh_.faceCentres()[facei]
|
||||
<< " on patch:" << patches.whichPatch(facei)
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Check if different cell.
|
||||
if (dualCellI != findDualCell(own[faceI], pointI))
|
||||
if (dualCellI != findDualCell(own[facei], pointI))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Different dual cells but no feature edge"
|
||||
@ -733,7 +733,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
|
||||
verts.shrink();
|
||||
|
||||
label dualCellI = findDualCell(own[faceI], pointI);
|
||||
label dualCellI = findDualCell(own[facei], pointI);
|
||||
|
||||
//Bit dodgy: create dualface from the last face (instead of from
|
||||
// the central point). This will also use the original faceZone to
|
||||
@ -744,7 +744,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
//pointI, // masterPointI
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
faceI, // masterFaceI
|
||||
facei, // masterFaceI
|
||||
dualCellI,
|
||||
patchi,
|
||||
verts,
|
||||
@ -753,17 +753,17 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
}
|
||||
else
|
||||
{
|
||||
label faceI = startFaceI;
|
||||
label facei = startFaceI;
|
||||
|
||||
// Storage for face
|
||||
DynamicList<label> verts(mesh_.faces()[faceI].size());
|
||||
DynamicList<label> verts(mesh_.faces()[facei].size());
|
||||
|
||||
// Starting point.
|
||||
verts.append(pointToDualPoint_[pointI]);
|
||||
|
||||
// Find edge between pointI and next point on face.
|
||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||
label nextEdgeI = fEdges[findIndex(mesh_.faces()[faceI], pointI)];
|
||||
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||
label nextEdgeI = fEdges[findIndex(mesh_.faces()[facei], pointI)];
|
||||
if (edgeToDualPoint_[nextEdgeI] != -1)
|
||||
{
|
||||
verts.append(edgeToDualPoint_[nextEdgeI]);
|
||||
@ -771,7 +771,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
|
||||
do
|
||||
{
|
||||
label index = findIndex(pFaces, faceI-pp.start());
|
||||
label index = findIndex(pFaces, facei-pp.start());
|
||||
|
||||
// Has face been visited already?
|
||||
if (donePFaces[index])
|
||||
@ -781,11 +781,11 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
donePFaces[index] = true;
|
||||
|
||||
// Face centre
|
||||
verts.append(faceToDualPoint_[faceI]);
|
||||
verts.append(faceToDualPoint_[facei]);
|
||||
|
||||
// Find edge before pointI on faceI
|
||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
// Find edge before pointI on facei
|
||||
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
label prevFp = f.rcIndex(findIndex(f, pointI));
|
||||
label edgeI = fEdges[prevFp];
|
||||
|
||||
@ -798,8 +798,8 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
(
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
faceI, // masterFaceI
|
||||
findDualCell(own[faceI], pointI),
|
||||
facei, // masterFaceI
|
||||
findDualCell(own[facei], pointI),
|
||||
patchi,
|
||||
verts.shrink(),
|
||||
meshMod
|
||||
@ -814,7 +814,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
edgeFaceCirculator circ
|
||||
(
|
||||
mesh_,
|
||||
faceI,
|
||||
facei,
|
||||
true, // ownerSide
|
||||
prevFp, // index of edge in face
|
||||
true // isBoundaryEdge
|
||||
@ -827,13 +827,13 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
while (mesh_.isInternalFace(circ.faceLabel()));
|
||||
|
||||
// Step to next face. Quit if not on same patch.
|
||||
faceI = circ.faceLabel();
|
||||
facei = circ.faceLabel();
|
||||
}
|
||||
while
|
||||
(
|
||||
faceI != startFaceI
|
||||
&& faceI >= pp.start()
|
||||
&& faceI < pp.start()+pp.size()
|
||||
facei != startFaceI
|
||||
&& facei >= pp.start()
|
||||
&& facei < pp.start()+pp.size()
|
||||
);
|
||||
|
||||
if (verts.size() > 2)
|
||||
@ -844,7 +844,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
startFaceI, // masterFaceI
|
||||
findDualCell(own[faceI], pointI),
|
||||
findDualCell(own[facei], pointI),
|
||||
patchi,
|
||||
verts.shrink(),
|
||||
meshMod
|
||||
@ -887,9 +887,9 @@ void Foam::meshDualiser::setRefinement
|
||||
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
||||
// facility instead)
|
||||
PackedBoolList isBoundaryEdge(mesh_.nEdges());
|
||||
for (label faceI = mesh_.nInternalFaces(); faceI < mesh_.nFaces(); faceI++)
|
||||
for (label facei = mesh_.nInternalFaces(); facei < mesh_.nFaces(); facei++)
|
||||
{
|
||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||
const labelList& fEdges = mesh_.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, i)
|
||||
{
|
||||
@ -912,15 +912,15 @@ void Foam::meshDualiser::setRefinement
|
||||
{
|
||||
featureFaceSet[featureFaces[i]] = true;
|
||||
}
|
||||
label faceI = findIndex(featureFaceSet, false);
|
||||
label facei = findIndex(featureFaceSet, false);
|
||||
|
||||
if (faceI != -1)
|
||||
if (facei != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "In split-face-mode (splitFace=true) but not all faces"
|
||||
<< " marked as feature faces." << endl
|
||||
<< "First conflicting face:" << faceI
|
||||
<< " centre:" << mesh_.faceCentres()[faceI]
|
||||
<< "First conflicting face:" << facei
|
||||
<< " centre:" << mesh_.faceCentres()[facei]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -954,18 +954,18 @@ void Foam::meshDualiser::setRefinement
|
||||
}
|
||||
for
|
||||
(
|
||||
label faceI = mesh_.nInternalFaces();
|
||||
faceI < mesh_.nFaces();
|
||||
faceI++
|
||||
label facei = mesh_.nInternalFaces();
|
||||
facei < mesh_.nFaces();
|
||||
facei++
|
||||
)
|
||||
{
|
||||
if (!featureFaceSet[faceI])
|
||||
if (!featureFaceSet[facei])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Not all boundary faces marked as feature faces."
|
||||
<< endl
|
||||
<< "First conflicting face:" << faceI
|
||||
<< " centre:" << mesh_.faceCentres()[faceI]
|
||||
<< "First conflicting face:" << facei
|
||||
<< " centre:" << mesh_.faceCentres()[facei]
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1116,12 +1116,12 @@ void Foam::meshDualiser::setRefinement
|
||||
// Dual points (from cell centres, feature faces, feature edges)
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
forAll(cellToDualPoint_, cellI)
|
||||
forAll(cellToDualPoint_, celli)
|
||||
{
|
||||
cellToDualPoint_[cellI] = meshMod.addPoint
|
||||
cellToDualPoint_[celli] = meshMod.addPoint
|
||||
(
|
||||
cellCentres[cellI],
|
||||
mesh_.faces()[mesh_.cells()[cellI][0]][0], // masterPoint
|
||||
cellCentres[celli],
|
||||
mesh_.faces()[mesh_.cells()[celli][0]][0], // masterPoint
|
||||
-1, // zoneID
|
||||
true // inCell
|
||||
);
|
||||
@ -1131,12 +1131,12 @@ void Foam::meshDualiser::setRefinement
|
||||
|
||||
forAll(featureFaces, i)
|
||||
{
|
||||
label faceI = featureFaces[i];
|
||||
label facei = featureFaces[i];
|
||||
|
||||
faceToDualPoint_[faceI] = meshMod.addPoint
|
||||
faceToDualPoint_[facei] = meshMod.addPoint
|
||||
(
|
||||
mesh_.faceCentres()[faceI],
|
||||
mesh_.faces()[faceI][0], // masterPoint
|
||||
mesh_.faceCentres()[facei],
|
||||
mesh_.faces()[facei][0], // masterPoint
|
||||
-1, // zoneID
|
||||
true // inCell
|
||||
);
|
||||
@ -1144,22 +1144,22 @@ void Foam::meshDualiser::setRefinement
|
||||
// Detect whether different dual cells on either side of a face. This
|
||||
// would neccesitate having a dual face built from the face and thus a
|
||||
// dual point at the face centre.
|
||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh_.nInternalFaces(); facei++)
|
||||
{
|
||||
if (faceToDualPoint_[faceI] == -1)
|
||||
if (faceToDualPoint_[facei] == -1)
|
||||
{
|
||||
const face& f = mesh_.faces()[faceI];
|
||||
const face& f = mesh_.faces()[facei];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
label ownDualCell = findDualCell(own[faceI], f[fp]);
|
||||
label neiDualCell = findDualCell(nei[faceI], f[fp]);
|
||||
label ownDualCell = findDualCell(own[facei], f[fp]);
|
||||
label neiDualCell = findDualCell(nei[facei], f[fp]);
|
||||
|
||||
if (ownDualCell != neiDualCell)
|
||||
{
|
||||
faceToDualPoint_[faceI] = meshMod.addPoint
|
||||
faceToDualPoint_[facei] = meshMod.addPoint
|
||||
(
|
||||
mesh_.faceCentres()[faceI],
|
||||
mesh_.faceCentres()[facei],
|
||||
f[fp], // masterPoint
|
||||
-1, // zoneID
|
||||
true // inCell
|
||||
@ -1332,12 +1332,12 @@ void Foam::meshDualiser::setRefinement
|
||||
// - multiple cells: create single face between unique cell pair. Only
|
||||
// create face where cells differ on either side.
|
||||
// - non-feature face : inbetween cell zones.
|
||||
forAll(faceToDualPoint_, faceI)
|
||||
forAll(faceToDualPoint_, facei)
|
||||
{
|
||||
if (faceToDualPoint_[faceI] != -1 && mesh_.isInternalFace(faceI))
|
||||
if (faceToDualPoint_[facei] != -1 && mesh_.isInternalFace(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];
|
||||
|
||||
// Starting edge
|
||||
label fp = 0;
|
||||
@ -1353,7 +1353,7 @@ void Foam::meshDualiser::setRefinement
|
||||
if
|
||||
(
|
||||
edgeToDualPoint_[fEdges[fp]] != -1
|
||||
&& !sameDualCell(faceI, f.nextLabel(fp))
|
||||
&& !sameDualCell(facei, f.nextLabel(fp))
|
||||
)
|
||||
{
|
||||
foundStart = true;
|
||||
@ -1371,7 +1371,7 @@ void Foam::meshDualiser::setRefinement
|
||||
// Walk from edge fp and generate a face.
|
||||
createFaceFromInternalFace
|
||||
(
|
||||
faceI,
|
||||
facei,
|
||||
fp,
|
||||
meshMod
|
||||
);
|
||||
|
||||
@ -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
|
||||
@ -94,7 +94,7 @@ class meshDualiser
|
||||
static void dumpPolyTopoChange(const polyTopoChange&, const fileName&);
|
||||
|
||||
//- Find dual cell given point and cell
|
||||
label findDualCell(const label cellI, const label pointI) const;
|
||||
label findDualCell(const label celli, const label pointI) const;
|
||||
|
||||
//- Helper function to generate dualpoints on all boundary edges
|
||||
// emanating from (boundary & feature) point
|
||||
@ -108,7 +108,7 @@ class meshDualiser
|
||||
//- Check that owner and neighbour of face have same dual cell
|
||||
bool sameDualCell
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label pointI
|
||||
) const;
|
||||
|
||||
@ -153,7 +153,7 @@ class meshDualiser
|
||||
//- Create single internal face from internal face
|
||||
void createFaceFromInternalFace
|
||||
(
|
||||
const label faceI,
|
||||
const label facei,
|
||||
label& fp,
|
||||
polyTopoChange&
|
||||
) const;
|
||||
|
||||
@ -234,9 +234,9 @@ void simpleMarkFeatures
|
||||
// Face centres that need inclusion in the dual mesh
|
||||
labelHashSet featureFaceSet(mesh.nFaces()-mesh.nInternalFaces());
|
||||
// A. boundary faces.
|
||||
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
|
||||
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
featureFaceSet.insert(faceI);
|
||||
featureFaceSet.insert(facei);
|
||||
}
|
||||
|
||||
// B. face zones.
|
||||
@ -270,11 +270,11 @@ void simpleMarkFeatures
|
||||
|
||||
forAll(fz, i)
|
||||
{
|
||||
label faceI = fz[i];
|
||||
const face& f = mesh.faces()[faceI];
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
label facei = fz[i];
|
||||
const face& f = mesh.faces()[facei];
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
featureFaceSet.insert(faceI);
|
||||
featureFaceSet.insert(facei);
|
||||
forAll(f, fp)
|
||||
{
|
||||
// Mark point as multi cell point (since both sides of
|
||||
@ -385,9 +385,9 @@ int main(int argc, char *argv[])
|
||||
// (Note: in 1.4.2 we can use the built-in mesh point ordering
|
||||
// facility instead)
|
||||
PackedBoolList isBoundaryEdge(mesh.nEdges());
|
||||
for (label faceI = mesh.nInternalFaces(); faceI < mesh.nFaces(); faceI++)
|
||||
for (label facei = mesh.nInternalFaces(); facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, i)
|
||||
{
|
||||
|
||||
@ -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
|
||||
@ -240,9 +240,9 @@ int main(int argc, char *argv[])
|
||||
// Select all cells
|
||||
refCells.setSize(mesh.nCells());
|
||||
|
||||
forAll(mesh.cells(), cellI)
|
||||
forAll(mesh.cells(), celli)
|
||||
{
|
||||
refCells[cellI] = cellI;
|
||||
refCells[celli] = celli;
|
||||
}
|
||||
|
||||
if (mesh.nGeometricD() == 3)
|
||||
|
||||
@ -86,9 +86,9 @@ tmp<volScalarField> createScalarField
|
||||
);
|
||||
volScalarField& fld = tfld.ref();
|
||||
|
||||
forAll(fld, cellI)
|
||||
forAll(fld, celli)
|
||||
{
|
||||
fld[cellI] = elems[cellI];
|
||||
fld[celli] = elems[celli];
|
||||
}
|
||||
|
||||
return tfld;
|
||||
@ -100,9 +100,9 @@ label getBand(const labelList& owner, const labelList& neighbour)
|
||||
{
|
||||
label band = 0;
|
||||
|
||||
forAll(neighbour, faceI)
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
label diff = neighbour[faceI] - owner[faceI];
|
||||
label diff = neighbour[facei] - owner[facei];
|
||||
|
||||
if (diff > band)
|
||||
{
|
||||
@ -128,10 +128,10 @@ void getBand
|
||||
labelList cellBandwidth(nCells, 0);
|
||||
scalarField nIntersect(nCells, 0.0);
|
||||
|
||||
forAll(neighbour, faceI)
|
||||
forAll(neighbour, facei)
|
||||
{
|
||||
label own = owner[faceI];
|
||||
label nei = neighbour[faceI];
|
||||
label own = owner[facei];
|
||||
label nei = neighbour[facei];
|
||||
|
||||
// Note: mag not necessary for correct (upper-triangular) ordering.
|
||||
label diff = nei-own;
|
||||
@ -142,17 +142,17 @@ void getBand
|
||||
|
||||
// Do not use field algebra because of conversion label to scalar
|
||||
profile = 0.0;
|
||||
forAll(cellBandwidth, cellI)
|
||||
forAll(cellBandwidth, celli)
|
||||
{
|
||||
profile += 1.0*cellBandwidth[cellI];
|
||||
profile += 1.0*cellBandwidth[celli];
|
||||
}
|
||||
|
||||
sumSqrIntersect = 0.0;
|
||||
if (calculateIntersect)
|
||||
{
|
||||
forAll(nIntersect, cellI)
|
||||
forAll(nIntersect, celli)
|
||||
{
|
||||
for (label colI = cellI-cellBandwidth[cellI]; colI <= cellI; colI++)
|
||||
for (label colI = celli-cellBandwidth[celli]; colI <= celli; colI++)
|
||||
{
|
||||
nIntersect[colI] += 1.0;
|
||||
}
|
||||
@ -190,15 +190,15 @@ labelList getFaceOrder
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
label faceI = cFaces[i];
|
||||
label facei = cFaces[i];
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
// Internal face. Get cell on other side.
|
||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[faceI]];
|
||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||
if (nbrCellI == newCellI)
|
||||
{
|
||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[faceI]];
|
||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
|
||||
}
|
||||
|
||||
if (newCellI < nbrCellI)
|
||||
@ -233,19 +233,19 @@ labelList getFaceOrder
|
||||
}
|
||||
|
||||
// Leave patch faces intact.
|
||||
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
|
||||
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
oldToNewFace[faceI] = faceI;
|
||||
oldToNewFace[facei] = facei;
|
||||
}
|
||||
|
||||
|
||||
// Check done all faces.
|
||||
forAll(oldToNewFace, faceI)
|
||||
forAll(oldToNewFace, facei)
|
||||
{
|
||||
if (oldToNewFace[faceI] == -1)
|
||||
if (oldToNewFace[facei] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Did not determine new position" << " for face " << faceI
|
||||
<< "Did not determine new position" << " for face " << facei
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -286,15 +286,15 @@ labelList getRegionFaceOrder
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
label faceI = cFaces[i];
|
||||
label facei = cFaces[i];
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
// Internal face. Get cell on other side.
|
||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[faceI]];
|
||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||
if (nbrCellI == newCellI)
|
||||
{
|
||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[faceI]];
|
||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
|
||||
}
|
||||
|
||||
if (cellToRegion[oldCellI] != cellToRegion[cellOrder[nbrCellI]])
|
||||
@ -337,14 +337,14 @@ labelList getRegionFaceOrder
|
||||
// Sort in increasing region
|
||||
SortableList<label> sortKey(mesh.nFaces(), labelMax);
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label ownRegion = cellToRegion[mesh.faceOwner()[faceI]];
|
||||
label neiRegion = cellToRegion[mesh.faceNeighbour()[faceI]];
|
||||
label ownRegion = cellToRegion[mesh.faceOwner()[facei]];
|
||||
label neiRegion = cellToRegion[mesh.faceNeighbour()[facei]];
|
||||
|
||||
if (ownRegion != neiRegion)
|
||||
{
|
||||
sortKey[faceI] =
|
||||
sortKey[facei] =
|
||||
min(ownRegion, neiRegion)*nRegions
|
||||
+max(ownRegion, neiRegion);
|
||||
}
|
||||
@ -372,20 +372,20 @@ labelList getRegionFaceOrder
|
||||
}
|
||||
|
||||
// Leave patch faces intact.
|
||||
for (label faceI = newFaceI; faceI < mesh.nFaces(); faceI++)
|
||||
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
oldToNewFace[faceI] = faceI;
|
||||
oldToNewFace[facei] = facei;
|
||||
}
|
||||
|
||||
|
||||
// Check done all faces.
|
||||
forAll(oldToNewFace, faceI)
|
||||
forAll(oldToNewFace, facei)
|
||||
{
|
||||
if (oldToNewFace[faceI] == -1)
|
||||
if (oldToNewFace[facei] == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Did not determine new position"
|
||||
<< " for face " << faceI
|
||||
<< " for face " << facei
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -427,16 +427,16 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
|
||||
// Check if any faces need swapping.
|
||||
labelHashSet flipFaceFlux(newOwner.size());
|
||||
forAll(newNeighbour, faceI)
|
||||
forAll(newNeighbour, facei)
|
||||
{
|
||||
label own = newOwner[faceI];
|
||||
label nei = newNeighbour[faceI];
|
||||
label own = newOwner[facei];
|
||||
label nei = newNeighbour[facei];
|
||||
|
||||
if (nei < own)
|
||||
{
|
||||
newFaces[faceI].flip();
|
||||
Swap(newOwner[faceI], newNeighbour[faceI]);
|
||||
flipFaceFlux.insert(faceI);
|
||||
newFaces[facei].flip();
|
||||
Swap(newOwner[facei], newNeighbour[facei]);
|
||||
flipFaceFlux.insert(facei);
|
||||
}
|
||||
}
|
||||
|
||||
@ -566,11 +566,11 @@ labelList regionRenumber
|
||||
|
||||
labelListList regionToCells(invertOneToMany(nRegions, cellToRegion));
|
||||
|
||||
label cellI = 0;
|
||||
label celli = 0;
|
||||
|
||||
forAll(regionToCells, regionI)
|
||||
{
|
||||
Info<< " region " << regionI << " starts at " << cellI << endl;
|
||||
Info<< " region " << regionI << " starts at " << celli << endl;
|
||||
|
||||
// Make sure no parallel comms
|
||||
bool oldParRun = UPstream::parRun();
|
||||
@ -595,7 +595,7 @@ labelList regionRenumber
|
||||
|
||||
forAll(subCellOrder, i)
|
||||
{
|
||||
cellOrder[cellI++] = cellMap[subCellOrder[i]];
|
||||
cellOrder[celli++] = cellMap[subCellOrder[i]];
|
||||
}
|
||||
}
|
||||
Info<< endl;
|
||||
@ -975,13 +975,13 @@ int main(int argc, char *argv[])
|
||||
const labelUList& faceCells = pbm[patchi].faceCells();
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
label cellI = faceCells[i];
|
||||
label celli = faceCells[i];
|
||||
|
||||
if (reverseCellOrder[cellI] != -1)
|
||||
if (reverseCellOrder[celli] != -1)
|
||||
{
|
||||
bndCells[nBndCells] = cellI;
|
||||
bndCellMap[nBndCells++] = reverseCellOrder[cellI];
|
||||
reverseCellOrder[cellI] = -1;
|
||||
bndCells[nBndCells] = celli;
|
||||
bndCellMap[nBndCells++] = reverseCellOrder[celli];
|
||||
reverseCellOrder[celli] = -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1105,10 +1105,10 @@ int main(int argc, char *argv[])
|
||||
const labelHashSet& fff = map().flipFaceFlux();
|
||||
forAllConstIter(labelHashSet, fff, iter)
|
||||
{
|
||||
label faceI = iter.key();
|
||||
label masterFaceI = faceProcAddressing[faceI];
|
||||
label facei = iter.key();
|
||||
label masterFaceI = faceProcAddressing[facei];
|
||||
|
||||
faceProcAddressing[faceI] = -masterFaceI;
|
||||
faceProcAddressing[facei] = -masterFaceI;
|
||||
|
||||
if (masterFaceI == 0)
|
||||
{
|
||||
|
||||
@ -110,31 +110,31 @@ void writeVTK
|
||||
|
||||
forAllConstIter(cellSet, currentSet, iter)
|
||||
{
|
||||
label cellI = iter.key();
|
||||
label celli = iter.key();
|
||||
|
||||
const cell& cFaces = mesh.cells()[cellI];
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
forAll(cFaces, i)
|
||||
{
|
||||
label faceI = cFaces[i];
|
||||
label facei = cFaces[i];
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
label otherCellI = mesh.faceOwner()[faceI];
|
||||
label otherCellI = mesh.faceOwner()[facei];
|
||||
|
||||
if (otherCellI == cellI)
|
||||
if (otherCellI == celli)
|
||||
{
|
||||
otherCellI = mesh.faceNeighbour()[faceI];
|
||||
otherCellI = mesh.faceNeighbour()[facei];
|
||||
}
|
||||
|
||||
if (!currentSet.found(otherCellI))
|
||||
{
|
||||
cellFaces.insert(faceI, cellI);
|
||||
cellFaces.insert(facei, celli);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
cellFaces.insert(faceI, cellI);
|
||||
cellFaces.insert(facei, celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -81,9 +81,9 @@ void writePatch
|
||||
|
||||
label nFaceVerts = 0;
|
||||
|
||||
forAll(fp.localFaces(), faceI)
|
||||
forAll(fp.localFaces(), facei)
|
||||
{
|
||||
nFaceVerts += fp.localFaces()[faceI].size() + 1;
|
||||
nFaceVerts += fp.localFaces()[facei].size() + 1;
|
||||
}
|
||||
pStream << "POLYGONS " << fp.size() << ' ' << nFaceVerts
|
||||
<< std::endl;
|
||||
@ -91,9 +91,9 @@ void writePatch
|
||||
|
||||
DynamicList<label> vertLabels(nFaceVerts);
|
||||
|
||||
forAll(fp.localFaces(), faceI)
|
||||
forAll(fp.localFaces(), facei)
|
||||
{
|
||||
const face& f = fp.localFaces()[faceI];
|
||||
const face& f = fp.localFaces()[facei];
|
||||
|
||||
vertLabels.append(f.size());
|
||||
|
||||
|
||||
@ -163,8 +163,8 @@ int main(int argc, char *argv[])
|
||||
// No flip map.
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
label faceI = faceLabels[i];
|
||||
addressing.append(faceI);
|
||||
label facei = faceLabels[i];
|
||||
addressing.append(facei);
|
||||
flipMap.append(false);
|
||||
}
|
||||
}
|
||||
@ -187,24 +187,24 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
label faceI = faceLabels[i];
|
||||
label facei = faceLabels[i];
|
||||
|
||||
bool flip = false;
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
if
|
||||
(
|
||||
cells.found(mesh.faceOwner()[faceI])
|
||||
&& !cells.found(mesh.faceNeighbour()[faceI])
|
||||
cells.found(mesh.faceOwner()[facei])
|
||||
&& !cells.found(mesh.faceNeighbour()[facei])
|
||||
)
|
||||
{
|
||||
flip = false;
|
||||
}
|
||||
else if
|
||||
(
|
||||
!cells.found(mesh.faceOwner()[faceI])
|
||||
&& cells.found(mesh.faceNeighbour()[faceI])
|
||||
!cells.found(mesh.faceOwner()[facei])
|
||||
&& cells.found(mesh.faceNeighbour()[facei])
|
||||
)
|
||||
{
|
||||
flip = true;
|
||||
@ -213,21 +213,21 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "One of owner or neighbour of internal face "
|
||||
<< faceI << " should be in cellSet " << cells.name()
|
||||
<< facei << " should be in cellSet " << cells.name()
|
||||
<< " to be able to determine orientation." << endl
|
||||
<< "Face:" << faceI
|
||||
<< " own:" << mesh.faceOwner()[faceI]
|
||||
<< "Face:" << facei
|
||||
<< " own:" << mesh.faceOwner()[facei]
|
||||
<< " OwnInCellSet:"
|
||||
<< cells.found(mesh.faceOwner()[faceI])
|
||||
<< " nei:" << mesh.faceNeighbour()[faceI]
|
||||
<< cells.found(mesh.faceOwner()[facei])
|
||||
<< " nei:" << mesh.faceNeighbour()[facei]
|
||||
<< " NeiInCellSet:"
|
||||
<< cells.found(mesh.faceNeighbour()[faceI])
|
||||
<< cells.found(mesh.faceNeighbour()[facei])
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cells.found(mesh.faceOwner()[faceI]))
|
||||
if (cells.found(mesh.faceOwner()[facei]))
|
||||
{
|
||||
flip = false;
|
||||
}
|
||||
@ -237,7 +237,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
addressing.append(faceI);
|
||||
addressing.append(facei);
|
||||
flipMap.append(flip);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -43,16 +43,16 @@ defineTypeNameAndDebug(regionSide, 0);
|
||||
Foam::label Foam::regionSide::otherFace
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const label cellI,
|
||||
const label faceI,
|
||||
const label celli,
|
||||
const label facei,
|
||||
const label edgeI
|
||||
)
|
||||
{
|
||||
label f0I, f1I;
|
||||
|
||||
meshTools::getEdgeFaces(mesh, cellI, edgeI, f0I, f1I);
|
||||
meshTools::getEdgeFaces(mesh, celli, edgeI, f0I, f1I);
|
||||
|
||||
if (f0I == faceI)
|
||||
if (f0I == facei)
|
||||
{
|
||||
return f1I;
|
||||
}
|
||||
@ -67,7 +67,7 @@ Foam::label Foam::regionSide::otherFace
|
||||
Foam::label Foam::regionSide::otherEdge
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const label pointI
|
||||
)
|
||||
@ -77,7 +77,7 @@ Foam::label Foam::regionSide::otherEdge
|
||||
// Get other point on edge.
|
||||
label freePointI = e.otherVertex(pointI);
|
||||
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
@ -102,52 +102,52 @@ Foam::label Foam::regionSide::otherEdge
|
||||
}
|
||||
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find other edge on face " << faceI << " that uses point "
|
||||
<< "Cannot find other edge on face " << facei << " that uses point "
|
||||
<< pointI << " but not point " << freePointI << endl
|
||||
<< "Edges on face:" << fEdges
|
||||
<< " verts:" << UIndirectList<edge>(mesh.edges(), fEdges)()
|
||||
<< " Vertices on face:"
|
||||
<< mesh.faces()[faceI]
|
||||
<< mesh.faces()[facei]
|
||||
<< " Vertices on original edge:" << e << abort(FatalError);
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
// Step from faceI (on side cellI) to connected face & cell without crossing
|
||||
// Step from facei (on side celli) to connected face & cell without crossing
|
||||
// fenceEdges.
|
||||
void Foam::regionSide::visitConnectedFaces
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const labelHashSet& region,
|
||||
const labelHashSet& fenceEdges,
|
||||
const label cellI,
|
||||
const label faceI,
|
||||
const label celli,
|
||||
const label facei,
|
||||
labelHashSet& visitedFace
|
||||
)
|
||||
{
|
||||
if (!visitedFace.found(faceI))
|
||||
if (!visitedFace.found(facei))
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "visitConnectedFaces : cellI:" << cellI << " faceI:"
|
||||
<< faceI << " isOwner:" << (cellI == mesh.faceOwner()[faceI])
|
||||
Info<< "visitConnectedFaces : celli:" << celli << " facei:"
|
||||
<< facei << " isOwner:" << (celli == mesh.faceOwner()[facei])
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Mark as visited
|
||||
visitedFace.insert(faceI);
|
||||
visitedFace.insert(facei);
|
||||
|
||||
// Mark which side of face was visited.
|
||||
if (cellI == mesh.faceOwner()[faceI])
|
||||
if (celli == mesh.faceOwner()[facei])
|
||||
{
|
||||
sideOwner_.insert(faceI);
|
||||
sideOwner_.insert(facei);
|
||||
}
|
||||
|
||||
|
||||
// Visit all neighbouring faces on faceSet. Stay on this 'side' of
|
||||
// face by doing edge-face-cell walk.
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
@ -159,11 +159,11 @@ void Foam::regionSide::visitConnectedFaces
|
||||
// we hit face on faceSet.
|
||||
|
||||
// Find face reachable from edge
|
||||
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
|
||||
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
|
||||
|
||||
if (mesh.isInternalFace(otherFaceI))
|
||||
{
|
||||
label otherCellI = cellI;
|
||||
label otherCellI = celli;
|
||||
|
||||
// Keep on crossing faces/cells until back on face on
|
||||
// surface
|
||||
@ -173,7 +173,7 @@ void Foam::regionSide::visitConnectedFaces
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "visitConnectedFaces : cellI:" << cellI
|
||||
Info<< "visitConnectedFaces : celli:" << celli
|
||||
<< " found insideEdgeFace:" << otherFaceI
|
||||
<< endl;
|
||||
}
|
||||
@ -234,13 +234,13 @@ void Foam::regionSide::walkPointConnectedFaces
|
||||
if (debug)
|
||||
{
|
||||
Info<< "walkPointConnectedFaces : regionPointI:" << regionPointI
|
||||
<< " faceI:" << startFaceI
|
||||
<< " facei:" << startFaceI
|
||||
<< " edgeI:" << startEdgeI << " verts:"
|
||||
<< mesh.edges()[startEdgeI]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
// Cross faceI i.e. get edge not startEdgeI which uses regionPointI
|
||||
// Cross facei i.e. get edge not startEdgeI which uses regionPointI
|
||||
label edgeI = otherEdge(mesh, startFaceI, startEdgeI, regionPointI);
|
||||
|
||||
if (!regionEdges.found(edgeI))
|
||||
@ -265,14 +265,14 @@ void Foam::regionSide::walkPointConnectedFaces
|
||||
|
||||
forAll(eFaces, eFaceI)
|
||||
{
|
||||
label faceI = eFaces[eFaceI];
|
||||
label facei = eFaces[eFaceI];
|
||||
|
||||
walkPointConnectedFaces
|
||||
(
|
||||
mesh,
|
||||
regionEdges,
|
||||
regionPointI,
|
||||
faceI,
|
||||
facei,
|
||||
edgeI,
|
||||
visitedEdges
|
||||
);
|
||||
@ -298,8 +298,8 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
||||
|
||||
forAllConstIter(labelHashSet, regionFaces, iter)
|
||||
{
|
||||
const label faceI = iter.key();
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
const label facei = iter.key();
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
@ -331,29 +331,29 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
||||
|
||||
forAllConstIter(labelHashSet, regionFaces, iter)
|
||||
{
|
||||
const label faceI = iter.key();
|
||||
const label facei = iter.key();
|
||||
|
||||
// Get side of face.
|
||||
label cellI;
|
||||
label celli;
|
||||
|
||||
if (sideOwner_.found(faceI))
|
||||
if (sideOwner_.found(facei))
|
||||
{
|
||||
cellI = mesh.faceOwner()[faceI];
|
||||
celli = mesh.faceOwner()[facei];
|
||||
}
|
||||
else
|
||||
{
|
||||
cellI = mesh.faceNeighbour()[faceI];
|
||||
celli = mesh.faceNeighbour()[facei];
|
||||
}
|
||||
|
||||
// Find starting point and edge on face.
|
||||
const labelList& fEdges = mesh.faceEdges()[faceI];
|
||||
const labelList& fEdges = mesh.faceEdges()[facei];
|
||||
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
label edgeI = fEdges[fEdgeI];
|
||||
|
||||
// Get the face 'perpendicular' to faceI on region.
|
||||
label otherFaceI = otherFace(mesh, cellI, faceI, edgeI);
|
||||
// Get the face 'perpendicular' to facei on region.
|
||||
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
|
||||
|
||||
// Edge
|
||||
const edge& e = mesh.edges()[edgeI];
|
||||
|
||||
@ -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
|
||||
@ -77,20 +77,20 @@ class regionSide
|
||||
static label otherEdge
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const label faceI,
|
||||
const label facei,
|
||||
const label edgeI,
|
||||
const label pointI
|
||||
);
|
||||
|
||||
//- From faceI, side cellI, cross to other faces/cells by
|
||||
//- From facei, side celli, cross to other faces/cells by
|
||||
// face-cell walking and store visited faces and update sideOwner_.
|
||||
void visitConnectedFaces
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const labelHashSet& region,
|
||||
const labelHashSet& fenceEdges,
|
||||
const label cellI,
|
||||
const label faceI,
|
||||
const label celli,
|
||||
const label facei,
|
||||
labelHashSet& visitedFace
|
||||
);
|
||||
|
||||
@ -127,7 +127,7 @@ public:
|
||||
static label otherFace
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const label cellI,
|
||||
const label celli,
|
||||
const label excludeFaceI,
|
||||
const label edgeI
|
||||
);
|
||||
|
||||
@ -250,11 +250,11 @@ void subsetSurfaceFields
|
||||
labelList getNonRegionCells(const labelList& cellRegion, const label regionI)
|
||||
{
|
||||
DynamicList<label> nonRegionCells(cellRegion.size());
|
||||
forAll(cellRegion, cellI)
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
if (cellRegion[cellI] != regionI)
|
||||
if (cellRegion[celli] != regionI)
|
||||
{
|
||||
nonRegionCells.append(cellI);
|
||||
nonRegionCells.append(celli);
|
||||
}
|
||||
}
|
||||
return nonRegionCells.shrink();
|
||||
@ -329,17 +329,17 @@ void getInterfaceSizes
|
||||
// Internal faces
|
||||
// ~~~~~~~~~~~~~~
|
||||
|
||||
forAll(mesh.faceNeighbour(), faceI)
|
||||
forAll(mesh.faceNeighbour(), facei)
|
||||
{
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
||||
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
|
||||
|
||||
if (ownRegion != neiRegion)
|
||||
{
|
||||
addToInterface
|
||||
(
|
||||
mesh,
|
||||
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
|
||||
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
|
||||
ownRegion,
|
||||
neiRegion,
|
||||
regionsToSize
|
||||
@ -355,15 +355,15 @@ void getInterfaceSizes
|
||||
|
||||
forAll(coupledRegion, i)
|
||||
{
|
||||
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||
coupledRegion[i] = cellRegion[cellI];
|
||||
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||
coupledRegion[i] = cellRegion[celli];
|
||||
}
|
||||
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
||||
|
||||
forAll(coupledRegion, i)
|
||||
{
|
||||
label faceI = i+mesh.nInternalFaces();
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
||||
label facei = i+mesh.nInternalFaces();
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||
label neiRegion = coupledRegion[i];
|
||||
|
||||
if (ownRegion != neiRegion)
|
||||
@ -371,7 +371,7 @@ void getInterfaceSizes
|
||||
addToInterface
|
||||
(
|
||||
mesh,
|
||||
(useFaceZones ? mesh.faceZones().whichZone(faceI) : -1),
|
||||
(useFaceZones ? mesh.faceZones().whichZone(facei) : -1),
|
||||
ownRegion,
|
||||
neiRegion,
|
||||
regionsToSize
|
||||
@ -519,17 +519,17 @@ void getInterfaceSizes
|
||||
// Mark all inter-region faces.
|
||||
faceToInterface.setSize(mesh.nFaces(), -1);
|
||||
|
||||
forAll(mesh.faceNeighbour(), faceI)
|
||||
forAll(mesh.faceNeighbour(), facei)
|
||||
{
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
||||
label neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||
label neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
|
||||
|
||||
if (ownRegion != neiRegion)
|
||||
{
|
||||
label zoneID = -1;
|
||||
if (useFaceZones)
|
||||
{
|
||||
zoneID = mesh.faceZones().whichZone(faceI);
|
||||
zoneID = mesh.faceZones().whichZone(facei);
|
||||
}
|
||||
|
||||
edge interface
|
||||
@ -538,13 +538,13 @@ void getInterfaceSizes
|
||||
max(ownRegion, neiRegion)
|
||||
);
|
||||
|
||||
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
|
||||
faceToInterface[facei] = regionsToInterface[interface][zoneID];
|
||||
}
|
||||
}
|
||||
forAll(coupledRegion, i)
|
||||
{
|
||||
label faceI = i+mesh.nInternalFaces();
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
||||
label facei = i+mesh.nInternalFaces();
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||
label neiRegion = coupledRegion[i];
|
||||
|
||||
if (ownRegion != neiRegion)
|
||||
@ -552,7 +552,7 @@ void getInterfaceSizes
|
||||
label zoneID = -1;
|
||||
if (useFaceZones)
|
||||
{
|
||||
zoneID = mesh.faceZones().whichZone(faceI);
|
||||
zoneID = mesh.faceZones().whichZone(facei);
|
||||
}
|
||||
|
||||
edge interface
|
||||
@ -561,7 +561,7 @@ void getInterfaceSizes
|
||||
max(ownRegion, neiRegion)
|
||||
);
|
||||
|
||||
faceToInterface[faceI] = regionsToInterface[interface][zoneID];
|
||||
faceToInterface[facei] = regionsToInterface[interface][zoneID];
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -639,8 +639,8 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
|
||||
forAll(coupledRegion, i)
|
||||
{
|
||||
label cellI = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||
coupledRegion[i] = cellRegion[cellI];
|
||||
label celli = mesh.faceOwner()[i+mesh.nInternalFaces()];
|
||||
coupledRegion[i] = cellRegion[celli];
|
||||
}
|
||||
syncTools::swapBoundaryFaceList(mesh, coupledRegion);
|
||||
|
||||
@ -662,19 +662,19 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
labelList exposedPatchIDs(exposedFaces.size());
|
||||
forAll(exposedFaces, i)
|
||||
{
|
||||
label faceI = exposedFaces[i];
|
||||
label interfaceI = faceToInterface[faceI];
|
||||
label facei = exposedFaces[i];
|
||||
label interfacei = faceToInterface[facei];
|
||||
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[faceI]];
|
||||
label ownRegion = cellRegion[mesh.faceOwner()[facei]];
|
||||
label neiRegion = -1;
|
||||
|
||||
if (mesh.isInternalFace(faceI))
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
neiRegion = cellRegion[mesh.faceNeighbour()[faceI]];
|
||||
neiRegion = cellRegion[mesh.faceNeighbour()[facei]];
|
||||
}
|
||||
else
|
||||
{
|
||||
neiRegion = coupledRegion[faceI-mesh.nInternalFaces()];
|
||||
neiRegion = coupledRegion[facei-mesh.nInternalFaces()];
|
||||
}
|
||||
|
||||
|
||||
@ -694,8 +694,8 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Exposed face:" << faceI
|
||||
<< " fc:" << mesh.faceCentres()[faceI]
|
||||
<< "Exposed face:" << facei
|
||||
<< " fc:" << mesh.faceCentres()[facei]
|
||||
<< " has owner region " << ownRegion
|
||||
<< " and neighbour region " << neiRegion
|
||||
<< " when handling region:" << regionI
|
||||
@ -705,11 +705,11 @@ autoPtr<mapPolyMesh> createRegionMesh
|
||||
// Find the patch.
|
||||
if (regionI < otherRegion)
|
||||
{
|
||||
exposedPatchIDs[i] = interfacePatches[interfaceI];
|
||||
exposedPatchIDs[i] = interfacePatches[interfacei];
|
||||
}
|
||||
else
|
||||
{
|
||||
exposedPatchIDs[i] = interfacePatches[interfaceI]+1;
|
||||
exposedPatchIDs[i] = interfacePatches[interfacei]+1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -770,10 +770,10 @@ void createAndWriteRegion
|
||||
|
||||
// Make map of all added patches
|
||||
labelHashSet addedPatches(2*interfacePatches.size());
|
||||
forAll(interfacePatches, interfaceI)
|
||||
forAll(interfacePatches, interfacei)
|
||||
{
|
||||
addedPatches.insert(interfacePatches[interfaceI]);
|
||||
addedPatches.insert(interfacePatches[interfaceI]+1);
|
||||
addedPatches.insert(interfacePatches[interfacei]);
|
||||
addedPatches.insert(interfacePatches[interfacei]+1);
|
||||
}
|
||||
|
||||
|
||||
@ -968,23 +968,23 @@ void createAndWriteRegion
|
||||
),
|
||||
newMesh().nFaces()
|
||||
);
|
||||
forAll(faceProcAddressing, faceI)
|
||||
forAll(faceProcAddressing, facei)
|
||||
{
|
||||
// face + turning index. (see decomposePar)
|
||||
// Is the face pointing in the same direction?
|
||||
label oldFaceI = map().faceMap()[faceI];
|
||||
label oldFaceI = map().faceMap()[facei];
|
||||
|
||||
if
|
||||
(
|
||||
map().cellMap()[newMesh().faceOwner()[faceI]]
|
||||
map().cellMap()[newMesh().faceOwner()[facei]]
|
||||
== mesh.faceOwner()[oldFaceI]
|
||||
)
|
||||
{
|
||||
faceProcAddressing[faceI] = oldFaceI+1;
|
||||
faceProcAddressing[facei] = oldFaceI+1;
|
||||
}
|
||||
else
|
||||
{
|
||||
faceProcAddressing[faceI] = -(oldFaceI+1);
|
||||
faceProcAddressing[facei] = -(oldFaceI+1);
|
||||
}
|
||||
}
|
||||
Info<< "Writing map " << faceProcAddressing.name()
|
||||
@ -1138,11 +1138,11 @@ label findCorrespondingRegion
|
||||
// Per region the number of cells in zoneI
|
||||
labelList cellsInZone(nCellRegions, 0);
|
||||
|
||||
forAll(cellRegion, cellI)
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
if (existingZoneID[cellI] == zoneI)
|
||||
if (existingZoneID[celli] == zoneI)
|
||||
{
|
||||
cellsInZone[cellRegion[cellI]]++;
|
||||
cellsInZone[cellRegion[celli]]++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1161,11 +1161,11 @@ label findCorrespondingRegion
|
||||
else
|
||||
{
|
||||
// Check that region contains no cells that aren't in cellZone.
|
||||
forAll(cellRegion, cellI)
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
if (cellRegion[cellI] == regionI && existingZoneID[cellI] != zoneI)
|
||||
if (cellRegion[celli] == regionI && existingZoneID[celli] != zoneI)
|
||||
{
|
||||
// cellI in regionI but not in zoneI
|
||||
// celli in regionI but not in zoneI
|
||||
regionI = -1;
|
||||
break;
|
||||
}
|
||||
@ -1200,18 +1200,18 @@ void getZoneID
|
||||
|
||||
forAll(cz, i)
|
||||
{
|
||||
label cellI = cz[i];
|
||||
if (zoneID[cellI] == -1)
|
||||
label celli = cz[i];
|
||||
if (zoneID[celli] == -1)
|
||||
{
|
||||
zoneID[cellI] = zoneI;
|
||||
zoneID[celli] = zoneI;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cell " << cellI << " with cell centre "
|
||||
<< mesh.cellCentres()[cellI]
|
||||
<< "Cell " << celli << " with cell centre "
|
||||
<< mesh.cellCentres()[celli]
|
||||
<< " is multiple zones. This is not allowed." << endl
|
||||
<< "It is in zone " << cellZones[zoneID[cellI]].name()
|
||||
<< "It is in zone " << cellZones[zoneID[celli]].name()
|
||||
<< " and in zone " << cellZones[zoneI].name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -1386,9 +1386,9 @@ void writeCellToRegion(const fvMesh& mesh, const labelList& cellRegion)
|
||||
dimensionedScalar("zero", dimless, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
);
|
||||
forAll(cellRegion, cellI)
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
cellToRegion[cellI] = cellRegion[cellI];
|
||||
cellToRegion[celli] = cellRegion[celli];
|
||||
}
|
||||
cellToRegion.write();
|
||||
|
||||
@ -1662,25 +1662,25 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
blockedFace.setSize(mesh.nFaces(), false);
|
||||
|
||||
for (label faceI = 0; faceI < mesh.nInternalFaces(); faceI++)
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label own = mesh.faceOwner()[faceI];
|
||||
label nei = mesh.faceNeighbour()[faceI];
|
||||
label own = mesh.faceOwner()[facei];
|
||||
label nei = mesh.faceNeighbour()[facei];
|
||||
|
||||
if (zoneID[own] != zoneID[nei])
|
||||
{
|
||||
blockedFace[faceI] = true;
|
||||
blockedFace[facei] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Different cellZones on either side of processor patch.
|
||||
forAll(neiZoneID, i)
|
||||
{
|
||||
label faceI = i+mesh.nInternalFaces();
|
||||
label facei = i+mesh.nInternalFaces();
|
||||
|
||||
if (zoneID[mesh.faceOwner()[faceI]] != neiZoneID[i])
|
||||
if (zoneID[mesh.faceOwner()[facei]] != neiZoneID[i])
|
||||
{
|
||||
blockedFace[faceI] = true;
|
||||
blockedFace[facei] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1740,9 +1740,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
labelList regionSizes(nCellRegions, 0);
|
||||
|
||||
forAll(cellRegion, cellI)
|
||||
forAll(cellRegion, celli)
|
||||
{
|
||||
regionSizes[cellRegion[cellI]]++;
|
||||
regionSizes[cellRegion[celli]]++;
|
||||
}
|
||||
forAll(regionSizes, regionI)
|
||||
{
|
||||
@ -1992,14 +1992,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
(void)mesh.tetBasePtIs();
|
||||
|
||||
label cellI = mesh.findCell(insidePoint);
|
||||
label celli = mesh.findCell(insidePoint);
|
||||
|
||||
Info<< nl << "Found point " << insidePoint << " in cell " << cellI
|
||||
Info<< nl << "Found point " << insidePoint << " in cell " << celli
|
||||
<< endl;
|
||||
|
||||
if (cellI != -1)
|
||||
if (celli != -1)
|
||||
{
|
||||
regionI = cellRegion[cellI];
|
||||
regionI = cellRegion[celli];
|
||||
}
|
||||
|
||||
reduce(regionI, maxOp<label>());
|
||||
|
||||
Reference in New Issue
Block a user