Standardized cell, patch, face and processor loop index names
This commit is contained in:
@ -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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user