Standardized cell, patch, face and processor loop index names

This commit is contained in:
Henry Weller
2016-04-25 12:00:53 +01:00
parent 8c4f6b8fcb
commit a8bf4be58a
525 changed files with 6296 additions and 6296 deletions

View File

@ -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);
}
}
}

View File

@ -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();

View File

@ -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());

View File

@ -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)));
}
}
}

View File

@ -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();
}
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -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)

View File

@ -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;

View File

@ -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;
}