diff --git a/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C b/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C index 3e9f8cd159..e0dda32b2a 100644 --- a/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C +++ b/applications/utilities/miscellaneous/foamInfoExec/foamInfoExec.C @@ -46,8 +46,8 @@ int main(int argc, char *argv[]) ); argList::noBanner(); - argList::noParallel(); argList::addBoolOption("times", "list available times"); + argList::addBoolOption("latestTime", "list last time"); argList::addBoolOption ( "keywords", @@ -75,6 +75,15 @@ int main(int argc, char *argv[]) Info<< times[i].name() << endl; } } + else if (args.optionFound("latestTime")) + { + instantList times + ( + Foam::Time::findTimes(args.rootPath()/args.caseName()) + ); + + Info<< times.last().name() << endl; + } if (args.optionFound("dict")) { diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C index 21ba1cdfa1..b569601734 100644 --- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C +++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C @@ -99,6 +99,40 @@ Usage // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +const labelIOList& procAddressing +( + const PtrList& procMeshList, + const label procI, + const word& name, + PtrList& procAddressingList +) +{ + const fvMesh& procMesh = procMeshList[procI]; + + if (!procAddressingList.set(procI)) + { + procAddressingList.set + ( + procI, + new labelIOList + ( + IOobject + ( + name, + procMesh.facesInstance(), + procMesh.meshSubDir, + procMesh, + IOobject::MUST_READ, + IOobject::NO_WRITE + ) + ) + ); + } + return procAddressingList[procI]; +} + + + int main(int argc, char *argv[]) { argList::addNote @@ -805,74 +839,29 @@ int main(int argc, char *argv[]) } const fvMesh& procMesh = procMeshList[procI]; + const labelIOList& faceProcAddressing = procAddressing + ( + procMeshList, + procI, + "faceProcAddressing", + faceProcAddressingList + ); - if (!faceProcAddressingList.set(procI)) - { - faceProcAddressingList.set - ( - procI, - new labelIOList - ( - IOobject - ( - "faceProcAddressing", - procMesh.facesInstance(), - procMesh.meshSubDir, - procMesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ) - ); - } - const labelIOList& faceProcAddressing = - faceProcAddressingList[procI]; + const labelIOList& cellProcAddressing = procAddressing + ( + procMeshList, + procI, + "cellProcAddressing", + cellProcAddressingList + ); - - if (!cellProcAddressingList.set(procI)) - { - cellProcAddressingList.set - ( - procI, - new labelIOList - ( - IOobject - ( - "cellProcAddressing", - procMesh.facesInstance(), - procMesh.meshSubDir, - procMesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ) - ); - } - const labelIOList& cellProcAddressing = - cellProcAddressingList[procI]; - - - if (!boundaryProcAddressingList.set(procI)) - { - boundaryProcAddressingList.set - ( - procI, - new labelIOList - ( - IOobject - ( - "boundaryProcAddressing", - procMesh.facesInstance(), - procMesh.meshSubDir, - procMesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ) - ); - } - const labelIOList& boundaryProcAddressing = - boundaryProcAddressingList[procI]; + const labelIOList& boundaryProcAddressing = procAddressing + ( + procMeshList, + procI, + "boundaryProcAddressing", + boundaryProcAddressingList + ); // FV fields @@ -959,27 +948,13 @@ int main(int argc, char *argv[]) || pointTensorFields.size() ) { - if (!pointProcAddressingList.set(procI)) - { - pointProcAddressingList.set - ( - procI, - new labelIOList - ( - IOobject - ( - "pointProcAddressing", - procMesh.facesInstance(), - procMesh.meshSubDir, - procMesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ) - ); - } - const labelIOList& pointProcAddressing = - pointProcAddressingList[procI]; + const labelIOList& pointProcAddressing = procAddressing + ( + procMeshList, + procI, + "pointProcAddressing", + pointProcAddressingList + ); const pointMesh& procPMesh = pointMesh::New(procMesh); diff --git a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C index 4eda411482..923d9ae1cf 100644 --- a/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C +++ b/applications/utilities/parallelProcessing/decomposePar/domainDecomposition.C @@ -38,6 +38,7 @@ License #include "cellSet.H" #include "faceSet.H" #include "pointSet.H" +#include "uniformDimensionedFields.H" // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // @@ -195,6 +196,60 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets) } + autoPtr cellLevelPtr; + { + IOobject io + ( + "cellLevel", + facesInstance(), + polyMesh::meshSubDir, + *this, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + if (io.headerOk()) + { + Info<< "Reading hexRef8 data : " << io.name() << endl; + cellLevelPtr.reset(new labelIOList(io)); + } + } + autoPtr pointLevelPtr; + { + IOobject io + ( + "pointLevel", + facesInstance(), + polyMesh::meshSubDir, + *this, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + if (io.headerOk()) + { + Info<< "Reading hexRef8 data : " << io.name() << endl; + pointLevelPtr.reset(new labelIOList(io)); + } + } + autoPtr level0EdgePtr; + { + IOobject io + ( + "level0Edge", + facesInstance(), + polyMesh::meshSubDir, + *this, + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + if (io.headerOk()) + { + Info<< "Reading hexRef8 data : " << io.name() << endl; + level0EdgePtr.reset(new uniformDimensionedScalarField(io)); + } + } + + + label maxProcCells = 0; label totProcFaces = 0; label maxProcPatches = 0; @@ -767,8 +822,28 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets) procMesh.write(); + // Write points if pointsInstance differing from facesInstance + if (facesInstancePointsPtr_.valid()) + { + pointIOField pointsInstancePoints + ( + IOobject + ( + "points", + pointsInstance(), + polyMesh::meshSubDir, + procMesh, + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + xferMove(procPoints) + ); + pointsInstancePoints.write(); + } + // Decompose any sets if (decomposeSets) { forAll(cellSets, i) @@ -813,25 +888,67 @@ bool Foam::domainDecomposition::writeDecomposition(const bool decomposeSets) } - // Write points if pointsInstance differing from facesInstance - if (facesInstancePointsPtr_.valid()) + // hexRef8 data + if (cellLevelPtr.valid()) { - pointIOField pointsInstancePoints + labelIOList ( IOobject ( - "points", - pointsInstance(), + cellLevelPtr().name(), + facesInstance(), polyMesh::meshSubDir, procMesh, IOobject::NO_READ, - IOobject::NO_WRITE, - false + IOobject::AUTO_WRITE ), - xferMove(procPoints) - ); - pointsInstancePoints.write(); + UIndirectList