mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Initial state after latest Foundation merge
This commit is contained in:
@ -8,11 +8,10 @@ EXE_INC = \
|
||||
-I$(LIB_SRC)/regionModels/regionModel/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lfiniteVolume \
|
||||
-ldynamicMesh \
|
||||
-ldecompose \
|
||||
-lgenericPatchFields \
|
||||
-ldecompositionMethods -L$(FOAM_LIBBIN)/dummy -lmetisDecomp -lscotchDecomp \
|
||||
-llagrangian \
|
||||
-ldynamicMesh \
|
||||
-lmeshTools \
|
||||
-lregionModels
|
||||
|
||||
@ -32,46 +32,47 @@ Description
|
||||
execution of OpenFOAM.
|
||||
|
||||
Usage
|
||||
\b decomposePar [OPTION]
|
||||
|
||||
- decomposePar [OPTION]
|
||||
Options:
|
||||
- \par -cellDist
|
||||
Write the cell distribution as a labelList, for use with 'manual'
|
||||
decomposition method or as a volScalarField for post-processing.
|
||||
|
||||
\param -cellDist \n
|
||||
Write the cell distribution as a labelList, for use with 'manual'
|
||||
decomposition method or as a volScalarField for post-processing.
|
||||
- \par -region \<regionName\> \n
|
||||
Decompose named region. Does not check for existence of processor*.
|
||||
|
||||
\param -region regionName \n
|
||||
Decompose named region. Does not check for existence of processor*.
|
||||
- \par -allRegions \n
|
||||
Decompose all regions in regionProperties. Does not check for
|
||||
existence of processor*.
|
||||
|
||||
\param -allRegions \n
|
||||
Decompose all regions in regionProperties. Does not check for
|
||||
existence of processor*.
|
||||
- \par -copyUniform \n
|
||||
Copy any \a uniform directories too.
|
||||
|
||||
\param -copyUniform \n
|
||||
Copy any \a uniform directories too.
|
||||
- \par -constant
|
||||
|
||||
\param -constant \n
|
||||
\param -time xxx:yyy \n
|
||||
Override controlDict settings and decompose selected times. Does not
|
||||
re-decompose the mesh i.e. does not handle moving mesh or changing
|
||||
mesh cases.
|
||||
- \par -time xxx:yyy \n
|
||||
Override controlDict settings and decompose selected times. Does not
|
||||
re-decompose the mesh i.e. does not handle moving mesh or changing
|
||||
mesh cases.
|
||||
|
||||
\param -fields \n
|
||||
Use existing geometry decomposition and convert fields only.
|
||||
- \par -fields \n
|
||||
Use existing geometry decomposition and convert fields only.
|
||||
|
||||
\param -noSets \n
|
||||
Skip decomposing cellSets, faceSets, pointSets.
|
||||
- \par -noSets \n
|
||||
Skip decomposing cellSets, faceSets, pointSets.
|
||||
|
||||
\param -force \n
|
||||
Remove any existing \a processor subdirectories before decomposing the
|
||||
geometry.
|
||||
- \par -force \n
|
||||
Remove any existing \a processor subdirectories before decomposing the
|
||||
geometry.
|
||||
|
||||
\param -ifRequired \n
|
||||
Only decompose the geometry if the number of domains has changed from a
|
||||
previous decomposition. No \a processor subdirectories will be removed
|
||||
unless the \a -force option is also specified. This option can be used
|
||||
to avoid redundant geometry decomposition (eg, in scripts), but should
|
||||
be used with caution when the underlying (serial) geometry or the
|
||||
decomposition method etc. have been changed between decompositions.
|
||||
- \par -ifRequired \n
|
||||
Only decompose the geometry if the number of domains has changed from a
|
||||
previous decomposition. No \a processor subdirectories will be removed
|
||||
unless the \a -force option is also specified. This option can be used
|
||||
to avoid redundant geometry decomposition (eg, in scripts), but should
|
||||
be used with caution when the underlying (serial) geometry or the
|
||||
decomposition method etc. have been changed between decompositions.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
@ -103,21 +104,24 @@ Usage
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
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
|
||||
@ -133,10 +137,65 @@ const labelIOList& procAddressing
|
||||
)
|
||||
);
|
||||
}
|
||||
return procAddressingList[procI];
|
||||
return procAddressingList[proci];
|
||||
}
|
||||
|
||||
|
||||
void decomposeUniform
|
||||
(
|
||||
const bool copyUniform,
|
||||
const domainDecomposition& mesh,
|
||||
const Time& processorDb,
|
||||
const word& regionDir = word::null
|
||||
)
|
||||
{
|
||||
const Time& runTime = mesh.time();
|
||||
|
||||
// Any uniform data to copy/link?
|
||||
const fileName uniformDir(regionDir/"uniform");
|
||||
|
||||
if (isDir(runTime.timePath()/uniformDir))
|
||||
{
|
||||
Info<< "Detected additional non-decomposed files in "
|
||||
<< runTime.timePath()/uniformDir
|
||||
<< endl;
|
||||
|
||||
const fileName timePath = processorDb.timePath();
|
||||
|
||||
if (copyUniform || mesh.distributed())
|
||||
{
|
||||
cp
|
||||
(
|
||||
runTime.timePath()/uniformDir,
|
||||
timePath/uniformDir
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// link with relative paths
|
||||
string parentPath = string("..")/"..";
|
||||
|
||||
if (regionDir != word::null)
|
||||
{
|
||||
parentPath = parentPath/"..";
|
||||
}
|
||||
|
||||
fileName currentDir(cwd());
|
||||
chDir(timePath);
|
||||
ln
|
||||
(
|
||||
parentPath/runTime.timeName()/uniformDir,
|
||||
uniformDir
|
||||
);
|
||||
chDir(currentDir);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@ -256,10 +315,10 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
|
||||
forAll(regionNames, regionI)
|
||||
forAll(regionNames, regioni)
|
||||
{
|
||||
const word& regionName = regionNames[regionI];
|
||||
const word& regionDir = regionDirs[regionI];
|
||||
const word& regionName = regionNames[regioni];
|
||||
const word& regionDir = regionDirs[regioni];
|
||||
|
||||
Info<< "\n\nDecomposing mesh " << regionName << nl << endl;
|
||||
|
||||
@ -340,11 +399,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);
|
||||
@ -648,7 +707,7 @@ int main(int argc, char *argv[])
|
||||
new List<SLList<indexedParticle*>*>
|
||||
(
|
||||
mesh.nCells(),
|
||||
static_cast<SLList<indexedParticle*>*>(NULL)
|
||||
static_cast<SLList<indexedParticle*>*>(nullptr)
|
||||
)
|
||||
);
|
||||
|
||||
@ -805,55 +864,40 @@ int main(int argc, char *argv[])
|
||||
lagrangianTensorFields.setSize(cloudI);
|
||||
lagrangianTensorFieldFields.setSize(cloudI);
|
||||
|
||||
|
||||
// Any uniform data to copy/link?
|
||||
fileName uniformDir("uniform");
|
||||
|
||||
if (isDir(runTime.timePath()/uniformDir))
|
||||
{
|
||||
Info<< "Detected additional non-decomposed files in "
|
||||
<< runTime.timePath()/uniformDir
|
||||
<< endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
uniformDir.clear();
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
// read the mesh
|
||||
if (!procMeshList.set(procI))
|
||||
if (!procMeshList.set(proci))
|
||||
{
|
||||
procMeshList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new fvMesh
|
||||
(
|
||||
IOobject
|
||||
@ -865,12 +909,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
|
||||
);
|
||||
@ -878,7 +922,7 @@ int main(int argc, char *argv[])
|
||||
const labelIOList& cellProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
proci,
|
||||
"cellProcAddressing",
|
||||
cellProcAddressingList
|
||||
);
|
||||
@ -886,7 +930,7 @@ int main(int argc, char *argv[])
|
||||
const labelIOList& boundaryProcAddressing = procAddressing
|
||||
(
|
||||
procMeshList,
|
||||
procI,
|
||||
proci,
|
||||
"boundaryProcAddressing",
|
||||
boundaryProcAddressingList
|
||||
);
|
||||
@ -894,11 +938,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
// FV fields
|
||||
{
|
||||
if (!fieldDecomposerList.set(procI))
|
||||
if (!fieldDecomposerList.set(proci))
|
||||
{
|
||||
fieldDecomposerList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new fvFieldDecomposer
|
||||
(
|
||||
mesh,
|
||||
@ -910,7 +954,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
const fvFieldDecomposer& fieldDecomposer =
|
||||
fieldDecomposerList[procI];
|
||||
fieldDecomposerList[proci];
|
||||
|
||||
fieldDecomposer.decomposeFields(volScalarFields);
|
||||
fieldDecomposer.decomposeFields(volVectorFields);
|
||||
@ -930,17 +974,17 @@ int main(int argc, char *argv[])
|
||||
if (times.size() == 1)
|
||||
{
|
||||
// Clear cached decomposer
|
||||
fieldDecomposerList.set(procI, NULL);
|
||||
fieldDecomposerList.set(proci, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
// Dimensioned fields
|
||||
{
|
||||
if (!dimFieldDecomposerList.set(procI))
|
||||
if (!dimFieldDecomposerList.set(proci))
|
||||
{
|
||||
dimFieldDecomposerList.set
|
||||
(
|
||||
procI,
|
||||
proci,
|
||||
new dimFieldDecomposer
|
||||
(
|
||||
mesh,
|
||||
@ -951,7 +995,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
const dimFieldDecomposer& dimDecomposer =
|
||||
dimFieldDecomposerList[procI];
|
||||
dimFieldDecomposerList[proci];
|
||||
|
||||
dimDecomposer.decomposeFields(dimScalarFields);
|
||||
dimDecomposer.decomposeFields(dimVectorFields);
|
||||
@ -961,7 +1005,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (times.size() == 1)
|
||||
{
|
||||
dimFieldDecomposerList.set(procI, NULL);
|
||||
dimFieldDecomposerList.set(proci, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -979,18 +1023,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,
|
||||
@ -1001,7 +1045,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
}
|
||||
const pointFieldDecomposer& pointDecomposer =
|
||||
pointFieldDecomposerList[procI];
|
||||
pointFieldDecomposerList[proci];
|
||||
|
||||
pointDecomposer.decomposeFields(pointScalarFields);
|
||||
pointDecomposer.decomposeFields(pointVectorFields);
|
||||
@ -1012,8 +1056,8 @@ int main(int argc, char *argv[])
|
||||
|
||||
if (times.size() == 1)
|
||||
{
|
||||
pointProcAddressingList.set(procI, NULL);
|
||||
pointFieldDecomposerList.set(procI, NULL);
|
||||
pointProcAddressingList.set(proci, nullptr);
|
||||
pointFieldDecomposerList.set(proci, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1100,52 +1144,31 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// Decompose the "uniform" directory in the time region
|
||||
// directory
|
||||
decomposeUniform(copyUniform, mesh, processorDb, regionDir);
|
||||
|
||||
// Any non-decomposed data to copy?
|
||||
if (uniformDir.size())
|
||||
{
|
||||
const fileName timePath = processorDb.timePath();
|
||||
// For the first region of a multi-region case additionally
|
||||
// decompose the "uniform" directory in the time directory
|
||||
if (regionNames.size() > 1 && regioni == 0)
|
||||
|
||||
// If no fields have been decomposed the destination
|
||||
// directory will not have been created so make sure.
|
||||
mkDir(timePath);
|
||||
|
||||
if (copyUniform || mesh.distributed())
|
||||
{
|
||||
cp
|
||||
(
|
||||
runTime.timePath()/uniformDir,
|
||||
timePath/uniformDir
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
// link with relative paths
|
||||
const string parentPath = string("..")/"..";
|
||||
|
||||
fileName currentDir(cwd());
|
||||
chDir(timePath);
|
||||
ln
|
||||
(
|
||||
parentPath/runTime.timeName()/uniformDir,
|
||||
uniformDir
|
||||
);
|
||||
chDir(currentDir);
|
||||
}
|
||||
{
|
||||
decomposeUniform(copyUniform, mesh, processorDb);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// We have cached all the constant mesh data for the current
|
||||
// processor. This is only important if running with multiple
|
||||
// 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, nullptr);
|
||||
cellProcAddressingList.set(proci, nullptr);
|
||||
faceProcAddressingList.set(proci, nullptr);
|
||||
procMeshList.set(proci, nullptr);
|
||||
processorDbList.set(proci, nullptr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,9 +65,9 @@ void Foam::dimFieldDecomposer::decomposeFields
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
{
|
||||
forAll(fields, fieldI)
|
||||
forAll(fields, fieldi)
|
||||
{
|
||||
decomposeField(fields[fieldI])().write();
|
||||
decomposeField(fields[fieldi])().write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -93,7 +93,7 @@ Foam::domainDecomposition::domainDecomposition
|
||||
false
|
||||
)
|
||||
)
|
||||
: NULL
|
||||
: nullptr
|
||||
),
|
||||
decompDictFile_(decompDictFile),
|
||||
nProcs_
|
||||
@ -151,25 +151,25 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
// Point zones
|
||||
labelList pointToZone(points().size(), -1);
|
||||
|
||||
forAll(pointZones(), zoneI)
|
||||
forAll(pointZones(), zonei)
|
||||
{
|
||||
mark(pointZones()[zoneI], zoneI, pointToZone);
|
||||
mark(pointZones()[zonei], zonei, pointToZone);
|
||||
}
|
||||
|
||||
// Face zones
|
||||
labelList faceToZone(faces().size(), -1);
|
||||
|
||||
forAll(faceZones(), zoneI)
|
||||
forAll(faceZones(), zonei)
|
||||
{
|
||||
mark(faceZones()[zoneI], zoneI, faceToZone);
|
||||
mark(faceZones()[zonei], zonei, faceToZone);
|
||||
}
|
||||
|
||||
// Cell zones
|
||||
labelList cellToZone(nCells(), -1);
|
||||
|
||||
forAll(cellZones(), zoneI)
|
||||
forAll(cellZones(), zonei)
|
||||
{
|
||||
mark(cellZones()[zoneI], zoneI, cellToZone);
|
||||
mark(cellZones()[zonei], zonei, cellToZone);
|
||||
}
|
||||
|
||||
|
||||
@ -229,10 +229,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();
|
||||
|
||||
@ -248,7 +248,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();
|
||||
|
||||
@ -290,7 +290,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();
|
||||
|
||||
@ -304,9 +304,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]];
|
||||
}
|
||||
}
|
||||
|
||||
@ -314,7 +314,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
|
||||
@ -390,33 +390,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
|
||||
@ -456,12 +456,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)
|
||||
{
|
||||
@ -469,7 +469,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)
|
||||
@ -482,8 +482,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
curStart,
|
||||
nPatches,
|
||||
procMesh.boundaryMesh(),
|
||||
procI,
|
||||
curNeighbourProcessors[procPatchI]
|
||||
proci,
|
||||
curNeighbourProcessors[procPatchi]
|
||||
);
|
||||
}
|
||||
else
|
||||
@ -501,8 +501,8 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
curStart,
|
||||
nPatches,
|
||||
procMesh.boundaryMesh(),
|
||||
procI,
|
||||
curNeighbourProcessors[procPatchI],
|
||||
proci,
|
||||
curNeighbourProcessors[procPatchi],
|
||||
pcPatch.name(),
|
||||
pcPatch.transform()
|
||||
);
|
||||
@ -529,9 +529,9 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
List<DynamicList<label>> zonePoints(pz.size());
|
||||
|
||||
// Estimate size
|
||||
forAll(zonePoints, zoneI)
|
||||
forAll(zonePoints, zonei)
|
||||
{
|
||||
zonePoints[zoneI].setCapacity(pz[zoneI].size() / nProcs_);
|
||||
zonePoints[zonei].setCapacity(pz[zonei].size()/nProcs_);
|
||||
}
|
||||
|
||||
// Use the pointToZone map to find out the single zone (if any),
|
||||
@ -540,23 +540,23 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
{
|
||||
label curPoint = curPointLabels[pointi];
|
||||
|
||||
label zoneI = pointToZone[curPoint];
|
||||
label zonei = pointToZone[curPoint];
|
||||
|
||||
if (zoneI >= 0)
|
||||
if (zonei >= 0)
|
||||
{
|
||||
// Single zone.
|
||||
zonePoints[zoneI].append(pointi);
|
||||
zonePoints[zonei].append(pointi);
|
||||
}
|
||||
else if (zoneI == -2)
|
||||
else if (zonei == -2)
|
||||
{
|
||||
// Multiple zones. Lookup.
|
||||
forAll(pz, zoneI)
|
||||
forAll(pz, zonei)
|
||||
{
|
||||
label index = pz[zoneI].whichPoint(curPoint);
|
||||
label index = pz[zonei].whichPoint(curPoint);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
zonePoints[zoneI].append(pointi);
|
||||
zonePoints[zonei].append(pointi);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -564,16 +564,16 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
procMesh.pointZones().clearAddressing();
|
||||
procMesh.pointZones().setSize(zonePoints.size());
|
||||
forAll(zonePoints, zoneI)
|
||||
forAll(zonePoints, zonei)
|
||||
{
|
||||
procMesh.pointZones().set
|
||||
(
|
||||
zoneI,
|
||||
pz[zoneI].clone
|
||||
zonei,
|
||||
pz[zonei].clone
|
||||
(
|
||||
procMesh.pointZones(),
|
||||
zoneI,
|
||||
zonePoints[zoneI].shrink()
|
||||
zonei,
|
||||
zonePoints[zonei].shrink()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -596,12 +596,12 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
List<DynamicList<bool>> zoneFaceFlips(fz.size());
|
||||
|
||||
// Estimate size
|
||||
forAll(zoneFaces, zoneI)
|
||||
forAll(zoneFaces, zonei)
|
||||
{
|
||||
label procSize = fz[zoneI].size() / nProcs_;
|
||||
label procSize = fz[zonei].size() / nProcs_;
|
||||
|
||||
zoneFaces[zoneI].setCapacity(procSize);
|
||||
zoneFaceFlips[zoneI].setCapacity(procSize);
|
||||
zoneFaces[zonei].setCapacity(procSize);
|
||||
zoneFaceFlips[zonei].setCapacity(procSize);
|
||||
}
|
||||
|
||||
// Go through all the zoned faces and find out if they
|
||||
@ -613,43 +613,43 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
//
|
||||
label curF = mag(curFaceLabels[facei]) - 1;
|
||||
|
||||
label zoneI = faceToZone[curF];
|
||||
label zonei = faceToZone[curF];
|
||||
|
||||
if (zoneI >= 0)
|
||||
{
|
||||
// Single zone. Add the face
|
||||
zoneFaces[zoneI].append(facei);
|
||||
zoneFaces[zonei].append(facei);
|
||||
|
||||
label index = fz[zoneI].whichFace(curF);
|
||||
label index = fz[zonei].whichFace(curF);
|
||||
|
||||
bool flip = fz[zoneI].flipMap()[index];
|
||||
bool flip = fz[zonei].flipMap()[index];
|
||||
|
||||
if (curFaceLabels[facei] < 0)
|
||||
{
|
||||
flip = !flip;
|
||||
}
|
||||
|
||||
zoneFaceFlips[zoneI].append(flip);
|
||||
zoneFaceFlips[zonei].append(flip);
|
||||
}
|
||||
else if (zoneI == -2)
|
||||
else if (zonei == -2)
|
||||
{
|
||||
// Multiple zones. Lookup.
|
||||
forAll(fz, zoneI)
|
||||
forAll(fz, zonei)
|
||||
{
|
||||
label index = fz[zoneI].whichFace(curF);
|
||||
label index = fz[zonei].whichFace(curF);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
zoneFaces[zoneI].append(facei);
|
||||
zoneFaces[zonei].append(facei);
|
||||
|
||||
bool flip = fz[zoneI].flipMap()[index];
|
||||
bool flip = fz[zonei].flipMap()[index];
|
||||
|
||||
if (curFaceLabels[facei] < 0)
|
||||
{
|
||||
flip = !flip;
|
||||
}
|
||||
|
||||
zoneFaceFlips[zoneI].append(flip);
|
||||
zoneFaceFlips[zonei].append(flip);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -657,16 +657,16 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
procMesh.faceZones().clearAddressing();
|
||||
procMesh.faceZones().setSize(zoneFaces.size());
|
||||
forAll(zoneFaces, zoneI)
|
||||
forAll(zoneFaces, zonei)
|
||||
{
|
||||
procMesh.faceZones().set
|
||||
(
|
||||
zoneI,
|
||||
fz[zoneI].clone
|
||||
zonei,
|
||||
fz[zonei].clone
|
||||
(
|
||||
zoneFaces[zoneI].shrink(), // addressing
|
||||
zoneFaceFlips[zoneI].shrink(), // flipmap
|
||||
zoneI,
|
||||
zoneFaces[zonei].shrink(), // addressing
|
||||
zoneFaceFlips[zonei].shrink(), // flipmap
|
||||
zonei,
|
||||
procMesh.faceZones()
|
||||
)
|
||||
);
|
||||
@ -689,32 +689,32 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
List<DynamicList<label>> zoneCells(cz.size());
|
||||
|
||||
// Estimate size
|
||||
forAll(zoneCells, zoneI)
|
||||
forAll(zoneCells, zonei)
|
||||
{
|
||||
zoneCells[zoneI].setCapacity(cz[zoneI].size() / nProcs_);
|
||||
zoneCells[zonei].setCapacity(cz[zonei].size()/nProcs_);
|
||||
}
|
||||
|
||||
forAll(curCellLabels, celli)
|
||||
{
|
||||
label curCellI = curCellLabels[celli];
|
||||
label curCelli = curCellLabels[celli];
|
||||
|
||||
label zoneI = cellToZone[curCellI];
|
||||
label zonei = cellToZone[curCelli];
|
||||
|
||||
if (zoneI >= 0)
|
||||
if (zonei >= 0)
|
||||
{
|
||||
// Single zone.
|
||||
zoneCells[zoneI].append(celli);
|
||||
zoneCells[zonei].append(celli);
|
||||
}
|
||||
else if (zoneI == -2)
|
||||
else if (zonei == -2)
|
||||
{
|
||||
// Multiple zones. Lookup.
|
||||
forAll(cz, zoneI)
|
||||
forAll(cz, zonei)
|
||||
{
|
||||
label index = cz[zoneI].whichCell(curCellI);
|
||||
label index = cz[zonei].whichCell(curCelli);
|
||||
|
||||
if (index != -1)
|
||||
{
|
||||
zoneCells[zoneI].append(celli);
|
||||
zoneCells[zonei].append(celli);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -722,15 +722,15 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
|
||||
procMesh.cellZones().clearAddressing();
|
||||
procMesh.cellZones().setSize(zoneCells.size());
|
||||
forAll(zoneCells, zoneI)
|
||||
forAll(zoneCells, zonei)
|
||||
{
|
||||
procMesh.cellZones().set
|
||||
(
|
||||
zoneI,
|
||||
cz[zoneI].clone
|
||||
zonei,
|
||||
cz[zonei].clone
|
||||
(
|
||||
zoneCells[zoneI].shrink(),
|
||||
zoneI,
|
||||
zoneCells[zonei].shrink(),
|
||||
zonei,
|
||||
procMesh.cellZones()
|
||||
)
|
||||
);
|
||||
@ -828,15 +828,15 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
false
|
||||
),
|
||||
baseMeshData,
|
||||
procCellAddressing_[procI],
|
||||
procPointAddressing_[procI]
|
||||
procCellAddressing_[proci],
|
||||
procPointAddressing_[proci]
|
||||
).write();
|
||||
|
||||
|
||||
// Statistics
|
||||
|
||||
Info<< endl
|
||||
<< "Processor " << procI << nl
|
||||
<< "Processor " << proci << nl
|
||||
<< " Number of cells = " << procMesh.nCells()
|
||||
<< endl;
|
||||
|
||||
@ -889,7 +889,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procPointAddressing_[procI]
|
||||
procPointAddressing_[proci]
|
||||
);
|
||||
pointProcAddressing.write();
|
||||
|
||||
@ -904,7 +904,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procFaceAddressing_[procI]
|
||||
procFaceAddressing_[proci]
|
||||
);
|
||||
faceProcAddressing.write();
|
||||
|
||||
@ -919,7 +919,7 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets)
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
procCellAddressing_[procI]
|
||||
procCellAddressing_[proci]
|
||||
);
|
||||
cellProcAddressing.write();
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -46,7 +46,6 @@ void Foam::domainDecomposition::distributeCells()
|
||||
decompDictFile_
|
||||
);
|
||||
|
||||
|
||||
scalarField cellWeights;
|
||||
if (method.found("weightField"))
|
||||
{
|
||||
@ -64,7 +63,7 @@ void Foam::domainDecomposition::distributeCells()
|
||||
),
|
||||
*this
|
||||
);
|
||||
cellWeights = weights.internalField();
|
||||
cellWeights = weights.primitiveField();
|
||||
}
|
||||
|
||||
cellToProc_ = method.decomposer().decompose(*this, cellWeights);
|
||||
|
||||
@ -55,37 +55,37 @@ void Foam::domainDecomposition::addInterProcFace
|
||||
List<DynamicList<DynamicList<label>>>& interPatchFaces
|
||||
) const
|
||||
{
|
||||
Map<label>::iterator patchIter = nbrToInterPatch[ownerProc].find(nbrProc);
|
||||
Map<label>::iterator patchiter = nbrToInterPatch[ownerProc].find(nbrProc);
|
||||
|
||||
// Introduce turning index only for internal faces (are duplicated).
|
||||
label ownerIndex = facei+1;
|
||||
label nbrIndex = -(facei+1);
|
||||
|
||||
if (patchIter != nbrToInterPatch[ownerProc].end())
|
||||
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)
|
||||
// forAll(curProcPatchStartIndex, patchi)
|
||||
// {
|
||||
// Info<< " patch:" << patchI
|
||||
// << "\tstart:" << curProcPatchStartIndex[patchI]
|
||||
// << "\tsize:" << procPatchSize_[procI][patchI]
|
||||
// Info<< " patch:" << patchi
|
||||
// << "\tstart:" << curProcPatchStartIndex[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)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -190,9 +190,9 @@ void Foam::lagrangianFieldDecomposer::decomposeFields
|
||||
{
|
||||
if (particleIndices_.size())
|
||||
{
|
||||
forAll(fields, fieldI)
|
||||
forAll(fields, fieldi)
|
||||
{
|
||||
decomposeField(cloudName, fields[fieldI])().write();
|
||||
decomposeField(cloudName, fields[fieldi])().write();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -207,9 +207,9 @@ void Foam::lagrangianFieldDecomposer::decomposeFieldFields
|
||||
{
|
||||
if (particleIndices_.size())
|
||||
{
|
||||
forAll(fields, fieldI)
|
||||
forAll(fields, fieldi)
|
||||
{
|
||||
decomposeFieldField(cloudName, fields[fieldI])().write();
|
||||
decomposeFieldField(cloudName, fields[fieldi])().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
|
||||
@ -89,7 +89,7 @@ Foam::pointFieldDecomposer::pointFieldDecomposer
|
||||
patchFieldDecomposerPtrs_
|
||||
(
|
||||
procMesh_.boundary().size(),
|
||||
static_cast<patchFieldDecomposer*>(NULL)
|
||||
static_cast<patchFieldDecomposer*>(nullptr)
|
||||
)
|
||||
{
|
||||
forAll(boundaryAddressing_, patchi)
|
||||
|
||||
@ -36,7 +36,7 @@ Foam::pointFieldDecomposer::decomposeField
|
||||
) const
|
||||
{
|
||||
// Create and map the internal field values
|
||||
Field<Type> internalField(field.internalField(), pointAddressing_);
|
||||
Field<Type> internalField(field.primitiveField(), pointAddressing_);
|
||||
|
||||
// Create a list of pointers for the patchFields
|
||||
PtrList<pointPatchField<Type>> patchFields(boundaryAddressing_.size());
|
||||
@ -101,9 +101,9 @@ void Foam::pointFieldDecomposer::decomposeFields
|
||||
const PtrList<GeoField>& fields
|
||||
) const
|
||||
{
|
||||
forAll(fields, fieldI)
|
||||
forAll(fields, fieldi)
|
||||
{
|
||||
decomposeField(fields[fieldI])().write();
|
||||
decomposeField(fields[fieldi])().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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -8,15 +8,15 @@
|
||||
|
||||
PtrList<labelIOList>& faceProcAddressing = procMeshes.faceProcAddressing();
|
||||
|
||||
forAll(faceProcAddressing, procI)
|
||||
forAll(faceProcAddressing, proci)
|
||||
{
|
||||
const labelList& curFaceAddr = faceProcAddressing[procI];
|
||||
const labelList& curFaceAddr = faceProcAddressing[proci];
|
||||
|
||||
forAll(curFaceAddr, faceI)
|
||||
forAll(curFaceAddr, facei)
|
||||
{
|
||||
if (mag(curFaceAddr[faceI]) < minFaceIndex)
|
||||
if (mag(curFaceAddr[facei]) < minFaceIndex)
|
||||
{
|
||||
minFaceIndex = mag(curFaceAddr[faceI]);
|
||||
minFaceIndex = mag(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)
|
||||
forAll(curFaceAddr, facei)
|
||||
{
|
||||
curFaceAddr[faceI] += sign(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 | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -59,9 +59,9 @@ bool haveAllTimes
|
||||
)
|
||||
{
|
||||
// Loop over all times
|
||||
forAll(timeDirs, timeI)
|
||||
forAll(timeDirs, timei)
|
||||
{
|
||||
if (!masterTimeDirSet.found(timeDirs[timeI].name()))
|
||||
if (!masterTimeDirSet.found(timeDirs[timei].name()))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@ -94,6 +94,11 @@ int main(int argc, char *argv[])
|
||||
"specify a list of fields to be reconstructed. Eg, '(U T p)' - "
|
||||
"regular expressions not currently supported"
|
||||
);
|
||||
argList::addBoolOption
|
||||
(
|
||||
"noFields",
|
||||
"skip reconstructing fields"
|
||||
);
|
||||
argList::addOption
|
||||
(
|
||||
"lagrangianFields",
|
||||
@ -127,6 +132,14 @@ int main(int argc, char *argv[])
|
||||
args.optionLookup("fields")() >> selectedFields;
|
||||
}
|
||||
|
||||
const bool noFields = args.optionFound("noFields");
|
||||
|
||||
if (noFields)
|
||||
{
|
||||
Info<< "Skipping reconstructing fields"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
const bool noLagrangian = args.optionFound("noLagrangian");
|
||||
|
||||
if (noLagrangian)
|
||||
@ -181,16 +194,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))
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -232,9 +245,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);
|
||||
}
|
||||
|
||||
|
||||
@ -274,10 +287,10 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
|
||||
forAll(regionNames, regionI)
|
||||
forAll(regionNames, regioni)
|
||||
{
|
||||
const word& regionName = regionNames[regionI];
|
||||
const word& regionDir = regionDirs[regionI];
|
||||
const word& regionName = regionNames[regioni];
|
||||
const word& regionDir = regionDirs[regioni];
|
||||
|
||||
Info<< "\n\nReconstructing fields for mesh " << regionName << nl
|
||||
<< endl;
|
||||
@ -318,25 +331,25 @@ int main(int argc, char *argv[])
|
||||
#include "checkFaceAddressingComp.H"
|
||||
|
||||
// Loop over all times
|
||||
forAll(timeDirs, timeI)
|
||||
forAll(timeDirs, timei)
|
||||
{
|
||||
if (newTimes && masterTimeDirSet.found(timeDirs[timeI].name()))
|
||||
if (newTimes && masterTimeDirSet.found(timeDirs[timei].name()))
|
||||
{
|
||||
Info<< "Skipping time " << timeDirs[timeI].name()
|
||||
Info<< "Skipping time " << timeDirs[timei].name()
|
||||
<< endl << endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// Set time for global database
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
runTime.setTime(timeDirs[timei], timei);
|
||||
|
||||
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.
|
||||
@ -371,6 +384,7 @@ int main(int argc, char *argv[])
|
||||
databases[0].timeName()
|
||||
);
|
||||
|
||||
if (!noFields)
|
||||
{
|
||||
// If there are any FV fields, reconstruct them
|
||||
Info<< "Reconstructing FV fields" << nl << endl;
|
||||
@ -469,18 +483,19 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
if (!noFields)
|
||||
{
|
||||
Info<< "Reconstructing point fields" << nl << endl;
|
||||
|
||||
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])
|
||||
);
|
||||
}
|
||||
|
||||
@ -536,13 +551,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
|
||||
@ -561,8 +576,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]
|
||||
);
|
||||
|
||||
@ -714,9 +729,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
|
||||
@ -747,131 +762,235 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
// Construct all sets
|
||||
PtrList<cellSet> cellSets(cSetNames.size());
|
||||
PtrList<faceSet> faceSets(fSetNames.size());
|
||||
PtrList<pointSet> pointSets(pSetNames.size());
|
||||
if (cSetNames.size() || fSetNames.size() || pSetNames.size())
|
||||
{
|
||||
// Construct all sets
|
||||
PtrList<cellSet> cellSets(cSetNames.size());
|
||||
PtrList<faceSet> faceSets(fSetNames.size());
|
||||
PtrList<pointSet> pointSets(pSetNames.size());
|
||||
|
||||
Info<< "Reconstructing sets:" << endl;
|
||||
if (cSetNames.size())
|
||||
{
|
||||
Info<< " cellSets " << cSetNames.sortedToc() << endl;
|
||||
}
|
||||
if (fSetNames.size())
|
||||
{
|
||||
Info<< " faceSets " << fSetNames.sortedToc() << endl;
|
||||
}
|
||||
if (pSetNames.size())
|
||||
{
|
||||
Info<< " pointSets " << pSetNames.sortedToc() << endl;
|
||||
Info<< "Reconstructing sets:" << endl;
|
||||
if (cSetNames.size())
|
||||
{
|
||||
Info<< " cellSets "
|
||||
<< cSetNames.sortedToc() << endl;
|
||||
}
|
||||
if (fSetNames.size())
|
||||
{
|
||||
Info<< " faceSets "
|
||||
<< fSetNames.sortedToc() << endl;
|
||||
}
|
||||
if (pSetNames.size())
|
||||
{
|
||||
Info<< " pointSets "
|
||||
<< pSetNames.sortedToc() << endl;
|
||||
}
|
||||
|
||||
// Load sets
|
||||
forAll(procMeshes.meshes(), proci)
|
||||
{
|
||||
const fvMesh& procMesh = procMeshes.meshes()[proci];
|
||||
|
||||
IOobjectList objects
|
||||
(
|
||||
procMesh,
|
||||
databases[0].timeName(),
|
||||
polyMesh::meshSubDir/"sets"
|
||||
);
|
||||
|
||||
// cellSets
|
||||
const labelList& cellMap =
|
||||
procMeshes.cellProcAddressing()[proci];
|
||||
|
||||
IOobjectList cSets
|
||||
(
|
||||
objects.lookupClass(cellSet::typeName)
|
||||
);
|
||||
|
||||
forAllConstIter(IOobjectList, cSets, iter)
|
||||
{
|
||||
// Load cellSet
|
||||
const cellSet procSet(*iter());
|
||||
label setI = cSetNames[iter.key()];
|
||||
if (!cellSets.set(setI))
|
||||
{
|
||||
cellSets.set
|
||||
(
|
||||
setI,
|
||||
new cellSet
|
||||
(
|
||||
mesh,
|
||||
iter.key(),
|
||||
procSet.size()
|
||||
)
|
||||
);
|
||||
}
|
||||
cellSet& cSet = cellSets[setI];
|
||||
cSet.instance() = runTime.timeName();
|
||||
|
||||
forAllConstIter(cellSet, procSet, iter)
|
||||
{
|
||||
cSet.insert(cellMap[iter.key()]);
|
||||
}
|
||||
}
|
||||
|
||||
// faceSets
|
||||
const labelList& faceMap =
|
||||
procMeshes.faceProcAddressing()[proci];
|
||||
|
||||
IOobjectList fSets
|
||||
(
|
||||
objects.lookupClass(faceSet::typeName)
|
||||
);
|
||||
|
||||
forAllConstIter(IOobjectList, fSets, iter)
|
||||
{
|
||||
// Load faceSet
|
||||
const faceSet procSet(*iter());
|
||||
label setI = fSetNames[iter.key()];
|
||||
if (!faceSets.set(setI))
|
||||
{
|
||||
faceSets.set
|
||||
(
|
||||
setI,
|
||||
new faceSet
|
||||
(
|
||||
mesh,
|
||||
iter.key(),
|
||||
procSet.size()
|
||||
)
|
||||
);
|
||||
}
|
||||
faceSet& fSet = faceSets[setI];
|
||||
fSet.instance() = runTime.timeName();
|
||||
|
||||
forAllConstIter(faceSet, procSet, iter)
|
||||
{
|
||||
fSet.insert(mag(faceMap[iter.key()])-1);
|
||||
}
|
||||
}
|
||||
// pointSets
|
||||
const labelList& pointMap =
|
||||
procMeshes.pointProcAddressing()[proci];
|
||||
|
||||
IOobjectList pSets
|
||||
(
|
||||
objects.lookupClass(pointSet::typeName)
|
||||
);
|
||||
forAllConstIter(IOobjectList, pSets, iter)
|
||||
{
|
||||
// Load pointSet
|
||||
const pointSet propSet(*iter());
|
||||
label setI = pSetNames[iter.key()];
|
||||
if (!pointSets.set(setI))
|
||||
{
|
||||
pointSets.set
|
||||
(
|
||||
setI,
|
||||
new pointSet
|
||||
(
|
||||
mesh,
|
||||
iter.key(),
|
||||
propSet.size()
|
||||
)
|
||||
);
|
||||
}
|
||||
pointSet& pSet = pointSets[setI];
|
||||
pSet.instance() = runTime.timeName();
|
||||
|
||||
forAllConstIter(pointSet, propSet, iter)
|
||||
{
|
||||
pSet.insert(pointMap[iter.key()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write sets
|
||||
forAll(cellSets, i)
|
||||
{
|
||||
cellSets[i].write();
|
||||
}
|
||||
forAll(faceSets, i)
|
||||
{
|
||||
faceSets[i].write();
|
||||
}
|
||||
forAll(pointSets, i)
|
||||
{
|
||||
pointSets[i].write();
|
||||
}
|
||||
}
|
||||
|
||||
// Load sets
|
||||
|
||||
// Reconstruct refinement data
|
||||
{
|
||||
PtrList<hexRef8Data> procData(procMeshes.meshes().size());
|
||||
|
||||
forAll(procMeshes.meshes(), procI)
|
||||
{
|
||||
const fvMesh& procMesh = procMeshes.meshes()[procI];
|
||||
|
||||
IOobjectList objects
|
||||
procData.set
|
||||
(
|
||||
procMesh,
|
||||
databases[0].timeName(), //procMesh.facesInstance(),
|
||||
polyMesh::meshSubDir/"sets"
|
||||
procI,
|
||||
new hexRef8Data
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dummy",
|
||||
procMesh.time().timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
procMesh,
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
// cellSets
|
||||
const labelList& cellMap =
|
||||
procMeshes.cellProcAddressing()[procI];
|
||||
|
||||
IOobjectList cSets(objects.lookupClass(cellSet::typeName));
|
||||
forAllConstIter(IOobjectList, cSets, iter)
|
||||
{
|
||||
// Load cellSet
|
||||
const cellSet procSet(*iter());
|
||||
label setI = cSetNames[iter.key()];
|
||||
if (!cellSets.set(setI))
|
||||
{
|
||||
cellSets.set
|
||||
(
|
||||
setI,
|
||||
new cellSet(mesh, iter.key(), procSet.size())
|
||||
);
|
||||
}
|
||||
cellSet& cSet = cellSets[setI];
|
||||
cSet.instance() = runTime.timeName();
|
||||
|
||||
forAllConstIter(cellSet, procSet, iter)
|
||||
{
|
||||
cSet.insert(cellMap[iter.key()]);
|
||||
}
|
||||
}
|
||||
|
||||
// faceSets
|
||||
const labelList& faceMap =
|
||||
procMeshes.faceProcAddressing()[procI];
|
||||
|
||||
IOobjectList fSets(objects.lookupClass(faceSet::typeName));
|
||||
forAllConstIter(IOobjectList, fSets, iter)
|
||||
{
|
||||
// Load faceSet
|
||||
const faceSet procSet(*iter());
|
||||
label setI = fSetNames[iter.key()];
|
||||
if (!faceSets.set(setI))
|
||||
{
|
||||
faceSets.set
|
||||
(
|
||||
setI,
|
||||
new faceSet(mesh, iter.key(), procSet.size())
|
||||
);
|
||||
}
|
||||
faceSet& fSet = faceSets[setI];
|
||||
fSet.instance() = runTime.timeName();
|
||||
|
||||
forAllConstIter(faceSet, procSet, iter)
|
||||
{
|
||||
fSet.insert(mag(faceMap[iter.key()])-1);
|
||||
}
|
||||
}
|
||||
// pointSets
|
||||
const labelList& pointMap =
|
||||
procMeshes.pointProcAddressing()[procI];
|
||||
|
||||
IOobjectList pSets(objects.lookupClass(pointSet::typeName));
|
||||
forAllConstIter(IOobjectList, pSets, iter)
|
||||
{
|
||||
// Load pointSet
|
||||
const pointSet propSet(*iter());
|
||||
label setI = pSetNames[iter.key()];
|
||||
if (!pointSets.set(setI))
|
||||
{
|
||||
pointSets.set
|
||||
(
|
||||
setI,
|
||||
new pointSet(mesh, iter.key(), propSet.size())
|
||||
);
|
||||
}
|
||||
pointSet& pSet = pointSets[setI];
|
||||
pSet.instance() = runTime.timeName();
|
||||
|
||||
forAllConstIter(pointSet, propSet, iter)
|
||||
{
|
||||
pSet.insert(pointMap[iter.key()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Write sets
|
||||
forAll(cellSets, i)
|
||||
// Combine individual parts
|
||||
|
||||
const PtrList<labelIOList>& cellAddr =
|
||||
procMeshes.cellProcAddressing();
|
||||
|
||||
UPtrList<const labelList> cellMaps(cellAddr.size());
|
||||
forAll(cellAddr, i)
|
||||
{
|
||||
cellSets[i].write();
|
||||
cellMaps.set(i, &cellAddr[i]);
|
||||
}
|
||||
forAll(faceSets, i)
|
||||
|
||||
const PtrList<labelIOList>& pointAddr =
|
||||
procMeshes.pointProcAddressing();
|
||||
|
||||
UPtrList<const labelList> pointMaps(pointAddr.size());
|
||||
forAll(pointAddr, i)
|
||||
{
|
||||
faceSets[i].write();
|
||||
pointMaps.set(i, &pointAddr[i]);
|
||||
}
|
||||
forAll(pointSets, i)
|
||||
|
||||
UPtrList<const hexRef8Data> procRefs(procData.size());
|
||||
forAll(procData, i)
|
||||
{
|
||||
pointSets[i].write();
|
||||
procRefs.set(i, &procData[i]);
|
||||
}
|
||||
|
||||
hexRef8Data
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"dummy",
|
||||
mesh.time().timeName(),
|
||||
polyMesh::meshSubDir,
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
),
|
||||
cellMaps,
|
||||
pointMaps,
|
||||
procRefs
|
||||
).write();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -945,20 +1064,35 @@ int main(int argc, char *argv[])
|
||||
procRefs
|
||||
).write();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// If there are any "uniform" directories copy them from
|
||||
// the master processor
|
||||
forAll(timeDirs, timeI)
|
||||
{
|
||||
runTime.setTime(timeDirs[timeI], timeI);
|
||||
databases[0].setTime(timeDirs[timeI], timeI);
|
||||
// If there is a "uniform" directory in the time region
|
||||
// directory copy from the master processor
|
||||
{
|
||||
fileName uniformDir0
|
||||
(
|
||||
databases[0].timePath()/regionDir/"uniform"
|
||||
);
|
||||
|
||||
fileName uniformDir0 = databases[0].timePath()/"uniform";
|
||||
if (isDir(uniformDir0))
|
||||
{
|
||||
cp(uniformDir0, runTime.timePath());
|
||||
if (isDir(uniformDir0))
|
||||
{
|
||||
cp(uniformDir0, runTime.timePath()/regionDir);
|
||||
}
|
||||
}
|
||||
|
||||
// For the first region of a multi-region case additionally
|
||||
// copy the "uniform" directory in the time directory
|
||||
if (regioni == 0 && regionDir != word::null)
|
||||
{
|
||||
fileName uniformDir0
|
||||
(
|
||||
databases[0].timePath()/"uniform"
|
||||
);
|
||||
|
||||
if (isDir(uniformDir0))
|
||||
{
|
||||
cp(uniformDir0, runTime.timePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -52,7 +52,7 @@ Description
|
||||
#include "faceCoupleInfo.H"
|
||||
#include "fvMeshAdder.H"
|
||||
#include "polyTopoChange.H"
|
||||
#include "zeroGradientFvPatchFields.H"
|
||||
#include "extrapolatedCalculatedFvPatchFields.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
@ -81,12 +81,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
|
||||
@ -108,11 +108,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
|
||||
(
|
||||
@ -120,9 +120,9 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
- masterMesh.nInternalFaces()
|
||||
);
|
||||
|
||||
forAll(masterPatches, patchI)
|
||||
forAll(masterPatches, patchi)
|
||||
{
|
||||
const polyPatch& pp = masterPatches[patchI];
|
||||
const polyPatch& pp = masterPatches[patchi];
|
||||
|
||||
if
|
||||
(
|
||||
@ -133,10 +133,10 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
)
|
||||
)
|
||||
{
|
||||
label meshFaceI = pp.start();
|
||||
label meshFacei = pp.start();
|
||||
forAll(pp, i)
|
||||
{
|
||||
masterFaces.append(meshFaceI++);
|
||||
masterFaces.append(meshFacei++);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -144,7 +144,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();
|
||||
|
||||
@ -154,19 +154,19 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
- meshToAdd.nInternalFaces()
|
||||
);
|
||||
|
||||
forAll(addPatches, patchI)
|
||||
forAll(addPatches, patchi)
|
||||
{
|
||||
const polyPatch& pp = addPatches[patchI];
|
||||
const polyPatch& pp = addPatches[patchi];
|
||||
|
||||
if (isA<processorPolyPatch>(pp))
|
||||
{
|
||||
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)
|
||||
@ -178,10 +178,10 @@ autoPtr<faceCoupleInfo> determineCoupledFaces
|
||||
|
||||
if (isConnected)
|
||||
{
|
||||
label meshFaceI = pp.start();
|
||||
label meshFacei = pp.start();
|
||||
forAll(pp, i)
|
||||
{
|
||||
addFaces.append(meshFaceI++);
|
||||
addFaces.append(meshFacei++);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -230,7 +230,7 @@ autoPtr<mapPolyMesh> mergeSharedPoints
|
||||
|
||||
if (returnReduce(pointToMaster.size(), sumOp<label>()) == 0)
|
||||
{
|
||||
return autoPtr<mapPolyMesh>(NULL);
|
||||
return autoPtr<mapPolyMesh>(nullptr);
|
||||
}
|
||||
|
||||
polyTopoChange meshMod(mesh);
|
||||
@ -247,30 +247,30 @@ 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)
|
||||
{
|
||||
label oldPointI = constructMap[i];
|
||||
label oldPointi = constructMap[i];
|
||||
|
||||
// New label of point after changeMesh.
|
||||
label newPointI = map().reversePointMap()[oldPointI];
|
||||
label newPointi = map().reversePointMap()[oldPointi];
|
||||
|
||||
if (newPointI < -1)
|
||||
if (newPointi < -1)
|
||||
{
|
||||
constructMap[i] = -newPointI-2;
|
||||
constructMap[i] = -newPointi-2;
|
||||
}
|
||||
else if (newPointI >= 0)
|
||||
else if (newPointi >= 0)
|
||||
{
|
||||
constructMap[i] = newPointI;
|
||||
constructMap[i] = newPointi;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Problem. oldPointI:" << oldPointI
|
||||
<< " newPointI:" << newPointI << abort(FatalError);
|
||||
<< "Problem. oldPointi:" << oldPointi
|
||||
<< " newPointi:" << newPointi << abort(FatalError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -288,21 +288,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
|
||||
@ -313,8 +313,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
|
||||
@ -322,13 +322,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
|
||||
@ -369,10 +369,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();
|
||||
@ -404,13 +404,14 @@ void writeCellDistance
|
||||
),
|
||||
masterMesh,
|
||||
dimensionedScalar("cellDist", dimless, 0),
|
||||
zeroGradientFvPatchScalarField::typeName
|
||||
extrapolatedCalculatedFvPatchScalarField::typeName
|
||||
);
|
||||
|
||||
forAll(cellDecomposition, cellI)
|
||||
forAll(cellDecomposition, celli)
|
||||
{
|
||||
cellDist[cellI] = cellDecomposition[cellI];
|
||||
cellDist[celli] = cellDecomposition[celli];
|
||||
}
|
||||
cellDist.correctBoundaryConditions();
|
||||
|
||||
cellDist.write();
|
||||
|
||||
@ -545,20 +546,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))
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -580,9 +581,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 =
|
||||
@ -639,11 +640,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
|
||||
@ -651,16 +652,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());
|
||||
|
||||
|
||||
@ -668,7 +669,7 @@ int main(int argc, char *argv[])
|
||||
autoPtr<faceCoupleInfo> couples = determineCoupledFaces
|
||||
(
|
||||
fullMatch,
|
||||
procI,
|
||||
proci,
|
||||
masterMesh,
|
||||
meshToAdd,
|
||||
mergeDist
|
||||
@ -689,7 +690,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]);
|
||||
@ -703,10 +704,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;
|
||||
}
|
||||
@ -743,18 +744,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]
|
||||
)
|
||||
);
|
||||
|
||||
@ -762,7 +763,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;
|
||||
@ -779,14 +780,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;
|
||||
@ -803,43 +804,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]++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -849,7 +850,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;
|
||||
@ -866,7 +867,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
),
|
||||
cellProcAddressing[procI]
|
||||
cellProcAddressing[proci]
|
||||
).write();
|
||||
|
||||
|
||||
@ -874,7 +875,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;
|
||||
@ -891,7 +892,7 @@ int main(int argc, char *argv[])
|
||||
IOobject::NO_WRITE,
|
||||
false // Do not register
|
||||
),
|
||||
boundaryProcAddressing[procI]
|
||||
boundaryProcAddressing[proci]
|
||||
).write();
|
||||
|
||||
Info<< endl;
|
||||
|
||||
@ -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 | Copyright (C) 2015 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -171,9 +171,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
List<polyPatch*> patches(patchEntries.size());
|
||||
label nPatches = 0;
|
||||
|
||||
forAll(patchEntries, patchI)
|
||||
forAll(patchEntries, patchi)
|
||||
{
|
||||
const entry& e = patchEntries[patchI];
|
||||
const entry& e = patchEntries[patchi];
|
||||
const word type(e.dict().lookup("type"));
|
||||
const word& name = e.keyword();
|
||||
|
||||
@ -187,7 +187,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
patchDict.set("nFaces", 0);
|
||||
patchDict.set("startFace", 0);
|
||||
|
||||
patches[patchI] = polyPatch::New
|
||||
patches[patchi] = polyPatch::New
|
||||
(
|
||||
name,
|
||||
patchDict,
|
||||
@ -270,9 +270,9 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
|
||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||
|
||||
forAll(patchEntries, patchI)
|
||||
forAll(patchEntries, patchi)
|
||||
{
|
||||
const entry& e = patchEntries[patchI];
|
||||
const entry& e = patchEntries[patchi];
|
||||
const word type(e.dict().lookup("type"));
|
||||
const word& name = e.keyword();
|
||||
|
||||
@ -281,7 +281,7 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
break;
|
||||
}
|
||||
|
||||
if (patchI >= patches.size())
|
||||
if (patchi >= patches.size())
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Non-processor patches not synchronised."
|
||||
@ -289,26 +289,26 @@ Foam::autoPtr<Foam::fvMesh> Foam::loadOrCreateMesh
|
||||
<< "Processor " << Pstream::myProcNo()
|
||||
<< " has only " << patches.size()
|
||||
<< " patches, master has "
|
||||
<< patchI
|
||||
<< patchi
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
type != patches[patchI].type()
|
||||
|| name != patches[patchI].name()
|
||||
type != patches[patchi].type()
|
||||
|| name != patches[patchi].name()
|
||||
)
|
||||
{
|
||||
FatalErrorInFunction
|
||||
<< "Non-processor patches not synchronised."
|
||||
<< endl
|
||||
<< "Master patch " << patchI
|
||||
<< "Master patch " << patchi
|
||||
<< " name:" << type
|
||||
<< " type:" << type << endl
|
||||
<< "Processor " << Pstream::myProcNo()
|
||||
<< " patch " << patchI
|
||||
<< " has name:" << patches[patchI].name()
|
||||
<< " type:" << patches[patchI].type()
|
||||
<< " patch " << patchi
|
||||
<< " has name:" << patches[patchi].name()
|
||||
<< " type:" << patches[patchi].type()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user