Standardized cell, patch, face and processor loop index names
This commit is contained in:
@ -163,11 +163,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Remove face
|
||||
label candidateFaceI = rndGen.integer(0, mesh.nInternalFaces()-1);
|
||||
Info<< "Wanting to delete face " << mesh.faceCentres()[candidateFaceI]
|
||||
label candidateFacei = rndGen.integer(0, mesh.nInternalFaces()-1);
|
||||
Info<< "Wanting to delete face " << mesh.faceCentres()[candidateFacei]
|
||||
<< nl << endl;
|
||||
|
||||
labelList candidates(1, candidateFaceI);
|
||||
labelList candidates(1, candidateFacei);
|
||||
|
||||
|
||||
// Get compatible set of faces and connected sets of cells.
|
||||
|
||||
@ -69,23 +69,23 @@ int main(int argc, char *argv[])
|
||||
for (label celli = 0; celli < mesh.nCells(); celli++)
|
||||
{
|
||||
// to global index
|
||||
label globalCellI = globalNumbering.toGlobal(celli);
|
||||
label globalCelli = globalNumbering.toGlobal(celli);
|
||||
|
||||
// and back
|
||||
label procI = globalNumbering.whichProcID(globalCellI);
|
||||
label localCellI = globalNumbering.toLocal(globalCellI);
|
||||
label proci = globalNumbering.whichProcID(globalCelli);
|
||||
label localCelli = globalNumbering.toLocal(globalCelli);
|
||||
|
||||
if (procI != Pstream::myProcNo() || localCellI != celli)
|
||||
if (proci != Pstream::myProcNo() || localCelli != celli)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. celli:" << celli << " localCellI:" << localCellI
|
||||
<< " procI:" << procI << abort(FatalError);
|
||||
<< "Problem. celli:" << celli << " localCelli:" << localCelli
|
||||
<< " proci:" << proci << abort(FatalError);
|
||||
}
|
||||
|
||||
if (!globalNumbering.isLocal(globalCellI))
|
||||
if (!globalNumbering.isLocal(globalCelli))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. celli:" << celli << " globalCellI:" << globalCellI
|
||||
<< "Problem. celli:" << celli << " globalCelli:" << globalCelli
|
||||
<< " not local" << abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -104,30 +104,30 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// We already checked that toGlobal(0) maps back correctly to myProcNo
|
||||
// so now check that the index one before maps to the previous processor
|
||||
label prevProcCellI = globalNumbering.toGlobal(0)-1;
|
||||
label procI = globalNumbering.whichProcID(prevProcCellI);
|
||||
label prevProcCelli = globalNumbering.toGlobal(0)-1;
|
||||
label proci = globalNumbering.whichProcID(prevProcCelli);
|
||||
|
||||
if (procI != Pstream::myProcNo()-1)
|
||||
if (proci != Pstream::myProcNo()-1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. global:" << prevProcCellI
|
||||
<< "Problem. global:" << prevProcCelli
|
||||
<< " expected on processor:" << Pstream::myProcNo()-1
|
||||
<< " but is calculated to be on procI:" << procI
|
||||
<< " but is calculated to be on proci:" << proci
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (globalNumbering.isLocal(prevProcCellI))
|
||||
if (globalNumbering.isLocal(prevProcCelli))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. globalCellI:" << prevProcCellI
|
||||
<< "Problem. globalCelli:" << prevProcCelli
|
||||
<< " calculated as local" << abort(FatalError);
|
||||
}
|
||||
|
||||
if (!globalNumbering.isLocal(procI, prevProcCellI))
|
||||
if (!globalNumbering.isLocal(proci, prevProcCelli))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. globalCellI:" << prevProcCellI
|
||||
<< " not calculated as local on processor:" << procI
|
||||
<< "Problem. globalCelli:" << prevProcCelli
|
||||
<< " not calculated as local on processor:" << proci
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -135,30 +135,30 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (Pstream::myProcNo() < Pstream::nProcs()-1)
|
||||
{
|
||||
label nextProcCellI = globalNumbering.toGlobal(mesh.nCells()-1)+1;
|
||||
label procI = globalNumbering.whichProcID(nextProcCellI);
|
||||
label nextProcCelli = globalNumbering.toGlobal(mesh.nCells()-1)+1;
|
||||
label proci = globalNumbering.whichProcID(nextProcCelli);
|
||||
|
||||
if (procI != Pstream::myProcNo()+1)
|
||||
if (proci != Pstream::myProcNo()+1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. global:" << nextProcCellI
|
||||
<< "Problem. global:" << nextProcCelli
|
||||
<< " expected on processor:" << Pstream::myProcNo()+1
|
||||
<< " but is calculated to be on procI:" << procI
|
||||
<< " but is calculated to be on proci:" << proci
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
if (globalNumbering.isLocal(nextProcCellI))
|
||||
if (globalNumbering.isLocal(nextProcCelli))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. globalCellI:" << nextProcCellI
|
||||
<< "Problem. globalCelli:" << nextProcCelli
|
||||
<< " calculated as local" << abort(FatalError);
|
||||
}
|
||||
|
||||
if (!globalNumbering.isLocal(procI, nextProcCellI))
|
||||
if (!globalNumbering.isLocal(proci, nextProcCelli))
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. globalCellI:" << nextProcCellI
|
||||
<< " not calculated as local on processor:" << procI
|
||||
<< "Problem. globalCelli:" << nextProcCelli
|
||||
<< " not calculated as local on processor:" << proci
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -151,9 +151,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
PstreamBuffers pBufs(Pstream::nonBlocking);
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
UOPstream toProc(procI, pBufs);
|
||||
UOPstream toProc(proci, pBufs);
|
||||
toProc << Pstream::myProcNo();
|
||||
}
|
||||
|
||||
@ -161,17 +161,17 @@ int main(int argc, char *argv[])
|
||||
pBufs.finishedSends();
|
||||
|
||||
// Consume
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
UIPstream fromProc(procI, pBufs);
|
||||
UIPstream fromProc(proci, pBufs);
|
||||
label data;
|
||||
fromProc >> data;
|
||||
|
||||
if (data != procI)
|
||||
if (data != proci)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "From processor " << procI << " received " << data
|
||||
<< " but expected " << procI
|
||||
<< "From processor " << proci << " received " << data
|
||||
<< " but expected " << proci
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,21 +76,21 @@ int main(int argc, char *argv[])
|
||||
labelList nSend(Pstream::nProcs(), 0);
|
||||
forAll(complexData, i)
|
||||
{
|
||||
label procI = complexData[i].first();
|
||||
nSend[procI]++;
|
||||
label proci = complexData[i].first();
|
||||
nSend[proci]++;
|
||||
}
|
||||
|
||||
// Collect items to be sent
|
||||
labelListList sendMap(Pstream::nProcs());
|
||||
forAll(sendMap, procI)
|
||||
forAll(sendMap, proci)
|
||||
{
|
||||
sendMap[procI].setSize(nSend[procI]);
|
||||
sendMap[proci].setSize(nSend[proci]);
|
||||
}
|
||||
nSend = 0;
|
||||
forAll(complexData, i)
|
||||
{
|
||||
label procI = complexData[i].first();
|
||||
sendMap[procI][nSend[procI]++] = i;
|
||||
label proci = complexData[i].first();
|
||||
sendMap[proci][nSend[proci]++] = i;
|
||||
}
|
||||
|
||||
// Sync how many to send
|
||||
@ -99,9 +99,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Collect items to be received
|
||||
labelListList recvMap(Pstream::nProcs());
|
||||
forAll(recvMap, procI)
|
||||
forAll(recvMap, proci)
|
||||
{
|
||||
recvMap[procI].setSize(nRecv[procI]);
|
||||
recvMap[proci].setSize(nRecv[proci]);
|
||||
}
|
||||
|
||||
label constructSize = 0;
|
||||
@ -111,13 +111,13 @@ int main(int argc, char *argv[])
|
||||
recvMap[Pstream::myProcNo()][i] = constructSize++;
|
||||
}
|
||||
// Construct from other processors
|
||||
forAll(recvMap, procI)
|
||||
forAll(recvMap, proci)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
forAll(recvMap[procI], i)
|
||||
forAll(recvMap[proci], i)
|
||||
{
|
||||
recvMap[procI][i] = constructSize++;
|
||||
recvMap[proci][i] = constructSize++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,14 +80,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
const labelList& fEdges = patch.faceEdges()[facei];
|
||||
|
||||
label globalFaceI = globalNumbering.toGlobal(facei);
|
||||
label globalFacei = globalNumbering.toGlobal(facei);
|
||||
|
||||
forAll(fEdges, i)
|
||||
{
|
||||
changedEdges.append(fEdges[i]);
|
||||
changedInfo.append
|
||||
(
|
||||
patchEdgeFaceRegions(labelPair(globalFaceI, globalFaceI))
|
||||
patchEdgeFaceRegions(labelPair(globalFacei, globalFacei))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -142,20 +142,20 @@ int main(int argc, char *argv[])
|
||||
OFstream objFile(fName);
|
||||
|
||||
// Write processors as single vertex in centre of mesh
|
||||
forAll(meshCentres, procI)
|
||||
forAll(meshCentres, proci)
|
||||
{
|
||||
const point& pt = meshCentres[procI];
|
||||
const point& pt = meshCentres[proci];
|
||||
|
||||
objFile << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z() << endl;
|
||||
}
|
||||
// Write connections as lines between processors (duplicated)
|
||||
forAll(connections, procI)
|
||||
forAll(connections, proci)
|
||||
{
|
||||
const labelList& nbs = connections[procI];
|
||||
const labelList& nbs = connections[proci];
|
||||
|
||||
forAll(nbs, nbI)
|
||||
{
|
||||
objFile << "l " << procI + 1 << ' ' << nbs[nbI] + 1 << endl;
|
||||
objFile << "l " << proci + 1 << ' ' << nbs[nbI] + 1 << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,9 +196,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
OFstream objFile(fName);
|
||||
|
||||
forAll(meshCentres, procI)
|
||||
forAll(meshCentres, proci)
|
||||
{
|
||||
const point& pt = meshCentres[procI];
|
||||
const point& pt = meshCentres[proci];
|
||||
|
||||
objFile << "v " << pt.x() << ' ' << pt.y() << ' ' << pt.z()
|
||||
<< endl;
|
||||
|
||||
@ -71,7 +71,7 @@ void modifyOrAddFace
|
||||
const label facei,
|
||||
const label own,
|
||||
const bool flipFaceFlux,
|
||||
const label newPatchI,
|
||||
const label newPatchi,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
|
||||
@ -90,7 +90,7 @@ void modifyOrAddFace
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
@ -112,7 +112,7 @@ void modifyOrAddFace
|
||||
-1, // master edge
|
||||
facei, // master face
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
@ -160,9 +160,9 @@ void subsetVolFields
|
||||
|
||||
label newStart = fld.patch().patch().start();
|
||||
|
||||
label oldPatchI = subsetter.patchMap()[patchi];
|
||||
label oldPatchi = subsetter.patchMap()[patchi];
|
||||
|
||||
if (oldPatchI == -1)
|
||||
if (oldPatchi == -1)
|
||||
{
|
||||
// New patch. Reset whole value.
|
||||
fld = exposedValue;
|
||||
@ -171,17 +171,17 @@ void subsetVolFields
|
||||
{
|
||||
// Reset those faces that originate from different patch
|
||||
// or internal faces.
|
||||
label oldSize = volField.boundaryField()[oldPatchI].size();
|
||||
label oldSize = volField.boundaryField()[oldPatchi].size();
|
||||
label oldStart = volField.boundaryField()
|
||||
[
|
||||
oldPatchI
|
||||
oldPatchi
|
||||
].patch().patch().start();
|
||||
|
||||
forAll(fld, j)
|
||||
{
|
||||
label oldFaceI = subsetter.faceMap()[newStart+j];
|
||||
label oldFacei = subsetter.faceMap()[newStart+j];
|
||||
|
||||
if (oldFaceI < oldStart || oldFaceI >= oldStart+oldSize)
|
||||
if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
|
||||
{
|
||||
fld[j] = exposedValue;
|
||||
}
|
||||
@ -233,9 +233,9 @@ void subsetSurfaceFields
|
||||
|
||||
label newStart = fld.patch().patch().start();
|
||||
|
||||
label oldPatchI = subsetter.patchMap()[patchi];
|
||||
label oldPatchi = subsetter.patchMap()[patchi];
|
||||
|
||||
if (oldPatchI == -1)
|
||||
if (oldPatchi == -1)
|
||||
{
|
||||
// New patch. Reset whole value.
|
||||
fld = exposedValue;
|
||||
@ -244,17 +244,17 @@ void subsetSurfaceFields
|
||||
{
|
||||
// Reset those faces that originate from different patch
|
||||
// or internal faces.
|
||||
label oldSize = volField.boundaryField()[oldPatchI].size();
|
||||
label oldSize = volField.boundaryField()[oldPatchi].size();
|
||||
label oldStart = volField.boundaryField()
|
||||
[
|
||||
oldPatchI
|
||||
oldPatchi
|
||||
].patch().patch().start();
|
||||
|
||||
forAll(fld, j)
|
||||
{
|
||||
label oldFaceI = subsetter.faceMap()[newStart+j];
|
||||
label oldFacei = subsetter.faceMap()[newStart+j];
|
||||
|
||||
if (oldFaceI < oldStart || oldFaceI >= oldStart+oldSize)
|
||||
if (oldFacei < oldStart || oldFacei >= oldStart+oldSize)
|
||||
{
|
||||
fld[j] = exposedValue;
|
||||
}
|
||||
@ -706,7 +706,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Exposed faces patch
|
||||
label defaultPatchI = findPatch(mesh.boundaryMesh(), defaultPatch);
|
||||
label defaultPatchi = findPatch(mesh.boundaryMesh(), defaultPatch);
|
||||
|
||||
|
||||
//
|
||||
@ -725,7 +725,7 @@ int main(int argc, char *argv[])
|
||||
blockedCells.invert(mesh.nCells());
|
||||
|
||||
// Create subsetted mesh.
|
||||
subsetter.setLargeCellSubset(blockedCells, defaultPatchI, true);
|
||||
subsetter.setLargeCellSubset(blockedCells, defaultPatchi, true);
|
||||
}
|
||||
|
||||
|
||||
@ -783,7 +783,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
scalar(Zero),
|
||||
volScalarField::typeName,
|
||||
scalarFlds
|
||||
@ -795,7 +795,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
vector(Zero),
|
||||
volVectorField::typeName,
|
||||
vectorFlds
|
||||
@ -813,7 +813,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
sphericalTensor(Zero),
|
||||
volSphericalTensorField::typeName,
|
||||
sphericalTensorFlds
|
||||
@ -825,7 +825,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
symmTensor(Zero),
|
||||
volSymmTensorField::typeName,
|
||||
symmTensorFlds
|
||||
@ -837,7 +837,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
tensor(Zero),
|
||||
volTensorField::typeName,
|
||||
tensorFlds
|
||||
@ -851,7 +851,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
scalar(Zero),
|
||||
surfaceScalarField::typeName,
|
||||
surfScalarFlds
|
||||
@ -863,7 +863,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
vector(Zero),
|
||||
surfaceVectorField::typeName,
|
||||
surfVectorFlds
|
||||
@ -881,7 +881,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
sphericalTensor(Zero),
|
||||
surfaceSphericalTensorField::typeName,
|
||||
surfSphericalTensorFlds
|
||||
@ -901,7 +901,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
symmTensor(Zero),
|
||||
surfaceSymmTensorField::typeName,
|
||||
surfSymmTensorFlds
|
||||
@ -913,7 +913,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
subsetter,
|
||||
objects,
|
||||
defaultPatchI,
|
||||
defaultPatchi,
|
||||
tensor(Zero),
|
||||
surfaceTensorField::typeName,
|
||||
surfTensorFlds
|
||||
|
||||
@ -458,15 +458,15 @@ void doRefinement
|
||||
|
||||
const labelListList& addedCells = multiRef.addedCells();
|
||||
|
||||
forAll(addedCells, oldCellI)
|
||||
forAll(addedCells, oldCelli)
|
||||
{
|
||||
const labelList& added = addedCells[oldCellI];
|
||||
const labelList& added = addedCells[oldCelli];
|
||||
|
||||
if (added.size())
|
||||
{
|
||||
// Give all cells resulting from split the refinement level
|
||||
// of the master.
|
||||
label masterLevel = ++refLevel[oldCellI];
|
||||
label masterLevel = ++refLevel[oldCelli];
|
||||
|
||||
forAll(added, i)
|
||||
{
|
||||
@ -629,7 +629,7 @@ int main(int argc, char *argv[])
|
||||
#include "createPolyMesh.H"
|
||||
|
||||
// If nessecary add oldInternalFaces patch
|
||||
label newPatchI = addPatch(mesh, "oldInternalFaces");
|
||||
label newPatchi = addPatch(mesh, "oldInternalFaces");
|
||||
|
||||
|
||||
//
|
||||
@ -854,7 +854,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
// Subset mesh to remove inside cells altogether. Updates cutCells,
|
||||
// refLevel.
|
||||
subsetMesh(mesh, writeMesh, newPatchI, inside, cutCells, refLevel);
|
||||
subsetMesh(mesh, writeMesh, newPatchi, inside, cutCells, refLevel);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -208,7 +208,7 @@ void Foam::cellSplitter::setRefinement
|
||||
// Add other pyramids
|
||||
for (label i = 1; i < cFaces.size(); i++)
|
||||
{
|
||||
label addedCellI =
|
||||
label addedCelli =
|
||||
meshMod.setAction
|
||||
(
|
||||
polyAddCell
|
||||
@ -221,7 +221,7 @@ void Foam::cellSplitter::setRefinement
|
||||
)
|
||||
);
|
||||
|
||||
newCells[i] = addedCellI;
|
||||
newCells[i] = addedCelli;
|
||||
}
|
||||
|
||||
cellToCells.insert(celli, newCells);
|
||||
@ -469,17 +469,17 @@ void Foam::cellSplitter::updateMesh(const mapPolyMesh& morphMap)
|
||||
|
||||
forAllConstIter(Map<label>, addedPoints_, iter)
|
||||
{
|
||||
label oldCellI = iter.key();
|
||||
label oldCelli = iter.key();
|
||||
|
||||
label newCellI = morphMap.reverseCellMap()[oldCellI];
|
||||
label newCelli = morphMap.reverseCellMap()[oldCelli];
|
||||
|
||||
label oldPointI = iter();
|
||||
|
||||
label newPointI = morphMap.reversePointMap()[oldPointI];
|
||||
|
||||
if (newCellI >= 0 && newPointI >= 0)
|
||||
if (newCelli >= 0 && newPointI >= 0)
|
||||
{
|
||||
newAddedPoints.insert(newCellI, newPointI);
|
||||
newAddedPoints.insert(newCelli, newPointI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -223,9 +223,9 @@ label findFace
|
||||
scalar almostMinDist = GREAT;
|
||||
label almostMinI = -1;
|
||||
|
||||
forAll(pp, patchFaceI)
|
||||
forAll(pp, patchFacei)
|
||||
{
|
||||
pointHit pHit(pp[patchFaceI].nearestPoint(nearPoint, points));
|
||||
pointHit pHit(pp[patchFacei].nearestPoint(nearPoint, points));
|
||||
|
||||
if (pHit.hit())
|
||||
{
|
||||
@ -235,12 +235,12 @@ label findFace
|
||||
almostMinI = minI;
|
||||
|
||||
minDist = pHit.distance();
|
||||
minI = patchFaceI + mesh.nInternalFaces();
|
||||
minI = patchFacei + mesh.nInternalFaces();
|
||||
}
|
||||
else if (pHit.distance() < almostMinDist)
|
||||
{
|
||||
almostMinDist = pHit.distance();
|
||||
almostMinI = patchFaceI + mesh.nInternalFaces();
|
||||
almostMinI = patchFacei + mesh.nInternalFaces();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 @@ int main(int argc, char *argv[])
|
||||
|
||||
const labelList& pCells = mesh.pointCells()[meshPointI];
|
||||
|
||||
forAll(pCells, pCellI)
|
||||
forAll(pCells, pCelli)
|
||||
{
|
||||
cutCells.insert(pCells[pCellI]);
|
||||
cutCells.insert(pCells[pCelli]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ labelList getInternalFaceOrder
|
||||
labelList oldToNew(owner.size(), -1);
|
||||
|
||||
// First unassigned face
|
||||
label newFaceI = 0;
|
||||
label newFacei = 0;
|
||||
|
||||
forAll(cells, celli)
|
||||
{
|
||||
@ -77,20 +77,20 @@ labelList getInternalFaceOrder
|
||||
{
|
||||
label facei = cFaces[i];
|
||||
|
||||
label nbrCellI = neighbour[facei];
|
||||
label nbrCelli = neighbour[facei];
|
||||
|
||||
if (nbrCellI != -1)
|
||||
if (nbrCelli != -1)
|
||||
{
|
||||
// Internal face. Get cell on other side.
|
||||
if (nbrCellI == celli)
|
||||
if (nbrCelli == celli)
|
||||
{
|
||||
nbrCellI = owner[facei];
|
||||
nbrCelli = owner[facei];
|
||||
}
|
||||
|
||||
if (celli < nbrCellI)
|
||||
if (celli < nbrCelli)
|
||||
{
|
||||
// CellI is master
|
||||
nbr[i] = nbrCellI;
|
||||
// Celli is master
|
||||
nbr[i] = nbrCelli;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -111,13 +111,13 @@ labelList getInternalFaceOrder
|
||||
{
|
||||
if (nbr[i] != -1)
|
||||
{
|
||||
oldToNew[cFaces[nbr.indices()[i]]] = newFaceI++;
|
||||
oldToNew[cFaces[nbr.indices()[i]]] = newFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Keep boundary faces in same order.
|
||||
for (label facei = newFaceI; facei < owner.size(); facei++)
|
||||
for (label facei = newFacei; facei < owner.size(); facei++)
|
||||
{
|
||||
oldToNew[facei] = facei;
|
||||
}
|
||||
@ -285,7 +285,7 @@ void ReadProblem
|
||||
)
|
||||
{
|
||||
// Index of foam patch
|
||||
label foamPatchI = -1;
|
||||
label foamPatchi = -1;
|
||||
|
||||
// Read prostar id
|
||||
|
||||
@ -311,7 +311,7 @@ void ReadProblem
|
||||
|
||||
if (prostarToFoamPatch.found(prostarI))
|
||||
{
|
||||
foamPatchI = prostarToFoamPatch[prostarI];
|
||||
foamPatchi = prostarToFoamPatch[prostarI];
|
||||
|
||||
// Read boundary type
|
||||
|
||||
@ -325,7 +325,7 @@ void ReadProblem
|
||||
char* s = new char[size + 1];
|
||||
CCMIOReadOptstr(NULL, boundary, "BoundaryType", &size, s);
|
||||
s[size] = '\0';
|
||||
foamPatchTypes[foamPatchI] = string::validate<word>(string(s));
|
||||
foamPatchTypes[foamPatchi] = string::validate<word>(string(s));
|
||||
delete [] s;
|
||||
}
|
||||
|
||||
@ -347,7 +347,7 @@ void ReadProblem
|
||||
char* name = new char[size + 1];
|
||||
CCMIOReadOptstr(NULL, boundary, "BoundaryName", &size, name);
|
||||
name[size] = '\0';
|
||||
foamPatchNames[foamPatchI] =
|
||||
foamPatchNames[foamPatchi] =
|
||||
string::validate<word>(string(name));
|
||||
delete [] name;
|
||||
}
|
||||
@ -360,22 +360,22 @@ void ReadProblem
|
||||
char* name = new char[size + 1];
|
||||
CCMIOReadOptstr(NULL, boundary, "Label", &size, name);
|
||||
name[size] = '\0';
|
||||
foamPatchNames[foamPatchI] =
|
||||
foamPatchNames[foamPatchi] =
|
||||
string::validate<word>(string(name));
|
||||
delete [] name;
|
||||
}
|
||||
else
|
||||
{
|
||||
foamPatchNames[foamPatchI] =
|
||||
foamPatchTypes[foamPatchI]
|
||||
+ Foam::name(foamPatchI);
|
||||
Pout<< "Made up name:" << foamPatchNames[foamPatchI]
|
||||
foamPatchNames[foamPatchi] =
|
||||
foamPatchTypes[foamPatchi]
|
||||
+ Foam::name(foamPatchi);
|
||||
Pout<< "Made up name:" << foamPatchNames[foamPatchi]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
Pout<< "Read patch:" << foamPatchI
|
||||
<< " name:" << foamPatchNames[foamPatchI]
|
||||
<< " foamPatchTypes:" << foamPatchTypes[foamPatchI]
|
||||
Pout<< "Read patch:" << foamPatchi
|
||||
<< " name:" << foamPatchNames[foamPatchi]
|
||||
<< " foamPatchTypes:" << foamPatchTypes[foamPatchi]
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -557,12 +557,12 @@ void ReadCells
|
||||
|
||||
for (unsigned int i = 0; i < nFaces; i++)
|
||||
{
|
||||
label foamFaceI = foamPatchStarts[regionI] + i;
|
||||
label foamFacei = foamPatchStarts[regionI] + i;
|
||||
|
||||
foamFaceMap[foamFaceI] = mapData[i];
|
||||
foamOwner[foamFaceI] = faceCells[i];
|
||||
foamNeighbour[foamFaceI] = -1;
|
||||
face& f = foamFaces[foamFaceI];
|
||||
foamFaceMap[foamFacei] = mapData[i];
|
||||
foamOwner[foamFacei] = faceCells[i];
|
||||
foamNeighbour[foamFacei] = -1;
|
||||
face& f = foamFaces[foamFacei];
|
||||
|
||||
f.setSize(faces[pos++]);
|
||||
forAll(f, fp)
|
||||
@ -812,8 +812,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Renumber cell labels
|
||||
{
|
||||
label maxCCMCellI = max(foamCellMap);
|
||||
labelList toFoamCells(invert(maxCCMCellI+1, foamCellMap));
|
||||
label maxCCMCelli = max(foamCellMap);
|
||||
labelList toFoamCells(invert(maxCCMCelli+1, foamCellMap));
|
||||
|
||||
inplaceRenumber(toFoamCells, foamOwner);
|
||||
inplaceRenumber(toFoamCells, foamNeighbour);
|
||||
@ -929,16 +929,16 @@ int main(int argc, char *argv[])
|
||||
// Create patches. Use patch types to determine what Foam types to generate.
|
||||
List<polyPatch*> newPatches(foamPatchNames.size());
|
||||
|
||||
label meshFaceI = foamPatchStarts[0];
|
||||
label meshFacei = foamPatchStarts[0];
|
||||
|
||||
forAll(newPatches, patchi)
|
||||
{
|
||||
const word& patchName = foamPatchNames[patchi];
|
||||
const word& patchType = foamPatchTypes[patchi];
|
||||
|
||||
Pout<< "Patch:" << patchName << " start at:" << meshFaceI
|
||||
Pout<< "Patch:" << patchName << " start at:" << meshFacei
|
||||
<< " size:" << foamPatchSizes[patchi]
|
||||
<< " end at:" << meshFaceI+foamPatchSizes[patchi]
|
||||
<< " end at:" << meshFacei+foamPatchSizes[patchi]
|
||||
<< endl;
|
||||
|
||||
if (patchType == "wall")
|
||||
@ -948,7 +948,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
@ -961,7 +961,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
@ -975,7 +975,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
patchType
|
||||
@ -990,20 +990,20 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
patchName,
|
||||
foamPatchSizes[patchi],
|
||||
meshFaceI,
|
||||
meshFacei,
|
||||
patchi,
|
||||
mesh.boundaryMesh(),
|
||||
word::null
|
||||
);
|
||||
}
|
||||
|
||||
meshFaceI += foamPatchSizes[patchi];
|
||||
meshFacei += foamPatchSizes[patchi];
|
||||
}
|
||||
|
||||
if (meshFaceI != foamOwner.size())
|
||||
if (meshFacei != foamOwner.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "meshFaceI:" << meshFaceI
|
||||
<< "meshFacei:" << meshFacei
|
||||
<< " nFaces:" << foamOwner.size()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -550,16 +550,16 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
labelListList curBlockCells = blocks[blockI].blockCells();
|
||||
|
||||
forAll(curBlockCells, blockCellI)
|
||||
forAll(curBlockCells, blockCelli)
|
||||
{
|
||||
labelList cellPoints(curBlockCells[blockCellI].size());
|
||||
labelList cellPoints(curBlockCells[blockCelli].size());
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
{
|
||||
cellPoints[pointI] =
|
||||
pointMergeList
|
||||
[
|
||||
curBlockCells[blockCellI][pointI]
|
||||
curBlockCells[blockCelli][pointI]
|
||||
+ blockOffsets[blockI]
|
||||
];
|
||||
}
|
||||
@ -587,11 +587,11 @@ int main(int argc, char *argv[])
|
||||
// Check if this name has been already created
|
||||
label existingPatch = -1;
|
||||
|
||||
for (label oldPatchI = 0; oldPatchI < nCreatedPatches; oldPatchI++)
|
||||
for (label oldPatchi = 0; oldPatchi < nCreatedPatches; oldPatchi++)
|
||||
{
|
||||
if (patchNames[oldPatchI] == cfxPatchNames[patchi])
|
||||
if (patchNames[oldPatchi] == cfxPatchNames[patchi])
|
||||
{
|
||||
existingPatch = oldPatchI;
|
||||
existingPatch = oldPatchi;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@ -144,16 +144,16 @@ cellShape create3DCellShape
|
||||
|
||||
bool found = false;
|
||||
|
||||
forAll(localFaces, meshFaceI)
|
||||
forAll(localFaces, meshFacei)
|
||||
{
|
||||
if (localFaces[meshFaceI].size() == firstModelFace.size())
|
||||
if (localFaces[meshFacei].size() == firstModelFace.size())
|
||||
{
|
||||
// Match. Insert points into the pointLabels
|
||||
found = true;
|
||||
|
||||
const labelList& curMeshFace = localFaces[meshFaceI];
|
||||
const labelList& curMeshFace = localFaces[meshFacei];
|
||||
|
||||
meshFaceUsed[meshFaceI] = true;
|
||||
meshFaceUsed[meshFacei] = true;
|
||||
|
||||
forAll(curMeshFace, pointI)
|
||||
{
|
||||
@ -173,26 +173,26 @@ cellShape create3DCellShape
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
for (label modelFaceI = 1; modelFaceI < modelFaces.size(); modelFaceI++)
|
||||
for (label modelFacei = 1; modelFacei < modelFaces.size(); modelFacei++)
|
||||
{
|
||||
// get the next model face
|
||||
const labelList& curModelFace =
|
||||
modelFaces
|
||||
[faceMatchingOrder[fluentCellModelID][modelFaceI]];
|
||||
[faceMatchingOrder[fluentCellModelID][modelFacei]];
|
||||
|
||||
found = false;
|
||||
|
||||
// Loop through mesh faces until a match is found
|
||||
forAll(localFaces, meshFaceI)
|
||||
forAll(localFaces, meshFacei)
|
||||
{
|
||||
if
|
||||
(
|
||||
!meshFaceUsed[meshFaceI]
|
||||
&& localFaces[meshFaceI].size() == curModelFace.size()
|
||||
!meshFaceUsed[meshFacei]
|
||||
&& localFaces[meshFacei].size() == curModelFace.size()
|
||||
)
|
||||
{
|
||||
// A possible match. A mesh face will be rotated, so make a copy
|
||||
labelList meshFaceLabels = localFaces[meshFaceI];
|
||||
labelList meshFaceLabels = localFaces[meshFacei];
|
||||
|
||||
for
|
||||
(
|
||||
@ -231,7 +231,7 @@ cellShape create3DCellShape
|
||||
meshFaceLabels[pointI];
|
||||
}
|
||||
|
||||
meshFaceUsed[meshFaceI] = true;
|
||||
meshFaceUsed[meshFacei] = true;
|
||||
|
||||
break;
|
||||
}
|
||||
@ -258,7 +258,7 @@ cellShape create3DCellShape
|
||||
// A model face is not matched. Shape detection failed
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find match for face "
|
||||
<< modelFaceI
|
||||
<< modelFacei
|
||||
<< ".\nModel: " << curModel.name() << " model face: "
|
||||
<< curModelFace << " Mesh faces: " << localFaces
|
||||
<< "Matched points: " << pointLabels
|
||||
|
||||
@ -949,23 +949,23 @@ int main(int argc, char *argv[])
|
||||
const face& f = pFaces[i];
|
||||
|
||||
// Find face in pp using all vertices of f.
|
||||
label patchFaceI = findFace(pp, f);
|
||||
label patchFacei = findFace(pp, f);
|
||||
|
||||
if (patchFaceI != -1)
|
||||
if (patchFacei != -1)
|
||||
{
|
||||
label meshFaceI = pp.start() + patchFaceI;
|
||||
label meshFacei = pp.start() + patchFacei;
|
||||
|
||||
repatcher.changePatchID(meshFaceI, patchi);
|
||||
repatcher.changePatchID(meshFacei, patchi);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Maybe internal face? If so add to faceZone with same index
|
||||
// - might be useful.
|
||||
label meshFaceI = findInternalFace(mesh, f);
|
||||
label meshFacei = findInternalFace(mesh, f);
|
||||
|
||||
if (meshFaceI != -1)
|
||||
if (meshFacei != -1)
|
||||
{
|
||||
zoneFaces[patchi].append(meshFaceI);
|
||||
zoneFaces[patchi].append(meshFacei);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1103,22 +1103,22 @@ int main(int argc, char *argv[])
|
||||
if (mesh.boundaryMesh()[defaultPatchID].size() == 0)
|
||||
{
|
||||
List<polyPatch*> newPatchPtrList((mesh.boundaryMesh().size() - 1));
|
||||
label newPatchI = 0;
|
||||
label newPatchi = 0;
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
if (patchi != defaultPatchID)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||
|
||||
newPatchPtrList[newPatchI] = patch.clone
|
||||
newPatchPtrList[newPatchi] = patch.clone
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
newPatchI,
|
||||
newPatchi,
|
||||
patch.size(),
|
||||
patch.start()
|
||||
).ptr();
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
}
|
||||
repatcher.changePatches(newPatchPtrList);
|
||||
|
||||
@ -816,21 +816,21 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Renumber vertex numbers on boundaryFaces
|
||||
|
||||
forAll(boundaryFaces, bFaceI)
|
||||
forAll(boundaryFaces, bFacei)
|
||||
{
|
||||
labelList foamVerts(renumber(unvToFoam, boundaryFaces[bFaceI]));
|
||||
labelList foamVerts(renumber(unvToFoam, boundaryFaces[bFacei]));
|
||||
|
||||
if (findIndex(foamVerts, -1) != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Boundary face " << bFaceI
|
||||
<< " unv vertices " << boundaryFaces[bFaceI]
|
||||
<< "Boundary face " << bFacei
|
||||
<< " unv vertices " << boundaryFaces[bFacei]
|
||||
<< " has some undefined vertices " << foamVerts
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
// Bit nasty: replace vertex list.
|
||||
boundaryFaces[bFaceI].transfer(foamVerts);
|
||||
boundaryFaces[bFacei].transfer(foamVerts);
|
||||
}
|
||||
|
||||
|
||||
@ -1021,13 +1021,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (boundaryFaceToIndex.found(faceIndices[i]))
|
||||
{
|
||||
label bFaceI = boundaryFaceToIndex[faceIndices[i]];
|
||||
label bFacei = boundaryFaceToIndex[faceIndices[i]];
|
||||
|
||||
if (own[bFaceI] != -1 && nei[bFaceI] == -1)
|
||||
if (own[bFacei] != -1 && nei[bFacei] == -1)
|
||||
{
|
||||
patchFaces[cnt] = boundaryFaces[bFaceI];
|
||||
patchFaces[cnt] = boundaryFaces[bFacei];
|
||||
cnt++;
|
||||
if (alreadyOnBoundary.found(bFaceI))
|
||||
if (alreadyOnBoundary.found(bFacei))
|
||||
{
|
||||
duplicateFaces = true;
|
||||
}
|
||||
@ -1100,8 +1100,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(patchFaces, i)
|
||||
{
|
||||
label bFaceI = boundaryFaceToIndex[faceIndices[i]];
|
||||
alreadyOnBoundary.insert(bFaceI);
|
||||
label bFacei = boundaryFaceToIndex[faceIndices[i]];
|
||||
alreadyOnBoundary.insert(bFacei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -207,16 +207,16 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
labelListList curBlockCells = blocks[blockI].blockCells();
|
||||
|
||||
forAll(curBlockCells, blockCellI)
|
||||
forAll(curBlockCells, blockCelli)
|
||||
{
|
||||
labelList cellPoints(curBlockCells[blockCellI].size());
|
||||
labelList cellPoints(curBlockCells[blockCelli].size());
|
||||
|
||||
forAll(cellPoints, pointI)
|
||||
{
|
||||
cellPoints[pointI] =
|
||||
oldToNew
|
||||
[
|
||||
curBlockCells[blockCellI][pointI]
|
||||
curBlockCells[blockCelli][pointI]
|
||||
+ blockOffsets[blockI]
|
||||
];
|
||||
}
|
||||
|
||||
@ -93,16 +93,16 @@ void Foam::sammMesh::createBoundaryFaces()
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[facePointCells[celli]];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (sammEqualFace(curCellFaces[cellFaceI], curFace))
|
||||
if (sammEqualFace(curCellFaces[cellFacei], curFace))
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
|
||||
// Set boundary face to the corresponding cell face
|
||||
// which guarantees it is outward-pointing
|
||||
curFace = curCellFaces[cellFaceI];
|
||||
curFace = curCellFaces[cellFacei];
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[facePointCells[celli]];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (curCellFaces[cellFaceI] == curFace)
|
||||
if (curCellFaces[cellFacei] == curFace)
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
@ -79,7 +79,7 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
// Debugging
|
||||
if
|
||||
(
|
||||
cellPolys_[facePointCells[celli]][cellFaceI]
|
||||
cellPolys_[facePointCells[celli]][cellFacei]
|
||||
!= -1
|
||||
)
|
||||
{
|
||||
@ -89,7 +89,7 @@ void Foam::sammMesh::createPolyBoundary()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
cellPolys_[facePointCells[celli]][cellFaceI] =
|
||||
cellPolys_[facePointCells[celli]][cellFacei] =
|
||||
nCreatedFaces;
|
||||
|
||||
nBoundaryFacesFound++;
|
||||
|
||||
@ -114,16 +114,16 @@ void Foam::sammMesh::createPolyCells()
|
||||
// get the list of search faces
|
||||
const faceList& searchFaces = cellFaces_[curNei];
|
||||
|
||||
forAll(searchFaces, neiFaceI)
|
||||
forAll(searchFaces, neiFacei)
|
||||
{
|
||||
if (searchFaces[neiFaceI] == curFace)
|
||||
if (searchFaces[neiFacei] == curFace)
|
||||
{
|
||||
// match!!
|
||||
found = true;
|
||||
|
||||
// Record the neighbour cell and face
|
||||
neiCells[facei] = curNei;
|
||||
faceOfNeiCell[facei] = neiFaceI;
|
||||
faceOfNeiCell[facei] = neiFacei;
|
||||
nNeighbours++;
|
||||
|
||||
break;
|
||||
|
||||
@ -129,16 +129,16 @@ void Foam::starMesh::markBoundaryFaces()
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[curCellIndex];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (starEqualFace(curFace, curCellFaces[cellFaceI]))
|
||||
if (starEqualFace(curFace, curCellFaces[cellFacei]))
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
|
||||
// Set boundary face to the corresponding cell face
|
||||
curBoundaryCellIDs[facei] = curCellIndex;
|
||||
curBoundaryCellFaceIDs[facei] = cellFaceI;
|
||||
curBoundaryCellFaceIDs[facei] = cellFacei;
|
||||
}
|
||||
if (found) break;
|
||||
}
|
||||
|
||||
@ -69,9 +69,9 @@ void Foam::starMesh::createPolyBoundary()
|
||||
const faceList& curCellFaces =
|
||||
cellFaces_[facePointCells[celli]];
|
||||
|
||||
forAll(curCellFaces, cellFaceI)
|
||||
forAll(curCellFaces, cellFacei)
|
||||
{
|
||||
if (curCellFaces[cellFaceI] == curFace)
|
||||
if (curCellFaces[cellFacei] == curFace)
|
||||
{
|
||||
// Found the cell face corresponding to this face
|
||||
found = true;
|
||||
@ -79,13 +79,13 @@ void Foam::starMesh::createPolyBoundary()
|
||||
// Debugging
|
||||
if
|
||||
(
|
||||
cellPolys_[facePointCells[celli]][cellFaceI]
|
||||
cellPolys_[facePointCells[celli]][cellFacei]
|
||||
!= -1
|
||||
)
|
||||
{
|
||||
if
|
||||
(
|
||||
cellPolys_[facePointCells[celli]][cellFaceI]
|
||||
cellPolys_[facePointCells[celli]][cellFacei]
|
||||
> nInternalFaces_
|
||||
)
|
||||
{
|
||||
@ -94,24 +94,24 @@ void Foam::starMesh::createPolyBoundary()
|
||||
<< "\nProbably multiple definitions "
|
||||
<< "of a single boundary face. " << endl
|
||||
<< "Other boundary face: "
|
||||
<< curCellFaces[cellFaceI]
|
||||
<< curCellFaces[cellFacei]
|
||||
<< endl;
|
||||
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll(curCellFaces[cellFaceI], spI)
|
||||
forAll(curCellFaces[cellFacei], spI)
|
||||
{
|
||||
// check if the point is given by STAR
|
||||
// or created locally
|
||||
if
|
||||
(
|
||||
curCellFaces[cellFaceI][spI] > -1
|
||||
&& curCellFaces[cellFaceI][spI]
|
||||
curCellFaces[cellFacei][spI] > -1
|
||||
&& curCellFaces[cellFacei][spI]
|
||||
< starPointID_.size()
|
||||
)
|
||||
{
|
||||
Info<< ","
|
||||
<< starPointID_
|
||||
[curCellFaces[cellFaceI][spI]];
|
||||
[curCellFaces[cellFacei][spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -128,24 +128,24 @@ void Foam::starMesh::createPolyBoundary()
|
||||
<< "boundary face on a previously "
|
||||
<< "matched internal face. " << endl
|
||||
<< "Internal face: "
|
||||
<< curCellFaces[cellFaceI]
|
||||
<< curCellFaces[cellFacei]
|
||||
<< endl;
|
||||
|
||||
Info<< "PROSTAR Command: vset,news,vlis";
|
||||
forAll(curCellFaces[cellFaceI], spI)
|
||||
forAll(curCellFaces[cellFacei], spI)
|
||||
{
|
||||
// check if the point is given by STAR
|
||||
// or created locally
|
||||
if
|
||||
(
|
||||
curCellFaces[cellFaceI][spI] > -1
|
||||
&& curCellFaces[cellFaceI][spI]
|
||||
curCellFaces[cellFacei][spI] > -1
|
||||
&& curCellFaces[cellFacei][spI]
|
||||
< starPointID_.size()
|
||||
)
|
||||
{
|
||||
Info<< ","
|
||||
<< starPointID_
|
||||
[curCellFaces[cellFaceI][spI]];
|
||||
[curCellFaces[cellFacei][spI]];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -157,7 +157,7 @@ void Foam::starMesh::createPolyBoundary()
|
||||
}
|
||||
}
|
||||
|
||||
cellPolys_[facePointCells[celli]][cellFaceI] =
|
||||
cellPolys_[facePointCells[celli]][cellFacei] =
|
||||
nCreatedFaces;
|
||||
|
||||
nBoundaryFacesFound++;
|
||||
|
||||
@ -114,16 +114,16 @@ void Foam::starMesh::createPolyCells()
|
||||
// get the list of search faces
|
||||
const faceList& searchFaces = cellFaces_[curNei];
|
||||
|
||||
forAll(searchFaces, neiFaceI)
|
||||
forAll(searchFaces, neiFacei)
|
||||
{
|
||||
if (searchFaces[neiFaceI] == curFace)
|
||||
if (searchFaces[neiFacei] == curFace)
|
||||
{
|
||||
// match!!
|
||||
found = true;
|
||||
|
||||
// Record the neighbour cell and face
|
||||
neiCells[facei] = curNei;
|
||||
faceOfNeiCell[facei] = neiFaceI;
|
||||
faceOfNeiCell[facei] = neiFacei;
|
||||
nNeighbours++;
|
||||
|
||||
break;
|
||||
|
||||
@ -406,9 +406,9 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
IStringStream faceLine(line);
|
||||
|
||||
label tetGenFaceI, dummy, region;
|
||||
label tetGenFacei, dummy, region;
|
||||
|
||||
faceLine >> tetGenFaceI;
|
||||
faceLine >> tetGenFacei;
|
||||
|
||||
// Read face and reverse orientation (Foam needs outwards
|
||||
// pointing)
|
||||
|
||||
@ -183,11 +183,11 @@ void updateFaceLabels(const mapPolyMesh& map, labelList& faceLabels)
|
||||
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
label oldFaceI = faceLabels[i];
|
||||
label oldFacei = faceLabels[i];
|
||||
|
||||
if (reverseMap[oldFaceI] >= 0)
|
||||
if (reverseMap[oldFacei] >= 0)
|
||||
{
|
||||
newFaceLabels[newI++] = reverseMap[oldFaceI];
|
||||
newFaceLabels[newI++] = reverseMap[oldFacei];
|
||||
}
|
||||
}
|
||||
newFaceLabels.setSize(newI);
|
||||
@ -203,11 +203,11 @@ void updateCellSet(const mapPolyMesh& map, labelHashSet& cellLabels)
|
||||
|
||||
forAll(cellLabels, i)
|
||||
{
|
||||
label oldCellI = cellLabels[i];
|
||||
label oldCelli = cellLabels[i];
|
||||
|
||||
if (reverseMap[oldCellI] >= 0)
|
||||
if (reverseMap[oldCelli] >= 0)
|
||||
{
|
||||
newCellLabels.insert(reverseMap[oldCellI]);
|
||||
newCellLabels.insert(reverseMap[oldCelli]);
|
||||
}
|
||||
}
|
||||
cellLabels.transfer(newCellLabels);
|
||||
@ -224,8 +224,8 @@ void changeFrontBackPatches
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label frontPatchI = findPatchID(patches, frontPatchName);
|
||||
label backPatchI = findPatchID(patches, backPatchName);
|
||||
label frontPatchi = findPatchID(patches, frontPatchName);
|
||||
label backPatchi = findPatchID(patches, backPatchName);
|
||||
|
||||
DynamicList<polyPatch*> newPatches(patches.size());
|
||||
|
||||
@ -233,7 +233,7 @@ void changeFrontBackPatches
|
||||
{
|
||||
const polyPatch& pp(patches[patchi]);
|
||||
|
||||
if (patchi == frontPatchI || patchi == backPatchI)
|
||||
if (patchi == frontPatchi || patchi == backPatchi)
|
||||
{
|
||||
newPatches.append
|
||||
(
|
||||
@ -395,28 +395,28 @@ int main(int argc, char *argv[])
|
||||
polyTopoChange meshMod(mesh);
|
||||
forAll(meshFaces, i)
|
||||
{
|
||||
label meshFaceI = meshFaces[i];
|
||||
label meshFacei = meshFaces[i];
|
||||
|
||||
label patchi = patches.whichPatch(meshFaceI);
|
||||
label own = mesh.faceOwner()[meshFaceI];
|
||||
label patchi = patches.whichPatch(meshFacei);
|
||||
label own = mesh.faceOwner()[meshFacei];
|
||||
label nei = -1;
|
||||
if (patchi == -1)
|
||||
{
|
||||
nei = mesh.faceNeighbour()[meshFaceI];
|
||||
nei = mesh.faceNeighbour()[meshFacei];
|
||||
}
|
||||
|
||||
label zoneI = mesh.faceZones().whichZone(meshFaceI);
|
||||
label zoneI = mesh.faceZones().whichZone(meshFacei);
|
||||
bool zoneFlip = false;
|
||||
if (zoneI != -1)
|
||||
{
|
||||
label index = mesh.faceZones()[zoneI].whichFace(meshFaceI);
|
||||
label index = mesh.faceZones()[zoneI].whichFace(meshFacei);
|
||||
zoneFlip = mesh.faceZones()[zoneI].flipMap()[index];
|
||||
}
|
||||
|
||||
meshMod.modifyFace
|
||||
(
|
||||
mesh.faces()[meshFaceI].reverseFace(), // modified face
|
||||
meshFaceI, // label of face
|
||||
mesh.faces()[meshFacei].reverseFace(), // modified face
|
||||
meshFacei, // label of face
|
||||
own, // owner
|
||||
nei, // neighbour
|
||||
true, // face flip
|
||||
@ -538,11 +538,11 @@ int main(int argc, char *argv[])
|
||||
patchi++
|
||||
)
|
||||
{
|
||||
label nbrProcI = patchToNbrProc[patchi];
|
||||
label nbrProci = patchToNbrProc[patchi];
|
||||
|
||||
Pout<< "Adding patch " << patchi
|
||||
<< " between " << Pstream::myProcNo()
|
||||
<< " and " << nbrProcI
|
||||
<< " and " << nbrProci
|
||||
<< endl;
|
||||
|
||||
newPatches.append
|
||||
@ -554,7 +554,7 @@ int main(int argc, char *argv[])
|
||||
patchi, // index
|
||||
mesh.boundaryMesh(),// polyBoundaryMesh
|
||||
Pstream::myProcNo(),// myProcNo
|
||||
nbrProcI // neighbProcNo
|
||||
nbrProci // neighbProcNo
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -688,10 +688,10 @@ int main(int argc, char *argv[])
|
||||
const labelListList& layerFaces = layerExtrude.layerFaces();
|
||||
backPatchFaces.setSize(layerFaces.size());
|
||||
frontPatchFaces.setSize(layerFaces.size());
|
||||
forAll(backPatchFaces, patchFaceI)
|
||||
forAll(backPatchFaces, patchFacei)
|
||||
{
|
||||
backPatchFaces[patchFaceI] = layerFaces[patchFaceI].first();
|
||||
frontPatchFaces[patchFaceI] = layerFaces[patchFaceI].last();
|
||||
backPatchFaces[patchFacei] = layerFaces[patchFacei].first();
|
||||
frontPatchFaces[patchFacei] = layerFaces[patchFacei].last();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -185,11 +185,11 @@ label addPatch
|
||||
|
||||
patchi = newPatches.size();
|
||||
|
||||
label startFaceI = 0;
|
||||
label startFacei = 0;
|
||||
if (patchi > 0)
|
||||
{
|
||||
const polyPatch& pp = *newPatches.last();
|
||||
startFaceI = pp.start()+pp.size();
|
||||
startFacei = pp.start()+pp.size();
|
||||
}
|
||||
|
||||
|
||||
@ -200,7 +200,7 @@ label addPatch
|
||||
PatchType::typeName,
|
||||
patchName,
|
||||
0, // size
|
||||
startFaceI, // nFaces
|
||||
startFacei, // nFaces
|
||||
patchi,
|
||||
patches
|
||||
).ptr()
|
||||
@ -240,17 +240,17 @@ label addPatch
|
||||
|
||||
patchi = newPatches.size();
|
||||
|
||||
label startFaceI = 0;
|
||||
label startFacei = 0;
|
||||
if (patchi > 0)
|
||||
{
|
||||
const polyPatch& pp = *newPatches.last();
|
||||
startFaceI = pp.start()+pp.size();
|
||||
startFacei = pp.start()+pp.size();
|
||||
}
|
||||
|
||||
dictionary patchDict(dict);
|
||||
patchDict.set("type", PatchType::typeName);
|
||||
patchDict.set("nFaces", 0);
|
||||
patchDict.set("startFace", startFaceI);
|
||||
patchDict.set("startFace", startFacei);
|
||||
|
||||
newPatches.append
|
||||
(
|
||||
@ -873,9 +873,9 @@ void addCoupledPatches
|
||||
{
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label procI = procID[eFaces[i]];
|
||||
minProcID[edgeI] = min(minProcID[edgeI], procI);
|
||||
maxProcID[edgeI] = max(maxProcID[edgeI], procI);
|
||||
label proci = procID[eFaces[i]];
|
||||
minProcID[edgeI] = min(minProcID[edgeI], proci);
|
||||
maxProcID[edgeI] = max(maxProcID[edgeI], proci);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -915,14 +915,14 @@ void addCoupledPatches
|
||||
)
|
||||
{
|
||||
// coupled boundary edge. Find matching patch.
|
||||
label nbrProcI = minProcID[edgeI];
|
||||
if (nbrProcI == Pstream::myProcNo())
|
||||
label nbrProci = minProcID[edgeI];
|
||||
if (nbrProci == Pstream::myProcNo())
|
||||
{
|
||||
nbrProcI = maxProcID[edgeI];
|
||||
nbrProci = maxProcID[edgeI];
|
||||
}
|
||||
|
||||
|
||||
if (nbrProcI == Pstream::myProcNo())
|
||||
if (nbrProci == Pstream::myProcNo())
|
||||
{
|
||||
// Cyclic patch since both procs the same. This cyclic should
|
||||
// already exist in newPatches so no adding necessary.
|
||||
@ -938,13 +938,13 @@ void addCoupledPatches
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label newPatchI = findPatchID
|
||||
label newPatchi = findPatchID
|
||||
(
|
||||
newPatches,
|
||||
patches[patches.whichPatch(facei)].name()
|
||||
);
|
||||
|
||||
sidePatchID[edgeI] = newPatchI;
|
||||
sidePatchID[edgeI] = newPatchi;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -958,7 +958,7 @@ void addCoupledPatches
|
||||
// Processor patch
|
||||
word name
|
||||
(
|
||||
processorPolyPatch::newName(Pstream::myProcNo(), nbrProcI)
|
||||
processorPolyPatch::newName(Pstream::myProcNo(), nbrProci)
|
||||
);
|
||||
|
||||
sidePatchID[edgeI] = findPatchID(newPatches, name);
|
||||
@ -967,7 +967,7 @@ void addCoupledPatches
|
||||
{
|
||||
dictionary patchDict;
|
||||
patchDict.add("myProcNo", Pstream::myProcNo());
|
||||
patchDict.add("neighbProcNo", nbrProcI);
|
||||
patchDict.add("neighbProcNo", nbrProci);
|
||||
|
||||
sidePatchID[edgeI] = addPatch<processorPolyPatch>
|
||||
(
|
||||
@ -1154,9 +1154,9 @@ tmp<pointField> calcOffset
|
||||
|
||||
forAll(fc, i)
|
||||
{
|
||||
label meshFaceI = pp.start()+i;
|
||||
label patchFaceI = mag(extruder.faceToFaceMap()[meshFaceI])-1;
|
||||
point patchFc = extrudePatch[patchFaceI].centre
|
||||
label meshFacei = pp.start()+i;
|
||||
label patchFacei = mag(extruder.faceToFaceMap()[meshFacei])-1;
|
||||
point patchFc = extrudePatch[patchFacei].centre
|
||||
(
|
||||
extrudePatch.points()
|
||||
);
|
||||
@ -1310,7 +1310,7 @@ void extrudeGeometricProperties
|
||||
if (extruder.faceToFaceMap()[facei] != 0)
|
||||
{
|
||||
// 'horizontal' face
|
||||
label patchFaceI = mag(extruder.faceToFaceMap()[facei])-1;
|
||||
label patchFacei = mag(extruder.faceToFaceMap()[facei])-1;
|
||||
|
||||
label celli = regionMesh.faceOwner()[facei];
|
||||
if (regionMesh.isInternalFace(facei))
|
||||
@ -1335,8 +1335,8 @@ void extrudeGeometricProperties
|
||||
// Recalculate based on extrusion model
|
||||
faceCentres[facei] = model
|
||||
(
|
||||
patchFaceCentres[patchFaceI],
|
||||
extrudePatch.faceNormals()[patchFaceI],
|
||||
patchFaceCentres[patchFacei],
|
||||
extrudePatch.faceNormals()[patchFacei],
|
||||
layerI
|
||||
);
|
||||
}
|
||||
@ -1387,7 +1387,7 @@ void extrudeGeometricProperties
|
||||
|
||||
forAll(extruder.cellToFaceMap(), celli)
|
||||
{
|
||||
label patchFaceI = extruder.cellToFaceMap()[celli];
|
||||
label patchFacei = extruder.cellToFaceMap()[celli];
|
||||
|
||||
// Calculate layer from cell numbering (see createShellMesh)
|
||||
label layerI = (celli % model.nLayers());
|
||||
@ -1395,14 +1395,14 @@ void extrudeGeometricProperties
|
||||
// Recalculate based on extrusion model
|
||||
point pt0 = model
|
||||
(
|
||||
patchFaceCentres[patchFaceI],
|
||||
extrudePatch.faceNormals()[patchFaceI],
|
||||
patchFaceCentres[patchFacei],
|
||||
extrudePatch.faceNormals()[patchFacei],
|
||||
layerI
|
||||
);
|
||||
point pt1 = model
|
||||
(
|
||||
patchFaceCentres[patchFaceI],
|
||||
extrudePatch.faceNormals()[patchFaceI],
|
||||
patchFaceCentres[patchFacei],
|
||||
extrudePatch.faceNormals()[patchFacei],
|
||||
layerI+1
|
||||
);
|
||||
|
||||
@ -1960,13 +1960,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (!isA<processorPolyPatch>(patches[patchi]))
|
||||
{
|
||||
label newPatchI = regionPatches.size();
|
||||
label newPatchi = regionPatches.size();
|
||||
regionPatches.append
|
||||
(
|
||||
patches[patchi].clone
|
||||
(
|
||||
patches,
|
||||
newPatchI,
|
||||
newPatchi,
|
||||
0, // size
|
||||
0 // start
|
||||
).ptr()
|
||||
@ -2240,12 +2240,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (facei != -1)
|
||||
{
|
||||
label newPatchI = findPatchID
|
||||
label newPatchi = findPatchID
|
||||
(
|
||||
regionPatches,
|
||||
patches[patches.whichPatch(facei)].name()
|
||||
);
|
||||
ePatches.setSize(eFaces.size(), newPatchI);
|
||||
ePatches.setSize(eFaces.size(), newPatchi);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -2683,20 +2683,20 @@ int main(int argc, char *argv[])
|
||||
polyTopoChange meshMod(mesh);
|
||||
|
||||
// Modify faces to be in bottom (= always coupled) patch
|
||||
forAll(extrudeMeshFaces, zoneFaceI)
|
||||
forAll(extrudeMeshFaces, zoneFacei)
|
||||
{
|
||||
label meshFaceI = extrudeMeshFaces[zoneFaceI];
|
||||
label zoneI = zoneID[zoneFaceI];
|
||||
bool flip = zoneFlipMap[zoneFaceI];
|
||||
const face& f = mesh.faces()[meshFaceI];
|
||||
label meshFacei = extrudeMeshFaces[zoneFacei];
|
||||
label zoneI = zoneID[zoneFacei];
|
||||
bool flip = zoneFlipMap[zoneFacei];
|
||||
const face& f = mesh.faces()[meshFacei];
|
||||
|
||||
if (!flip)
|
||||
{
|
||||
meshMod.modifyFace
|
||||
(
|
||||
f, // modified face
|
||||
meshFaceI, // label of face being modified
|
||||
mesh.faceOwner()[meshFaceI],// owner
|
||||
meshFacei, // label of face being modified
|
||||
mesh.faceOwner()[meshFacei],// owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
interMeshBottomPatch[zoneI],// patch for face
|
||||
@ -2704,13 +2704,13 @@ int main(int argc, char *argv[])
|
||||
flip // face flip in zone
|
||||
);
|
||||
}
|
||||
else if (mesh.isInternalFace(meshFaceI))
|
||||
else if (mesh.isInternalFace(meshFacei))
|
||||
{
|
||||
meshMod.modifyFace
|
||||
(
|
||||
f.reverseFace(), // modified face
|
||||
meshFaceI, // label of modified face
|
||||
mesh.faceNeighbour()[meshFaceI],// owner
|
||||
meshFacei, // label of modified face
|
||||
mesh.faceNeighbour()[meshFacei],// owner
|
||||
-1, // neighbour
|
||||
true, // face flip
|
||||
interMeshBottomPatch[zoneI], // patch for face
|
||||
@ -2722,20 +2722,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (zoneShadowNames.size() > 0) //if there is a top faceZone specified
|
||||
{
|
||||
forAll(extrudeMeshFaces, zoneFaceI)
|
||||
forAll(extrudeMeshFaces, zoneFacei)
|
||||
{
|
||||
label meshFaceI = extrudeMeshShadowFaces[zoneFaceI];
|
||||
label zoneI = zoneShadowID[zoneFaceI];
|
||||
bool flip = zoneShadowFlipMap[zoneFaceI];
|
||||
const face& f = mesh.faces()[meshFaceI];
|
||||
label meshFacei = extrudeMeshShadowFaces[zoneFacei];
|
||||
label zoneI = zoneShadowID[zoneFacei];
|
||||
bool flip = zoneShadowFlipMap[zoneFacei];
|
||||
const face& f = mesh.faces()[meshFacei];
|
||||
|
||||
if (!flip)
|
||||
{
|
||||
meshMod.modifyFace
|
||||
(
|
||||
f, // modified face
|
||||
meshFaceI, // face being modified
|
||||
mesh.faceOwner()[meshFaceI],// owner
|
||||
meshFacei, // face being modified
|
||||
mesh.faceOwner()[meshFacei],// owner
|
||||
-1, // neighbour
|
||||
false, // face flip
|
||||
interMeshTopPatch[zoneI], // patch for face
|
||||
@ -2743,13 +2743,13 @@ int main(int argc, char *argv[])
|
||||
flip // face flip in zone
|
||||
);
|
||||
}
|
||||
else if (mesh.isInternalFace(meshFaceI))
|
||||
else if (mesh.isInternalFace(meshFacei))
|
||||
{
|
||||
meshMod.modifyFace
|
||||
(
|
||||
f.reverseFace(), // modified face
|
||||
meshFaceI, // label modified face
|
||||
mesh.faceNeighbour()[meshFaceI],// owner
|
||||
meshFacei, // label modified face
|
||||
mesh.faceNeighbour()[meshFacei],// owner
|
||||
-1, // neighbour
|
||||
true, // face flip
|
||||
interMeshTopPatch[zoneI], // patch for face
|
||||
@ -2762,25 +2762,25 @@ int main(int argc, char *argv[])
|
||||
else
|
||||
{
|
||||
// Add faces (using same points) to be in top patch
|
||||
forAll(extrudeMeshFaces, zoneFaceI)
|
||||
forAll(extrudeMeshFaces, zoneFacei)
|
||||
{
|
||||
label meshFaceI = extrudeMeshFaces[zoneFaceI];
|
||||
label zoneI = zoneID[zoneFaceI];
|
||||
bool flip = zoneFlipMap[zoneFaceI];
|
||||
const face& f = mesh.faces()[meshFaceI];
|
||||
label meshFacei = extrudeMeshFaces[zoneFacei];
|
||||
label zoneI = zoneID[zoneFacei];
|
||||
bool flip = zoneFlipMap[zoneFacei];
|
||||
const face& f = mesh.faces()[meshFacei];
|
||||
|
||||
if (!flip)
|
||||
{
|
||||
if (mesh.isInternalFace(meshFaceI))
|
||||
if (mesh.isInternalFace(meshFacei))
|
||||
{
|
||||
meshMod.addFace
|
||||
(
|
||||
f.reverseFace(), // modified face
|
||||
mesh.faceNeighbour()[meshFaceI],// owner
|
||||
mesh.faceNeighbour()[meshFacei],// owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
meshFaceI, // master face
|
||||
meshFacei, // master face
|
||||
true, // flip flux
|
||||
interMeshTopPatch[zoneI], // patch for face
|
||||
-1, // zone for face
|
||||
@ -2793,11 +2793,11 @@ int main(int argc, char *argv[])
|
||||
meshMod.addFace
|
||||
(
|
||||
f, // face
|
||||
mesh.faceOwner()[meshFaceI], // owner
|
||||
mesh.faceOwner()[meshFacei], // owner
|
||||
-1, // neighbour
|
||||
-1, // master point
|
||||
-1, // master edge
|
||||
meshFaceI, // master face
|
||||
meshFacei, // master face
|
||||
false, // flip flux
|
||||
interMeshTopPatch[zoneI], // patch for face
|
||||
-1, // zone for face
|
||||
|
||||
@ -92,8 +92,8 @@ Foam::extrude2DMesh::extrude2DMesh
|
||||
model_(model),
|
||||
modelType_(dict.lookup("extrudeModel")),
|
||||
patchType_(dict.lookup("patchType")),
|
||||
frontPatchI_(-1),
|
||||
backPatchI_(-1)
|
||||
frontPatchi_(-1),
|
||||
backPatchi_(-1)
|
||||
{
|
||||
check2D();
|
||||
}
|
||||
@ -111,8 +111,8 @@ void Foam::extrude2DMesh::addFrontBackPatches()
|
||||
{
|
||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||
|
||||
frontPatchI_ = patches.findPatchID("front");
|
||||
backPatchI_ = patches.findPatchID("back");
|
||||
frontPatchi_ = patches.findPatchID("front");
|
||||
backPatchi_ = patches.findPatchID("back");
|
||||
|
||||
// Add patch.
|
||||
List<polyPatch*> newPatches(patches.size() + 2);
|
||||
@ -131,59 +131,59 @@ void Foam::extrude2DMesh::addFrontBackPatches()
|
||||
).ptr();
|
||||
}
|
||||
|
||||
if (frontPatchI_ == -1)
|
||||
if (frontPatchi_ == -1)
|
||||
{
|
||||
frontPatchI_ = patches.size();
|
||||
frontPatchi_ = patches.size();
|
||||
|
||||
newPatches[frontPatchI_] =
|
||||
newPatches[frontPatchi_] =
|
||||
polyPatch::New
|
||||
(
|
||||
patchType_,
|
||||
"front",
|
||||
0,
|
||||
mesh_.nFaces(),
|
||||
frontPatchI_,
|
||||
frontPatchi_,
|
||||
patches
|
||||
).ptr();
|
||||
|
||||
// newPatches[frontPatchI_] = polyPatch::New
|
||||
// newPatches[frontPatchi_] = polyPatch::New
|
||||
// (
|
||||
// "front",
|
||||
// patchDict_,
|
||||
// frontPatchI_,
|
||||
// frontPatchi_,
|
||||
// patches
|
||||
// ).ptr();
|
||||
|
||||
Info<< "Adding patch " << newPatches[frontPatchI_]->name()
|
||||
<< " at index " << frontPatchI_
|
||||
Info<< "Adding patch " << newPatches[frontPatchi_]->name()
|
||||
<< " at index " << frontPatchi_
|
||||
<< " for front faces." << nl << endl;
|
||||
}
|
||||
|
||||
if (backPatchI_ == -1)
|
||||
if (backPatchi_ == -1)
|
||||
{
|
||||
backPatchI_ = patches.size() + 1;
|
||||
backPatchi_ = patches.size() + 1;
|
||||
|
||||
newPatches[backPatchI_] =
|
||||
newPatches[backPatchi_] =
|
||||
polyPatch::New
|
||||
(
|
||||
patchType_,
|
||||
"back",
|
||||
0,
|
||||
mesh_.nFaces(),
|
||||
backPatchI_,
|
||||
backPatchi_,
|
||||
patches
|
||||
).ptr();
|
||||
|
||||
// newPatches[frontPatchI_] = polyPatch::New
|
||||
// newPatches[frontPatchi_] = polyPatch::New
|
||||
// (
|
||||
// "back",
|
||||
// patchDict_,
|
||||
// backPatchI_,
|
||||
// backPatchi_,
|
||||
// patches
|
||||
// ).ptr();
|
||||
|
||||
Info<< "Adding patch " << newPatches[backPatchI_]->name()
|
||||
<< " at index " << backPatchI_
|
||||
Info<< "Adding patch " << newPatches[backPatchi_]->name()
|
||||
<< " at index " << backPatchi_
|
||||
<< " for back faces." << nl << endl;
|
||||
}
|
||||
|
||||
@ -330,10 +330,10 @@ void Foam::extrude2DMesh::setRefinement
|
||||
label currentLayerOffset = layer*mesh_.nPoints();
|
||||
label nextLayerOffset = currentLayerOffset + mesh_.nPoints();
|
||||
|
||||
label startFaceI = patches[patchi].start();
|
||||
label endFaceI = startFaceI + patches[patchi].size();
|
||||
label startFacei = patches[patchi].start();
|
||||
label endFacei = startFacei + patches[patchi].size();
|
||||
|
||||
for (label facei = startFaceI; facei < endFaceI; facei++)
|
||||
for (label facei = startFacei; facei < endFacei; facei++)
|
||||
{
|
||||
label zoneID = mesh_.faceZones().whichZone(facei);
|
||||
bool zoneFlip = false;
|
||||
@ -386,12 +386,12 @@ void Foam::extrude2DMesh::setRefinement
|
||||
face frontFace(cFaces.size());
|
||||
|
||||
// Make a loop out of faces.
|
||||
label nextFaceI = cFaces[0];
|
||||
label nextFacei = cFaces[0];
|
||||
|
||||
const face& f = faces[nextFaceI];
|
||||
const face& f = faces[nextFacei];
|
||||
|
||||
label nextPointI;
|
||||
if (mesh_.faceOwner()[nextFaceI] == celli)
|
||||
if (mesh_.faceOwner()[nextFacei] == celli)
|
||||
{
|
||||
frontFace[0] = f[0];
|
||||
nextPointI = f[1];
|
||||
@ -408,23 +408,23 @@ void Foam::extrude2DMesh::setRefinement
|
||||
frontFace[i] = nextPointI;
|
||||
|
||||
// Find face containing pointI
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
label facei = cFaces[cFaceI];
|
||||
if (facei != nextFaceI)
|
||||
label facei = cFaces[cFacei];
|
||||
if (facei != nextFacei)
|
||||
{
|
||||
const face& f = faces[facei];
|
||||
|
||||
if (f[0] == nextPointI)
|
||||
{
|
||||
nextPointI = f[1];
|
||||
nextFaceI = facei;
|
||||
nextFacei = facei;
|
||||
break;
|
||||
}
|
||||
else if (f[1] == nextPointI)
|
||||
{
|
||||
nextPointI = f[0];
|
||||
nextFaceI = facei;
|
||||
nextFacei = facei;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -482,12 +482,12 @@ void Foam::extrude2DMesh::setRefinement
|
||||
face frontFace(cFaces.size());
|
||||
|
||||
// Make a loop out of faces.
|
||||
label nextFaceI = cFaces[0];
|
||||
label nextFacei = cFaces[0];
|
||||
|
||||
const face& f = faces[nextFaceI];
|
||||
const face& f = faces[nextFacei];
|
||||
|
||||
label nextPointI;
|
||||
if (mesh_.faceOwner()[nextFaceI] == celli)
|
||||
if (mesh_.faceOwner()[nextFacei] == celli)
|
||||
{
|
||||
frontFace[0] = f[0];
|
||||
nextPointI = f[1];
|
||||
@ -504,23 +504,23 @@ void Foam::extrude2DMesh::setRefinement
|
||||
frontFace[i] = nextPointI;
|
||||
|
||||
// Find face containing pointI
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
label facei = cFaces[cFaceI];
|
||||
if (facei != nextFaceI)
|
||||
label facei = cFaces[cFacei];
|
||||
if (facei != nextFacei)
|
||||
{
|
||||
const face& f = faces[facei];
|
||||
|
||||
if (f[0] == nextPointI)
|
||||
{
|
||||
nextPointI = f[1];
|
||||
nextFaceI = facei;
|
||||
nextFacei = facei;
|
||||
break;
|
||||
}
|
||||
else if (f[1] == nextPointI)
|
||||
{
|
||||
nextPointI = f[0];
|
||||
nextFaceI = facei;
|
||||
nextFacei = facei;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -537,7 +537,7 @@ void Foam::extrude2DMesh::setRefinement
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
backPatchI_, // patchID
|
||||
backPatchi_, // patchID
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
@ -567,7 +567,7 @@ void Foam::extrude2DMesh::setRefinement
|
||||
-1, // masterEdgeID
|
||||
nFaces++, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
frontPatchI_, // patchID
|
||||
frontPatchi_, // patchID
|
||||
-1, // zoneID
|
||||
false // zoneFlip
|
||||
);
|
||||
|
||||
@ -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
|
||||
@ -76,8 +76,8 @@ class extrude2DMesh
|
||||
|
||||
const word patchType_;
|
||||
|
||||
label frontPatchI_;
|
||||
label backPatchI_;
|
||||
label frontPatchi_;
|
||||
label backPatchi_;
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -128,14 +128,14 @@ public:
|
||||
void distribute(const mapDistributePolyMesh&)
|
||||
{}
|
||||
|
||||
label frontPatchI() const
|
||||
label frontPatchi() const
|
||||
{
|
||||
return frontPatchI_;
|
||||
return frontPatchi_;
|
||||
}
|
||||
|
||||
label backPatchI() const
|
||||
label backPatchi() const
|
||||
{
|
||||
return backPatchI_;
|
||||
return backPatchi_;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@ -101,7 +101,7 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
|
||||
|
||||
labelList oldToNew(owner_.size(), -1);
|
||||
|
||||
label newFaceI = 0;
|
||||
label newFacei = 0;
|
||||
|
||||
forAll(faceEdges, facei)
|
||||
{
|
||||
@ -115,17 +115,17 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
|
||||
{
|
||||
// Internal edge. Get the face on other side.
|
||||
|
||||
label nbrFaceI = neighbour_[fEdges[feI]];
|
||||
label nbrFacei = neighbour_[fEdges[feI]];
|
||||
|
||||
if (nbrFaceI == facei)
|
||||
if (nbrFacei == facei)
|
||||
{
|
||||
nbrFaceI = owner_[fEdges[feI]];
|
||||
nbrFacei = owner_[fEdges[feI]];
|
||||
}
|
||||
|
||||
if (facei < nbrFaceI)
|
||||
if (facei < nbrFacei)
|
||||
{
|
||||
// facei is master
|
||||
nbr[feI] = nbrFaceI;
|
||||
nbr[feI] = nbrFacei;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,7 +136,7 @@ Foam::labelList Foam::patchToPoly2DMesh::internalFaceOrder()
|
||||
{
|
||||
if (nbr[i] != -1)
|
||||
{
|
||||
oldToNew[fEdges[nbr.indices()[i]]] = newFaceI++;
|
||||
oldToNew[fEdges[nbr.indices()[i]]] = newFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -183,12 +183,12 @@ void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
|
||||
|
||||
for
|
||||
(
|
||||
label bFaceI = nInternalEdges;
|
||||
bFaceI < faces_.size();
|
||||
++bFaceI
|
||||
label bFacei = nInternalEdges;
|
||||
bFacei < faces_.size();
|
||||
++bFacei
|
||||
)
|
||||
{
|
||||
const face& e = faces_[bFaceI];
|
||||
const face& e = faces_[bFacei];
|
||||
|
||||
bool matched = false;
|
||||
|
||||
@ -209,14 +209,14 @@ void Foam::patchToPoly2DMesh::addPatchFacesToOwner()
|
||||
|
||||
label fp = findIndex(f, e[0]);
|
||||
|
||||
newOwner[bFaceI] = owner_[bEdgeI];
|
||||
newOwner[bFacei] = owner_[bEdgeI];
|
||||
|
||||
if (f.nextLabel(fp) != e[1])
|
||||
{
|
||||
Info<< "Flipping" << endl;
|
||||
|
||||
faces_[bFaceI][0] = e[1];
|
||||
faces_[bFaceI][1] = e[0];
|
||||
faces_[bFacei][0] = e[1];
|
||||
faces_[bFacei][1] = e[0];
|
||||
}
|
||||
|
||||
nMatched++;
|
||||
|
||||
@ -51,28 +51,28 @@ Foam::DistributedDelaunayMesh<Triangulation>::buildMap
|
||||
|
||||
forAll(toProc, i)
|
||||
{
|
||||
label procI = toProc[i];
|
||||
label proci = toProc[i];
|
||||
|
||||
nSend[procI]++;
|
||||
nSend[proci]++;
|
||||
}
|
||||
|
||||
|
||||
// 2. Size sendMap
|
||||
labelListList sendMap(Pstream::nProcs());
|
||||
|
||||
forAll(nSend, procI)
|
||||
forAll(nSend, proci)
|
||||
{
|
||||
sendMap[procI].setSize(nSend[procI]);
|
||||
sendMap[proci].setSize(nSend[proci]);
|
||||
|
||||
nSend[procI] = 0;
|
||||
nSend[proci] = 0;
|
||||
}
|
||||
|
||||
// 3. Fill sendMap
|
||||
forAll(toProc, i)
|
||||
{
|
||||
label procI = toProc[i];
|
||||
label proci = toProc[i];
|
||||
|
||||
sendMap[procI][nSend[procI]++] = i;
|
||||
sendMap[proci][nSend[proci]++] = i;
|
||||
}
|
||||
|
||||
// 4. Send over how many I need to receive
|
||||
@ -93,17 +93,17 @@ Foam::DistributedDelaunayMesh<Triangulation>::buildMap
|
||||
|
||||
label constructSize = constructMap[Pstream::myProcNo()].size();
|
||||
|
||||
forAll(constructMap, procI)
|
||||
forAll(constructMap, proci)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
label nRecv = recvSizes[procI];
|
||||
label nRecv = recvSizes[proci];
|
||||
|
||||
constructMap[procI].setSize(nRecv);
|
||||
constructMap[proci].setSize(nRecv);
|
||||
|
||||
for (label i = 0; i < nRecv; i++)
|
||||
{
|
||||
constructMap[procI][i] = constructSize++;
|
||||
constructMap[proci][i] = constructSize++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -201,16 +201,16 @@ Foam::labelList Foam::DistributedDelaunayMesh<Triangulation>::overlapProcessors
|
||||
{
|
||||
DynamicList<label> toProc(Pstream::nProcs());
|
||||
|
||||
forAll(allBackgroundMeshBounds_(), procI)
|
||||
forAll(allBackgroundMeshBounds_(), proci)
|
||||
{
|
||||
// Test against the bounding box of the processor
|
||||
if
|
||||
(
|
||||
!isLocal(procI)
|
||||
&& allBackgroundMeshBounds_()[procI].overlaps(centre, radiusSqr)
|
||||
!isLocal(proci)
|
||||
&& allBackgroundMeshBounds_()[proci].overlaps(centre, radiusSqr)
|
||||
)
|
||||
{
|
||||
toProc.append(procI);
|
||||
toProc.append(proci);
|
||||
}
|
||||
}
|
||||
|
||||
@ -366,9 +366,9 @@ void Foam::DistributedDelaunayMesh<Triangulation>::findProcessorBoundaryCells
|
||||
if (cellToCheck.found(cit->cellIndex()))
|
||||
{
|
||||
// Get the neighbours and check them
|
||||
for (label adjCellI = 0; adjCellI < 4; ++adjCellI)
|
||||
for (label adjCelli = 0; adjCelli < 4; ++adjCelli)
|
||||
{
|
||||
Cell_handle citNeighbor = cit->neighbor(adjCellI);
|
||||
Cell_handle citNeighbor = cit->neighbor(adjCelli);
|
||||
|
||||
// Ignore if has far point or previously visited
|
||||
if
|
||||
@ -432,7 +432,7 @@ void Foam::DistributedDelaunayMesh<Triangulation>::markVerticesToRefer
|
||||
|
||||
forAll(citOverlaps, cOI)
|
||||
{
|
||||
label procI = citOverlaps[cOI];
|
||||
label proci = citOverlaps[cOI];
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
@ -451,11 +451,11 @@ void Foam::DistributedDelaunayMesh<Triangulation>::markVerticesToRefer
|
||||
// Using the hashSet to ensure that each vertex is only
|
||||
// referred once to each processor.
|
||||
// Do not refer a vertex to its own processor.
|
||||
if (vProcIndex != procI)
|
||||
if (vProcIndex != proci)
|
||||
{
|
||||
if (referralVertices[procI].insert(procIndexPair))
|
||||
if (referralVertices[proci].insert(procIndexPair))
|
||||
{
|
||||
targetProcessor.append(procI);
|
||||
targetProcessor.append(proci);
|
||||
|
||||
parallelInfluenceVertices.append
|
||||
(
|
||||
@ -501,9 +501,9 @@ Foam::label Foam::DistributedDelaunayMesh<Triangulation>::referVertices
|
||||
|
||||
pointMap.distribute(parallelVertices);
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
const labelList& constructMap = pointMap.constructMap()[procI];
|
||||
const labelList& constructMap = pointMap.constructMap()[proci];
|
||||
|
||||
if (constructMap.size())
|
||||
{
|
||||
@ -841,11 +841,11 @@ void Foam::DistributedDelaunayMesh<Triangulation>::sync(const boundBox& bb)
|
||||
/Pstream::nProcs();
|
||||
|
||||
PtrList<labelPairHashSet> referralVertices(Pstream::nProcs());
|
||||
forAll(referralVertices, procI)
|
||||
forAll(referralVertices, proci)
|
||||
{
|
||||
if (!isLocal(procI))
|
||||
if (!isLocal(proci))
|
||||
{
|
||||
referralVertices.set(procI, new labelPairHashSet(nApproxReferred));
|
||||
referralVertices.set(proci, new labelPairHashSet(nApproxReferred));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -86,9 +86,9 @@ void Foam::PrintTable<KeyType, DataType>::print
|
||||
|
||||
List<label> largestProcSize(Pstream::nProcs(), 0);
|
||||
|
||||
forAll(procData, procI)
|
||||
forAll(procData, proci)
|
||||
{
|
||||
const HashTableData& procIData = procData[procI];
|
||||
const HashTableData& procIData = procData[proci];
|
||||
|
||||
for
|
||||
(
|
||||
@ -108,7 +108,7 @@ void Foam::PrintTable<KeyType, DataType>::print
|
||||
|
||||
HashTable<DataType, label>& key = combinedTable[iter.key()];
|
||||
|
||||
key.insert(procI, iter());
|
||||
key.insert(proci, iter());
|
||||
|
||||
for
|
||||
(
|
||||
@ -145,11 +145,11 @@ void Foam::PrintTable<KeyType, DataType>::print
|
||||
os.width(largestKeyLength);
|
||||
os << indent << "# Proc";
|
||||
|
||||
forAll(procData, procI)
|
||||
forAll(procData, proci)
|
||||
{
|
||||
os << tab;
|
||||
os.width(largestDataLength);
|
||||
os << procI;
|
||||
os << proci;
|
||||
}
|
||||
|
||||
if (printSum)
|
||||
|
||||
@ -56,28 +56,28 @@ Foam::autoPtr<Foam::mapDistribute> Foam::backgroundMeshDecomposition::buildMap
|
||||
|
||||
forAll(toProc, i)
|
||||
{
|
||||
label procI = toProc[i];
|
||||
label proci = toProc[i];
|
||||
|
||||
nSend[procI]++;
|
||||
nSend[proci]++;
|
||||
}
|
||||
|
||||
|
||||
// 2. Size sendMap
|
||||
labelListList sendMap(Pstream::nProcs());
|
||||
|
||||
forAll(nSend, procI)
|
||||
forAll(nSend, proci)
|
||||
{
|
||||
sendMap[procI].setSize(nSend[procI]);
|
||||
sendMap[proci].setSize(nSend[proci]);
|
||||
|
||||
nSend[procI] = 0;
|
||||
nSend[proci] = 0;
|
||||
}
|
||||
|
||||
// 3. Fill sendMap
|
||||
forAll(toProc, i)
|
||||
{
|
||||
label procI = toProc[i];
|
||||
label proci = toProc[i];
|
||||
|
||||
sendMap[procI][nSend[procI]++] = i;
|
||||
sendMap[proci][nSend[proci]++] = i;
|
||||
}
|
||||
|
||||
// 4. Send over how many I need to receive
|
||||
@ -98,17 +98,17 @@ Foam::autoPtr<Foam::mapDistribute> Foam::backgroundMeshDecomposition::buildMap
|
||||
|
||||
label constructSize = constructMap[Pstream::myProcNo()].size();
|
||||
|
||||
forAll(constructMap, procI)
|
||||
forAll(constructMap, proci)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
label nRecv = recvSizes[procI];
|
||||
label nRecv = recvSizes[proci];
|
||||
|
||||
constructMap[procI].setSize(nRecv);
|
||||
constructMap[proci].setSize(nRecv);
|
||||
|
||||
for (label i = 0; i < nRecv; i++)
|
||||
{
|
||||
constructMap[procI][i] = constructSize++;
|
||||
constructMap[proci][i] = constructSize++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -259,17 +259,17 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
|
||||
List<volumeType> newVolumeStatus(cellMap.size());
|
||||
|
||||
forAll(cellMap, newCellI)
|
||||
forAll(cellMap, newCelli)
|
||||
{
|
||||
label oldCellI = cellMap[newCellI];
|
||||
label oldCelli = cellMap[newCelli];
|
||||
|
||||
if (oldCellI == -1)
|
||||
if (oldCelli == -1)
|
||||
{
|
||||
newVolumeStatus[newCellI] = volumeType::UNKNOWN;
|
||||
newVolumeStatus[newCelli] = volumeType::UNKNOWN;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVolumeStatus[newCellI] = volumeStatus[oldCellI];
|
||||
newVolumeStatus[newCelli] = volumeStatus[oldCelli];
|
||||
}
|
||||
}
|
||||
|
||||
@ -369,17 +369,17 @@ void Foam::backgroundMeshDecomposition::initialRefinement()
|
||||
|
||||
List<volumeType> newVolumeStatus(cellMap.size());
|
||||
|
||||
forAll(cellMap, newCellI)
|
||||
forAll(cellMap, newCelli)
|
||||
{
|
||||
label oldCellI = cellMap[newCellI];
|
||||
label oldCelli = cellMap[newCelli];
|
||||
|
||||
if (oldCellI == -1)
|
||||
if (oldCelli == -1)
|
||||
{
|
||||
newVolumeStatus[newCellI] = volumeType::UNKNOWN;
|
||||
newVolumeStatus[newCelli] = volumeType::UNKNOWN;
|
||||
}
|
||||
else
|
||||
{
|
||||
newVolumeStatus[newCellI] = volumeStatus[oldCellI];
|
||||
newVolumeStatus[newCelli] = volumeStatus[oldCelli];
|
||||
}
|
||||
}
|
||||
|
||||
@ -474,29 +474,29 @@ void Foam::backgroundMeshDecomposition::printMeshData
|
||||
|
||||
// globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces());
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
Info<< "Processor " << procI << " "
|
||||
<< "Number of cells = " << globalCells.localSize(procI)
|
||||
Info<< "Processor " << proci << " "
|
||||
<< "Number of cells = " << globalCells.localSize(proci)
|
||||
<< endl;
|
||||
|
||||
// label nProcFaces = 0;
|
||||
|
||||
// const labelList& nei = patchNeiProcNo[procI];
|
||||
// const labelList& nei = patchNeiProcNo[proci];
|
||||
|
||||
// forAll(patchNeiProcNo[procI], i)
|
||||
// forAll(patchNeiProcNo[proci], i)
|
||||
// {
|
||||
// Info<< " Number of faces shared with processor "
|
||||
// << patchNeiProcNo[procI][i] << " = " << patchSize[procI][i]
|
||||
// << patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
|
||||
// << endl;
|
||||
|
||||
// nProcFaces += patchSize[procI][i];
|
||||
// nProcFaces += patchSize[proci][i];
|
||||
// }
|
||||
|
||||
// Info<< " Number of processor patches = " << nei.size() << nl
|
||||
// << " Number of processor faces = " << nProcFaces << nl
|
||||
// << " Number of boundary faces = "
|
||||
// << globalBoundaryFaces.localSize(procI) << endl;
|
||||
// << globalBoundaryFaces.localSize(proci) << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -721,10 +721,10 @@ void Foam::backgroundMeshDecomposition::buildPatchAndTree()
|
||||
point bbMin(GREAT, GREAT, GREAT);
|
||||
point bbMax(-GREAT, -GREAT, -GREAT);
|
||||
|
||||
forAll(allBackgroundMeshBounds_, procI)
|
||||
forAll(allBackgroundMeshBounds_, proci)
|
||||
{
|
||||
bbMin = min(bbMin, allBackgroundMeshBounds_[procI].min());
|
||||
bbMax = max(bbMax, allBackgroundMeshBounds_[procI].max());
|
||||
bbMin = min(bbMin, allBackgroundMeshBounds_[proci].min());
|
||||
bbMax = max(bbMax, allBackgroundMeshBounds_[proci].max());
|
||||
}
|
||||
|
||||
globalBackgroundBounds_ = treeBoundBox(bbMin, bbMax);
|
||||
@ -1119,13 +1119,13 @@ Foam::labelList Foam::backgroundMeshDecomposition::processorNearestPosition
|
||||
|
||||
label nCandidates = 0;
|
||||
|
||||
forAll(allBackgroundMeshBounds_, procI)
|
||||
forAll(allBackgroundMeshBounds_, proci)
|
||||
{
|
||||
// Candidate points may lie just outside a processor box, increase
|
||||
// test range by using overlaps rather than contains
|
||||
if (allBackgroundMeshBounds_[procI].overlaps(pt, sqr(SMALL*100)))
|
||||
if (allBackgroundMeshBounds_[proci].overlaps(pt, sqr(SMALL*100)))
|
||||
{
|
||||
toCandidateProc.append(procI);
|
||||
toCandidateProc.append(proci);
|
||||
testPoints.append(pt);
|
||||
|
||||
nCandidates++;
|
||||
@ -1242,17 +1242,17 @@ Foam::backgroundMeshDecomposition::intersectsProcessors
|
||||
|
||||
label nCandidates = 0;
|
||||
|
||||
forAll(allBackgroundMeshBounds_, procI)
|
||||
forAll(allBackgroundMeshBounds_, proci)
|
||||
{
|
||||
// It is assumed that the sphere in question overlaps the source
|
||||
// processor, so don't test it, unless includeOwnProcessor is true
|
||||
if
|
||||
(
|
||||
(includeOwnProcessor || procI != Pstream::myProcNo())
|
||||
&& allBackgroundMeshBounds_[procI].intersects(s, e, p)
|
||||
(includeOwnProcessor || proci != Pstream::myProcNo())
|
||||
&& allBackgroundMeshBounds_[proci].intersects(s, e, p)
|
||||
)
|
||||
{
|
||||
toCandidateProc.append(procI);
|
||||
toCandidateProc.append(proci);
|
||||
testStarts.append(s);
|
||||
testEnds.append(e);
|
||||
|
||||
@ -1336,7 +1336,7 @@ bool Foam::backgroundMeshDecomposition::overlapsOtherProcessors
|
||||
const scalar& radiusSqr
|
||||
) const
|
||||
{
|
||||
forAll(allBackgroundMeshBounds_, procI)
|
||||
forAll(allBackgroundMeshBounds_, proci)
|
||||
{
|
||||
if (bFTreePtr_().findNearest(centre, radiusSqr).hit())
|
||||
{
|
||||
@ -1356,19 +1356,19 @@ Foam::labelList Foam::backgroundMeshDecomposition::overlapProcessors
|
||||
{
|
||||
DynamicList<label> toProc(Pstream::nProcs());
|
||||
|
||||
forAll(allBackgroundMeshBounds_, procI)
|
||||
forAll(allBackgroundMeshBounds_, proci)
|
||||
{
|
||||
// Test against the bounding box of the processor
|
||||
if
|
||||
(
|
||||
procI != Pstream::myProcNo()
|
||||
&& allBackgroundMeshBounds_[procI].overlaps(centre, radiusSqr)
|
||||
proci != Pstream::myProcNo()
|
||||
&& allBackgroundMeshBounds_[proci].overlaps(centre, radiusSqr)
|
||||
)
|
||||
{
|
||||
// Expensive test
|
||||
// if (bFTreePtr_().findNearest(centre, radiusSqr).hit())
|
||||
{
|
||||
toProc.append(procI);
|
||||
toProc.append(proci);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1400,19 +1400,19 @@ Foam::labelList Foam::backgroundMeshDecomposition::overlapProcessors
|
||||
//
|
||||
// label nCandidates = 0;
|
||||
//
|
||||
// forAll(allBackgroundMeshBounds_, procI)
|
||||
// forAll(allBackgroundMeshBounds_, proci)
|
||||
// {
|
||||
// // It is assumed that the sphere in question overlaps the source
|
||||
// // processor, so don't test it, unless includeOwnProcessor is true
|
||||
// if
|
||||
// (
|
||||
// (includeOwnProcessor || procI != Pstream::myProcNo())
|
||||
// && allBackgroundMeshBounds_[procI].overlaps(c, rSqr)
|
||||
// (includeOwnProcessor || proci != Pstream::myProcNo())
|
||||
// && allBackgroundMeshBounds_[proci].overlaps(c, rSqr)
|
||||
// )
|
||||
// {
|
||||
// if (bFTreePtr_().findNearest(c, rSqr).hit())
|
||||
// {
|
||||
// toCandidateProc.append(procI);
|
||||
// toCandidateProc.append(proci);
|
||||
// testCentres.append(c);
|
||||
// testRadiusSqrs.append(rSqr);
|
||||
//
|
||||
@ -1525,17 +1525,17 @@ Foam::labelList Foam::backgroundMeshDecomposition::overlapProcessors
|
||||
//
|
||||
// label nCandidates = 0;
|
||||
//
|
||||
// forAll(allBackgroundMeshBounds_, procI)
|
||||
// forAll(allBackgroundMeshBounds_, proci)
|
||||
// {
|
||||
// // It is assumed that the sphere in question overlaps the source
|
||||
// // processor, so don't test it, unless includeOwnProcessor is true
|
||||
// if
|
||||
// (
|
||||
// (includeOwnProcessor || procI != Pstream::myProcNo())
|
||||
// && allBackgroundMeshBounds_[procI].overlaps(cc, rSqr)
|
||||
// (includeOwnProcessor || proci != Pstream::myProcNo())
|
||||
// && allBackgroundMeshBounds_[proci].overlaps(cc, rSqr)
|
||||
// )
|
||||
// {
|
||||
// toCandidateProc.append(procI);
|
||||
// toCandidateProc.append(proci);
|
||||
//
|
||||
// nCandidates++;
|
||||
// }
|
||||
|
||||
@ -64,11 +64,11 @@ Foam::labelList Foam::backgroundMeshDecomposition::processorPosition
|
||||
|
||||
label nCandidates = 0;
|
||||
|
||||
forAll(allBackgroundMeshBounds_, procI)
|
||||
forAll(allBackgroundMeshBounds_, proci)
|
||||
{
|
||||
if (allBackgroundMeshBounds_[procI].contains(pt))
|
||||
if (allBackgroundMeshBounds_[proci].contains(pt))
|
||||
{
|
||||
toCandidateProc.append(procI);
|
||||
toCandidateProc.append(proci);
|
||||
testPoints.append(pt);
|
||||
|
||||
nCandidates++;
|
||||
|
||||
@ -1595,13 +1595,13 @@ Foam::label Foam::conformalVoronoiMesh::createPatchInfo
|
||||
Pstream::gatherList(procUsedList);
|
||||
Pstream::scatterList(procUsedList);
|
||||
|
||||
forAll(procUsedList, procI)
|
||||
forAll(procUsedList, proci)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
if (procUsedList[procI][Pstream::myProcNo()])
|
||||
if (procUsedList[proci][Pstream::myProcNo()])
|
||||
{
|
||||
procUsed[procI] = true;
|
||||
procUsed[proci] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1762,7 +1762,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
|
||||
labelPairPairDynListList procPatchSortingIndex(nPatches);
|
||||
|
||||
label dualFaceI = 0;
|
||||
label dualFacei = 0;
|
||||
|
||||
if (foamyHexMeshControls().guardFeaturePoints())
|
||||
{
|
||||
@ -2029,11 +2029,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
}
|
||||
|
||||
// internal face
|
||||
faces[dualFaceI] = newDualFace;
|
||||
owner[dualFaceI] = own;
|
||||
neighbour[dualFaceI] = nei;
|
||||
faces[dualFacei] = newDualFace;
|
||||
owner[dualFacei] = own;
|
||||
neighbour[dualFacei] = nei;
|
||||
|
||||
dualFaceI++;
|
||||
dualFacei++;
|
||||
}
|
||||
else if
|
||||
(
|
||||
@ -2293,11 +2293,11 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
// else
|
||||
{
|
||||
// internal face
|
||||
faces[dualFaceI] = newDualFace;
|
||||
owner[dualFaceI] = own;
|
||||
neighbour[dualFaceI] = nei;
|
||||
faces[dualFacei] = newDualFace;
|
||||
owner[dualFacei] = own;
|
||||
neighbour[dualFacei] = nei;
|
||||
|
||||
dualFaceI++;
|
||||
dualFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2313,7 +2313,7 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
<< endl;
|
||||
}
|
||||
|
||||
label nInternalFaces = dualFaceI;
|
||||
label nInternalFaces = dualFacei;
|
||||
|
||||
faces.setSize(nInternalFaces);
|
||||
owner.setSize(nInternalFaces);
|
||||
|
||||
@ -408,13 +408,13 @@ void Foam::conformalVoronoiMesh::buildSurfaceConformation()
|
||||
|
||||
if (Pstream::parRun())
|
||||
{
|
||||
forAll(referralVertices, procI)
|
||||
forAll(referralVertices, proci)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
referralVertices.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new labelPairHashSet(number_of_vertices()/Pstream::nProcs())
|
||||
);
|
||||
}
|
||||
@ -700,16 +700,16 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
|
||||
label nStoppedInsertion = 0;
|
||||
|
||||
// Do the nearness tests here
|
||||
for (label procI = 0; procI < Pstream::nProcs(); ++procI)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); ++proci)
|
||||
{
|
||||
// Skip own points
|
||||
if (procI >= Pstream::myProcNo())
|
||||
if (proci >= Pstream::myProcNo())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const pointIndexHitAndFeatureList& otherSurfEdges =
|
||||
procSurfLocations[procI];
|
||||
procSurfLocations[proci];
|
||||
|
||||
forAll(otherSurfEdges, peI)
|
||||
{
|
||||
@ -725,9 +725,9 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseSurfaceTrees
|
||||
{
|
||||
nStoppedInsertion++;
|
||||
|
||||
if (!hits[procI].found(peI))
|
||||
if (!hits[proci].found(peI))
|
||||
{
|
||||
hits[procI].insert(peI);
|
||||
hits[proci].insert(peI);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -792,15 +792,15 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
|
||||
label nStoppedInsertion = 0;
|
||||
|
||||
// Do the nearness tests here
|
||||
for (label procI = 0; procI < Pstream::nProcs(); ++procI)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); ++proci)
|
||||
{
|
||||
// Skip own points
|
||||
if (procI >= Pstream::myProcNo())
|
||||
if (proci >= Pstream::myProcNo())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
pointIndexHitAndFeatureList& otherProcEdges = procEdgeLocations[procI];
|
||||
pointIndexHitAndFeatureList& otherProcEdges = procEdgeLocations[proci];
|
||||
|
||||
forAll(otherProcEdges, peI)
|
||||
{
|
||||
@ -812,7 +812,7 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
|
||||
if (nearest.hit())
|
||||
{
|
||||
// Pout<< "Not inserting " << peI << " " << pt << " "
|
||||
// << nearest.rawPoint() << " on proc " << procI
|
||||
// << nearest.rawPoint() << " on proc " << proci
|
||||
// << ", near edge = " << nearest
|
||||
// << " near ftPt = "<< info
|
||||
// << " " << featureEdgeExclusionDistanceSqr(pt)
|
||||
@ -820,9 +820,9 @@ Foam::label Foam::conformalVoronoiMesh::synchroniseEdgeTrees
|
||||
|
||||
nStoppedInsertion++;
|
||||
|
||||
if (!hits[procI].found(peI))
|
||||
if (!hits[proci].found(peI))
|
||||
{
|
||||
hits[procI].insert(peI);
|
||||
hits[proci].insert(peI);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,8 +250,8 @@ void Foam::conformalVoronoiMesh::writeMesh(const fileName& instance)
|
||||
//
|
||||
// // Vertex might be used by multiple faces. Which one to
|
||||
// // use? For now last one wins.
|
||||
// label dualFaceI = dualPatchStarts[patchi]+i;
|
||||
// vertexToDualAddressing[vertI] = -dualFaceI-1;
|
||||
// label dualFacei = dualPatchStarts[patchi]+i;
|
||||
// vertexToDualAddressing[vertI] = -dualFacei-1;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
@ -498,19 +498,19 @@ void Foam::conformalVoronoiMesh::checkProcessorPatchesMatch
|
||||
{
|
||||
bool allMatch = true;
|
||||
|
||||
forAll(procPatchSizes, procI)
|
||||
forAll(procPatchSizes, proci)
|
||||
{
|
||||
const labelList& patchSizes = procPatchSizes[procI];
|
||||
const labelList& patchSizes = procPatchSizes[proci];
|
||||
|
||||
forAll(patchSizes, patchi)
|
||||
{
|
||||
if (patchSizes[patchi] != procPatchSizes[patchi][procI])
|
||||
if (patchSizes[patchi] != procPatchSizes[patchi][proci])
|
||||
{
|
||||
allMatch = false;
|
||||
|
||||
Info<< indent << "Patches " << procI << " and " << patchi
|
||||
Info<< indent << "Patches " << proci << " and " << patchi
|
||||
<< " have different sizes: " << patchSizes[patchi]
|
||||
<< " and " << procPatchSizes[patchi][procI] << endl;
|
||||
<< " and " << procPatchSizes[patchi][proci] << endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -708,18 +708,18 @@ void Foam::conformalVoronoiMesh::reorderProcessorPatches
|
||||
if (changed)
|
||||
{
|
||||
// Merge patch face reordering into mesh face reordering table
|
||||
forAll(patchFaceRotation, patchFaceI)
|
||||
forAll(patchFaceRotation, patchFacei)
|
||||
{
|
||||
rotation[patchFaceI + patchStartFace]
|
||||
= patchFaceRotation[patchFaceI];
|
||||
rotation[patchFacei + patchStartFace]
|
||||
= patchFaceRotation[patchFacei];
|
||||
}
|
||||
|
||||
forAll(patchFaceMap, patchFaceI)
|
||||
forAll(patchFaceMap, patchFacei)
|
||||
{
|
||||
if (patchFaceMap[patchFaceI] != patchFaceI)
|
||||
if (patchFaceMap[patchFacei] != patchFacei)
|
||||
{
|
||||
faceMap[patchFaceI + patchStartFace]
|
||||
= patchFaceMap[patchFaceI] + patchStartFace;
|
||||
faceMap[patchFacei + patchStartFace]
|
||||
= patchFaceMap[patchFacei] + patchStartFace;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -57,14 +57,14 @@ void Foam::conformalVoronoiMesh::calcNeighbourCellCentres
|
||||
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
|
||||
label bFaceI = pp.start() - mesh.nInternalFaces();
|
||||
label bFacei = pp.start() - mesh.nInternalFaces();
|
||||
|
||||
if (pp.coupled())
|
||||
{
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
neiCc[bFaceI] = cellCentres[faceCells[i]];
|
||||
bFaceI++;
|
||||
neiCc[bFacei] = cellCentres[faceCells[i]];
|
||||
bFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -329,14 +329,14 @@ void Foam::conformalVoronoiMesh::calcFaceZones
|
||||
|
||||
const labelUList& faceCells = pp.faceCells();
|
||||
|
||||
label bFaceI = pp.start() - mesh.nInternalFaces();
|
||||
label bFacei = pp.start() - mesh.nInternalFaces();
|
||||
|
||||
if (pp.coupled())
|
||||
{
|
||||
forAll(faceCells, i)
|
||||
{
|
||||
neiFaceOwner[bFaceI] = cellToSurface[faceCells[i]];
|
||||
bFaceI++;
|
||||
neiFaceOwner[bFacei] = cellToSurface[faceCells[i]];
|
||||
bFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -127,15 +127,15 @@ List<Vb::Point> pointFile::initialPoints() const
|
||||
{
|
||||
bool foundAlready = false;
|
||||
|
||||
forAll(allProcPt, procI)
|
||||
forAll(allProcPt, proci)
|
||||
{
|
||||
// If a processor with a lower index has found this point
|
||||
// to insert already, defer to it and don't insert.
|
||||
if (foundAlready)
|
||||
{
|
||||
allProcPt[procI][ptI] = false;
|
||||
allProcPt[proci][ptI] = false;
|
||||
}
|
||||
else if (allProcPt[procI][ptI])
|
||||
else if (allProcPt[proci][ptI])
|
||||
{
|
||||
foundAlready = true;
|
||||
}
|
||||
|
||||
@ -127,32 +127,32 @@ void printMeshData(const polyMesh& mesh)
|
||||
label totProcPatches = 0;
|
||||
label maxProcFaces = 0;
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
Info<< endl
|
||||
<< "Processor " << procI << nl
|
||||
<< " Number of cells = " << globalCells.localSize(procI)
|
||||
<< "Processor " << proci << nl
|
||||
<< " Number of cells = " << globalCells.localSize(proci)
|
||||
<< endl;
|
||||
|
||||
label nProcFaces = 0;
|
||||
|
||||
const labelList& nei = patchNeiProcNo[procI];
|
||||
const labelList& nei = patchNeiProcNo[proci];
|
||||
|
||||
forAll(patchNeiProcNo[procI], i)
|
||||
forAll(patchNeiProcNo[proci], i)
|
||||
{
|
||||
Info<< " Number of faces shared with processor "
|
||||
<< patchNeiProcNo[procI][i] << " = " << patchSize[procI][i]
|
||||
<< patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
|
||||
<< endl;
|
||||
|
||||
nProcFaces += patchSize[procI][i];
|
||||
nProcFaces += patchSize[proci][i];
|
||||
}
|
||||
|
||||
Info<< " Number of processor patches = " << nei.size() << nl
|
||||
<< " Number of processor faces = " << nProcFaces << nl
|
||||
<< " Number of boundary faces = "
|
||||
<< globalBoundaryFaces.localSize(procI) << endl;
|
||||
<< globalBoundaryFaces.localSize(proci) << endl;
|
||||
|
||||
maxProcCells = max(maxProcCells, globalCells.localSize(procI));
|
||||
maxProcCells = max(maxProcCells, globalCells.localSize(proci));
|
||||
totProcFaces += nProcFaces;
|
||||
totProcPatches += nei.size();
|
||||
maxProcPatches = max(maxProcPatches, nei.size());
|
||||
|
||||
@ -352,29 +352,29 @@ Foam::shortEdgeFilter2D::filter()
|
||||
bool flagDegenerateFace = false;
|
||||
const labelList& pFaces = ms_.pointFaces()[startVertex];
|
||||
|
||||
forAll(pFaces, pFaceI)
|
||||
forAll(pFaces, pFacei)
|
||||
{
|
||||
const face& f = ms_.localFaces()[pFaces[pFaceI]];
|
||||
const face& f = ms_.localFaces()[pFaces[pFacei]];
|
||||
forAll(f, fp)
|
||||
{
|
||||
// If the edge is part of this face...
|
||||
if (f[fp] == endVertex)
|
||||
{
|
||||
// If deleting vertex would create a triangle, don't!
|
||||
if (newFaceVertexCount[pFaces[pFaceI]] < 4)
|
||||
if (newFaceVertexCount[pFaces[pFacei]] < 4)
|
||||
{
|
||||
flagDegenerateFace = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
newFaceVertexCount[pFaces[pFaceI]]--;
|
||||
newFaceVertexCount[pFaces[pFacei]]--;
|
||||
}
|
||||
}
|
||||
// If the edge is not part of this face...
|
||||
else
|
||||
{
|
||||
// Deleting vertex of a triangle...
|
||||
if (newFaceVertexCount[pFaces[pFaceI]] < 3)
|
||||
if (newFaceVertexCount[pFaces[pFacei]] < 3)
|
||||
{
|
||||
flagDegenerateFace = true;
|
||||
}
|
||||
@ -450,7 +450,7 @@ Foam::shortEdgeFilter2D::filter()
|
||||
|
||||
// Need a new faceList
|
||||
faceList newFaces(faces.size());
|
||||
label newFaceI = 0;
|
||||
label newFacei = 0;
|
||||
|
||||
labelList newFace;
|
||||
label newFaceSize = 0;
|
||||
@ -521,7 +521,7 @@ Foam::shortEdgeFilter2D::filter()
|
||||
|
||||
if (newFace.size() > 2)
|
||||
{
|
||||
newFaces[newFaceI++] = face(newFace);
|
||||
newFaces[newFacei++] = face(newFace);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -531,7 +531,7 @@ Foam::shortEdgeFilter2D::filter()
|
||||
}
|
||||
}
|
||||
|
||||
newFaces.setSize(newFaceI);
|
||||
newFaces.setSize(newFacei);
|
||||
|
||||
MeshedSurface<face> fMesh
|
||||
(
|
||||
|
||||
@ -120,16 +120,16 @@ int main(int argc, char *argv[])
|
||||
//
|
||||
|
||||
// Current patch number.
|
||||
label newPatchI = bMesh.patches().size();
|
||||
label newPatchi = bMesh.patches().size();
|
||||
|
||||
label suffix = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
// Find first unset face.
|
||||
label unsetFaceI = findIndex(patchIDs, -1);
|
||||
label unsetFacei = findIndex(patchIDs, -1);
|
||||
|
||||
if (unsetFaceI == -1)
|
||||
if (unsetFacei == -1)
|
||||
{
|
||||
// All faces have patchID set. Exit.
|
||||
break;
|
||||
@ -148,10 +148,10 @@ int main(int argc, char *argv[])
|
||||
bMesh.changePatchType(patchName, "patch");
|
||||
|
||||
|
||||
// Fill visited with all faces reachable from unsetFaceI.
|
||||
// Fill visited with all faces reachable from unsetFacei.
|
||||
boolList visited(bMesh.mesh().size());
|
||||
|
||||
bMesh.markFaces(markedEdges, unsetFaceI, visited);
|
||||
bMesh.markFaces(markedEdges, unsetFacei, visited);
|
||||
|
||||
|
||||
// Assign all visited faces to current patch
|
||||
@ -163,14 +163,14 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
nVisited++;
|
||||
|
||||
patchIDs[facei] = newPatchI;
|
||||
patchIDs[facei] = newPatchi;
|
||||
}
|
||||
}
|
||||
|
||||
Info<< "Assigned " << nVisited << " faces to patch " << patchName
|
||||
<< endl << endl;
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
|
||||
|
||||
@ -180,41 +180,41 @@ int main(int argc, char *argv[])
|
||||
// Create new list of patches with old ones first
|
||||
List<polyPatch*> newPatchPtrList(patches.size());
|
||||
|
||||
newPatchI = 0;
|
||||
newPatchi = 0;
|
||||
|
||||
// Copy old patches
|
||||
forAll(mesh.boundaryMesh(), patchi)
|
||||
{
|
||||
const polyPatch& patch = mesh.boundaryMesh()[patchi];
|
||||
|
||||
newPatchPtrList[newPatchI] =
|
||||
newPatchPtrList[newPatchi] =
|
||||
patch.clone
|
||||
(
|
||||
mesh.boundaryMesh(),
|
||||
newPatchI,
|
||||
newPatchi,
|
||||
patch.size(),
|
||||
patch.start()
|
||||
).ptr();
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
|
||||
// Add new ones with empty size.
|
||||
for (label patchi = newPatchI; patchi < patches.size(); patchi++)
|
||||
for (label patchi = newPatchi; patchi < patches.size(); patchi++)
|
||||
{
|
||||
const boundaryPatch& bp = patches[patchi];
|
||||
|
||||
newPatchPtrList[newPatchI] = polyPatch::New
|
||||
newPatchPtrList[newPatchi] = polyPatch::New
|
||||
(
|
||||
polyPatch::typeName,
|
||||
bp.name(),
|
||||
0,
|
||||
mesh.nFaces(),
|
||||
newPatchI,
|
||||
newPatchi,
|
||||
mesh.boundaryMesh()
|
||||
).ptr();
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
|
||||
if (!overwrite)
|
||||
@ -236,9 +236,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(patchIDs, facei)
|
||||
{
|
||||
label meshFaceI = meshFace[facei];
|
||||
label meshFacei = meshFace[facei];
|
||||
|
||||
polyMeshRepatcher.changePatchID(meshFaceI, patchIDs[facei]);
|
||||
polyMeshRepatcher.changePatchID(meshFacei, patchIDs[facei]);
|
||||
}
|
||||
|
||||
polyMeshRepatcher.repatch();
|
||||
|
||||
@ -84,9 +84,9 @@ bool Foam::checkWedges
|
||||
}
|
||||
|
||||
// Find opposite
|
||||
label oppositePatchI = findOppositeWedge(mesh, pp);
|
||||
label oppositePatchi = findOppositeWedge(mesh, pp);
|
||||
|
||||
if (oppositePatchI == -1)
|
||||
if (oppositePatchi == -1)
|
||||
{
|
||||
if (report)
|
||||
{
|
||||
@ -97,7 +97,7 @@ bool Foam::checkWedges
|
||||
}
|
||||
|
||||
const wedgePolyPatch& opp =
|
||||
refCast<const wedgePolyPatch>(patches[oppositePatchI]);
|
||||
refCast<const wedgePolyPatch>(patches[oppositePatchi]);
|
||||
|
||||
|
||||
if (mag(opp.axis() & pp.axis()) < (1-1e-3))
|
||||
@ -351,13 +351,13 @@ bool Foam::checkCoupledPoints
|
||||
|
||||
forAll(cpp, i)
|
||||
{
|
||||
label bFaceI = cpp.start() + i - mesh.nInternalFaces();
|
||||
label bFacei = cpp.start() + i - mesh.nInternalFaces();
|
||||
const face& f = cpp[i];
|
||||
nbrPoints[bFaceI].setSize(f.size());
|
||||
nbrPoints[bFacei].setSize(f.size());
|
||||
forAll(f, fp)
|
||||
{
|
||||
const point& p0 = p[f[fp]];
|
||||
nbrPoints[bFaceI][fp] = p0;
|
||||
nbrPoints[bFacei][fp] = p0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -397,15 +397,15 @@ bool Foam::checkCoupledPoints
|
||||
|
||||
forAll(cpp, i)
|
||||
{
|
||||
label bFaceI = cpp.start() + i - mesh.nInternalFaces();
|
||||
label bFacei = cpp.start() + i - mesh.nInternalFaces();
|
||||
const face& f = cpp[i];
|
||||
|
||||
if (f.size() != nbrPoints[bFaceI].size())
|
||||
if (f.size() != nbrPoints[bFacei].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Local face size : " << f.size()
|
||||
<< " does not equal neighbour face size : "
|
||||
<< nbrPoints[bFaceI].size()
|
||||
<< nbrPoints[bFacei].size()
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
@ -413,7 +413,7 @@ bool Foam::checkCoupledPoints
|
||||
forAll(f, j)
|
||||
{
|
||||
const point& p0 = p[f[fp]];
|
||||
scalar d = mag(p0 - nbrPoints[bFaceI][j]);
|
||||
scalar d = mag(p0 - nbrPoints[bFacei][j]);
|
||||
|
||||
if (d > smallDist[i])
|
||||
{
|
||||
|
||||
@ -113,7 +113,7 @@ void modifyOrAddFace
|
||||
const label facei,
|
||||
const label own,
|
||||
const bool flipFaceFlux,
|
||||
const label newPatchI,
|
||||
const label newPatchi,
|
||||
const label zoneID,
|
||||
const bool zoneFlip,
|
||||
|
||||
@ -132,7 +132,7 @@ void modifyOrAddFace
|
||||
own, // owner
|
||||
-1, // neighbour
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
false, // remove from zone
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
@ -154,7 +154,7 @@ void modifyOrAddFace
|
||||
-1, // master edge
|
||||
facei, // master face
|
||||
flipFaceFlux, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
zoneID, // zone for face
|
||||
zoneFlip // face flip in zone
|
||||
)
|
||||
@ -186,11 +186,11 @@ void createFaces
|
||||
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label zoneFaceI = fZone.whichFace(facei);
|
||||
label zoneFacei = fZone.whichFace(facei);
|
||||
|
||||
if (zoneFaceI != -1)
|
||||
if (zoneFacei != -1)
|
||||
{
|
||||
if (!fZone.flipMap()[zoneFaceI])
|
||||
if (!fZone.flipMap()[zoneFacei])
|
||||
{
|
||||
// Use owner side of face
|
||||
modifyOrAddFace
|
||||
@ -236,11 +236,11 @@ void createFaces
|
||||
|
||||
for (label facei = 0; facei < mesh.nInternalFaces(); facei++)
|
||||
{
|
||||
label zoneFaceI = fZone.whichFace(facei);
|
||||
label zoneFacei = fZone.whichFace(facei);
|
||||
|
||||
if (zoneFaceI != -1)
|
||||
if (zoneFacei != -1)
|
||||
{
|
||||
if (!fZone.flipMap()[zoneFaceI])
|
||||
if (!fZone.flipMap()[zoneFacei])
|
||||
{
|
||||
// Use neighbour side of face
|
||||
modifyOrAddFace
|
||||
@ -294,9 +294,9 @@ void createFaces
|
||||
{
|
||||
const polyPatch& pp = pbm[patchi];
|
||||
|
||||
label newPatchI = newMasterPatches[i];
|
||||
label newPatchi = newMasterPatches[i];
|
||||
|
||||
if (pp.coupled() && pbm[newPatchI].coupled())
|
||||
if (pp.coupled() && pbm[newPatchi].coupled())
|
||||
{
|
||||
// Do not allow coupled faces to be moved to different
|
||||
// coupled patches.
|
||||
@ -307,9 +307,9 @@ void createFaces
|
||||
{
|
||||
label facei = pp.start()+i;
|
||||
|
||||
label zoneFaceI = fZone.whichFace(facei);
|
||||
label zoneFacei = fZone.whichFace(facei);
|
||||
|
||||
if (zoneFaceI != -1)
|
||||
if (zoneFacei != -1)
|
||||
{
|
||||
if (patchWarned.insert(patchi))
|
||||
{
|
||||
@ -318,7 +318,7 @@ void createFaces
|
||||
<< pp.name()
|
||||
<< ") in faceZone " << fZone.name()
|
||||
<< " to convert to baffle patch "
|
||||
<< pbm[newPatchI].name()
|
||||
<< pbm[newPatchi].name()
|
||||
<< endl
|
||||
<< " Run with -internalFacesOnly option"
|
||||
<< " if you don't wish to convert"
|
||||
@ -332,9 +332,9 @@ void createFaces
|
||||
facei, // label of face
|
||||
mesh.faceOwner()[facei], // owner
|
||||
false, // face flip
|
||||
newPatchI, // patch for face
|
||||
newPatchi, // patch for face
|
||||
fZone.index(), // zone for face
|
||||
fZone.flipMap()[zoneFaceI], // face flip in zone
|
||||
fZone.flipMap()[zoneFacei], // face flip in zone
|
||||
modifiedFace // modify or add
|
||||
);
|
||||
nModified++;
|
||||
|
||||
@ -555,7 +555,7 @@ int main(int argc, char *argv[])
|
||||
// Old and new patches.
|
||||
DynamicList<polyPatch*> allPatches(patches.size()+patchSources.size());
|
||||
|
||||
label startFaceI = mesh.nInternalFaces();
|
||||
label startFacei = mesh.nInternalFaces();
|
||||
|
||||
// Copy old patches.
|
||||
forAll(patches, patchi)
|
||||
@ -571,10 +571,10 @@ int main(int argc, char *argv[])
|
||||
patches,
|
||||
patchi,
|
||||
pp.size(),
|
||||
startFaceI
|
||||
startFacei
|
||||
).ptr()
|
||||
);
|
||||
startFaceI += pp.size();
|
||||
startFacei += pp.size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -584,20 +584,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
word patchName(dict.lookup("name"));
|
||||
|
||||
label destPatchI = patches.findPatchID(patchName);
|
||||
label destPatchi = patches.findPatchID(patchName);
|
||||
|
||||
if (destPatchI == -1)
|
||||
if (destPatchi == -1)
|
||||
{
|
||||
dictionary patchDict(dict.subDict("patchInfo"));
|
||||
|
||||
destPatchI = allPatches.size();
|
||||
destPatchi = allPatches.size();
|
||||
|
||||
Info<< "Adding new patch " << patchName
|
||||
<< " as patch " << destPatchI
|
||||
<< " as patch " << destPatchi
|
||||
<< " from " << patchDict << endl;
|
||||
|
||||
patchDict.set("nFaces", 0);
|
||||
patchDict.set("startFace", startFaceI);
|
||||
patchDict.set("startFace", startFacei);
|
||||
|
||||
// Add an empty patch.
|
||||
allPatches.append
|
||||
@ -606,7 +606,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
patchName,
|
||||
patchDict,
|
||||
destPatchI,
|
||||
destPatchi,
|
||||
patches
|
||||
).ptr()
|
||||
);
|
||||
@ -632,10 +632,10 @@ int main(int argc, char *argv[])
|
||||
patches,
|
||||
patchi,
|
||||
pp.size(),
|
||||
startFaceI
|
||||
startFacei
|
||||
).ptr()
|
||||
);
|
||||
startFaceI += pp.size();
|
||||
startFacei += pp.size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -659,9 +659,9 @@ int main(int argc, char *argv[])
|
||||
const dictionary& dict = patchSources[addedI];
|
||||
|
||||
const word patchName(dict.lookup("name"));
|
||||
label destPatchI = patches.findPatchID(patchName);
|
||||
label destPatchi = patches.findPatchID(patchName);
|
||||
|
||||
if (destPatchI == -1)
|
||||
if (destPatchi == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "patch " << patchName << " not added. Problem."
|
||||
@ -686,7 +686,7 @@ int main(int argc, char *argv[])
|
||||
const polyPatch& pp = patches[iter.key()];
|
||||
|
||||
Info<< "Moving faces from patch " << pp.name()
|
||||
<< " to patch " << destPatchI << endl;
|
||||
<< " to patch " << destPatchi << endl;
|
||||
|
||||
forAll(pp, i)
|
||||
{
|
||||
@ -694,7 +694,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
pp.start() + i,
|
||||
destPatchI,
|
||||
destPatchi,
|
||||
meshMod
|
||||
);
|
||||
}
|
||||
@ -732,7 +732,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
mesh,
|
||||
facei,
|
||||
destPatchI,
|
||||
destPatchi,
|
||||
meshMod
|
||||
);
|
||||
}
|
||||
|
||||
@ -76,16 +76,16 @@ void insertDuplicateMerge
|
||||
const labelList& faceOwner = mesh.faceOwner();
|
||||
const faceZoneMesh& faceZones = mesh.faceZones();
|
||||
|
||||
forAll(duplicates, bFaceI)
|
||||
forAll(duplicates, bFacei)
|
||||
{
|
||||
label otherFaceI = duplicates[bFaceI];
|
||||
label otherFacei = duplicates[bFacei];
|
||||
|
||||
if (otherFaceI != -1 && otherFaceI > bFaceI)
|
||||
if (otherFacei != -1 && otherFacei > bFacei)
|
||||
{
|
||||
// Two duplicate faces. Merge.
|
||||
|
||||
label face0 = mesh.nInternalFaces() + bFaceI;
|
||||
label face1 = mesh.nInternalFaces() + otherFaceI;
|
||||
label face0 = mesh.nInternalFaces() + bFacei;
|
||||
label face1 = mesh.nInternalFaces() + otherFacei;
|
||||
|
||||
label own0 = faceOwner[face0];
|
||||
label own1 = faceOwner[face1];
|
||||
@ -166,11 +166,11 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
|
||||
// Check that none are on processor patches
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(duplicates, bFaceI)
|
||||
forAll(duplicates, bFacei)
|
||||
{
|
||||
if (duplicates[bFaceI] != -1)
|
||||
if (duplicates[bFacei] != -1)
|
||||
{
|
||||
label facei = mesh.nInternalFaces() + bFaceI;
|
||||
label facei = mesh.nInternalFaces() + bFacei;
|
||||
label patchi = patches.whichPatch(facei);
|
||||
|
||||
if (isA<processorPolyPatch>(patches[patchi]))
|
||||
@ -196,14 +196,14 @@ labelList findBaffles(const polyMesh& mesh, const labelList& boundaryFaces)
|
||||
(mesh.nFaces() - mesh.nInternalFaces())/256
|
||||
);
|
||||
|
||||
forAll(duplicates, bFaceI)
|
||||
forAll(duplicates, bFacei)
|
||||
{
|
||||
label otherFaceI = duplicates[bFaceI];
|
||||
label otherFacei = duplicates[bFacei];
|
||||
|
||||
if (otherFaceI != -1 && otherFaceI > bFaceI)
|
||||
if (otherFacei != -1 && otherFacei > bFacei)
|
||||
{
|
||||
duplicateSet.insert(mesh.nInternalFaces() + bFaceI);
|
||||
duplicateSet.insert(mesh.nInternalFaces() + otherFaceI);
|
||||
duplicateSet.insert(mesh.nInternalFaces() + bFacei);
|
||||
duplicateSet.insert(mesh.nInternalFaces() + otherFacei);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -101,14 +101,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label meshFaceI = faceLabels[facei];
|
||||
const label patchi = bm.whichPatch(meshFaceI);
|
||||
const label meshFacei = faceLabels[facei];
|
||||
const label patchi = bm.whichPatch(meshFacei);
|
||||
|
||||
if
|
||||
(
|
||||
patchi != -1
|
||||
&& bm[patchi].coupled()
|
||||
&& !isMasterFace[meshFaceI]
|
||||
&& !isMasterFace[meshFacei]
|
||||
)
|
||||
{
|
||||
// Slave side. Mark so doesn't get visited.
|
||||
@ -127,9 +127,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(faceLabels, facei)
|
||||
{
|
||||
const label meshFaceI = faceLabels[facei];
|
||||
const label meshFacei = faceLabels[facei];
|
||||
|
||||
if (isMasterFace[meshFaceI])
|
||||
if (isMasterFace[meshFacei])
|
||||
{
|
||||
const labelList& fEdges = patch.faceEdges()[facei];
|
||||
forAll(fEdges, fEdgeI)
|
||||
@ -183,59 +183,59 @@ int main(int argc, char *argv[])
|
||||
while (true)
|
||||
{
|
||||
// Pick an unset face
|
||||
label unsetFaceI = labelMax;
|
||||
label unsetFacei = labelMax;
|
||||
forAll(allFaceInfo, facei)
|
||||
{
|
||||
if (allFaceInfo[facei] == orientedSurface::UNVISITED)
|
||||
{
|
||||
unsetFaceI = globalFaces.toGlobal(facei);
|
||||
unsetFacei = globalFaces.toGlobal(facei);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
reduce(unsetFaceI, minOp<label>());
|
||||
reduce(unsetFacei, minOp<label>());
|
||||
|
||||
if (unsetFaceI == labelMax)
|
||||
if (unsetFacei == labelMax)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
label procI = globalFaces.whichProcID(unsetFaceI);
|
||||
label seedFaceI = globalFaces.toLocal(procI, unsetFaceI);
|
||||
Info<< "Seeding from processor " << procI << " face " << seedFaceI
|
||||
label proci = globalFaces.whichProcID(unsetFacei);
|
||||
label seedFacei = globalFaces.toLocal(proci, unsetFacei);
|
||||
Info<< "Seeding from processor " << proci << " face " << seedFacei
|
||||
<< endl;
|
||||
|
||||
if (procI == Pstream::myProcNo())
|
||||
if (proci == Pstream::myProcNo())
|
||||
{
|
||||
// Determine orientation of seedFace
|
||||
|
||||
vector d = outsidePoint-patch.faceCentres()[seedFaceI];
|
||||
const vector& fn = patch.faceNormals()[seedFaceI];
|
||||
vector d = outsidePoint-patch.faceCentres()[seedFacei];
|
||||
const vector& fn = patch.faceNormals()[seedFacei];
|
||||
|
||||
// Set information to correct orientation
|
||||
patchFaceOrientation& faceInfo = allFaceInfo[seedFaceI];
|
||||
patchFaceOrientation& faceInfo = allFaceInfo[seedFacei];
|
||||
faceInfo = orientedSurface::NOFLIP;
|
||||
|
||||
if ((fn&d) < 0)
|
||||
{
|
||||
faceInfo.flip();
|
||||
|
||||
Pout<< "Face " << seedFaceI << " at "
|
||||
<< patch.faceCentres()[seedFaceI]
|
||||
Pout<< "Face " << seedFacei << " at "
|
||||
<< patch.faceCentres()[seedFacei]
|
||||
<< " with normal " << fn
|
||||
<< " needs to be flipped." << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Pout<< "Face " << seedFaceI << " at "
|
||||
<< patch.faceCentres()[seedFaceI]
|
||||
Pout<< "Face " << seedFacei << " at "
|
||||
<< patch.faceCentres()[seedFacei]
|
||||
<< " with normal " << fn
|
||||
<< " points in positive direction (cos = " << (fn&d)/mag(d)
|
||||
<< ")" << endl;
|
||||
}
|
||||
|
||||
|
||||
const labelList& fEdges = patch.faceEdges()[seedFaceI];
|
||||
const labelList& fEdges = patch.faceEdges()[seedFacei];
|
||||
forAll(fEdges, fEdgeI)
|
||||
{
|
||||
label edgeI = fEdges[fEdgeI];
|
||||
@ -249,7 +249,7 @@ int main(int argc, char *argv[])
|
||||
mesh,
|
||||
patch,
|
||||
edgeI,
|
||||
seedFaceI,
|
||||
seedFacei,
|
||||
faceInfo,
|
||||
tol,
|
||||
dummyTrackData
|
||||
@ -300,10 +300,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
const label meshFaceI = faceLabels[i];
|
||||
if (!mesh.isInternalFace(meshFaceI))
|
||||
const label meshFacei = faceLabels[i];
|
||||
if (!mesh.isInternalFace(meshFacei))
|
||||
{
|
||||
neiStatus[meshFaceI-mesh.nInternalFaces()] =
|
||||
neiStatus[meshFacei-mesh.nInternalFaces()] =
|
||||
allFaceInfo[i].flipStatus();
|
||||
}
|
||||
}
|
||||
@ -311,31 +311,31 @@ int main(int argc, char *argv[])
|
||||
|
||||
forAll(faceLabels, i)
|
||||
{
|
||||
const label meshFaceI = faceLabels[i];
|
||||
const label patchi = bm.whichPatch(meshFaceI);
|
||||
const label meshFacei = faceLabels[i];
|
||||
const label patchi = bm.whichPatch(meshFacei);
|
||||
|
||||
if
|
||||
(
|
||||
patchi != -1
|
||||
&& bm[patchi].coupled()
|
||||
&& !isMasterFace[meshFaceI]
|
||||
&& !isMasterFace[meshFacei]
|
||||
)
|
||||
{
|
||||
// Slave side. Take flipped from neighbour
|
||||
label bFaceI = meshFaceI-mesh.nInternalFaces();
|
||||
label bFacei = meshFacei-mesh.nInternalFaces();
|
||||
|
||||
if (neiStatus[bFaceI] == orientedSurface::NOFLIP)
|
||||
if (neiStatus[bFacei] == orientedSurface::NOFLIP)
|
||||
{
|
||||
allFaceInfo[i] = orientedSurface::FLIP;
|
||||
}
|
||||
else if (neiStatus[bFaceI] == orientedSurface::FLIP)
|
||||
else if (neiStatus[bFacei] == orientedSurface::FLIP)
|
||||
{
|
||||
allFaceInfo[i] = orientedSurface::NOFLIP;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Incorrect status for face " << meshFaceI
|
||||
<< "Incorrect status for face " << meshFacei
|
||||
<< abort(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
@ -199,7 +199,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
(
|
||||
const label masterPointI,
|
||||
const label masterEdgeI,
|
||||
const label masterFaceI,
|
||||
const label masterFacei,
|
||||
|
||||
const bool edgeOrder,
|
||||
const label dualCell0,
|
||||
@ -240,30 +240,30 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
|
||||
label zoneID = -1;
|
||||
bool zoneFlip = false;
|
||||
if (masterFaceI != -1)
|
||||
if (masterFacei != -1)
|
||||
{
|
||||
zoneID = mesh_.faceZones().whichZone(masterFaceI);
|
||||
zoneID = mesh_.faceZones().whichZone(masterFacei);
|
||||
|
||||
if (zoneID != -1)
|
||||
{
|
||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFacei)];
|
||||
}
|
||||
}
|
||||
|
||||
label dualFaceI;
|
||||
label dualFacei;
|
||||
|
||||
if (dualCell0 < dualCell1)
|
||||
{
|
||||
dualFaceI = meshMod.addFace
|
||||
dualFacei = meshMod.addFace
|
||||
(
|
||||
newFace,
|
||||
dualCell0, // own
|
||||
dualCell1, // nei
|
||||
masterPointI, // masterPointID
|
||||
masterEdgeI, // masterEdgeID
|
||||
masterFaceI, // masterFaceID
|
||||
masterFacei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
zoneID, // zoneID
|
||||
@ -273,7 +273,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
//pointField dualPoints(meshMod.points());
|
||||
//vector n(newFace.normal(dualPoints));
|
||||
//n /= mag(n);
|
||||
//Pout<< "Generated internal dualFace:" << dualFaceI
|
||||
//Pout<< "Generated internal dualFace:" << dualFacei
|
||||
// << " verts:" << newFace
|
||||
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||
// << " n:" << n
|
||||
@ -283,14 +283,14 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
}
|
||||
else
|
||||
{
|
||||
dualFaceI = meshMod.addFace
|
||||
dualFacei = meshMod.addFace
|
||||
(
|
||||
newFace,
|
||||
dualCell1, // own
|
||||
dualCell0, // nei
|
||||
masterPointI, // masterPointID
|
||||
masterEdgeI, // masterEdgeID
|
||||
masterFaceI, // masterFaceID
|
||||
masterFacei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
-1, // patchID
|
||||
zoneID, // zoneID
|
||||
@ -300,7 +300,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
//pointField dualPoints(meshMod.points());
|
||||
//vector n(newFace.normal(dualPoints));
|
||||
//n /= mag(n);
|
||||
//Pout<< "Generated internal dualFace:" << dualFaceI
|
||||
//Pout<< "Generated internal dualFace:" << dualFacei
|
||||
// << " verts:" << newFace
|
||||
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||
// << " n:" << n
|
||||
@ -308,7 +308,7 @@ Foam::label Foam::meshDualiser::addInternalFace
|
||||
// << " dualneigbour:" << dualCell0
|
||||
// << endl;
|
||||
}
|
||||
return dualFaceI;
|
||||
return dualFacei;
|
||||
}
|
||||
|
||||
|
||||
@ -316,9 +316,9 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
||||
(
|
||||
const label masterPointI,
|
||||
const label masterEdgeI,
|
||||
const label masterFaceI,
|
||||
const label masterFacei,
|
||||
|
||||
const label dualCellI,
|
||||
const label dualCelli,
|
||||
const label patchi,
|
||||
const DynamicList<label>& verts,
|
||||
polyTopoChange& meshMod
|
||||
@ -328,26 +328,26 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
||||
|
||||
label zoneID = -1;
|
||||
bool zoneFlip = false;
|
||||
if (masterFaceI != -1)
|
||||
if (masterFacei != -1)
|
||||
{
|
||||
zoneID = mesh_.faceZones().whichZone(masterFaceI);
|
||||
zoneID = mesh_.faceZones().whichZone(masterFacei);
|
||||
|
||||
if (zoneID != -1)
|
||||
{
|
||||
const faceZone& fZone = mesh_.faceZones()[zoneID];
|
||||
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFaceI)];
|
||||
zoneFlip = fZone.flipMap()[fZone.whichFace(masterFacei)];
|
||||
}
|
||||
}
|
||||
|
||||
label dualFaceI = meshMod.addFace
|
||||
label dualFacei = meshMod.addFace
|
||||
(
|
||||
newFace,
|
||||
dualCellI, // own
|
||||
dualCelli, // own
|
||||
-1, // nei
|
||||
masterPointI, // masterPointID
|
||||
masterEdgeI, // masterEdgeID
|
||||
masterFaceI, // masterFaceID
|
||||
masterFacei, // masterFaceID
|
||||
false, // flipFaceFlux
|
||||
patchi, // patchID
|
||||
zoneID, // zoneID
|
||||
@ -357,13 +357,13 @@ Foam::label Foam::meshDualiser::addBoundaryFace
|
||||
//pointField dualPoints(meshMod.points());
|
||||
//vector n(newFace.normal(dualPoints));
|
||||
//n /= mag(n);
|
||||
//Pout<< "Generated boundary dualFace:" << dualFaceI
|
||||
//Pout<< "Generated boundary dualFace:" << dualFacei
|
||||
// << " verts:" << newFace
|
||||
// << " points:" << UIndirectList<point>(meshMod.points(), newFace)()
|
||||
// << " n:" << n
|
||||
// << " on dualowner:" << dualCellI
|
||||
// << " on dualowner:" << dualCelli
|
||||
// << endl;
|
||||
return dualFaceI;
|
||||
return dualFacei;
|
||||
}
|
||||
|
||||
|
||||
@ -376,7 +376,7 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
const bool splitFace,
|
||||
const PackedBoolList& isBoundaryEdge,
|
||||
const label edgeI,
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
polyTopoChange& meshMod,
|
||||
boolList& doneEFaces
|
||||
) const
|
||||
@ -386,7 +386,7 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
|
||||
label fp = edgeFaceCirculator::getMinIndex
|
||||
(
|
||||
mesh_.faces()[startFaceI],
|
||||
mesh_.faces()[startFacei],
|
||||
e[0],
|
||||
e[1]
|
||||
);
|
||||
@ -394,7 +394,7 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
edgeFaceCirculator ie
|
||||
(
|
||||
mesh_,
|
||||
startFaceI, // face
|
||||
startFacei, // face
|
||||
true, // ownerSide
|
||||
fp, // fp
|
||||
isBoundaryEdge.get(edgeI) == 1 // isBoundaryEdge
|
||||
@ -475,7 +475,7 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
(
|
||||
-1, // masterPointI
|
||||
edgeI, // masterEdgeI
|
||||
-1, // masterFaceI
|
||||
-1, // masterFacei
|
||||
edgeOrder,
|
||||
currentDualCell0,
|
||||
currentDualCell1,
|
||||
@ -527,7 +527,7 @@ void Foam::meshDualiser::createFacesAroundEdge
|
||||
(
|
||||
-1, // masterPointI
|
||||
edgeI, // masterEdgeI
|
||||
-1, // masterFaceI
|
||||
-1, // masterFacei
|
||||
edgeOrder,
|
||||
currentDualCell0,
|
||||
currentDualCell1,
|
||||
@ -621,7 +621,7 @@ void Foam::meshDualiser::createFaceFromInternalFace
|
||||
(
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
facei, // masterFaceI
|
||||
facei, // masterFacei
|
||||
true, // edgeOrder,
|
||||
currentDualCell0,
|
||||
currentDualCell1,
|
||||
@ -642,7 +642,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
(
|
||||
const label patchi,
|
||||
const label patchPointI,
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
polyTopoChange& meshMod,
|
||||
boolList& donePFaces // pFaces visited
|
||||
) const
|
||||
@ -660,7 +660,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
// pointFaces.
|
||||
|
||||
// Starting face
|
||||
label facei = startFaceI;
|
||||
label facei = startFacei;
|
||||
|
||||
DynamicList<label> verts(4);
|
||||
|
||||
@ -678,7 +678,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
// Insert face centre
|
||||
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];
|
||||
@ -721,7 +721,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
}
|
||||
|
||||
// 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,8 +744,8 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
//pointI, // masterPointI
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
facei, // masterFaceI
|
||||
dualCellI,
|
||||
facei, // masterFacei
|
||||
dualCelli,
|
||||
patchi,
|
||||
verts,
|
||||
meshMod
|
||||
@ -753,7 +753,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
}
|
||||
else
|
||||
{
|
||||
label facei = startFaceI;
|
||||
label facei = startFacei;
|
||||
|
||||
// Storage for face
|
||||
DynamicList<label> verts(mesh_.faces()[facei].size());
|
||||
@ -798,7 +798,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
(
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
facei, // masterFaceI
|
||||
facei, // masterFacei
|
||||
findDualCell(own[facei], pointI),
|
||||
patchi,
|
||||
verts.shrink(),
|
||||
@ -831,7 +831,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
}
|
||||
while
|
||||
(
|
||||
facei != startFaceI
|
||||
facei != startFacei
|
||||
&& facei >= pp.start()
|
||||
&& facei < pp.start()+pp.size()
|
||||
);
|
||||
@ -843,7 +843,7 @@ void Foam::meshDualiser::createFacesAroundBoundaryPoint
|
||||
(
|
||||
-1, // masterPointI
|
||||
-1, // masterEdgeI
|
||||
startFaceI, // masterFaceI
|
||||
startFacei, // masterFacei
|
||||
findDualCell(own[facei], pointI),
|
||||
patchi,
|
||||
verts.shrink(),
|
||||
@ -1070,22 +1070,22 @@ void Foam::meshDualiser::setRefinement
|
||||
|
||||
pointToDualCells_[pointI].setSize(pCells.size());
|
||||
|
||||
forAll(pCells, pCellI)
|
||||
forAll(pCells, pCelli)
|
||||
{
|
||||
pointToDualCells_[pointI][pCellI] = meshMod.addCell
|
||||
pointToDualCells_[pointI][pCelli] = meshMod.addCell
|
||||
(
|
||||
pointI, //masterPointID
|
||||
-1, //masterEdgeID
|
||||
-1, //masterFaceID
|
||||
-1, //masterCellID
|
||||
mesh_.cellZones().whichZone(pCells[pCellI]) //zoneID
|
||||
mesh_.cellZones().whichZone(pCells[pCelli]) //zoneID
|
||||
);
|
||||
if (dualCcStr.valid())
|
||||
{
|
||||
meshTools::writeOBJ
|
||||
(
|
||||
dualCcStr(),
|
||||
0.5*(mesh_.points()[pointI]+cellCentres[pCells[pCellI]])
|
||||
0.5*(mesh_.points()[pointI]+cellCentres[pCells[pCelli]])
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -1299,13 +1299,13 @@ void Foam::meshDualiser::setRefinement
|
||||
// happen for non-manifold edges where a single edge can
|
||||
// become multiple faces.
|
||||
|
||||
label startFaceI = eFaces[i];
|
||||
label startFacei = eFaces[i];
|
||||
|
||||
//Pout<< "Walking edge:" << edgeI
|
||||
// << " points:" << mesh_.points()[e[0]]
|
||||
// << mesh_.points()[e[1]]
|
||||
// << " startFace:" << startFaceI
|
||||
// << " at:" << mesh_.faceCentres()[startFaceI]
|
||||
// << " startFace:" << startFacei
|
||||
// << " at:" << mesh_.faceCentres()[startFacei]
|
||||
// << endl;
|
||||
|
||||
createFacesAroundEdge
|
||||
@ -1313,7 +1313,7 @@ void Foam::meshDualiser::setRefinement
|
||||
splitFace,
|
||||
isBoundaryEdge,
|
||||
edgeI,
|
||||
startFaceI,
|
||||
startFacei,
|
||||
meshMod,
|
||||
doneEFaces
|
||||
);
|
||||
@ -1407,20 +1407,20 @@ void Foam::meshDualiser::setRefinement
|
||||
if (!donePFaces[i])
|
||||
{
|
||||
// Starting face
|
||||
label startFaceI = pp.start()+pFaces[i];
|
||||
label startFacei = pp.start()+pFaces[i];
|
||||
|
||||
//Pout<< "Walking around point:" << pointI
|
||||
// << " coord:" << mesh_.points()[pointI]
|
||||
// << " on patch:" << patchi
|
||||
// << " startFace:" << startFaceI
|
||||
// << " at:" << mesh_.faceCentres()[startFaceI]
|
||||
// << " startFace:" << startFacei
|
||||
// << " at:" << mesh_.faceCentres()[startFacei]
|
||||
// << endl;
|
||||
|
||||
createFacesAroundBoundaryPoint
|
||||
(
|
||||
patchi,
|
||||
patchPointI,
|
||||
startFaceI,
|
||||
startFacei,
|
||||
meshMod,
|
||||
donePFaces // pFaces visited
|
||||
);
|
||||
|
||||
@ -117,7 +117,7 @@ class meshDualiser
|
||||
(
|
||||
const label masterPointI,
|
||||
const label masterEdgeI,
|
||||
const label masterFaceI,
|
||||
const label masterFacei,
|
||||
|
||||
const bool edgeOrder,
|
||||
const label dualCell0,
|
||||
@ -131,9 +131,9 @@ class meshDualiser
|
||||
(
|
||||
const label masterPointI,
|
||||
const label masterEdgeI,
|
||||
const label masterFaceI,
|
||||
const label masterFacei,
|
||||
|
||||
const label dualCellI,
|
||||
const label dualCelli,
|
||||
const label patchI,
|
||||
const DynamicList<label>& verts,
|
||||
polyTopoChange& meshMod
|
||||
@ -145,7 +145,7 @@ class meshDualiser
|
||||
const bool splitFace,
|
||||
const PackedBoolList&,
|
||||
const label edgeI,
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
polyTopoChange&,
|
||||
boolList& doneEFaces
|
||||
) const;
|
||||
@ -163,7 +163,7 @@ class meshDualiser
|
||||
(
|
||||
const label patchI,
|
||||
const label patchPointI,
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
polyTopoChange&,
|
||||
boolList& donePFaces // pFaces visited
|
||||
) const;
|
||||
|
||||
@ -329,9 +329,9 @@ int main(int argc, char *argv[])
|
||||
// Create cellSet with added cells for easy inspection
|
||||
cellSet newCells(mesh, "refinedCells", refCells.size());
|
||||
|
||||
forAll(oldToNew, oldCellI)
|
||||
forAll(oldToNew, oldCelli)
|
||||
{
|
||||
const labelList& added = oldToNew[oldCellI];
|
||||
const labelList& added = oldToNew[oldCelli];
|
||||
|
||||
forAll(added, i)
|
||||
{
|
||||
@ -372,21 +372,21 @@ int main(int argc, char *argv[])
|
||||
+ oldTimeName;
|
||||
|
||||
|
||||
forAll(oldToNew, oldCellI)
|
||||
forAll(oldToNew, oldCelli)
|
||||
{
|
||||
const labelList& added = oldToNew[oldCellI];
|
||||
const labelList& added = oldToNew[oldCelli];
|
||||
|
||||
if (added.size())
|
||||
{
|
||||
forAll(added, i)
|
||||
{
|
||||
newToOld[added[i]] = oldCellI;
|
||||
newToOld[added[i]] = oldCelli;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unrefined cell
|
||||
newToOld[oldCellI] = oldCellI;
|
||||
newToOld[oldCelli] = oldCelli;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -174,16 +174,16 @@ labelList getFaceOrder
|
||||
|
||||
labelList oldToNewFace(mesh.nFaces(), -1);
|
||||
|
||||
label newFaceI = 0;
|
||||
label newFacei = 0;
|
||||
|
||||
labelList nbr;
|
||||
labelList order;
|
||||
|
||||
forAll(cellOrder, newCellI)
|
||||
forAll(cellOrder, newCelli)
|
||||
{
|
||||
label oldCellI = cellOrder[newCellI];
|
||||
label oldCelli = cellOrder[newCelli];
|
||||
|
||||
const cell& cFaces = mesh.cells()[oldCellI];
|
||||
const cell& cFaces = mesh.cells()[oldCelli];
|
||||
|
||||
// Neighbouring cells
|
||||
nbr.setSize(cFaces.size());
|
||||
@ -195,16 +195,16 @@ labelList getFaceOrder
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
// Internal face. Get cell on other side.
|
||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||
if (nbrCellI == newCellI)
|
||||
label nbrCelli = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||
if (nbrCelli == newCelli)
|
||||
{
|
||||
nbrCellI = reverseCellOrder[mesh.faceOwner()[facei]];
|
||||
nbrCelli = reverseCellOrder[mesh.faceOwner()[facei]];
|
||||
}
|
||||
|
||||
if (newCellI < nbrCellI)
|
||||
if (newCelli < nbrCelli)
|
||||
{
|
||||
// CellI is master
|
||||
nbr[i] = nbrCellI;
|
||||
// Celli is master
|
||||
nbr[i] = nbrCelli;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -227,13 +227,13 @@ labelList getFaceOrder
|
||||
label index = order[i];
|
||||
if (nbr[index] != -1)
|
||||
{
|
||||
oldToNewFace[cFaces[index]] = newFaceI++;
|
||||
oldToNewFace[cFaces[index]] = newFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Leave patch faces intact.
|
||||
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
|
||||
for (label facei = newFacei; facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
oldToNewFace[facei] = facei;
|
||||
}
|
||||
@ -267,20 +267,20 @@ labelList getRegionFaceOrder
|
||||
|
||||
labelList oldToNewFace(mesh.nFaces(), -1);
|
||||
|
||||
label newFaceI = 0;
|
||||
label newFacei = 0;
|
||||
|
||||
label prevRegion = -1;
|
||||
|
||||
forAll(cellOrder, newCellI)
|
||||
forAll(cellOrder, newCelli)
|
||||
{
|
||||
label oldCellI = cellOrder[newCellI];
|
||||
label oldCelli = cellOrder[newCelli];
|
||||
|
||||
if (cellToRegion[oldCellI] != prevRegion)
|
||||
if (cellToRegion[oldCelli] != prevRegion)
|
||||
{
|
||||
prevRegion = cellToRegion[oldCellI];
|
||||
prevRegion = cellToRegion[oldCelli];
|
||||
}
|
||||
|
||||
const cell& cFaces = mesh.cells()[oldCellI];
|
||||
const cell& cFaces = mesh.cells()[oldCelli];
|
||||
|
||||
SortableList<label> nbr(cFaces.size());
|
||||
|
||||
@ -291,21 +291,21 @@ labelList getRegionFaceOrder
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
// Internal face. Get cell on other side.
|
||||
label nbrCellI = reverseCellOrder[mesh.faceNeighbour()[facei]];
|
||||
if (nbrCellI == newCellI)
|
||||
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]])
|
||||
if (cellToRegion[oldCelli] != cellToRegion[cellOrder[nbrCelli]])
|
||||
{
|
||||
// Treat like external face. Do later.
|
||||
nbr[i] = -1;
|
||||
}
|
||||
else if (newCellI < nbrCellI)
|
||||
else if (newCelli < nbrCelli)
|
||||
{
|
||||
// CellI is master
|
||||
nbr[i] = nbrCellI;
|
||||
// Celli is master
|
||||
nbr[i] = nbrCelli;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -326,7 +326,7 @@ labelList getRegionFaceOrder
|
||||
{
|
||||
if (nbr[i] != -1)
|
||||
{
|
||||
oldToNewFace[cFaces[nbr.indices()[i]]] = newFaceI++;
|
||||
oldToNewFace[cFaces[nbr.indices()[i]]] = newFacei++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -367,12 +367,12 @@ labelList getRegionFaceOrder
|
||||
prevKey = key;
|
||||
}
|
||||
|
||||
oldToNewFace[sortKey.indices()[i]] = newFaceI++;
|
||||
oldToNewFace[sortKey.indices()[i]] = newFacei++;
|
||||
}
|
||||
}
|
||||
|
||||
// Leave patch faces intact.
|
||||
for (label facei = newFaceI; facei < mesh.nFaces(); facei++)
|
||||
for (label facei = newFacei; facei < mesh.nFaces(); facei++)
|
||||
{
|
||||
oldToNewFace[facei] = facei;
|
||||
}
|
||||
@ -477,8 +477,8 @@ autoPtr<mapPolyMesh> reorderMesh
|
||||
boolList newFlipMap(fZone.size());
|
||||
forAll(fZone, i)
|
||||
{
|
||||
label oldFaceI = fZone[i];
|
||||
newAddressing[i] = reverseFaceOrder[oldFaceI];
|
||||
label oldFacei = fZone[i];
|
||||
newAddressing[i] = reverseFaceOrder[oldFacei];
|
||||
if (flipFaceFlux.found(newAddressing[i]))
|
||||
{
|
||||
newFlipMap[i] = !fZone.flipMap()[i];
|
||||
@ -999,8 +999,8 @@ int main(int argc, char *argv[])
|
||||
label sortedI = mesh.nCells();
|
||||
forAllReverse(order, i)
|
||||
{
|
||||
label origCellI = bndCells[order[i]];
|
||||
newReverseCellOrder[origCellI] = --sortedI;
|
||||
label origCelli = bndCells[order[i]];
|
||||
newReverseCellOrder[origCelli] = --sortedI;
|
||||
}
|
||||
|
||||
Info<< "Ordered all " << nBndCells << " cells with a coupled face"
|
||||
@ -1009,12 +1009,12 @@ int main(int argc, char *argv[])
|
||||
|
||||
// Compact
|
||||
sortedI = 0;
|
||||
forAll(cellOrder, newCellI)
|
||||
forAll(cellOrder, newCelli)
|
||||
{
|
||||
label origCellI = cellOrder[newCellI];
|
||||
if (newReverseCellOrder[origCellI] == -1)
|
||||
label origCelli = cellOrder[newCelli];
|
||||
if (newReverseCellOrder[origCelli] == -1)
|
||||
{
|
||||
newReverseCellOrder[origCellI] = sortedI++;
|
||||
newReverseCellOrder[origCelli] = sortedI++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1106,14 +1106,14 @@ int main(int argc, char *argv[])
|
||||
forAllConstIter(labelHashSet, fff, iter)
|
||||
{
|
||||
label facei = iter.key();
|
||||
label masterFaceI = faceProcAddressing[facei];
|
||||
label masterFacei = faceProcAddressing[facei];
|
||||
|
||||
faceProcAddressing[facei] = -masterFaceI;
|
||||
faceProcAddressing[facei] = -masterFacei;
|
||||
|
||||
if (masterFaceI == 0)
|
||||
if (masterFacei == 0)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< " masterFaceI:" << masterFaceI << exit(FatalError);
|
||||
<< " masterFacei:" << masterFacei << exit(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,13 +81,13 @@ void writeVTK
|
||||
|
||||
faceList setFaces(currentSet.size());
|
||||
labelList faceValues(currentSet.size());
|
||||
label setFaceI = 0;
|
||||
label setFacei = 0;
|
||||
|
||||
forAllConstIter(topoSet, currentSet, iter)
|
||||
{
|
||||
setFaces[setFaceI] = mesh.faces()[iter.key()];
|
||||
faceValues[setFaceI] = iter.key();
|
||||
setFaceI++;
|
||||
setFaces[setFacei] = mesh.faces()[iter.key()];
|
||||
faceValues[setFacei] = iter.key();
|
||||
setFacei++;
|
||||
}
|
||||
|
||||
primitiveFacePatch fp(setFaces, mesh.points());
|
||||
@ -120,14 +120,14 @@ void writeVTK
|
||||
|
||||
if (mesh.isInternalFace(facei))
|
||||
{
|
||||
label otherCellI = mesh.faceOwner()[facei];
|
||||
label otherCelli = mesh.faceOwner()[facei];
|
||||
|
||||
if (otherCellI == celli)
|
||||
if (otherCelli == celli)
|
||||
{
|
||||
otherCellI = mesh.faceNeighbour()[facei];
|
||||
otherCelli = mesh.faceNeighbour()[facei];
|
||||
}
|
||||
|
||||
if (!currentSet.found(otherCellI))
|
||||
if (!currentSet.found(otherCelli))
|
||||
{
|
||||
cellFaces.insert(facei, celli);
|
||||
}
|
||||
@ -141,13 +141,13 @@ void writeVTK
|
||||
|
||||
faceList setFaces(cellFaces.size());
|
||||
labelList faceValues(cellFaces.size());
|
||||
label setFaceI = 0;
|
||||
label setFacei = 0;
|
||||
|
||||
forAllConstIter(Map<label>, cellFaces, iter)
|
||||
{
|
||||
setFaces[setFaceI] = mesh.faces()[iter.key()];
|
||||
faceValues[setFaceI] = iter(); // Cell ID
|
||||
setFaceI++;
|
||||
setFaces[setFacei] = mesh.faces()[iter.key()];
|
||||
faceValues[setFacei] = iter(); // Cell ID
|
||||
setFacei++;
|
||||
}
|
||||
|
||||
primitiveFacePatch fp(setFaces, mesh.points());
|
||||
|
||||
@ -159,41 +159,41 @@ 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))
|
||||
if (mesh.isInternalFace(otherFacei))
|
||||
{
|
||||
label otherCellI = celli;
|
||||
label otherCelli = celli;
|
||||
|
||||
// Keep on crossing faces/cells until back on face on
|
||||
// surface
|
||||
while (!region.found(otherFaceI))
|
||||
while (!region.found(otherFacei))
|
||||
{
|
||||
visitedFace.insert(otherFaceI);
|
||||
visitedFace.insert(otherFacei);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "visitConnectedFaces : celli:" << celli
|
||||
<< " found insideEdgeFace:" << otherFaceI
|
||||
<< " found insideEdgeFace:" << otherFacei
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
||||
// Cross otherFaceI into neighbouring cell
|
||||
otherCellI =
|
||||
// Cross otherFacei into neighbouring cell
|
||||
otherCelli =
|
||||
meshTools::otherCell
|
||||
(
|
||||
mesh,
|
||||
otherCellI,
|
||||
otherFaceI
|
||||
otherCelli,
|
||||
otherFacei
|
||||
);
|
||||
|
||||
otherFaceI =
|
||||
otherFacei =
|
||||
otherFace
|
||||
(
|
||||
mesh,
|
||||
otherCellI,
|
||||
otherFaceI,
|
||||
otherCelli,
|
||||
otherFacei,
|
||||
edgeI
|
||||
);
|
||||
}
|
||||
@ -203,8 +203,8 @@ void Foam::regionSide::visitConnectedFaces
|
||||
mesh,
|
||||
region,
|
||||
fenceEdges,
|
||||
otherCellI,
|
||||
otherFaceI,
|
||||
otherCelli,
|
||||
otherFacei,
|
||||
visitedFace
|
||||
);
|
||||
}
|
||||
@ -223,25 +223,25 @@ void Foam::regionSide::walkPointConnectedFaces
|
||||
const primitiveMesh& mesh,
|
||||
const labelHashSet& regionEdges,
|
||||
const label regionPointI,
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
const label startEdgeI,
|
||||
labelHashSet& visitedEdges
|
||||
)
|
||||
{
|
||||
// Mark as visited
|
||||
insidePointFaces_.insert(startFaceI);
|
||||
insidePointFaces_.insert(startFacei);
|
||||
|
||||
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
|
||||
label edgeI = otherEdge(mesh, startFaceI, startEdgeI, regionPointI);
|
||||
label edgeI = otherEdge(mesh, startFacei, startEdgeI, regionPointI);
|
||||
|
||||
if (!regionEdges.found(edgeI))
|
||||
{
|
||||
@ -263,9 +263,9 @@ void Foam::regionSide::walkPointConnectedFaces
|
||||
|
||||
const labelList& eFaces = mesh.edgeFaces()[edgeI];
|
||||
|
||||
forAll(eFaces, eFaceI)
|
||||
forAll(eFaces, eFacei)
|
||||
{
|
||||
label facei = eFaces[eFaceI];
|
||||
label facei = eFaces[eFacei];
|
||||
|
||||
walkPointConnectedFaces
|
||||
(
|
||||
@ -353,7 +353,7 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
||||
label edgeI = fEdges[fEdgeI];
|
||||
|
||||
// Get the face 'perpendicular' to facei on region.
|
||||
label otherFaceI = otherFace(mesh, celli, facei, edgeI);
|
||||
label otherFacei = otherFace(mesh, celli, facei, edgeI);
|
||||
|
||||
// Edge
|
||||
const edge& e = mesh.edges()[edgeI];
|
||||
@ -365,14 +365,14 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
||||
|
||||
visitedPoint.insert(e.start());
|
||||
|
||||
//edgeI = otherEdge(mesh, otherFaceI, edgeI, e.start());
|
||||
//edgeI = otherEdge(mesh, otherFacei, edgeI, e.start());
|
||||
|
||||
walkPointConnectedFaces
|
||||
(
|
||||
mesh,
|
||||
regionEdges,
|
||||
e.start(),
|
||||
otherFaceI,
|
||||
otherFacei,
|
||||
edgeI,
|
||||
visitedEdges
|
||||
);
|
||||
@ -384,14 +384,14 @@ void Foam::regionSide::walkAllPointConnectedFaces
|
||||
|
||||
visitedPoint.insert(e.end());
|
||||
|
||||
//edgeI = otherEdge(mesh, otherFaceI, edgeI, e.end());
|
||||
//edgeI = otherEdge(mesh, otherFacei, edgeI, e.end());
|
||||
|
||||
walkPointConnectedFaces
|
||||
(
|
||||
mesh,
|
||||
regionEdges,
|
||||
e.end(),
|
||||
otherFaceI,
|
||||
otherFacei,
|
||||
edgeI,
|
||||
visitedEdges
|
||||
);
|
||||
@ -409,8 +409,8 @@ Foam::regionSide::regionSide
|
||||
const primitiveMesh& mesh,
|
||||
const labelHashSet& region, // faces of region
|
||||
const labelHashSet& fenceEdges, // outside edges
|
||||
const label startCellI,
|
||||
const label startFaceI
|
||||
const label startCelli,
|
||||
const label startFacei
|
||||
)
|
||||
:
|
||||
sideOwner_(region.size()),
|
||||
@ -427,8 +427,8 @@ Foam::regionSide::regionSide
|
||||
mesh,
|
||||
region,
|
||||
fenceEdges,
|
||||
startCellI,
|
||||
startFaceI,
|
||||
startCelli,
|
||||
startFacei,
|
||||
visitedFace
|
||||
);
|
||||
|
||||
|
||||
@ -102,7 +102,7 @@ class regionSide
|
||||
const primitiveMesh& mesh,
|
||||
const labelHashSet& regionEdges,
|
||||
const label regionPointI,
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
const label startEdgeI,
|
||||
labelHashSet& visitedEdges
|
||||
);
|
||||
@ -128,7 +128,7 @@ public:
|
||||
(
|
||||
const primitiveMesh& mesh,
|
||||
const label celli,
|
||||
const label excludeFaceI,
|
||||
const label excludeFacei,
|
||||
const label edgeI
|
||||
);
|
||||
|
||||
|
||||
@ -200,15 +200,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Find sides reachable from 0th face of faceSet
|
||||
label startFaceI = faces[0];
|
||||
label startFacei = faces[0];
|
||||
|
||||
regionSide regionInfo
|
||||
(
|
||||
mesh,
|
||||
facesSet,
|
||||
fenceEdges,
|
||||
mesh.faceOwner()[startFaceI],
|
||||
startFaceI
|
||||
mesh.faceOwner()[startFacei],
|
||||
startFacei
|
||||
);
|
||||
|
||||
// Determine flip state for all faces in faceSet
|
||||
|
||||
@ -972,19 +972,19 @@ void createAndWriteRegion
|
||||
{
|
||||
// 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]]
|
||||
== mesh.faceOwner()[oldFaceI]
|
||||
== 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()
|
||||
@ -1261,15 +1261,15 @@ void matchRegions
|
||||
Pstream::gatherList(zoneNames);
|
||||
Pstream::scatterList(zoneNames);
|
||||
|
||||
forAll(zoneNames, procI)
|
||||
forAll(zoneNames, proci)
|
||||
{
|
||||
if (zoneNames[procI] != zoneNames[0])
|
||||
if (zoneNames[proci] != zoneNames[0])
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "cellZones not synchronised across processors." << endl
|
||||
<< "Master has cellZones " << zoneNames[0] << endl
|
||||
<< "Processor " << procI
|
||||
<< " has cellZones " << zoneNames[procI]
|
||||
<< "Processor " << proci
|
||||
<< " has cellZones " << zoneNames[proci]
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
@ -1561,14 +1561,14 @@ int main(int argc, char *argv[])
|
||||
<< " This requires all"
|
||||
<< " cells to be in one and only one cellZone." << nl << endl;
|
||||
|
||||
label unzonedCellI = findIndex(zoneID, -1);
|
||||
if (unzonedCellI != -1)
|
||||
label unzonedCelli = findIndex(zoneID, -1);
|
||||
if (unzonedCelli != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "For the cellZonesOnly option all cells "
|
||||
<< "have to be in a cellZone." << endl
|
||||
<< "Cell " << unzonedCellI
|
||||
<< " at" << mesh.cellCentres()[unzonedCellI]
|
||||
<< "Cell " << unzonedCelli
|
||||
<< " at" << mesh.cellCentres()[unzonedCelli]
|
||||
<< " is not in a cellZone. There might be more unzoned cells."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
@ -1610,14 +1610,14 @@ int main(int argc, char *argv[])
|
||||
labelList newNeiZoneID(mesh.nFaces()-mesh.nInternalFaces());
|
||||
getZoneID(mesh, newCellZones, newZoneID, newNeiZoneID);
|
||||
|
||||
label unzonedCellI = findIndex(newZoneID, -1);
|
||||
if (unzonedCellI != -1)
|
||||
label unzonedCelli = findIndex(newZoneID, -1);
|
||||
if (unzonedCelli != -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "For the cellZonesFileOnly option all cells "
|
||||
<< "have to be in a cellZone." << endl
|
||||
<< "Cell " << unzonedCellI
|
||||
<< " at" << mesh.cellCentres()[unzonedCellI]
|
||||
<< "Cell " << unzonedCelli
|
||||
<< " at" << mesh.cellCentres()[unzonedCelli]
|
||||
<< " is not in a cellZone. There might be more unzoned cells."
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
@ -102,18 +102,18 @@ Usage
|
||||
const labelIOList& procAddressing
|
||||
(
|
||||
const PtrList<fvMesh>& procMeshList,
|
||||
const label procI,
|
||||
const label proci,
|
||||
const word& name,
|
||||
PtrList<labelIOList>& procAddressingList
|
||||
)
|
||||
{
|
||||
const fvMesh& procMesh = procMeshList[procI];
|
||||
const fvMesh& procMesh = procMeshList[proci];
|
||||
|
||||
if (!procAddressingList.set(procI))
|
||||
if (!procAddressingList.set(proci))
|
||||
{
|
||||
procAddressingList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new labelIOList
|
||||
(
|
||||
IOobject
|
||||
@ -129,7 +129,7 @@ const labelIOList& procAddressing
|
||||
)
|
||||
);
|
||||
}
|
||||
return procAddressingList[procI];
|
||||
return procAddressingList[proci];
|
||||
}
|
||||
|
||||
|
||||
@ -314,11 +314,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
// remove existing processor dirs
|
||||
// reverse order to avoid gaps if someone interrupts the process
|
||||
for (label procI = nProcs-1; procI >= 0; --procI)
|
||||
for (label proci = nProcs-1; proci >= 0; --proci)
|
||||
{
|
||||
fileName procDir
|
||||
(
|
||||
runTime.path()/(word("processor") + name(procI))
|
||||
runTime.path()/(word("processor") + name(proci))
|
||||
);
|
||||
|
||||
rmDir(procDir);
|
||||
@ -794,27 +794,27 @@ int main(int argc, char *argv[])
|
||||
Info<< endl;
|
||||
|
||||
// split the fields over processors
|
||||
for (label procI = 0; procI < mesh.nProcs(); procI++)
|
||||
for (label proci = 0; proci < mesh.nProcs(); proci++)
|
||||
{
|
||||
Info<< "Processor " << procI << ": field transfer" << endl;
|
||||
Info<< "Processor " << proci << ": field transfer" << endl;
|
||||
|
||||
|
||||
// open the database
|
||||
if (!processorDbList.set(procI))
|
||||
if (!processorDbList.set(proci))
|
||||
{
|
||||
processorDbList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new Time
|
||||
(
|
||||
Time::controlDictName,
|
||||
args.rootPath(),
|
||||
args.caseName()
|
||||
/fileName(word("processor") + name(procI))
|
||||
/fileName(word("processor") + name(proci))
|
||||
)
|
||||
);
|
||||
}
|
||||
Time& processorDb = processorDbList[procI];
|
||||
Time& processorDb = processorDbList[proci];
|
||||
|
||||
|
||||
processorDb.setTime(runTime);
|
||||
@ -830,11 +830,11 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// read the mesh
|
||||
if (!procMeshList.set(procI))
|
||||
if (!procMeshList.set(proci))
|
||||
{
|
||||
procMeshList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new fvMesh
|
||||
(
|
||||
IOobject
|
||||
@ -846,12 +846,12 @@ int main(int argc, char *argv[])
|
||||
)
|
||||
);
|
||||
}
|
||||
const fvMesh& procMesh = procMeshList[procI];
|
||||
const fvMesh& procMesh = procMeshList[proci];
|
||||
|
||||
const labelIOList& faceProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
proci,
|
||||
"faceProcAddressing",
|
||||
faceProcAddressingList
|
||||
);
|
||||
@ -859,7 +859,7 @@ int main(int argc, char *argv[])
|
||||
const labelIOList& cellProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
proci,
|
||||
"cellProcAddressing",
|
||||
cellProcAddressingList
|
||||
);
|
||||
@ -867,7 +867,7 @@ int main(int argc, char *argv[])
|
||||
const labelIOList& boundaryProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
proci,
|
||||
"boundaryProcAddressing",
|
||||
boundaryProcAddressingList
|
||||
);
|
||||
@ -875,11 +875,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
// FV fields
|
||||
{
|
||||
if (!fieldDecomposerList.set(procI))
|
||||
if (!fieldDecomposerList.set(proci))
|
||||
{
|
||||
fieldDecomposerList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new fvFieldDecomposer
|
||||
(
|
||||
mesh,
|
||||
@ -891,7 +891,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
const fvFieldDecomposer& fieldDecomposer =
|
||||
fieldDecomposerList[procI];
|
||||
fieldDecomposerList[proci];
|
||||
|
||||
fieldDecomposer.decomposeFields(volScalarFields);
|
||||
fieldDecomposer.decomposeFields(volVectorFields);
|
||||
@ -911,17 +911,17 @@ int main(int argc, char *argv[])
|
||||
if (times.size() == 1)
|
||||
{
|
||||
// Clear cached decomposer
|
||||
fieldDecomposerList.set(procI, NULL);
|
||||
fieldDecomposerList.set(proci, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
// Dimensioned fields
|
||||
{
|
||||
if (!dimFieldDecomposerList.set(procI))
|
||||
if (!dimFieldDecomposerList.set(proci))
|
||||
{
|
||||
dimFieldDecomposerList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new dimFieldDecomposer
|
||||
(
|
||||
mesh,
|
||||
@ -932,7 +932,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
const dimFieldDecomposer& dimDecomposer =
|
||||
dimFieldDecomposerList[procI];
|
||||
dimFieldDecomposerList[proci];
|
||||
|
||||
dimDecomposer.decomposeFields(dimScalarFields);
|
||||
dimDecomposer.decomposeFields(dimVectorFields);
|
||||
@ -942,7 +942,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (times.size() == 1)
|
||||
{
|
||||
dimFieldDecomposerList.set(procI, NULL);
|
||||
dimFieldDecomposerList.set(proci, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -960,18 +960,18 @@ int main(int argc, char *argv[])
|
||||
const labelIOList& pointProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
proci,
|
||||
"pointProcAddressing",
|
||||
pointProcAddressingList
|
||||
);
|
||||
|
||||
const pointMesh& procPMesh = pointMesh::New(procMesh);
|
||||
|
||||
if (!pointFieldDecomposerList.set(procI))
|
||||
if (!pointFieldDecomposerList.set(proci))
|
||||
{
|
||||
pointFieldDecomposerList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new pointFieldDecomposer
|
||||
(
|
||||
pMesh,
|
||||
@ -982,7 +982,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
const pointFieldDecomposer& pointDecomposer =
|
||||
pointFieldDecomposerList[procI];
|
||||
pointFieldDecomposerList[proci];
|
||||
|
||||
pointDecomposer.decomposeFields(pointScalarFields);
|
||||
pointDecomposer.decomposeFields(pointVectorFields);
|
||||
@ -993,8 +993,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (times.size() == 1)
|
||||
{
|
||||
pointProcAddressingList.set(procI, NULL);
|
||||
pointFieldDecomposerList.set(procI, NULL);
|
||||
pointProcAddressingList.set(proci, NULL);
|
||||
pointFieldDecomposerList.set(proci, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1118,11 +1118,11 @@ int main(int argc, char *argv[])
|
||||
// times, otherwise it is just extra storage.
|
||||
if (times.size() == 1)
|
||||
{
|
||||
boundaryProcAddressingList.set(procI, NULL);
|
||||
cellProcAddressingList.set(procI, NULL);
|
||||
faceProcAddressingList.set(procI, NULL);
|
||||
procMeshList.set(procI, NULL);
|
||||
processorDbList.set(procI, NULL);
|
||||
boundaryProcAddressingList.set(proci, NULL);
|
||||
cellProcAddressingList.set(proci, NULL);
|
||||
faceProcAddressingList.set(proci, NULL);
|
||||
procMeshList.set(proci, NULL);
|
||||
processorDbList.set(proci, NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -257,10 +257,10 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
|
||||
// Write out the meshes
|
||||
for (label procI = 0; procI < nProcs_; procI++)
|
||||
for (label proci = 0; proci < nProcs_; proci++)
|
||||
{
|
||||
// Create processor points
|
||||
const labelList& curPointLabels = procPointAddressing_[procI];
|
||||
const labelList& curPointLabels = procPointAddressing_[proci];
|
||||
|
||||
const pointField& meshPoints = points();
|
||||
|
||||
@ -276,7 +276,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
}
|
||||
|
||||
// Create processor faces
|
||||
const labelList& curFaceLabels = procFaceAddressing_[procI];
|
||||
const labelList& curFaceLabels = procFaceAddressing_[proci];
|
||||
|
||||
const faceList& meshFaces = faces();
|
||||
|
||||
@ -318,7 +318,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
}
|
||||
|
||||
// Create processor cells
|
||||
const labelList& curCellLabels = procCellAddressing_[procI];
|
||||
const labelList& curCellLabels = procCellAddressing_[proci];
|
||||
|
||||
const cellList& meshCells = cells();
|
||||
|
||||
@ -332,9 +332,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
curCell.setSize(origCellLabels.size());
|
||||
|
||||
forAll(origCellLabels, cellFaceI)
|
||||
forAll(origCellLabels, cellFacei)
|
||||
{
|
||||
curCell[cellFaceI] = faceLookup[origCellLabels[cellFaceI]];
|
||||
curCell[cellFacei] = faceLookup[origCellLabels[cellFacei]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -342,7 +342,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
fileName processorCasePath
|
||||
(
|
||||
time().caseName()/fileName(word("processor") + Foam::name(procI))
|
||||
time().caseName()/fileName(word("processor") + Foam::name(proci))
|
||||
);
|
||||
|
||||
// make the processor directory
|
||||
@ -418,33 +418,33 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
|
||||
// Create processor boundary patches
|
||||
const labelList& curPatchSizes = procPatchSize_[procI];
|
||||
const labelList& curPatchSizes = procPatchSize_[proci];
|
||||
|
||||
const labelList& curPatchStarts = procPatchStartIndex_[procI];
|
||||
const labelList& curPatchStarts = procPatchStartIndex_[proci];
|
||||
|
||||
const labelList& curNeighbourProcessors =
|
||||
procNeighbourProcessors_[procI];
|
||||
procNeighbourProcessors_[proci];
|
||||
|
||||
const labelList& curProcessorPatchSizes =
|
||||
procProcessorPatchSize_[procI];
|
||||
procProcessorPatchSize_[proci];
|
||||
|
||||
const labelList& curProcessorPatchStarts =
|
||||
procProcessorPatchStartIndex_[procI];
|
||||
procProcessorPatchStartIndex_[proci];
|
||||
|
||||
const labelListList& curSubPatchIDs =
|
||||
procProcessorPatchSubPatchIDs_[procI];
|
||||
procProcessorPatchSubPatchIDs_[proci];
|
||||
|
||||
const labelListList& curSubStarts =
|
||||
procProcessorPatchSubPatchStarts_[procI];
|
||||
procProcessorPatchSubPatchStarts_[proci];
|
||||
|
||||
const polyPatchList& meshPatches = boundaryMesh();
|
||||
|
||||
|
||||
// Count the number of inter-proc patches
|
||||
label nInterProcPatches = 0;
|
||||
forAll(curSubPatchIDs, procPatchI)
|
||||
forAll(curSubPatchIDs, procPatchi)
|
||||
{
|
||||
nInterProcPatches += curSubPatchIDs[procPatchI].size();
|
||||
nInterProcPatches += curSubPatchIDs[procPatchi].size();
|
||||
}
|
||||
|
||||
List<polyPatch*> procPatches
|
||||
@ -484,12 +484,12 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
nPatches++;
|
||||
}
|
||||
|
||||
forAll(curProcessorPatchSizes, procPatchI)
|
||||
forAll(curProcessorPatchSizes, procPatchi)
|
||||
{
|
||||
const labelList& subPatchID = curSubPatchIDs[procPatchI];
|
||||
const labelList& subStarts = curSubStarts[procPatchI];
|
||||
const labelList& subPatchID = curSubPatchIDs[procPatchi];
|
||||
const labelList& subStarts = curSubStarts[procPatchi];
|
||||
|
||||
label curStart = curProcessorPatchStarts[procPatchI];
|
||||
label curStart = curProcessorPatchStarts[procPatchi];
|
||||
|
||||
forAll(subPatchID, i)
|
||||
{
|
||||
@ -497,7 +497,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
(
|
||||
i < subPatchID.size()-1
|
||||
? subStarts[i+1] - subStarts[i]
|
||||
: curProcessorPatchSizes[procPatchI] - subStarts[i]
|
||||
: curProcessorPatchSizes[procPatchi] - subStarts[i]
|
||||
);
|
||||
|
||||
if (subPatchID[i] == -1)
|
||||
@ -510,8 +510,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
curStart,
|
||||
nPatches,
|
||||
procMesh.boundaryMesh(),
|
||||
procI,
|
||||
curNeighbourProcessors[procPatchI]
|
||||
proci,
|
||||
curNeighbourProcessors[procPatchi]
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -529,8 +529,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
curStart,
|
||||
nPatches,
|
||||
procMesh.boundaryMesh(),
|
||||
procI,
|
||||
curNeighbourProcessors[procPatchI],
|
||||
proci,
|
||||
curNeighbourProcessors[procPatchi],
|
||||
pcPatch.name(),
|
||||
pcPatch.transform()
|
||||
);
|
||||
@ -724,9 +724,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
forAll(curCellLabels, celli)
|
||||
{
|
||||
label curCellI = curCellLabels[celli];
|
||||
label curCelli = curCellLabels[celli];
|
||||
|
||||
label zoneI = cellToZone[curCellI];
|
||||
label zoneI = cellToZone[curCelli];
|
||||
|
||||
if (zoneI >= 0)
|
||||
{
|
||||
@ -738,7 +738,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
// Multiple zones. Lookup.
|
||||
forAll(cz, zoneI)
|
||||
{
|
||||
label index = cz[zoneI].whichCell(curCellI);
|
||||
label index = cz[zoneI].whichCell(curCelli);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
@ -859,7 +859,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
UIndirectList<label>
|
||||
(
|
||||
cellLevelPtr(),
|
||||
procCellAddressing_[procI]
|
||||
procCellAddressing_[proci]
|
||||
)()
|
||||
).write();
|
||||
}
|
||||
@ -879,7 +879,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
UIndirectList<label>
|
||||
(
|
||||
pointLevelPtr(),
|
||||
procPointAddressing_[procI]
|
||||
procPointAddressing_[proci]
|
||||
)()
|
||||
).write();
|
||||
}
|
||||
@ -905,7 +905,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
// Statistics
|
||||
|
||||
Info<< endl
|
||||
<< "Processor " << procI << nl
|
||||
<< "Processor " << proci << nl
|
||||
<< " Number of cells = " << procMesh.nCells()
|
||||
<< endl;
|
||||
|
||||
@ -958,7 +958,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procPointAddressing_[procI]
|
||||
procPointAddressing_[proci]
|
||||
);
|
||||
pointProcAddressing.write();
|
||||
|
||||
@ -973,7 +973,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procFaceAddressing_[procI]
|
||||
procFaceAddressing_[proci]
|
||||
);
|
||||
faceProcAddressing.write();
|
||||
|
||||
@ -988,7 +988,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procCellAddressing_[procI]
|
||||
procCellAddressing_[proci]
|
||||
);
|
||||
cellProcAddressing.write();
|
||||
|
||||
|
||||
@ -64,28 +64,28 @@ void Foam::domainDecomposition::addInterProcFace
|
||||
if (patchiter != nbrToInterPatch[ownerProc].end())
|
||||
{
|
||||
// Existing interproc patch. Add to both sides.
|
||||
label toNbrProcPatchI = patchiter();
|
||||
interPatchFaces[ownerProc][toNbrProcPatchI].append(ownerIndex);
|
||||
label toNbrProcPatchi = patchiter();
|
||||
interPatchFaces[ownerProc][toNbrProcPatchi].append(ownerIndex);
|
||||
|
||||
if (isInternalFace(facei))
|
||||
{
|
||||
label toOwnerProcPatchI = nbrToInterPatch[nbrProc][ownerProc];
|
||||
interPatchFaces[nbrProc][toOwnerProcPatchI].append(nbrIndex);
|
||||
label toOwnerProcPatchi = nbrToInterPatch[nbrProc][ownerProc];
|
||||
interPatchFaces[nbrProc][toOwnerProcPatchi].append(nbrIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Create new interproc patches.
|
||||
label toNbrProcPatchI = nbrToInterPatch[ownerProc].size();
|
||||
nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchI);
|
||||
label toNbrProcPatchi = nbrToInterPatch[ownerProc].size();
|
||||
nbrToInterPatch[ownerProc].insert(nbrProc, toNbrProcPatchi);
|
||||
DynamicList<label> oneFace;
|
||||
oneFace.append(ownerIndex);
|
||||
interPatchFaces[ownerProc].append(oneFace);
|
||||
|
||||
if (isInternalFace(facei))
|
||||
{
|
||||
label toOwnerProcPatchI = nbrToInterPatch[nbrProc].size();
|
||||
nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchI);
|
||||
label toOwnerProcPatchi = nbrToInterPatch[nbrProc].size();
|
||||
nbrToInterPatch[nbrProc].insert(ownerProc, toOwnerProcPatchi);
|
||||
oneFace.clear();
|
||||
oneFace.append(nbrIndex);
|
||||
interPatchFaces[nbrProc].append(oneFace);
|
||||
@ -139,20 +139,20 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
|
||||
// for all processors, set the size of start index and patch size
|
||||
// lists to the number of patches in the mesh
|
||||
forAll(procPatchSize_, procI)
|
||||
forAll(procPatchSize_, proci)
|
||||
{
|
||||
procPatchSize_[procI].setSize(patches.size());
|
||||
procPatchStartIndex_[procI].setSize(patches.size());
|
||||
procPatchSize_[proci].setSize(patches.size());
|
||||
procPatchStartIndex_[proci].setSize(patches.size());
|
||||
}
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
// Reset size and start index for all processors
|
||||
forAll(procPatchSize_, procI)
|
||||
forAll(procPatchSize_, proci)
|
||||
{
|
||||
procPatchSize_[procI][patchi] = 0;
|
||||
procPatchStartIndex_[procI][patchi] =
|
||||
procFaceAddressing_[procI].size();
|
||||
procPatchSize_[proci][patchi] = 0;
|
||||
procPatchStartIndex_[proci][patchi] =
|
||||
procFaceAddressing_[proci].size();
|
||||
}
|
||||
|
||||
const label patchStart = patches[patchi].start();
|
||||
@ -239,12 +239,12 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
// originating from internal faces this is always -1.
|
||||
List<labelListList> subPatchIDs(nProcs_);
|
||||
List<labelListList> subPatchStarts(nProcs_);
|
||||
forAll(interPatchFaces, procI)
|
||||
forAll(interPatchFaces, proci)
|
||||
{
|
||||
label nInterfaces = interPatchFaces[procI].size();
|
||||
label nInterfaces = interPatchFaces[proci].size();
|
||||
|
||||
subPatchIDs[procI].setSize(nInterfaces, labelList(1, label(-1)));
|
||||
subPatchStarts[procI].setSize(nInterfaces, labelList(1, label(0)));
|
||||
subPatchIDs[proci].setSize(nInterfaces, labelList(1, label(-1)));
|
||||
subPatchStarts[proci].setSize(nInterfaces, labelList(1, label(0)));
|
||||
}
|
||||
|
||||
|
||||
@ -318,63 +318,63 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
|
||||
// Sort inter-proc patch by neighbour
|
||||
labelList order;
|
||||
forAll(procNbrToInterPatch, procI)
|
||||
forAll(procNbrToInterPatch, proci)
|
||||
{
|
||||
label nInterfaces = procNbrToInterPatch[procI].size();
|
||||
label nInterfaces = procNbrToInterPatch[proci].size();
|
||||
|
||||
procNeighbourProcessors_[procI].setSize(nInterfaces);
|
||||
procProcessorPatchSize_[procI].setSize(nInterfaces);
|
||||
procProcessorPatchStartIndex_[procI].setSize(nInterfaces);
|
||||
procProcessorPatchSubPatchIDs_[procI].setSize(nInterfaces);
|
||||
procProcessorPatchSubPatchStarts_[procI].setSize(nInterfaces);
|
||||
procNeighbourProcessors_[proci].setSize(nInterfaces);
|
||||
procProcessorPatchSize_[proci].setSize(nInterfaces);
|
||||
procProcessorPatchStartIndex_[proci].setSize(nInterfaces);
|
||||
procProcessorPatchSubPatchIDs_[proci].setSize(nInterfaces);
|
||||
procProcessorPatchSubPatchStarts_[proci].setSize(nInterfaces);
|
||||
|
||||
//Info<< "Processor " << procI << endl;
|
||||
//Info<< "Processor " << proci << endl;
|
||||
|
||||
// Get sorted neighbour processors
|
||||
const Map<label>& curNbrToInterPatch = procNbrToInterPatch[procI];
|
||||
const Map<label>& curNbrToInterPatch = procNbrToInterPatch[proci];
|
||||
labelList nbrs = curNbrToInterPatch.toc();
|
||||
|
||||
sortedOrder(nbrs, order);
|
||||
|
||||
DynamicList<DynamicList<label>>& curInterPatchFaces =
|
||||
interPatchFaces[procI];
|
||||
interPatchFaces[proci];
|
||||
|
||||
forAll(nbrs, i)
|
||||
{
|
||||
const label nbrProc = nbrs[i];
|
||||
const label interPatch = curNbrToInterPatch[nbrProc];
|
||||
|
||||
procNeighbourProcessors_[procI][i] = nbrProc;
|
||||
procProcessorPatchSize_[procI][i] =
|
||||
procNeighbourProcessors_[proci][i] = nbrProc;
|
||||
procProcessorPatchSize_[proci][i] =
|
||||
curInterPatchFaces[interPatch].size();
|
||||
procProcessorPatchStartIndex_[procI][i] =
|
||||
procFaceAddressing_[procI].size();
|
||||
procProcessorPatchStartIndex_[proci][i] =
|
||||
procFaceAddressing_[proci].size();
|
||||
|
||||
// Add size as last element to substarts and transfer
|
||||
append
|
||||
(
|
||||
subPatchStarts[procI][interPatch],
|
||||
subPatchStarts[proci][interPatch],
|
||||
curInterPatchFaces[interPatch].size()
|
||||
);
|
||||
procProcessorPatchSubPatchIDs_[procI][i].transfer
|
||||
procProcessorPatchSubPatchIDs_[proci][i].transfer
|
||||
(
|
||||
subPatchIDs[procI][interPatch]
|
||||
subPatchIDs[proci][interPatch]
|
||||
);
|
||||
procProcessorPatchSubPatchStarts_[procI][i].transfer
|
||||
procProcessorPatchSubPatchStarts_[proci][i].transfer
|
||||
(
|
||||
subPatchStarts[procI][interPatch]
|
||||
subPatchStarts[proci][interPatch]
|
||||
);
|
||||
|
||||
//Info<< " nbr:" << nbrProc << endl;
|
||||
//Info<< " interpatch:" << interPatch << endl;
|
||||
//Info<< " size:" << procProcessorPatchSize_[procI][i] << endl;
|
||||
//Info<< " start:" << procProcessorPatchStartIndex_[procI][i]
|
||||
//Info<< " size:" << procProcessorPatchSize_[proci][i] << endl;
|
||||
//Info<< " start:" << procProcessorPatchStartIndex_[proci][i]
|
||||
// << endl;
|
||||
//Info<< " subPatches:"
|
||||
// << procProcessorPatchSubPatchIDs_[procI][i]
|
||||
// << procProcessorPatchSubPatchIDs_[proci][i]
|
||||
// << endl;
|
||||
//Info<< " subStarts:"
|
||||
// << procProcessorPatchSubPatchStarts_[procI][i] << endl;
|
||||
// << procProcessorPatchSubPatchStarts_[proci][i] << endl;
|
||||
|
||||
// And add all the face labels for interPatch
|
||||
DynamicList<label>& interPatchFaces =
|
||||
@ -382,55 +382,55 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
|
||||
forAll(interPatchFaces, j)
|
||||
{
|
||||
procFaceAddressing_[procI].append(interPatchFaces[j]);
|
||||
procFaceAddressing_[proci].append(interPatchFaces[j]);
|
||||
}
|
||||
interPatchFaces.clearStorage();
|
||||
}
|
||||
curInterPatchFaces.clearStorage();
|
||||
procFaceAddressing_[procI].shrink();
|
||||
procFaceAddressing_[proci].shrink();
|
||||
}
|
||||
|
||||
|
||||
////XXXXXXX
|
||||
//// Print a bit
|
||||
// forAll(procPatchStartIndex_, procI)
|
||||
// forAll(procPatchStartIndex_, proci)
|
||||
// {
|
||||
// Info<< "Processor:" << procI << endl;
|
||||
// Info<< "Processor:" << proci << endl;
|
||||
//
|
||||
// Info<< " total faces:" << procFaceAddressing_[procI].size()
|
||||
// Info<< " total faces:" << procFaceAddressing_[proci].size()
|
||||
// << endl;
|
||||
//
|
||||
// const labelList& curProcPatchStartIndex = procPatchStartIndex_[procI];
|
||||
// const labelList& curProcPatchStartIndex = procPatchStartIndex_[proci];
|
||||
//
|
||||
// forAll(curProcPatchStartIndex, patchi)
|
||||
// {
|
||||
// Info<< " patch:" << patchi
|
||||
// << "\tstart:" << curProcPatchStartIndex[patchi]
|
||||
// << "\tsize:" << procPatchSize_[procI][patchi]
|
||||
// << "\tsize:" << procPatchSize_[proci][patchi]
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
// Info<< endl;
|
||||
//
|
||||
// forAll(procNeighbourProcessors_, procI)
|
||||
// forAll(procNeighbourProcessors_, proci)
|
||||
// {
|
||||
// Info<< "Processor " << procI << endl;
|
||||
// Info<< "Processor " << proci << endl;
|
||||
//
|
||||
// forAll(procNeighbourProcessors_[procI], i)
|
||||
// forAll(procNeighbourProcessors_[proci], i)
|
||||
// {
|
||||
// Info<< " nbr:" << procNeighbourProcessors_[procI][i] << endl;
|
||||
// Info<< " size:" << procProcessorPatchSize_[procI][i] << endl;
|
||||
// Info<< " start:" << procProcessorPatchStartIndex_[procI][i]
|
||||
// Info<< " nbr:" << procNeighbourProcessors_[proci][i] << endl;
|
||||
// Info<< " size:" << procProcessorPatchSize_[proci][i] << endl;
|
||||
// Info<< " start:" << procProcessorPatchStartIndex_[proci][i]
|
||||
// << endl;
|
||||
// }
|
||||
// }
|
||||
// Info<< endl;
|
||||
//
|
||||
// forAll(procFaceAddressing_, procI)
|
||||
// forAll(procFaceAddressing_, proci)
|
||||
// {
|
||||
// Info<< "Processor:" << procI << endl;
|
||||
// Info<< "Processor:" << proci << endl;
|
||||
//
|
||||
// Info<< " faces:" << procFaceAddressing_[procI] << endl;
|
||||
// Info<< " faces:" << procFaceAddressing_[proci] << endl;
|
||||
// }
|
||||
|
||||
|
||||
@ -441,12 +441,12 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
// used for the processor. Collect the list of used points for the
|
||||
// processor.
|
||||
|
||||
forAll(procPointAddressing_, procI)
|
||||
forAll(procPointAddressing_, proci)
|
||||
{
|
||||
boolList pointLabels(nPoints(), false);
|
||||
|
||||
// Get reference to list of used faces
|
||||
const labelList& procFaceLabels = procFaceAddressing_[procI];
|
||||
const labelList& procFaceLabels = procFaceAddressing_[proci];
|
||||
|
||||
forAll(procFaceLabels, facei)
|
||||
{
|
||||
@ -461,7 +461,7 @@ void Foam::domainDecomposition::decomposeMesh()
|
||||
}
|
||||
|
||||
// Collect the used points
|
||||
labelList& procPointLabels = procPointAddressing_[procI];
|
||||
labelList& procPointLabels = procPointAddressing_[proci];
|
||||
|
||||
procPointLabels.setSize(pointLabels.size());
|
||||
|
||||
|
||||
@ -62,15 +62,15 @@ void Foam::domainDecomposition::processInterCyclics
|
||||
// Store old sizes. Used to detect which inter-proc patches
|
||||
// have been added to.
|
||||
labelListList oldInterfaceSizes(nProcs_);
|
||||
forAll(oldInterfaceSizes, procI)
|
||||
forAll(oldInterfaceSizes, proci)
|
||||
{
|
||||
labelList& curOldSizes = oldInterfaceSizes[procI];
|
||||
labelList& curOldSizes = oldInterfaceSizes[proci];
|
||||
|
||||
curOldSizes.setSize(interPatchFaces[procI].size());
|
||||
curOldSizes.setSize(interPatchFaces[proci].size());
|
||||
forAll(curOldSizes, interI)
|
||||
{
|
||||
curOldSizes[interI] =
|
||||
interPatchFaces[procI][interI].size();
|
||||
interPatchFaces[proci][interI].size();
|
||||
}
|
||||
}
|
||||
|
||||
@ -94,28 +94,28 @@ void Foam::domainDecomposition::processInterCyclics
|
||||
}
|
||||
|
||||
// 1. Check if any faces added to existing interfaces
|
||||
forAll(oldInterfaceSizes, procI)
|
||||
forAll(oldInterfaceSizes, proci)
|
||||
{
|
||||
const labelList& curOldSizes = oldInterfaceSizes[procI];
|
||||
const labelList& curOldSizes = oldInterfaceSizes[proci];
|
||||
|
||||
forAll(curOldSizes, interI)
|
||||
{
|
||||
label oldSz = curOldSizes[interI];
|
||||
if (interPatchFaces[procI][interI].size() > oldSz)
|
||||
if (interPatchFaces[proci][interI].size() > oldSz)
|
||||
{
|
||||
// Added faces to this interface. Add an entry
|
||||
append(subPatchIDs[procI][interI], patchi);
|
||||
append(subPatchStarts[procI][interI], oldSz);
|
||||
append(subPatchIDs[proci][interI], patchi);
|
||||
append(subPatchStarts[proci][interI], oldSz);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 2. Any new interfaces
|
||||
forAll(subPatchIDs, procI)
|
||||
forAll(subPatchIDs, proci)
|
||||
{
|
||||
label nIntfcs = interPatchFaces[procI].size();
|
||||
subPatchIDs[procI].setSize(nIntfcs, labelList(1, patchi));
|
||||
subPatchStarts[procI].setSize(nIntfcs, labelList(1, label(0)));
|
||||
label nIntfcs = interPatchFaces[proci].size();
|
||||
subPatchIDs[proci].setSize(nIntfcs, labelList(1, patchi));
|
||||
subPatchStarts[proci].setSize(nIntfcs, labelList(1, label(0)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,9 +8,9 @@
|
||||
|
||||
PtrList<labelIOList>& faceProcAddressing = procMeshes.faceProcAddressing();
|
||||
|
||||
forAll(faceProcAddressing, procI)
|
||||
forAll(faceProcAddressing, proci)
|
||||
{
|
||||
const labelList& curFaceAddr = faceProcAddressing[procI];
|
||||
const labelList& curFaceAddr = faceProcAddressing[proci];
|
||||
|
||||
forAll(curFaceAddr, facei)
|
||||
{
|
||||
@ -33,16 +33,16 @@
|
||||
<< "the current version fo decomposePar"
|
||||
<< endl;
|
||||
|
||||
forAll(faceProcAddressing, procI)
|
||||
forAll(faceProcAddressing, proci)
|
||||
{
|
||||
labelList& curFaceAddr = faceProcAddressing[procI];
|
||||
labelList& curFaceAddr = faceProcAddressing[proci];
|
||||
|
||||
forAll(curFaceAddr, facei)
|
||||
{
|
||||
curFaceAddr[facei] += sign(curFaceAddr[facei]);
|
||||
}
|
||||
|
||||
faceProcAddressing[procI].write();
|
||||
faceProcAddressing[proci].write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
@ -176,16 +176,16 @@ int main(int argc, char *argv[])
|
||||
// Create the processor databases
|
||||
PtrList<Time> databases(nProcs);
|
||||
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
databases.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new Time
|
||||
(
|
||||
Time::controlDictName,
|
||||
args.rootPath(),
|
||||
args.caseName()/fileName(word("processor") + name(procI))
|
||||
args.caseName()/fileName(word("processor") + name(proci))
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -227,9 +227,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Set all times on processor meshes equal to reconstructed mesh
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
databases[procI].setTime(runTime);
|
||||
databases[proci].setTime(runTime);
|
||||
}
|
||||
|
||||
|
||||
@ -329,9 +329,9 @@ int main(int argc, char *argv[])
|
||||
Info<< "Time = " << runTime.timeName() << endl << endl;
|
||||
|
||||
// Set time for all databases
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
databases[procI].setTime(timeDirs[timeI], timeI);
|
||||
databases[proci].setTime(timeDirs[timeI], timeI);
|
||||
}
|
||||
|
||||
// Check if any new meshes need to be read.
|
||||
@ -470,12 +470,12 @@ int main(int argc, char *argv[])
|
||||
const pointMesh& pMesh = pointMesh::New(mesh);
|
||||
PtrList<pointMesh> pMeshes(procMeshes.meshes().size());
|
||||
|
||||
forAll(pMeshes, procI)
|
||||
forAll(pMeshes, proci)
|
||||
{
|
||||
pMeshes.set
|
||||
(
|
||||
procI,
|
||||
new pointMesh(procMeshes.meshes()[procI])
|
||||
proci,
|
||||
new pointMesh(procMeshes.meshes()[proci])
|
||||
);
|
||||
}
|
||||
|
||||
@ -531,13 +531,13 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
HashTable<IOobjectList> cloudObjects;
|
||||
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
fileNameList cloudDirs
|
||||
(
|
||||
readDir
|
||||
(
|
||||
databases[procI].timePath()
|
||||
databases[proci].timePath()
|
||||
/ regionDir
|
||||
/ cloud::prefix,
|
||||
fileName::DIRECTORY
|
||||
@ -556,8 +556,8 @@ int main(int argc, char *argv[])
|
||||
// Do local scan for valid cloud objects
|
||||
IOobjectList sprayObjs
|
||||
(
|
||||
procMeshes.meshes()[procI],
|
||||
databases[procI].timeName(),
|
||||
procMeshes.meshes()[proci],
|
||||
databases[proci].timeName(),
|
||||
cloud::prefix/cloudDirs[i]
|
||||
);
|
||||
|
||||
@ -709,9 +709,9 @@ int main(int argc, char *argv[])
|
||||
HashTable<label> fSetNames;
|
||||
HashTable<label> pSetNames;
|
||||
|
||||
forAll(procMeshes.meshes(), procI)
|
||||
forAll(procMeshes.meshes(), proci)
|
||||
{
|
||||
const fvMesh& procMesh = procMeshes.meshes()[procI];
|
||||
const fvMesh& procMesh = procMeshes.meshes()[proci];
|
||||
|
||||
// Note: look at sets in current time only or between
|
||||
// mesh and current time?. For now current time. This will
|
||||
@ -762,9 +762,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Load sets
|
||||
forAll(procMeshes.meshes(), procI)
|
||||
forAll(procMeshes.meshes(), proci)
|
||||
{
|
||||
const fvMesh& procMesh = procMeshes.meshes()[procI];
|
||||
const fvMesh& procMesh = procMeshes.meshes()[proci];
|
||||
|
||||
IOobjectList objects
|
||||
(
|
||||
@ -775,7 +775,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// cellSets
|
||||
const labelList& cellMap =
|
||||
procMeshes.cellProcAddressing()[procI];
|
||||
procMeshes.cellProcAddressing()[proci];
|
||||
|
||||
IOobjectList cSets(objects.lookupClass(cellSet::typeName));
|
||||
forAllConstIter(IOobjectList, cSets, iter)
|
||||
@ -802,7 +802,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
// faceSets
|
||||
const labelList& faceMap =
|
||||
procMeshes.faceProcAddressing()[procI];
|
||||
procMeshes.faceProcAddressing()[proci];
|
||||
|
||||
IOobjectList fSets(objects.lookupClass(faceSet::typeName));
|
||||
forAllConstIter(IOobjectList, fSets, iter)
|
||||
@ -828,7 +828,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
// pointSets
|
||||
const labelList& pointMap =
|
||||
procMeshes.pointProcAddressing()[procI];
|
||||
procMeshes.pointProcAddressing()[proci];
|
||||
|
||||
IOobjectList pSets(objects.lookupClass(pointSet::typeName));
|
||||
forAllConstIter(IOobjectList, pSets, iter)
|
||||
|
||||
@ -78,12 +78,12 @@ static void renumber
|
||||
|
||||
// Determine which faces are coupled. Uses geometric merge distance.
|
||||
// Looks either at all boundaryFaces (fullMatch) or only at the
|
||||
// procBoundaries for procI. Assumes that masterMesh contains already merged
|
||||
// all the processors < procI.
|
||||
// procBoundaries for proci. Assumes that masterMesh contains already merged
|
||||
// all the processors < proci.
|
||||
autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
(
|
||||
const bool fullMatch,
|
||||
const label procI,
|
||||
const label proci,
|
||||
const polyMesh& masterMesh,
|
||||
const polyMesh& meshToAdd,
|
||||
const scalar mergeDist
|
||||
@ -105,11 +105,11 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
else
|
||||
{
|
||||
// Pick up all patches on masterMesh ending in "toDDD" where DDD is
|
||||
// the processor number procI.
|
||||
// the processor number proci.
|
||||
|
||||
const polyBoundaryMesh& masterPatches = masterMesh.boundaryMesh();
|
||||
|
||||
const string toProcString("to" + name(procI));
|
||||
const string toProcString("to" + name(proci));
|
||||
|
||||
DynamicList<label> masterFaces
|
||||
(
|
||||
@ -130,10 +130,10 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
)
|
||||
)
|
||||
{
|
||||
label meshFaceI = pp.start();
|
||||
label meshFacei = pp.start();
|
||||
forAll(pp, i)
|
||||
{
|
||||
masterFaces.append(meshFaceI++);
|
||||
masterFaces.append(meshFacei++);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -141,7 +141,7 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
|
||||
|
||||
// Pick up all patches on meshToAdd ending in "procBoundaryDDDtoYYY"
|
||||
// where DDD is the processor number procI and YYY is < procI.
|
||||
// where DDD is the processor number proci and YYY is < proci.
|
||||
|
||||
const polyBoundaryMesh& addPatches = meshToAdd.boundaryMesh();
|
||||
|
||||
@ -159,11 +159,11 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
{
|
||||
bool isConnected = false;
|
||||
|
||||
for (label mergedProcI = 0; mergedProcI < procI; mergedProcI++)
|
||||
for (label mergedProci = 0; mergedProci < proci; mergedProci++)
|
||||
{
|
||||
const word fromProcString
|
||||
(
|
||||
processorPolyPatch::newName(procI, mergedProcI)
|
||||
processorPolyPatch::newName(proci, mergedProci)
|
||||
);
|
||||
|
||||
if (pp.name() == fromProcString)
|
||||
@ -175,10 +175,10 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
|
||||
if (isConnected)
|
||||
{
|
||||
label meshFaceI = pp.start();
|
||||
label meshFacei = pp.start();
|
||||
forAll(pp, i)
|
||||
{
|
||||
addFaces.append(meshFaceI++);
|
||||
addFaces.append(meshFacei++);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -244,9 +244,9 @@ autoPtr<mapPolyMesh> mergeSharedPoints
|
||||
// for changed point numbering.
|
||||
|
||||
// Adapt constructMaps for merged points.
|
||||
forAll(pointProcAddressing, procI)
|
||||
forAll(pointProcAddressing, proci)
|
||||
{
|
||||
labelList& constructMap = pointProcAddressing[procI];
|
||||
labelList& constructMap = pointProcAddressing[proci];
|
||||
|
||||
forAll(constructMap, i)
|
||||
{
|
||||
@ -285,21 +285,21 @@ boundBox procBounds
|
||||
{
|
||||
boundBox bb = boundBox::invertedBox;
|
||||
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
fileName pointsInstance
|
||||
(
|
||||
databases[procI].findInstance
|
||||
databases[proci].findInstance
|
||||
(
|
||||
regionDir/polyMesh::meshSubDir,
|
||||
"points"
|
||||
)
|
||||
);
|
||||
|
||||
if (pointsInstance != databases[procI].timeName())
|
||||
if (pointsInstance != databases[proci].timeName())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Your time was specified as " << databases[procI].timeName()
|
||||
<< "Your time was specified as " << databases[proci].timeName()
|
||||
<< " but there is no polyMesh/points in that time." << endl
|
||||
<< "(there is a points file in " << pointsInstance
|
||||
<< ")" << endl
|
||||
@ -310,8 +310,8 @@ boundBox procBounds
|
||||
}
|
||||
|
||||
Info<< "Reading points from "
|
||||
<< databases[procI].caseName()
|
||||
<< " for time = " << databases[procI].timeName()
|
||||
<< databases[proci].caseName()
|
||||
<< " for time = " << databases[proci].timeName()
|
||||
<< nl << endl;
|
||||
|
||||
pointIOField points
|
||||
@ -319,13 +319,13 @@ boundBox procBounds
|
||||
IOobject
|
||||
(
|
||||
"points",
|
||||
databases[procI].findInstance
|
||||
databases[proci].findInstance
|
||||
(
|
||||
regionDir/polyMesh::meshSubDir,
|
||||
"points"
|
||||
),
|
||||
regionDir/polyMesh::meshSubDir,
|
||||
databases[procI],
|
||||
databases[proci],
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
@ -366,10 +366,10 @@ void writeCellDistance
|
||||
masterMesh.nCells()
|
||||
);
|
||||
|
||||
forAll(cellProcAddressing, procI)
|
||||
forAll(cellProcAddressing, proci)
|
||||
{
|
||||
const labelList& pCells = cellProcAddressing[procI];
|
||||
UIndirectList<label>(cellDecomposition, pCells) = procI;
|
||||
const labelList& pCells = cellProcAddressing[proci];
|
||||
UIndirectList<label>(cellDecomposition, pCells) = proci;
|
||||
}
|
||||
|
||||
cellDecomposition.write();
|
||||
@ -542,20 +542,20 @@ int main(int argc, char *argv[])
|
||||
// Read all time databases
|
||||
PtrList<Time> databases(nProcs);
|
||||
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
Info<< "Reading database "
|
||||
<< args.caseName()/fileName(word("processor") + name(procI))
|
||||
<< args.caseName()/fileName(word("processor") + name(proci))
|
||||
<< endl;
|
||||
|
||||
databases.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new Time
|
||||
(
|
||||
Time::controlDictName,
|
||||
args.rootPath(),
|
||||
args.caseName()/fileName(word("processor") + name(procI))
|
||||
args.caseName()/fileName(word("processor") + name(proci))
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -577,9 +577,9 @@ int main(int argc, char *argv[])
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
// Set time for all databases
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
databases[procI].setTime(timeDirs[timeI], timeI);
|
||||
databases[proci].setTime(timeDirs[timeI], timeI);
|
||||
}
|
||||
|
||||
const fileName meshPath =
|
||||
@ -636,11 +636,11 @@ int main(int argc, char *argv[])
|
||||
xferCopy(cellList())
|
||||
);
|
||||
|
||||
for (label procI = 0; procI < nProcs; procI++)
|
||||
for (label proci = 0; proci < nProcs; proci++)
|
||||
{
|
||||
Info<< "Reading mesh to add from "
|
||||
<< databases[procI].caseName()
|
||||
<< " for time = " << databases[procI].timeName()
|
||||
<< databases[proci].caseName()
|
||||
<< " for time = " << databases[proci].timeName()
|
||||
<< nl << endl;
|
||||
|
||||
fvMesh meshToAdd
|
||||
@ -648,16 +648,16 @@ int main(int argc, char *argv[])
|
||||
IOobject
|
||||
(
|
||||
regionName,
|
||||
databases[procI].timeName(),
|
||||
databases[procI]
|
||||
databases[proci].timeName(),
|
||||
databases[proci]
|
||||
)
|
||||
);
|
||||
|
||||
// Initialize its addressing
|
||||
cellProcAddressing[procI] = identity(meshToAdd.nCells());
|
||||
faceProcAddressing[procI] = identity(meshToAdd.nFaces());
|
||||
pointProcAddressing[procI] = identity(meshToAdd.nPoints());
|
||||
boundaryProcAddressing[procI] =
|
||||
cellProcAddressing[proci] = identity(meshToAdd.nCells());
|
||||
faceProcAddressing[proci] = identity(meshToAdd.nFaces());
|
||||
pointProcAddressing[proci] = identity(meshToAdd.nPoints());
|
||||
boundaryProcAddressing[proci] =
|
||||
identity(meshToAdd.boundaryMesh().size());
|
||||
|
||||
|
||||
@ -665,7 +665,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
||||
(
|
||||
fullMatch,
|
||||
procI,
|
||||
proci,
|
||||
masterMesh,
|
||||
meshToAdd,
|
||||
mergeDist
|
||||
@ -686,7 +686,7 @@ int main(int argc, char *argv[])
|
||||
// item in masterMesh.
|
||||
|
||||
// Processors that were already in masterMesh
|
||||
for (label mergedI = 0; mergedI < procI; mergedI++)
|
||||
for (label mergedI = 0; mergedI < proci; mergedI++)
|
||||
{
|
||||
renumber(map().oldCellMap(), cellProcAddressing[mergedI]);
|
||||
renumber(map().oldFaceMap(), faceProcAddressing[mergedI]);
|
||||
@ -700,10 +700,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
// Added processor
|
||||
renumber(map().addedCellMap(), cellProcAddressing[procI]);
|
||||
renumber(map().addedFaceMap(), faceProcAddressing[procI]);
|
||||
renumber(map().addedPointMap(), pointProcAddressing[procI]);
|
||||
renumber(map().addedPatchMap(), boundaryProcAddressing[procI]);
|
||||
renumber(map().addedCellMap(), cellProcAddressing[proci]);
|
||||
renumber(map().addedFaceMap(), faceProcAddressing[proci]);
|
||||
renumber(map().addedPointMap(), pointProcAddressing[proci]);
|
||||
renumber(map().addedPatchMap(), boundaryProcAddressing[proci]);
|
||||
|
||||
Info<< endl;
|
||||
}
|
||||
@ -740,18 +740,18 @@ int main(int argc, char *argv[])
|
||||
Info<< "Reconstructing the addressing from the processor meshes"
|
||||
<< " to the newly reconstructed mesh" << nl << endl;
|
||||
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
Info<< "Reading processor " << procI << " mesh from "
|
||||
<< databases[procI].caseName() << endl;
|
||||
Info<< "Reading processor " << proci << " mesh from "
|
||||
<< databases[proci].caseName() << endl;
|
||||
|
||||
polyMesh procMesh
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
regionName,
|
||||
databases[procI].timeName(),
|
||||
databases[procI]
|
||||
databases[proci].timeName(),
|
||||
databases[proci]
|
||||
)
|
||||
);
|
||||
|
||||
@ -759,7 +759,7 @@ int main(int argc, char *argv[])
|
||||
// From processor point to reconstructed mesh point
|
||||
|
||||
Info<< "Writing pointProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
<< databases[proci].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
<< endl;
|
||||
@ -776,14 +776,14 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
),
|
||||
pointProcAddressing[procI]
|
||||
pointProcAddressing[proci]
|
||||
).write();
|
||||
|
||||
|
||||
// From processor face to reconstructed mesh face
|
||||
|
||||
Info<< "Writing faceProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
<< databases[proci].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
<< endl;
|
||||
@ -800,43 +800,43 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
),
|
||||
faceProcAddressing[procI]
|
||||
faceProcAddressing[proci]
|
||||
);
|
||||
|
||||
// Now add turning index to faceProcAddressing.
|
||||
// See reconstructPar for meaning of turning index.
|
||||
forAll(faceProcAddr, procFaceI)
|
||||
forAll(faceProcAddr, procFacei)
|
||||
{
|
||||
label masterFaceI = faceProcAddr[procFaceI];
|
||||
label masterFacei = faceProcAddr[procFacei];
|
||||
|
||||
if
|
||||
(
|
||||
!procMesh.isInternalFace(procFaceI)
|
||||
&& masterFaceI < masterInternalFaces
|
||||
!procMesh.isInternalFace(procFacei)
|
||||
&& masterFacei < masterInternalFaces
|
||||
)
|
||||
{
|
||||
// proc face is now external but used to be internal face.
|
||||
// Check if we have owner or neighbour.
|
||||
|
||||
label procOwn = procMesh.faceOwner()[procFaceI];
|
||||
label masterOwn = masterOwner[masterFaceI];
|
||||
label procOwn = procMesh.faceOwner()[procFacei];
|
||||
label masterOwn = masterOwner[masterFacei];
|
||||
|
||||
if (cellProcAddressing[procI][procOwn] == masterOwn)
|
||||
if (cellProcAddressing[proci][procOwn] == masterOwn)
|
||||
{
|
||||
// No turning. Offset by 1.
|
||||
faceProcAddr[procFaceI]++;
|
||||
faceProcAddr[procFacei]++;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Turned face.
|
||||
faceProcAddr[procFaceI] =
|
||||
-1 - faceProcAddr[procFaceI];
|
||||
faceProcAddr[procFacei] =
|
||||
-1 - faceProcAddr[procFacei];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// No turning. Offset by 1.
|
||||
faceProcAddr[procFaceI]++;
|
||||
faceProcAddr[procFacei]++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -846,7 +846,7 @@ int main(int argc, char *argv[])
|
||||
// From processor cell to reconstructed mesh cell
|
||||
|
||||
Info<< "Writing cellProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
<< databases[proci].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
<< endl;
|
||||
@ -863,7 +863,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
),
|
||||
cellProcAddressing[procI]
|
||||
cellProcAddressing[proci]
|
||||
).write();
|
||||
|
||||
|
||||
@ -871,7 +871,7 @@ int main(int argc, char *argv[])
|
||||
// From processor patch to reconstructed mesh patch
|
||||
|
||||
Info<< "Writing boundaryProcAddressing to "
|
||||
<< databases[procI].caseName()
|
||||
<< databases[proci].caseName()
|
||||
/procMesh.facesInstance()
|
||||
/polyMesh::meshSubDir
|
||||
<< endl;
|
||||
@ -888,7 +888,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
),
|
||||
boundaryProcAddressing[procI]
|
||||
boundaryProcAddressing[proci]
|
||||
).write();
|
||||
|
||||
Info<< endl;
|
||||
|
||||
@ -150,32 +150,32 @@ void printMeshData(const polyMesh& mesh)
|
||||
label totProcPatches = 0;
|
||||
label maxProcFaces = 0;
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
Info<< endl
|
||||
<< "Processor " << procI << nl
|
||||
<< " Number of cells = " << globalCells.localSize(procI)
|
||||
<< "Processor " << proci << nl
|
||||
<< " Number of cells = " << globalCells.localSize(proci)
|
||||
<< endl;
|
||||
|
||||
label nProcFaces = 0;
|
||||
|
||||
const labelList& nei = patchNeiProcNo[procI];
|
||||
const labelList& nei = patchNeiProcNo[proci];
|
||||
|
||||
forAll(patchNeiProcNo[procI], i)
|
||||
forAll(patchNeiProcNo[proci], i)
|
||||
{
|
||||
Info<< " Number of faces shared with processor "
|
||||
<< patchNeiProcNo[procI][i] << " = " << patchSize[procI][i]
|
||||
<< patchNeiProcNo[proci][i] << " = " << patchSize[proci][i]
|
||||
<< endl;
|
||||
|
||||
nProcFaces += patchSize[procI][i];
|
||||
nProcFaces += patchSize[proci][i];
|
||||
}
|
||||
|
||||
Info<< " Number of processor patches = " << nei.size() << nl
|
||||
<< " Number of processor faces = " << nProcFaces << nl
|
||||
<< " Number of boundary faces = "
|
||||
<< globalBoundaryFaces.localSize(procI) << endl;
|
||||
<< globalBoundaryFaces.localSize(proci) << endl;
|
||||
|
||||
maxProcCells = max(maxProcCells, globalCells.localSize(procI));
|
||||
maxProcCells = max(maxProcCells, globalCells.localSize(proci));
|
||||
totProcFaces += nProcFaces;
|
||||
totProcPatches += nei.size();
|
||||
maxProcPatches = max(maxProcPatches, nei.size());
|
||||
@ -298,11 +298,11 @@ void readFields
|
||||
tmp<GeoField> tsubfld = subsetterPtr().interpolate(fields[i]);
|
||||
|
||||
// Send to all processors that don't have a mesh
|
||||
for (label procI = 1; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 1; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
if (!haveMesh[procI])
|
||||
if (!haveMesh[proci])
|
||||
{
|
||||
OPstream toProc(Pstream::blocking, procI);
|
||||
OPstream toProc(Pstream::blocking, proci);
|
||||
toProc<< tsubfld();
|
||||
}
|
||||
}
|
||||
@ -574,7 +574,7 @@ int main(int argc, char *argv[])
|
||||
// Find last non-processor patch.
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
label nonProcI = -1;
|
||||
label nonProci = -1;
|
||||
|
||||
forAll(patches, patchi)
|
||||
{
|
||||
@ -582,10 +582,10 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
break;
|
||||
}
|
||||
nonProcI++;
|
||||
nonProci++;
|
||||
}
|
||||
|
||||
if (nonProcI == -1)
|
||||
if (nonProci == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot find non-processor patch on processor "
|
||||
@ -596,7 +596,7 @@ int main(int argc, char *argv[])
|
||||
// Subset 0 cells, no parallel comms. This is used to create zero-sized
|
||||
// fields.
|
||||
subsetterPtr.reset(new fvMeshSubset(mesh));
|
||||
subsetterPtr().setLargeCellSubset(labelHashSet(0), nonProcI, false);
|
||||
subsetterPtr().setLargeCellSubset(labelHashSet(0), nonProci, false);
|
||||
}
|
||||
|
||||
|
||||
@ -781,11 +781,11 @@ int main(int argc, char *argv[])
|
||||
<< " Take care when issuing these" << nl
|
||||
<< "commands." << nl << endl;
|
||||
|
||||
forAll(nFaces, procI)
|
||||
forAll(nFaces, proci)
|
||||
{
|
||||
fileName procDir = "processor" + name(procI);
|
||||
fileName procDir = "processor" + name(proci);
|
||||
|
||||
if (nFaces[procI] == 0)
|
||||
if (nFaces[proci] == 0)
|
||||
{
|
||||
Info<< " rm -r " << procDir.c_str() << nl;
|
||||
}
|
||||
|
||||
@ -133,7 +133,7 @@ bool writePatchField
|
||||
(
|
||||
const Field<Type>& pf,
|
||||
const label patchi,
|
||||
const label ensightPatchI,
|
||||
const label ensightPatchi,
|
||||
const faceSets& boundaryFaceSet,
|
||||
const ensightMesh::nFacePrimitives& nfp,
|
||||
ensightStream& ensightFile
|
||||
@ -143,7 +143,7 @@ bool writePatchField
|
||||
{
|
||||
if (Pstream::master())
|
||||
{
|
||||
ensightFile.writePartHeader(ensightPatchI);
|
||||
ensightFile.writePartHeader(ensightPatchi);
|
||||
}
|
||||
|
||||
writeField
|
||||
@ -197,7 +197,7 @@ void writePatchField
|
||||
const HashTable<ensightMesh::nFacePrimitives>&
|
||||
nPatchPrims = eMesh.nPatchPrims();
|
||||
|
||||
label ensightPatchI = eMesh.patchPartOffset();
|
||||
label ensightPatchi = eMesh.patchPartOffset();
|
||||
|
||||
label patchi = -1;
|
||||
|
||||
@ -208,7 +208,7 @@ void writePatchField
|
||||
patchi = i;
|
||||
break;
|
||||
}
|
||||
ensightPatchI++;
|
||||
ensightPatchi++;
|
||||
}
|
||||
|
||||
|
||||
@ -265,7 +265,7 @@ void writePatchField
|
||||
(
|
||||
pf,
|
||||
patchi,
|
||||
ensightPatchI,
|
||||
ensightPatchi,
|
||||
boundaryFaceSets[patchi],
|
||||
nPatchPrims.find(patchName)(),
|
||||
ensightFile
|
||||
@ -279,7 +279,7 @@ void writePatchField
|
||||
(
|
||||
Field<Type>(),
|
||||
-1,
|
||||
ensightPatchI,
|
||||
ensightPatchi,
|
||||
nullFaceSets,
|
||||
nPatchPrims.find(patchName)(),
|
||||
ensightFile
|
||||
@ -418,7 +418,7 @@ void ensightField
|
||||
);
|
||||
}
|
||||
|
||||
label ensightPatchI = eMesh.patchPartOffset();
|
||||
label ensightPatchi = eMesh.patchPartOffset();
|
||||
|
||||
forAll(allPatchNames, patchi)
|
||||
{
|
||||
@ -434,14 +434,14 @@ void ensightField
|
||||
(
|
||||
vf.boundaryField()[patchi],
|
||||
patchi,
|
||||
ensightPatchI,
|
||||
ensightPatchi,
|
||||
boundaryFaceSets[patchi],
|
||||
nPatchPrims.find(patchName)(),
|
||||
ensightFile
|
||||
)
|
||||
)
|
||||
{
|
||||
ensightPatchI++;
|
||||
ensightPatchi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -494,8 +494,8 @@ void ensightField
|
||||
{
|
||||
label patchi = mesh.boundaryMesh().whichPatch(facei);
|
||||
const polyPatch& pp = mesh.boundaryMesh()[patchi];
|
||||
label patchFaceI = pp.whichFace(facei);
|
||||
Type value = sf.boundaryField()[patchi][patchFaceI];
|
||||
label patchFacei = pp.whichFace(facei);
|
||||
Type value = sf.boundaryField()[patchi][patchFacei];
|
||||
values[j] = value;
|
||||
++j;
|
||||
}
|
||||
@ -508,14 +508,14 @@ void ensightField
|
||||
(
|
||||
values,
|
||||
zoneID,
|
||||
ensightPatchI,
|
||||
ensightPatchi,
|
||||
faceZoneFaceSets[zoneID],
|
||||
nFaceZonePrims.find(faceZoneName)(),
|
||||
ensightFile
|
||||
)
|
||||
)
|
||||
{
|
||||
ensightPatchI++;
|
||||
ensightPatchi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -609,7 +609,7 @@ void ensightPointField
|
||||
}
|
||||
|
||||
|
||||
label ensightPatchI = eMesh.patchPartOffset();
|
||||
label ensightPatchi = eMesh.patchPartOffset();
|
||||
|
||||
forAll(allPatchNames, patchi)
|
||||
{
|
||||
@ -640,7 +640,7 @@ void ensightPointField
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
ensightFile.writePartHeader(ensightPatchI);
|
||||
ensightFile.writePartHeader(ensightPatchi);
|
||||
}
|
||||
|
||||
writeField
|
||||
@ -650,7 +650,7 @@ void ensightPointField
|
||||
ensightFile
|
||||
);
|
||||
|
||||
ensightPatchI++;
|
||||
ensightPatchi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -684,7 +684,7 @@ void ensightPointField
|
||||
|
||||
if (Pstream::master())
|
||||
{
|
||||
ensightFile.writePartHeader(ensightPatchI);
|
||||
ensightFile.writePartHeader(ensightPatchi);
|
||||
}
|
||||
|
||||
writeField
|
||||
@ -698,7 +698,7 @@ void ensightPointField
|
||||
ensightFile
|
||||
);
|
||||
|
||||
ensightPatchI++;
|
||||
ensightPatchi++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,10 +293,10 @@ void Foam::ensightMesh::correct()
|
||||
&& !refCast<const processorPolyPatch>(pp).owner()
|
||||
)
|
||||
{
|
||||
label bFaceI = pp.start()-mesh_.nInternalFaces();
|
||||
label bFacei = pp.start()-mesh_.nInternalFaces();
|
||||
forAll(pp, i)
|
||||
{
|
||||
boundaryFaceToBeIncluded_[bFaceI++] = 0;
|
||||
boundaryFaceToBeIncluded_[bFacei++] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1136,7 +1136,7 @@ void Foam::ensightMesh::write
|
||||
}
|
||||
|
||||
|
||||
label ensightPatchI = patchPartOffset_;
|
||||
label ensightPatchi = patchPartOffset_;
|
||||
|
||||
forAll(allPatchNames_, patchi)
|
||||
{
|
||||
@ -1176,7 +1176,7 @@ void Foam::ensightMesh::write
|
||||
|
||||
writeAllPoints
|
||||
(
|
||||
ensightPatchI++,
|
||||
ensightPatchi++,
|
||||
patchName,
|
||||
uniquePoints,
|
||||
globalPointsPtr().size(),
|
||||
@ -1281,7 +1281,7 @@ void Foam::ensightMesh::write
|
||||
|
||||
writeAllPoints
|
||||
(
|
||||
ensightPatchI++,
|
||||
ensightPatchi++,
|
||||
faceZoneName,
|
||||
uniquePoints,
|
||||
globalPointsPtr().size(),
|
||||
|
||||
@ -107,8 +107,8 @@ Foam::tmp<Field<Type>> Foam::tecplotWriter::getFaceField
|
||||
}
|
||||
else
|
||||
{
|
||||
label localFaceI = facei - patches[patchi].start();
|
||||
fld[i] = sfld.boundaryField()[patchi][localFaceI];
|
||||
label localFacei = facei - patches[patchi].start();
|
||||
fld[i] = sfld.boundaryField()[patchi][localFacei];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,15 +107,15 @@ void ReadAndMapFields
|
||||
else if (index < 0)
|
||||
{
|
||||
label facei = -index-1;
|
||||
label bFaceI = facei - mesh.nInternalFaces();
|
||||
if (bFaceI >= 0)
|
||||
label bFacei = facei - mesh.nInternalFaces();
|
||||
if (bFacei >= 0)
|
||||
{
|
||||
label patchi = mesh.boundaryMesh().patchID()[bFaceI];
|
||||
label localFaceI = mesh.boundaryMesh()[patchi].whichFace
|
||||
label patchi = mesh.boundaryMesh().patchID()[bFacei];
|
||||
label localFacei = mesh.boundaryMesh()[patchi].whichFace
|
||||
(
|
||||
facei
|
||||
);
|
||||
fld[pointI] = readField.boundaryField()[patchi][localFaceI];
|
||||
fld[pointI] = readField.boundaryField()[patchi][localFacei];
|
||||
}
|
||||
//else
|
||||
//{
|
||||
|
||||
@ -137,11 +137,11 @@ void Foam::internalWriter::writeCellIDs()
|
||||
{
|
||||
cellId[labelI++] = cMap[celli];
|
||||
}
|
||||
forAll(superCells, superCellI)
|
||||
forAll(superCells, superCelli)
|
||||
{
|
||||
label origCellI = cMap[superCells[superCellI]];
|
||||
label origCelli = cMap[superCells[superCelli]];
|
||||
|
||||
cellId[labelI++] = origCellI;
|
||||
cellId[labelI++] = origCelli;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -150,11 +150,11 @@ void Foam::internalWriter::writeCellIDs()
|
||||
{
|
||||
cellId[labelI++] = celli;
|
||||
}
|
||||
forAll(superCells, superCellI)
|
||||
forAll(superCells, superCelli)
|
||||
{
|
||||
label origCellI = superCells[superCellI];
|
||||
label origCelli = superCells[superCelli];
|
||||
|
||||
cellId[labelI++] = origCellI;
|
||||
cellId[labelI++] = origCelli;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -51,8 +51,8 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
|
||||
}
|
||||
else
|
||||
{
|
||||
label localFaceI = facei - patches[patchi].start();
|
||||
fld[i] = sfld.boundaryField()[patchi][localFaceI];
|
||||
label localFacei = facei - patches[patchi].start();
|
||||
fld[i] = sfld.boundaryField()[patchi][localFacei];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -87,9 +87,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
{
|
||||
const cell& cFaces = mesh_.cells()[celli];
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh_.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh_.faces()[cFaces[cFacei]];
|
||||
|
||||
label nQuads = 0;
|
||||
label nTris = 0;
|
||||
@ -120,7 +120,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
cellTypes_.setSize(cellShapes.size() + nAddCells);
|
||||
|
||||
// Set counters for additional points and additional cells
|
||||
label addPointI = 0, addCellI = 0;
|
||||
label addPointI = 0, addCelli = 0;
|
||||
|
||||
forAll(cellShapes, celli)
|
||||
{
|
||||
@ -200,10 +200,10 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
bool substituteCell = true;
|
||||
|
||||
const labelList& cFaces = mesh_.cells()[celli];
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh_.faces()[cFaces[cFaceI]];
|
||||
const bool isOwner = (owner[cFaces[cFaceI]] == celli);
|
||||
const face& f = mesh_.faces()[cFaces[cFacei]];
|
||||
const bool isOwner = (owner[cFaces[cFacei]] == celli);
|
||||
|
||||
// Number of triangles and quads in decomposition
|
||||
label nTris = 0;
|
||||
@ -219,20 +219,20 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
|
||||
forAll(quadFcs, quadI)
|
||||
{
|
||||
label thisCellI;
|
||||
label thisCelli;
|
||||
|
||||
if (substituteCell)
|
||||
{
|
||||
thisCellI = celli;
|
||||
thisCelli = celli;
|
||||
substituteCell = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
thisCellI = mesh_.nCells() + addCellI;
|
||||
superCells_[addCellI++] = celli;
|
||||
thisCelli = mesh_.nCells() + addCelli;
|
||||
superCells_[addCelli++] = celli;
|
||||
}
|
||||
|
||||
labelList& addVtkVerts = vertLabels_[thisCellI];
|
||||
labelList& addVtkVerts = vertLabels_[thisCelli];
|
||||
|
||||
addVtkVerts.setSize(5);
|
||||
|
||||
@ -261,26 +261,26 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
}
|
||||
addVtkVerts[4] = newVertexLabel;
|
||||
|
||||
cellTypes_[thisCellI] = VTK_PYRAMID;
|
||||
cellTypes_[thisCelli] = VTK_PYRAMID;
|
||||
}
|
||||
|
||||
forAll(triFcs, triI)
|
||||
{
|
||||
label thisCellI;
|
||||
label thisCelli;
|
||||
|
||||
if (substituteCell)
|
||||
{
|
||||
thisCellI = celli;
|
||||
thisCelli = celli;
|
||||
substituteCell = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
thisCellI = mesh_.nCells() + addCellI;
|
||||
superCells_[addCellI++] = celli;
|
||||
thisCelli = mesh_.nCells() + addCelli;
|
||||
superCells_[addCelli++] = celli;
|
||||
}
|
||||
|
||||
|
||||
labelList& addVtkVerts = vertLabels_[thisCellI];
|
||||
labelList& addVtkVerts = vertLabels_[thisCelli];
|
||||
|
||||
const face& tri = triFcs[triI];
|
||||
|
||||
@ -301,7 +301,7 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
}
|
||||
addVtkVerts[3] = newVertexLabel;
|
||||
|
||||
cellTypes_[thisCellI] = VTK_TETRA;
|
||||
cellTypes_[thisCelli] = VTK_TETRA;
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,9 +318,9 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
label nData = 1 + cFaces.size();
|
||||
|
||||
// count total number of face points
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
nData += f.size(); // space for the face labels
|
||||
}
|
||||
|
||||
@ -330,10 +330,10 @@ Foam::vtkTopo::vtkTopo(const polyMesh& mesh)
|
||||
vtkVerts[nData++] = cFaces.size();
|
||||
|
||||
// build face stream
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const bool isOwner = (owner[cFaces[cFaceI]] == celli);
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
const bool isOwner = (owner[cFaces[cFacei]] == celli);
|
||||
|
||||
// number of labels for this face
|
||||
vtkVerts[nData++] = f.size();
|
||||
|
||||
@ -61,13 +61,13 @@ void Foam::writeFaceSet
|
||||
|
||||
faceList setFaces(set.size());
|
||||
labelList setFaceLabels(set.size());
|
||||
label setFaceI = 0;
|
||||
label setFacei = 0;
|
||||
|
||||
forAllConstIter(faceSet, set, iter)
|
||||
{
|
||||
setFaceLabels[setFaceI] = iter.key();
|
||||
setFaces[setFaceI] = faces[iter.key()];
|
||||
setFaceI++;
|
||||
setFaceLabels[setFacei] = iter.key();
|
||||
setFaces[setFacei] = faces[iter.key()];
|
||||
setFacei++;
|
||||
}
|
||||
primitiveFacePatch fp(setFaces, vMesh.mesh().points());
|
||||
|
||||
|
||||
@ -81,11 +81,11 @@ void Foam::writeFuns::write
|
||||
|
||||
insert(vvf.internalField(), fField);
|
||||
|
||||
forAll(superCells, superCellI)
|
||||
forAll(superCells, superCelli)
|
||||
{
|
||||
label origCellI = superCells[superCellI];
|
||||
label origCelli = superCells[superCelli];
|
||||
|
||||
insert(vvf[origCellI], fField);
|
||||
insert(vvf[origCelli], fField);
|
||||
}
|
||||
write(os, binary, fField);
|
||||
}
|
||||
@ -115,9 +115,9 @@ void Foam::writeFuns::write
|
||||
|
||||
forAll(addPointCellLabels, api)
|
||||
{
|
||||
label origCellI = addPointCellLabels[api];
|
||||
label origCelli = addPointCellLabels[api];
|
||||
|
||||
insert(interpolatePointToCell(pvf, origCellI), fField);
|
||||
insert(interpolatePointToCell(pvf, origCelli), fField);
|
||||
}
|
||||
write(os, binary, fField);
|
||||
}
|
||||
@ -148,9 +148,9 @@ void Foam::writeFuns::write
|
||||
|
||||
forAll(addPointCellLabels, api)
|
||||
{
|
||||
label origCellI = addPointCellLabels[api];
|
||||
label origCelli = addPointCellLabels[api];
|
||||
|
||||
insert(vvf[origCellI], fField);
|
||||
insert(vvf[origCelli], fField);
|
||||
}
|
||||
write(os, binary, fField);
|
||||
}
|
||||
|
||||
@ -99,9 +99,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
{
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
|
||||
label nQuads = 0;
|
||||
label nTris = 0;
|
||||
@ -158,7 +158,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
vtkmesh->Allocate(mesh.nCells() + nAddCells);
|
||||
|
||||
// Set counters for additional points and additional cells
|
||||
label addPointI = 0, addCellI = 0;
|
||||
label addPointI = 0, addCelli = 0;
|
||||
|
||||
// Create storage for points - needed for mapping from OpenFOAM to VTK
|
||||
// data types - max 'order' = hex = 8 points
|
||||
@ -173,7 +173,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
const cellShape& cellShape = cellShapes[celli];
|
||||
const cellModel& cellModel = cellShape.model();
|
||||
|
||||
superCells[addCellI++] = celli;
|
||||
superCells[addCelli++] = celli;
|
||||
|
||||
if (cellModel == tet)
|
||||
{
|
||||
@ -280,9 +280,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
vtkIdType nLabels = nFaces;
|
||||
|
||||
// count size for face stream
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
nLabels += f.size();
|
||||
}
|
||||
|
||||
@ -292,10 +292,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
faceStream.clear();
|
||||
faceStream.reserve(nLabels + nFaces);
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const bool isOwner = (owner[cFaces[cFaceI]] == celli);
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
const bool isOwner = (owner[cFaces[cFacei]] == celli);
|
||||
const label nFacePoints = f.size();
|
||||
|
||||
// number of labels for this face
|
||||
@ -327,9 +327,9 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
// establish unique node ids used
|
||||
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -363,10 +363,10 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
bool substituteCell = true;
|
||||
|
||||
const labelList& cFaces = mesh.cells()[celli];
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const bool isOwner = (owner[cFaces[cFaceI]] == celli);
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
const bool isOwner = (owner[cFaces[cFacei]] == celli);
|
||||
|
||||
// Number of triangles and quads in decomposition
|
||||
label nTris = 0;
|
||||
@ -388,7 +388,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
}
|
||||
else
|
||||
{
|
||||
superCells[addCellI++] = celli;
|
||||
superCells[addCelli++] = celli;
|
||||
}
|
||||
|
||||
const face& quad = quadFcs[quadI];
|
||||
@ -431,7 +431,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
}
|
||||
else
|
||||
{
|
||||
superCells[addCellI++] = celli;
|
||||
superCells[addCelli++] = celli;
|
||||
}
|
||||
|
||||
const face& tri = triFcs[triI];
|
||||
|
||||
@ -99,9 +99,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
{
|
||||
const cell& cFaces = mesh.cells()[celli];
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
|
||||
label nQuads = 0;
|
||||
label nTris = 0;
|
||||
@ -158,7 +158,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
vtkmesh->Allocate(mesh.nCells() + nAddCells);
|
||||
|
||||
// Set counters for additional points and additional cells
|
||||
label addPointI = 0, addCellI = 0;
|
||||
label addPointI = 0, addCelli = 0;
|
||||
|
||||
// Create storage for points - needed for mapping from OpenFOAM to VTK
|
||||
// data types - max 'order' = hex = 8 points
|
||||
@ -173,7 +173,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
const cellShape& cellShape = cellShapes[celli];
|
||||
const cellModel& cellModel = cellShape.model();
|
||||
|
||||
superCells[addCellI++] = celli;
|
||||
superCells[addCelli++] = celli;
|
||||
|
||||
if (cellModel == tet)
|
||||
{
|
||||
@ -280,9 +280,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
vtkIdType nLabels = nFaces;
|
||||
|
||||
// count size for face stream
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
nLabels += f.size();
|
||||
}
|
||||
|
||||
@ -292,10 +292,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
faceStream.clear();
|
||||
faceStream.reserve(nLabels + nFaces);
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const bool isOwner = (owner[cFaces[cFaceI]] == celli);
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
const bool isOwner = (owner[cFaces[cFacei]] == celli);
|
||||
const label nFacePoints = f.size();
|
||||
|
||||
// number of labels for this face
|
||||
@ -327,9 +327,9 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
// establish unique node ids used
|
||||
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
@ -363,10 +363,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
bool substituteCell = true;
|
||||
|
||||
const labelList& cFaces = mesh.cells()[celli];
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = mesh.faces()[cFaces[cFaceI]];
|
||||
const bool isOwner = (owner[cFaces[cFaceI]] == celli);
|
||||
const face& f = mesh.faces()[cFaces[cFacei]];
|
||||
const bool isOwner = (owner[cFaces[cFacei]] == celli);
|
||||
|
||||
// Number of triangles and quads in decomposition
|
||||
label nTris = 0;
|
||||
@ -388,7 +388,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
}
|
||||
else
|
||||
{
|
||||
superCells[addCellI++] = celli;
|
||||
superCells[addCelli++] = celli;
|
||||
}
|
||||
|
||||
const face& quad = quadFcs[quadI];
|
||||
@ -431,7 +431,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
||||
}
|
||||
else
|
||||
{
|
||||
superCells[addCellI++] = celli;
|
||||
superCells[addCelli++] = celli;
|
||||
}
|
||||
|
||||
const face& tri = triFcs[triI];
|
||||
|
||||
@ -103,10 +103,10 @@ int main(int argc, char *argv[])
|
||||
labelList numIds = maxIds + 1;
|
||||
|
||||
Info<< nl << "Particle statistics:" << endl;
|
||||
forAll(maxIds, procI)
|
||||
forAll(maxIds, proci)
|
||||
{
|
||||
Info<< " Found " << numIds[procI] << " particles originating"
|
||||
<< " from processor " << procI << endl;
|
||||
Info<< " Found " << numIds[proci] << " particles originating"
|
||||
<< " from processor " << proci << endl;
|
||||
}
|
||||
Info<< nl << endl;
|
||||
|
||||
@ -169,13 +169,13 @@ int main(int argc, char *argv[])
|
||||
Info<< " Constructing tracks" << nl << endl;
|
||||
if (Pstream::master())
|
||||
{
|
||||
forAll(allPositions, procI)
|
||||
forAll(allPositions, proci)
|
||||
{
|
||||
forAll(allPositions[procI], i)
|
||||
forAll(allPositions[proci], i)
|
||||
{
|
||||
label globalId =
|
||||
startIds[allOrigProcs[procI][i]]
|
||||
+ allOrigIds[procI][i];
|
||||
startIds[allOrigProcs[proci][i]]
|
||||
+ allOrigIds[proci][i];
|
||||
|
||||
if (globalId % sampleFrequency == 0)
|
||||
{
|
||||
@ -184,7 +184,7 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
allTracks[trackId].append
|
||||
(
|
||||
allPositions[procI][i]
|
||||
allPositions[proci][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
|
||||
@ -88,16 +88,16 @@ int main(int argc, char *argv[])
|
||||
// Create the processor databases
|
||||
databases.setSize(nProcs);
|
||||
|
||||
forAll(databases, procI)
|
||||
forAll(databases, proci)
|
||||
{
|
||||
databases.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new Time
|
||||
(
|
||||
Time::controlDictName,
|
||||
args.rootPath(),
|
||||
args.caseName()/fileName(word("processor") + name(procI))
|
||||
args.caseName()/fileName(word("processor") + name(proci))
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -128,11 +128,11 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
if (args.optionFound("processor"))
|
||||
{
|
||||
for (label procI=0; procI<nProcs; procI++)
|
||||
for (label proci=0; proci<nProcs; proci++)
|
||||
{
|
||||
fileName procPath
|
||||
(
|
||||
args.path()/(word("processor") + name(procI))
|
||||
args.path()/(word("processor") + name(proci))
|
||||
);
|
||||
|
||||
forAll(timeDirs, timeI)
|
||||
|
||||
@ -109,9 +109,9 @@ void Foam::channelIndex::walkOppositeFaces
|
||||
{
|
||||
const cell& ownCell = cells[mesh.faceOwner()[facei]];
|
||||
|
||||
label oppositeFaceI = ownCell.opposingFaceLabel(facei, faces);
|
||||
label oppositeFacei = ownCell.opposingFaceLabel(facei, faces);
|
||||
|
||||
if (oppositeFaceI == -1)
|
||||
if (oppositeFacei == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face:" << facei << " owner cell:" << ownCell
|
||||
@ -119,10 +119,10 @@ void Foam::channelIndex::walkOppositeFaces
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!blockedFace[oppositeFaceI])
|
||||
if (!blockedFace[oppositeFacei])
|
||||
{
|
||||
blockedFace[oppositeFaceI] = true;
|
||||
newFrontFaces.append(oppositeFaceI);
|
||||
blockedFace[oppositeFacei] = true;
|
||||
newFrontFaces.append(oppositeFacei);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -131,9 +131,9 @@ void Foam::channelIndex::walkOppositeFaces
|
||||
{
|
||||
const cell& neiCell = mesh.cells()[mesh.faceNeighbour()[facei]];
|
||||
|
||||
label oppositeFaceI = neiCell.opposingFaceLabel(facei, faces);
|
||||
label oppositeFacei = neiCell.opposingFaceLabel(facei, faces);
|
||||
|
||||
if (oppositeFaceI == -1)
|
||||
if (oppositeFacei == -1)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Face:" << facei << " neighbour cell:" << neiCell
|
||||
@ -141,10 +141,10 @@ void Foam::channelIndex::walkOppositeFaces
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!blockedFace[oppositeFaceI])
|
||||
if (!blockedFace[oppositeFacei])
|
||||
{
|
||||
blockedFace[oppositeFaceI] = true;
|
||||
newFrontFaces.append(oppositeFaceI);
|
||||
blockedFace[oppositeFacei] = true;
|
||||
newFrontFaces.append(oppositeFacei);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,8 +118,8 @@ void rewriteBoundary
|
||||
|
||||
|
||||
// Add new entries
|
||||
label addedPatchI = nOldPatches;
|
||||
label newPatchI = 0;
|
||||
label addedPatchi = nOldPatches;
|
||||
label newPatchi = 0;
|
||||
forAll(oldPatches, patchi)
|
||||
{
|
||||
const dictionary& patchDict = oldPatches[patchi].dict();
|
||||
@ -134,7 +134,7 @@ void rewriteBoundary
|
||||
if (patchDict.found("neighbourPatch"))
|
||||
{
|
||||
patches.set(patchi, oldPatches.set(patchi, NULL));
|
||||
oldToNew[patchi] = newPatchI++;
|
||||
oldToNew[patchi] = newPatchi++;
|
||||
|
||||
// Check if patches come from automatic conversion
|
||||
word oldName;
|
||||
@ -182,7 +182,7 @@ void rewriteBoundary
|
||||
|
||||
// Change entry on this side
|
||||
patches.set(patchi, oldPatches.set(patchi, NULL));
|
||||
oldToNew[patchi] = newPatchI++;
|
||||
oldToNew[patchi] = newPatchi++;
|
||||
dictionary& thisPatchDict = patches[patchi].dict();
|
||||
thisPatchDict.add("neighbourPatch", nbrName);
|
||||
thisPatchDict.set("nFaces", nFaces/2);
|
||||
@ -191,7 +191,7 @@ void rewriteBoundary
|
||||
// Add entry on other side
|
||||
patches.set
|
||||
(
|
||||
addedPatchI,
|
||||
addedPatchi,
|
||||
new dictionaryEntry
|
||||
(
|
||||
nbrName,
|
||||
@ -199,12 +199,12 @@ void rewriteBoundary
|
||||
patchDict
|
||||
)
|
||||
);
|
||||
oldToNew[addedPatchI] = newPatchI++;
|
||||
dictionary& nbrPatchDict = patches[addedPatchI].dict();
|
||||
oldToNew[addedPatchi] = newPatchi++;
|
||||
dictionary& nbrPatchDict = patches[addedPatchi].dict();
|
||||
nbrPatchDict.set("neighbourPatch", thisName);
|
||||
nbrPatchDict.set("nFaces", nFaces/2);
|
||||
nbrPatchDict.set("startFace", startFace+nFaces/2);
|
||||
patches[addedPatchI].keyword() = nbrName;
|
||||
patches[addedPatchi].keyword() = nbrName;
|
||||
|
||||
Info<< "Replaced with patches" << nl
|
||||
<< patches[patchi].keyword() << " with" << nl
|
||||
@ -213,7 +213,7 @@ void rewriteBoundary
|
||||
<< nl
|
||||
<< " startFace : "
|
||||
<< readLabel(thisPatchDict.lookup("startFace")) << nl
|
||||
<< patches[addedPatchI].keyword() << " with" << nl
|
||||
<< patches[addedPatchi].keyword() << " with" << nl
|
||||
<< " nFaces : "
|
||||
<< readLabel(nbrPatchDict.lookup("nFaces"))
|
||||
<< nl
|
||||
@ -221,13 +221,13 @@ void rewriteBoundary
|
||||
<< readLabel(nbrPatchDict.lookup("startFace"))
|
||||
<< nl << endl;
|
||||
|
||||
addedPatchI++;
|
||||
addedPatchi++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
patches.set(patchi, oldPatches.set(patchi, NULL));
|
||||
oldToNew[patchi] = newPatchI++;
|
||||
oldToNew[patchi] = newPatchi++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
@ -348,15 +348,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Target mesh size: " << meshTarget.nCells() << endl;
|
||||
|
||||
for (int procI=0; procI<nProcs; procI++)
|
||||
for (int proci=0; proci<nProcs; proci++)
|
||||
{
|
||||
Info<< nl << "Source processor " << procI << endl;
|
||||
Info<< nl << "Source processor " << proci << endl;
|
||||
|
||||
Time runTimeSource
|
||||
(
|
||||
Time::controlDictName,
|
||||
rootDirSource,
|
||||
caseDirSource/fileName(word("processor") + name(procI))
|
||||
caseDirSource/fileName(word("processor") + name(proci))
|
||||
);
|
||||
|
||||
#include "setTimeIndex.H"
|
||||
@ -429,15 +429,15 @@ int main(int argc, char *argv[])
|
||||
|
||||
Info<< "Source mesh size: " << meshSource.nCells() << endl;
|
||||
|
||||
for (int procI=0; procI<nProcs; procI++)
|
||||
for (int proci=0; proci<nProcs; proci++)
|
||||
{
|
||||
Info<< nl << "Target processor " << procI << endl;
|
||||
Info<< nl << "Target processor " << proci << endl;
|
||||
|
||||
Time runTimeTarget
|
||||
(
|
||||
Time::controlDictName,
|
||||
rootDirTarget,
|
||||
caseDirTarget/fileName(word("processor") + name(procI))
|
||||
caseDirTarget/fileName(word("processor") + name(proci))
|
||||
);
|
||||
|
||||
fvMesh meshTarget
|
||||
|
||||
@ -40,12 +40,12 @@ static const scalar perturbFactor = 1e-6;
|
||||
static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
||||
{
|
||||
label celli = -1;
|
||||
label tetFaceI = -1;
|
||||
label tetFacei = -1;
|
||||
label tetPtI = -1;
|
||||
|
||||
const polyMesh& mesh = cloud.pMesh();
|
||||
|
||||
mesh.findCellFacePt(pt, celli, tetFaceI, tetPtI);
|
||||
mesh.findCellFacePt(pt, celli, tetFacei, tetPtI);
|
||||
|
||||
if (celli >= 0)
|
||||
{
|
||||
@ -70,7 +70,7 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
||||
|
||||
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
|
||||
|
||||
mesh.findCellFacePt(perturbPt, celli, tetFaceI, tetPtI);
|
||||
mesh.findCellFacePt(perturbPt, celli, tetFacei, tetPtI);
|
||||
|
||||
return celli;
|
||||
}
|
||||
|
||||
@ -40,12 +40,12 @@ static const scalar perturbFactor = 1e-6;
|
||||
static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
||||
{
|
||||
label celli = -1;
|
||||
label tetFaceI = -1;
|
||||
label tetFacei = -1;
|
||||
label tetPtI = -1;
|
||||
|
||||
const polyMesh& mesh = cloud.pMesh();
|
||||
|
||||
mesh.findCellFacePt(pt, celli, tetFaceI, tetPtI);
|
||||
mesh.findCellFacePt(pt, celli, tetFacei, tetPtI);
|
||||
|
||||
if (celli >= 0)
|
||||
{
|
||||
@ -70,7 +70,7 @@ static label findCell(const Cloud<passiveParticle>& cloud, const point& pt)
|
||||
|
||||
const point perturbPt = (1-perturbFactor)*pt+perturbFactor*cc;
|
||||
|
||||
mesh.findCellFacePt(perturbPt, celli, tetFaceI, tetPtI);
|
||||
mesh.findCellFacePt(perturbPt, celli, tetFacei, tetPtI);
|
||||
|
||||
return celli;
|
||||
}
|
||||
|
||||
@ -267,9 +267,9 @@ bool setFaceFieldType
|
||||
}
|
||||
else
|
||||
{
|
||||
label bFaceI = facei-mesh.nInternalFaces();
|
||||
allBoundaryValues[bFaceI] = value;
|
||||
nChanged[mesh.boundaryMesh().patchID()[bFaceI]]++;
|
||||
label bFacei = facei-mesh.nInternalFaces();
|
||||
allBoundaryValues[bFacei] = value;
|
||||
nChanged[mesh.boundaryMesh().patchID()[bFacei]]++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -7,9 +7,9 @@ const label maxDynListLength
|
||||
viewFactorDict.lookupOrDefault<label>("maxDynListLength", 100000)
|
||||
);
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
// Shoot rays from me to procI. Note that even if processor has
|
||||
// Shoot rays from me to proci. Note that even if processor has
|
||||
// 0 faces we still need to call findLine to keep calls synced.
|
||||
|
||||
DynamicField<point> start(coarseMesh.nFaces());
|
||||
@ -25,9 +25,9 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
const vectorField& myArea = remoteCoarseSf[Pstream::myProcNo()];
|
||||
const labelField& myAgg = remoteCoarseAgg[Pstream::myProcNo()];
|
||||
|
||||
const pointField& remoteArea = remoteCoarseSf[procI];
|
||||
const pointField& remoteFc = remoteCoarseCf[procI];
|
||||
const labelField& remoteAgg = remoteCoarseAgg[procI];
|
||||
const pointField& remoteArea = remoteCoarseSf[proci];
|
||||
const pointField& remoteFc = remoteCoarseCf[proci];
|
||||
const labelField& remoteAgg = remoteCoarseAgg[proci];
|
||||
|
||||
label i = 0;
|
||||
label j = 0;
|
||||
@ -41,7 +41,7 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
|
||||
for (; j < remoteFc.size(); j++)
|
||||
{
|
||||
if (procI != Pstream::myProcNo() || i != j)
|
||||
if (proci != Pstream::myProcNo() || i != j)
|
||||
{
|
||||
const point& remFc = remoteFc[j];
|
||||
const vector& remA = remoteArea[j];
|
||||
@ -53,11 +53,11 @@ for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
{
|
||||
start.append(fc + 0.001*d);
|
||||
startIndex.append(i);
|
||||
startAgg.append(globalNumbering.toGlobal(procI, fAgg));
|
||||
startAgg.append(globalNumbering.toGlobal(proci, fAgg));
|
||||
end.append(fc + 0.999*d);
|
||||
label globalI = globalNumbering.toGlobal(procI, j);
|
||||
label globalI = globalNumbering.toGlobal(proci, j);
|
||||
endIndex.append(globalI);
|
||||
endAgg.append(globalNumbering.toGlobal(procI, remAgg));
|
||||
endAgg.append(globalNumbering.toGlobal(proci, remAgg));
|
||||
if (startIndex.size() > maxDynListLength)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
|
||||
@ -75,8 +75,8 @@ triSurface triangulate
|
||||
mesh.nFaces() - mesh.nInternalFaces()
|
||||
);
|
||||
|
||||
label newPatchI = 0;
|
||||
label localTriFaceI = 0;
|
||||
label newPatchi = 0;
|
||||
label localTriFacei = 0;
|
||||
|
||||
forAllConstIter(labelHashSet, includePatches, iter)
|
||||
{
|
||||
@ -86,9 +86,9 @@ triSurface triangulate
|
||||
|
||||
label nTriTotal = 0;
|
||||
|
||||
forAll(patch, patchFaceI)
|
||||
forAll(patch, patchFacei)
|
||||
{
|
||||
const face& f = patch[patchFaceI];
|
||||
const face& f = patch[patchFacei];
|
||||
|
||||
faceList triFaces(f.nTriangles(points));
|
||||
|
||||
@ -96,27 +96,27 @@ triSurface triangulate
|
||||
|
||||
f.triangles(points, nTri, triFaces);
|
||||
|
||||
forAll(triFaces, triFaceI)
|
||||
forAll(triFaces, triFacei)
|
||||
{
|
||||
const face& f = triFaces[triFaceI];
|
||||
const face& f = triFaces[triFacei];
|
||||
|
||||
triangles.append(labelledTri(f[0], f[1], f[2], newPatchI));
|
||||
triangles.append(labelledTri(f[0], f[1], f[2], newPatchi));
|
||||
|
||||
nTriTotal++;
|
||||
|
||||
triSurfaceToAgglom[localTriFaceI++] = globalNumbering.toGlobal
|
||||
triSurfaceToAgglom[localTriFacei++] = globalNumbering.toGlobal
|
||||
(
|
||||
Pstream::myProcNo(),
|
||||
finalAgglom[patchi][patchFaceI]
|
||||
finalAgglom[patchi][patchFacei]
|
||||
+ coarsePatches[patchi].start()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
|
||||
triSurfaceToAgglom.resize(localTriFaceI);
|
||||
triSurfaceToAgglom.resize(localTriFacei);
|
||||
|
||||
triangles.shrink();
|
||||
|
||||
@ -131,20 +131,20 @@ triSurface triangulate
|
||||
);
|
||||
|
||||
// Add patch names to surface
|
||||
surface.patches().setSize(newPatchI);
|
||||
surface.patches().setSize(newPatchi);
|
||||
|
||||
newPatchI = 0;
|
||||
newPatchi = 0;
|
||||
|
||||
forAllConstIter(labelHashSet, includePatches, iter)
|
||||
{
|
||||
const label patchi = iter.key();
|
||||
const polyPatch& patch = bMesh[patchi];
|
||||
|
||||
surface.patches()[newPatchI].index() = patchi;
|
||||
surface.patches()[newPatchI].name() = patch.name();
|
||||
surface.patches()[newPatchI].geometricType() = patch.type();
|
||||
surface.patches()[newPatchi].index() = patchi;
|
||||
surface.patches()[newPatchi].name() = patch.name();
|
||||
surface.patches()[newPatchi].geometricType() = patch.type();
|
||||
|
||||
newPatchI++;
|
||||
newPatchi++;
|
||||
}
|
||||
|
||||
return surface;
|
||||
@ -222,7 +222,7 @@ scalar calculateViewFactorFij
|
||||
void insertMatrixElements
|
||||
(
|
||||
const globalIndex& globalNumbering,
|
||||
const label fromProcI,
|
||||
const label fromProci,
|
||||
const labelListList& globalFaceFaces,
|
||||
const scalarListList& viewFactors,
|
||||
scalarSquareMatrix& matrix
|
||||
@ -233,7 +233,7 @@ void insertMatrixElements
|
||||
const scalarList& vf = viewFactors[facei];
|
||||
const labelList& globalFaces = globalFaceFaces[facei];
|
||||
|
||||
label globalI = globalNumbering.toGlobal(fromProcI, facei);
|
||||
label globalI = globalNumbering.toGlobal(fromProci, facei);
|
||||
forAll(globalFaces, i)
|
||||
{
|
||||
matrix[globalI][globalFaces[i]] = vf[i];
|
||||
@ -401,8 +401,8 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
point cf = coarseCf[facei];
|
||||
|
||||
const label coarseFaceI = coarsePatchFace[facei];
|
||||
const labelList& fineFaces = coarseToFine[coarseFaceI];
|
||||
const label coarseFacei = coarsePatchFace[facei];
|
||||
const labelList& fineFaces = coarseToFine[coarseFacei];
|
||||
const label agglomI =
|
||||
agglom[fineFaces[0]] + coarsePatches[patchID].start();
|
||||
|
||||
@ -611,8 +611,8 @@ int main(int argc, char *argv[])
|
||||
List<point>& fineCf = compactFineCf[compactI];
|
||||
List<point>& fineSf = compactFineSf[compactI++];
|
||||
|
||||
const label coarseFaceI = coarsePatchFace[coarseI];
|
||||
const labelList& fineFaces = coarseToFine[coarseFaceI];
|
||||
const label coarseFacei = coarsePatchFace[coarseI];
|
||||
const labelList& fineFaces = coarseToFine[coarseFacei];
|
||||
|
||||
fineCf.setSize(fineFaces.size());
|
||||
fineSf.setSize(fineFaces.size());
|
||||
@ -620,12 +620,12 @@ int main(int argc, char *argv[])
|
||||
fineCf = UIndirectList<point>
|
||||
(
|
||||
mesh.Cf().boundaryField()[patchID],
|
||||
coarseToFine[coarseFaceI]
|
||||
coarseToFine[coarseFacei]
|
||||
);
|
||||
fineSf = UIndirectList<point>
|
||||
(
|
||||
mesh.Sf().boundaryField()[patchID],
|
||||
coarseToFine[coarseFaceI]
|
||||
coarseToFine[coarseFacei]
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -688,20 +688,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (mesh.nSolutionD() == 3)
|
||||
{
|
||||
forAll(localCoarseSf, coarseFaceI)
|
||||
forAll(localCoarseSf, coarseFacei)
|
||||
{
|
||||
const List<point>& localFineSf = compactFineSf[coarseFaceI];
|
||||
const List<point>& localFineSf = compactFineSf[coarseFacei];
|
||||
const vector Ai = sum(localFineSf);
|
||||
const List<point>& localFineCf = compactFineCf[coarseFaceI];
|
||||
const label fromPatchId = compactPatchId[coarseFaceI];
|
||||
const List<point>& localFineCf = compactFineCf[coarseFacei];
|
||||
const label fromPatchId = compactPatchId[coarseFacei];
|
||||
patchArea[fromPatchId] += mag(Ai);
|
||||
|
||||
const labelList& visCoarseFaces = visibleFaceFaces[coarseFaceI];
|
||||
const labelList& visCoarseFaces = visibleFaceFaces[coarseFacei];
|
||||
|
||||
forAll(visCoarseFaces, visCoarseFaceI)
|
||||
forAll(visCoarseFaces, visCoarseFacei)
|
||||
{
|
||||
F[coarseFaceI].setSize(visCoarseFaces.size());
|
||||
label compactJ = visCoarseFaces[visCoarseFaceI];
|
||||
F[coarseFacei].setSize(visCoarseFaces.size());
|
||||
label compactJ = visCoarseFaces[visCoarseFacei];
|
||||
const List<point>& remoteFineSj = compactFineSf[compactJ];
|
||||
const List<point>& remoteFineCj = compactFineCf[compactJ];
|
||||
|
||||
@ -729,7 +729,7 @@ int main(int argc, char *argv[])
|
||||
Fij += dIntFij;
|
||||
}
|
||||
}
|
||||
F[coarseFaceI][visCoarseFaceI] = Fij/mag(Ai);
|
||||
F[coarseFacei][visCoarseFacei] = Fij/mag(Ai);
|
||||
sumViewFactorPatch[fromPatchId][toPatchId] += Fij;
|
||||
}
|
||||
}
|
||||
@ -749,22 +749,22 @@ int main(int argc, char *argv[])
|
||||
|
||||
scalar wideBy2 = (box.span() & emptyDir)*2.0;
|
||||
|
||||
forAll(localCoarseSf, coarseFaceI)
|
||||
forAll(localCoarseSf, coarseFacei)
|
||||
{
|
||||
const vector& Ai = localCoarseSf[coarseFaceI];
|
||||
const vector& Ci = localCoarseCf[coarseFaceI];
|
||||
const vector& Ai = localCoarseSf[coarseFacei];
|
||||
const vector& Ci = localCoarseCf[coarseFacei];
|
||||
vector Ain = Ai/mag(Ai);
|
||||
vector R1i = Ci + (mag(Ai)/wideBy2)*(Ain ^ emptyDir);
|
||||
vector R2i = Ci - (mag(Ai)/wideBy2)*(Ain ^ emptyDir) ;
|
||||
|
||||
const label fromPatchId = compactPatchId[coarseFaceI];
|
||||
const label fromPatchId = compactPatchId[coarseFacei];
|
||||
patchArea[fromPatchId] += mag(Ai);
|
||||
|
||||
const labelList& visCoarseFaces = visibleFaceFaces[coarseFaceI];
|
||||
forAll(visCoarseFaces, visCoarseFaceI)
|
||||
const labelList& visCoarseFaces = visibleFaceFaces[coarseFacei];
|
||||
forAll(visCoarseFaces, visCoarseFacei)
|
||||
{
|
||||
F[coarseFaceI].setSize(visCoarseFaces.size());
|
||||
label compactJ = visCoarseFaces[visCoarseFaceI];
|
||||
F[coarseFacei].setSize(visCoarseFaces.size());
|
||||
label compactJ = visCoarseFaces[visCoarseFacei];
|
||||
const vector& Aj = compactCoarseSf[compactJ];
|
||||
const vector& Cj = compactCoarseCf[compactJ];
|
||||
|
||||
@ -781,7 +781,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
scalar Fij = mag((d1 + d2) - (s1 + s2))/(4.0*mag(Ai)/wideBy2);
|
||||
|
||||
F[coarseFaceI][visCoarseFaceI] = Fij;
|
||||
F[coarseFacei][visCoarseFacei] = Fij;
|
||||
sumViewFactorPatch[fromPatchId][toPatchId] += Fij*mag(Ai);
|
||||
}
|
||||
}
|
||||
@ -873,15 +873,15 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
forAll(compactMap, procI)
|
||||
forAll(compactMap, proci)
|
||||
{
|
||||
const Map<label>& localToCompactMap = compactMap[procI];
|
||||
const Map<label>& localToCompactMap = compactMap[proci];
|
||||
|
||||
forAllConstIter(Map<label>, localToCompactMap, iter)
|
||||
{
|
||||
compactToGlobal[iter()] = globalNumbering.toGlobal
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
iter.key()
|
||||
);
|
||||
}
|
||||
|
||||
@ -244,16 +244,16 @@ int main(int argc, char *argv[])
|
||||
|
||||
newPatches.setSize(nRegions1 + nRegions2);
|
||||
|
||||
label newPatchI = 0;
|
||||
label newPatchi = 0;
|
||||
|
||||
forAll(surface1.patches(), patchi)
|
||||
{
|
||||
newPatches[newPatchI++] = surface1.patches()[patchi];
|
||||
newPatches[newPatchi++] = surface1.patches()[patchi];
|
||||
}
|
||||
|
||||
forAll(surface2.patches(), patchi)
|
||||
{
|
||||
newPatches[newPatchI++] = surface2.patches()[patchi];
|
||||
newPatches[newPatchi++] = surface2.patches()[patchi];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -83,15 +83,15 @@ bool validTri
|
||||
// Note: discards normal information - sides of baffle are merged.
|
||||
forAll(fFaces, i)
|
||||
{
|
||||
label nbrFaceI = fFaces[i];
|
||||
label nbrFacei = fFaces[i];
|
||||
|
||||
if (nbrFaceI <= facei)
|
||||
if (nbrFacei <= facei)
|
||||
{
|
||||
// lower numbered faces already checked
|
||||
continue;
|
||||
}
|
||||
|
||||
const labelledTri& nbrF = surf[nbrFaceI];
|
||||
const labelledTri& nbrF = surf[nbrFacei];
|
||||
|
||||
if
|
||||
(
|
||||
@ -102,7 +102,7 @@ bool validTri
|
||||
{
|
||||
WarningInFunction
|
||||
<< "triangle " << facei << " vertices " << f
|
||||
<< " has the same vertices as triangle " << nbrFaceI
|
||||
<< " has the same vertices as triangle " << nbrFacei
|
||||
<< " vertices " << nbrF
|
||||
<< " coords:" << f.points(surf.points())
|
||||
<< endl;
|
||||
@ -534,9 +534,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (myFaces.size() > 2)
|
||||
{
|
||||
forAll(myFaces, myFaceI)
|
||||
forAll(myFaces, myFacei)
|
||||
{
|
||||
problemFaces.append(myFaces[myFaceI]);
|
||||
problemFaces.append(myFaces[myFacei]);
|
||||
}
|
||||
|
||||
nMultEdges++;
|
||||
|
||||
@ -405,28 +405,28 @@ static void markRegion
|
||||
|
||||
forAll(eFaces, i)
|
||||
{
|
||||
label nbrFaceI = eFaces[i];
|
||||
label nbrFacei = eFaces[i];
|
||||
|
||||
if (faceToEdge[nbrFaceI] != -1)
|
||||
if (faceToEdge[nbrFacei] != -1)
|
||||
{
|
||||
if (collapseRegion[nbrFaceI] == -1)
|
||||
if (collapseRegion[nbrFacei] == -1)
|
||||
{
|
||||
markRegion
|
||||
(
|
||||
surf,
|
||||
faceToEdge,
|
||||
regionI,
|
||||
nbrFaceI,
|
||||
nbrFacei,
|
||||
collapseRegion
|
||||
);
|
||||
}
|
||||
else if (collapseRegion[nbrFaceI] != regionI)
|
||||
else if (collapseRegion[nbrFacei] != regionI)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Edge:" << edgeI << " between face " << facei
|
||||
<< " with region " << regionI
|
||||
<< " and face " << nbrFaceI
|
||||
<< " with region " << collapseRegion[nbrFaceI]
|
||||
<< " and face " << nbrFacei
|
||||
<< " with region " << collapseRegion[nbrFacei]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -752,9 +752,9 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
|
||||
DynamicList<Foam::vector> normals(2);
|
||||
DynamicList<labelList> bins(2);
|
||||
|
||||
forAll(eFaces, eFaceI)
|
||||
forAll(eFaces, eFacei)
|
||||
{
|
||||
const Foam::vector& n = surf.faceNormals()[eFaces[eFaceI]];
|
||||
const Foam::vector& n = surf.faceNormals()[eFaces[eFacei]];
|
||||
|
||||
// Find the normal in normals
|
||||
label index = -1;
|
||||
@ -769,7 +769,7 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
bins[index].append(eFaceI);
|
||||
bins[index].append(eFacei);
|
||||
}
|
||||
else if (normals.size() >= 2)
|
||||
{
|
||||
@ -783,7 +783,7 @@ surfaceFeatures::edgeStatus checkFlatRegionEdge
|
||||
else
|
||||
{
|
||||
normals.append(n);
|
||||
bins.append(labelList(1, eFaceI));
|
||||
bins.append(labelList(1, eFacei));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -531,11 +531,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
visitedFace[hitSurfI][facei] = true;
|
||||
|
||||
forAll(newFacesFromSplit, newFaceI)
|
||||
forAll(newFacesFromSplit, newFacei)
|
||||
{
|
||||
const labelledTri& fN = newFacesFromSplit[newFaceI];
|
||||
const labelledTri& fN = newFacesFromSplit[newFacei];
|
||||
|
||||
if (newFaceI == 0)
|
||||
if (newFacei == 0)
|
||||
{
|
||||
newFaces[hitSurfI][facei] = fN;
|
||||
}
|
||||
|
||||
@ -76,19 +76,19 @@ void writeProcStats
|
||||
Pstream::gatherList(nFaces);
|
||||
Pstream::scatterList(nFaces);
|
||||
|
||||
forAll(surfBb, procI)
|
||||
forAll(surfBb, proci)
|
||||
{
|
||||
const List<treeBoundBox>& bbs = meshBb[procI];
|
||||
const List<treeBoundBox>& bbs = meshBb[proci];
|
||||
|
||||
Info<< "processor" << procI << nl
|
||||
Info<< "processor" << proci << nl
|
||||
<< "\tMesh bounds : " << bbs[0] << nl;
|
||||
for (label i = 1; i < bbs.size(); i++)
|
||||
{
|
||||
Info<< "\t " << bbs[i]<< nl;
|
||||
}
|
||||
Info<< "\tSurface bounding box : " << surfBb[procI] << nl
|
||||
<< "\tTriangles : " << nFaces[procI] << nl
|
||||
<< "\tVertices : " << nPoints[procI]
|
||||
Info<< "\tSurface bounding box : " << surfBb[proci] << nl
|
||||
<< "\tTriangles : " << nFaces[proci] << nl
|
||||
<< "\tVertices : " << nPoints[proci]
|
||||
<< endl;
|
||||
}
|
||||
Info<< endl;
|
||||
|
||||
@ -357,7 +357,7 @@ void walkSplitLine
|
||||
const boolList& borderEdge,
|
||||
const labelList& borderPoint,
|
||||
|
||||
const label startFaceI,
|
||||
const label startFacei,
|
||||
const label startEdgeI, // is border edge
|
||||
const label startPointI, // is border point
|
||||
|
||||
@ -365,7 +365,7 @@ void walkSplitLine
|
||||
Map<label>& faceToPoint
|
||||
)
|
||||
{
|
||||
label facei = startFaceI;
|
||||
label facei = startFacei;
|
||||
label edgeI = startEdgeI;
|
||||
label pointI = startPointI;
|
||||
|
||||
@ -446,7 +446,7 @@ void walkSplitLine
|
||||
label sharedFace
|
||||
(
|
||||
const triSurface& surf,
|
||||
const label firstFaceI,
|
||||
const label firstFacei,
|
||||
const label sharedEdgeI
|
||||
)
|
||||
{
|
||||
@ -454,7 +454,7 @@ label sharedFace
|
||||
|
||||
const edge& e = surf.edges()[sharedEdgeI];
|
||||
|
||||
const triSurface::FaceType& f = surf.localFaces()[firstFaceI];
|
||||
const triSurface::FaceType& f = surf.localFaces()[firstFacei];
|
||||
|
||||
label startIndex = findIndex(f, e.start());
|
||||
|
||||
@ -467,16 +467,16 @@ label sharedFace
|
||||
const labelList& eFaces = surf.sortedEdgeFaces()[sharedEdgeI];
|
||||
|
||||
// Get position of face in sorted edge faces
|
||||
label faceIndex = findIndex(eFaces, firstFaceI);
|
||||
label faceIndex = findIndex(eFaces, firstFacei);
|
||||
|
||||
if (edgeOrder)
|
||||
{
|
||||
// Get face before firstFaceI
|
||||
// Get face before firstFacei
|
||||
return eFaces[eFaces.rcIndex(faceIndex)];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Get face after firstFaceI
|
||||
// Get face after firstFacei
|
||||
return eFaces[eFaces.fcIndex(faceIndex)];
|
||||
}
|
||||
}
|
||||
@ -808,17 +808,17 @@ int main(int argc, char *argv[])
|
||||
// Pick any face using edge to start from.
|
||||
const labelList& eFaces = surf.edgeFaces()[startEdgeI];
|
||||
|
||||
label firstFaceI = eFaces[0];
|
||||
label firstFacei = eFaces[0];
|
||||
|
||||
// Find second face which is from same surface i.e. has outwards
|
||||
// pointing normal as well (actually bit more complex than this)
|
||||
label secondFaceI = sharedFace(surf, firstFaceI, startEdgeI);
|
||||
label secondFacei = sharedFace(surf, firstFacei, startEdgeI);
|
||||
|
||||
Info<< "Starting local walk from:" << endl
|
||||
<< " edge :" << startEdgeI << endl
|
||||
<< " point:" << startPointI << endl
|
||||
<< " face0:" << firstFaceI << endl
|
||||
<< " face1:" << secondFaceI << endl
|
||||
<< " face0:" << firstFacei << endl
|
||||
<< " face1:" << secondFacei << endl
|
||||
<< endl;
|
||||
|
||||
// From face on border edge to edge.
|
||||
@ -826,7 +826,7 @@ int main(int argc, char *argv[])
|
||||
// From face connected to border point (but not border edge) to point.
|
||||
Map<label> faceToPoint(2*nBorderPoints);
|
||||
|
||||
faceToEdge.insert(firstFaceI, startEdgeI);
|
||||
faceToEdge.insert(firstFacei, startEdgeI);
|
||||
|
||||
walkSplitLine
|
||||
(
|
||||
@ -834,7 +834,7 @@ int main(int argc, char *argv[])
|
||||
borderEdge,
|
||||
borderPoint,
|
||||
|
||||
firstFaceI,
|
||||
firstFacei,
|
||||
startEdgeI,
|
||||
startPointI,
|
||||
|
||||
@ -842,7 +842,7 @@ int main(int argc, char *argv[])
|
||||
faceToPoint
|
||||
);
|
||||
|
||||
faceToEdge.insert(secondFaceI, startEdgeI);
|
||||
faceToEdge.insert(secondFacei, startEdgeI);
|
||||
|
||||
walkSplitLine
|
||||
(
|
||||
@ -850,7 +850,7 @@ int main(int argc, char *argv[])
|
||||
borderEdge,
|
||||
borderPoint,
|
||||
|
||||
secondFaceI,
|
||||
secondFacei,
|
||||
startEdgeI,
|
||||
startPointI,
|
||||
|
||||
|
||||
@ -112,12 +112,12 @@ bool repatchFace
|
||||
{
|
||||
bool changed = false;
|
||||
|
||||
label bFaceI = facei - mesh.nInternalFaces();
|
||||
label bFacei = facei - mesh.nInternalFaces();
|
||||
|
||||
if (nearest[bFaceI] != -1)
|
||||
if (nearest[bFacei] != -1)
|
||||
{
|
||||
// Use boundary mesh one.
|
||||
label bMeshPatchID = bMesh.whichPatch(nearest[bFaceI]);
|
||||
label bMeshPatchID = bMesh.whichPatch(nearest[bFacei]);
|
||||
|
||||
label patchID = surfToMeshPatch[bMeshPatchID];
|
||||
|
||||
@ -255,11 +255,11 @@ int main(int argc, char *argv[])
|
||||
// Dump unmatched faces to faceSet for debugging.
|
||||
faceSet unmatchedFaces(mesh, "unmatchedFaces", nearest.size()/100);
|
||||
|
||||
forAll(nearest, bFaceI)
|
||||
forAll(nearest, bFacei)
|
||||
{
|
||||
if (nearest[bFaceI] == -1)
|
||||
if (nearest[bFacei] == -1)
|
||||
{
|
||||
unmatchedFaces.insert(mesh.nInternalFaces() + bFaceI);
|
||||
unmatchedFaces.insert(mesh.nInternalFaces() + bFacei);
|
||||
}
|
||||
}
|
||||
|
||||
@ -293,9 +293,9 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(nearest, bFaceI)
|
||||
forAll(nearest, bFacei)
|
||||
{
|
||||
label facei = mesh.nInternalFaces() + bFaceI;
|
||||
label facei = mesh.nInternalFaces() + bFacei;
|
||||
|
||||
if (repatchFace(mesh, bMesh, nearest, patchMap, facei, meshMod))
|
||||
{
|
||||
|
||||
@ -51,9 +51,9 @@ Foam::treeBoundBox Foam::treeDataCell::calcCellBb(const label celli) const
|
||||
|
||||
const cell& cFaces = cells[celli];
|
||||
|
||||
forAll(cFaces, cFaceI)
|
||||
forAll(cFaces, cFacei)
|
||||
{
|
||||
const face& f = faces[cFaces[cFaceI]];
|
||||
const face& f = faces[cFaces[cFacei]];
|
||||
|
||||
forAll(f, fp)
|
||||
{
|
||||
|
||||
@ -97,22 +97,22 @@ void Foam::ParSortableList<Type>::checkAndSend
|
||||
List<Type>& values,
|
||||
labelList& indices,
|
||||
const label bufSize,
|
||||
const label destProcI
|
||||
const label destProci
|
||||
) const
|
||||
{
|
||||
if (destProcI != Pstream::myProcNo())
|
||||
if (destProci != Pstream::myProcNo())
|
||||
{
|
||||
values.setSize(bufSize);
|
||||
indices.setSize(bufSize);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Sending to " << destProcI << " elements:" << values
|
||||
Pout<< "Sending to " << destProci << " elements:" << values
|
||||
<< endl;
|
||||
}
|
||||
|
||||
{
|
||||
OPstream toSlave(Pstream::blocking, destProcI);
|
||||
OPstream toSlave(Pstream::blocking, destProci);
|
||||
toSlave << values << indices;
|
||||
}
|
||||
}
|
||||
@ -214,7 +214,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
//
|
||||
|
||||
label pivotI = 1;
|
||||
label destProcI = 0;
|
||||
label destProci = 0;
|
||||
|
||||
// Buffer for my own data. Keep original index together with value.
|
||||
labelList ownValues(sorted.size());
|
||||
@ -230,7 +230,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
{
|
||||
if ((pivotI < Pstream::nProcs()) && (sorted[sortedI] > pivots[pivotI]))
|
||||
{
|
||||
checkAndSend(sendValues, sendIndices, sendI, destProcI);
|
||||
checkAndSend(sendValues, sendIndices, sendI, destProci);
|
||||
|
||||
// Reset buffer.
|
||||
sendValues.setSize(sorted.size());
|
||||
@ -238,10 +238,10 @@ void Foam::ParSortableList<Type>::sort()
|
||||
sendI = 0;
|
||||
|
||||
pivotI++;
|
||||
destProcI++;
|
||||
destProci++;
|
||||
}
|
||||
|
||||
if (destProcI != Pstream::myProcNo())
|
||||
if (destProci != Pstream::myProcNo())
|
||||
{
|
||||
sendValues[sendI] = sorted[sortedI];
|
||||
sendIndices[sendI] = sorted.indices()[sortedI];
|
||||
@ -259,7 +259,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
// Handle trailing send buffer
|
||||
if (sendI != 0)
|
||||
{
|
||||
checkAndSend(sendValues, sendIndices, sendI, destProcI);
|
||||
checkAndSend(sendValues, sendIndices, sendI, destProci);
|
||||
}
|
||||
|
||||
// Print ownValues
|
||||
@ -283,9 +283,9 @@ void Foam::ParSortableList<Type>::sort()
|
||||
|
||||
label combinedI = 0;
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
if (procI == Pstream::myProcNo())
|
||||
if (proci == Pstream::myProcNo())
|
||||
{
|
||||
if (debug & 2)
|
||||
{
|
||||
@ -293,7 +293,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
}
|
||||
|
||||
// Copy ownValues,ownIndices into combined buffer
|
||||
copyInto(ownValues, ownIndices, procI, combinedI, combinedValues);
|
||||
copyInto(ownValues, ownIndices, proci, combinedI, combinedValues);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -303,16 +303,16 @@ void Foam::ParSortableList<Type>::sort()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "Receiving from " << procI << endl;
|
||||
Pout<< "Receiving from " << proci << endl;
|
||||
}
|
||||
|
||||
IPstream fromSlave(Pstream::blocking, procI);
|
||||
IPstream fromSlave(Pstream::blocking, proci);
|
||||
|
||||
fromSlave >> recValues >> recIndices;
|
||||
|
||||
if (debug & 2)
|
||||
{
|
||||
Pout<< "Received from " << procI
|
||||
Pout<< "Received from " << proci
|
||||
<< " elements:" << recValues << endl;
|
||||
}
|
||||
}
|
||||
@ -321,7 +321,7 @@ void Foam::ParSortableList<Type>::sort()
|
||||
{
|
||||
Pout<< "Copying starting at:" << combinedI << endl;
|
||||
}
|
||||
copyInto(recValues, recIndices, procI, combinedI, combinedValues);
|
||||
copyInto(recValues, recIndices, proci, combinedI, combinedValues);
|
||||
}
|
||||
}
|
||||
combinedValues.setSize(combinedI);
|
||||
|
||||
@ -163,7 +163,7 @@ class ParSortableList
|
||||
List<Type>& values,
|
||||
labelList& indices,
|
||||
const label bufSize,
|
||||
const label destProcI
|
||||
const label destProci
|
||||
) const;
|
||||
|
||||
|
||||
|
||||
@ -62,14 +62,14 @@ Foam::PstreamBuffers::PstreamBuffers
|
||||
Foam::PstreamBuffers::~PstreamBuffers()
|
||||
{
|
||||
// Check that all data has been consumed.
|
||||
forAll(recvBufPos_, procI)
|
||||
forAll(recvBufPos_, proci)
|
||||
{
|
||||
if (recvBufPos_[procI] < recvBuf_[procI].size())
|
||||
if (recvBufPos_[proci] < recvBuf_[proci].size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Message from processor " << procI
|
||||
<< " not fully consumed. messageSize:" << recvBuf_[procI].size()
|
||||
<< " bytes of which only " << recvBufPos_[procI]
|
||||
<< "Message from processor " << proci
|
||||
<< " not fully consumed. messageSize:" << recvBuf_[proci].size()
|
||||
<< " bytes of which only " << recvBufPos_[proci]
|
||||
<< " consumed."
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
|
||||
@ -37,24 +37,24 @@ Description
|
||||
|
||||
PstreamBuffers pBuffers(Pstream::nonBlocking);
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
someObject vals;
|
||||
|
||||
UOPstream str(procI, pBuffers);
|
||||
UOPstream str(proci, pBuffers);
|
||||
str << vals;
|
||||
}
|
||||
}
|
||||
|
||||
pBuffers.finishedSends(); // no-op for blocking
|
||||
|
||||
for (label procI = 0; procI < Pstream::nProcs(); procI++)
|
||||
for (label proci = 0; proci < Pstream::nProcs(); proci++)
|
||||
{
|
||||
if (procI != Pstream::myProcNo())
|
||||
if (proci != Pstream::myProcNo())
|
||||
{
|
||||
UIPstream str(procI, pBuffers);
|
||||
UIPstream str(proci, pBuffers);
|
||||
someObject vals(str);
|
||||
}
|
||||
}
|
||||
|
||||
@ -490,7 +490,7 @@ public:
|
||||
static void abort();
|
||||
|
||||
//- Exchange label with all processors (in the communicator).
|
||||
// sendData[procI] is the label to send to procI.
|
||||
// sendData[proci] is the label to send to proci.
|
||||
// After return recvData contains the data from the other processors.
|
||||
static void allToAll
|
||||
(
|
||||
|
||||
@ -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,11 +74,11 @@ Foam::UPstream::commsStruct::commsStruct
|
||||
}
|
||||
|
||||
label notI = 0;
|
||||
forAll(inBelow, procI)
|
||||
forAll(inBelow, proci)
|
||||
{
|
||||
if ((procI != myProcID) && !inBelow[procI])
|
||||
if ((proci != myProcID) && !inBelow[proci])
|
||||
{
|
||||
allNotBelow_[notI++] = procI;
|
||||
allNotBelow_[notI++] = proci;
|
||||
}
|
||||
}
|
||||
if (notI != allNotBelow_.size())
|
||||
|
||||
@ -68,18 +68,18 @@ void Foam::Pstream::exchange
|
||||
// Set up receives
|
||||
// ~~~~~~~~~~~~~~~
|
||||
|
||||
forAll(recvSizes, procI)
|
||||
forAll(recvSizes, proci)
|
||||
{
|
||||
label nRecv = recvSizes[procI];
|
||||
label nRecv = recvSizes[proci];
|
||||
|
||||
if (procI != Pstream::myProcNo(comm) && nRecv > 0)
|
||||
if (proci != Pstream::myProcNo(comm) && nRecv > 0)
|
||||
{
|
||||
recvBufs[procI].setSize(nRecv);
|
||||
recvBufs[proci].setSize(nRecv);
|
||||
UIPstream::read
|
||||
(
|
||||
UPstream::nonBlocking,
|
||||
procI,
|
||||
reinterpret_cast<char*>(recvBufs[procI].begin()),
|
||||
proci,
|
||||
reinterpret_cast<char*>(recvBufs[proci].begin()),
|
||||
nRecv*sizeof(T),
|
||||
tag,
|
||||
comm
|
||||
@ -91,18 +91,18 @@ void Foam::Pstream::exchange
|
||||
// Set up sends
|
||||
// ~~~~~~~~~~~~
|
||||
|
||||
forAll(sendBufs, procI)
|
||||
forAll(sendBufs, proci)
|
||||
{
|
||||
if (procI != Pstream::myProcNo(comm) && sendBufs[procI].size() > 0)
|
||||
if (proci != Pstream::myProcNo(comm) && sendBufs[proci].size() > 0)
|
||||
{
|
||||
if
|
||||
(
|
||||
!UOPstream::write
|
||||
(
|
||||
UPstream::nonBlocking,
|
||||
procI,
|
||||
reinterpret_cast<const char*>(sendBufs[procI].begin()),
|
||||
sendBufs[procI].size()*sizeof(T),
|
||||
proci,
|
||||
reinterpret_cast<const char*>(sendBufs[proci].begin()),
|
||||
sendBufs[proci].size()*sizeof(T),
|
||||
tag,
|
||||
comm
|
||||
)
|
||||
@ -110,8 +110,8 @@ void Foam::Pstream::exchange
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Cannot send outgoing message. "
|
||||
<< "to:" << procI << " nBytes:"
|
||||
<< label(sendBufs[procI].size()*sizeof(T))
|
||||
<< "to:" << proci << " nBytes:"
|
||||
<< label(sendBufs[proci].size()*sizeof(T))
|
||||
<< Foam::abort(FatalError);
|
||||
}
|
||||
}
|
||||
@ -150,9 +150,9 @@ void Foam::Pstream::exchangeSizes
|
||||
}
|
||||
|
||||
labelList sendSizes(sendBufs.size());
|
||||
forAll(sendBufs, procI)
|
||||
forAll(sendBufs, proci)
|
||||
{
|
||||
sendSizes[procI] = sendBufs[procI].size();
|
||||
sendSizes[proci] = sendBufs[proci].size();
|
||||
}
|
||||
recvSizes.setSize(sendSizes.size());
|
||||
allToAll(sendSizes, recvSizes, comm);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user