make -cellDist output compatible with manualDecomp

This commit is contained in:
mattijs
2009-09-10 21:11:43 +01:00
parent 8c26da7856
commit feba218914

View File

@ -237,23 +237,28 @@ int main(int argc, char *argv[])
if (writeCellDist) if (writeCellDist)
{ {
const labelList& procIds = mesh.cellToProc();
// Write the decomposition as labelList for use with 'manual' // Write the decomposition as labelList for use with 'manual'
// decomposition method. // decomposition method.
labelIOList cellDecomposition
// FIXME: may attempt to write to a non-existent "region0/"
OFstream os
( (
runTime.path() IOobject
/ mesh.facesInstance() (
/ regionName "cellDecomposition",
/ "cellDecomposition" mesh.facesInstance(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
procIds
); );
cellDecomposition.write();
os << mesh.cellToProc();
Info<< nl << "Wrote decomposition to " Info<< nl << "Wrote decomposition to "
<< os.name() << " for use in manual decomposition." << cellDecomposition.objectPath()
<< endl; << " for use in manual decomposition." << endl;
// Write as volScalarField for postprocessing. // Write as volScalarField for postprocessing.
volScalarField cellDist volScalarField cellDist
@ -271,7 +276,6 @@ int main(int argc, char *argv[])
zeroGradientFvPatchScalarField::typeName zeroGradientFvPatchScalarField::typeName
); );
const labelList& procIds = mesh.cellToProc();
forAll(procIds, celli) forAll(procIds, celli)
{ {
cellDist[celli] = procIds[celli]; cellDist[celli] = procIds[celli];