diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H index 1144833a01..76b55aada7 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/checkData.H @@ -1,7 +1,7 @@ // ignore special fields or fields that we don't handle // bool variableGood = true; -for (label n1=startTime; n1 2 && fieldName(fieldName.size() - 2, 2) == "_0") diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H index 0ddde7448a..6ec8373fcf 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightCaseTail.H @@ -19,7 +19,7 @@ if (Pstream::master()) Info<< "Correcting time values. Adding " << Tcorr << endl; } - for (int n=startTime; n& pf, - const labelList& patchProcessors, OFstream& ensightFile ) { @@ -199,16 +198,12 @@ void writeAllFaceData { writeData(map(pf, prims, cmpt), ensightFile); - forAll(patchProcessors, i) + for (int slave=1; slave& pf, - const labelList& patchProcessors, std::ofstream& ensightFile ) { @@ -245,16 +239,12 @@ void writeAllFaceDataBinary { writeEnsDataBinary(map(pf, prims, cmpt), ensightFile); - forAll(patchProcessors, i) + for (int slave=1; slave& boundaryFaceSets = eMesh.boundaryFaceSets(); const wordList& allPatchNames = eMesh.allPatchNames(); - const List& allPatchProcs = eMesh.allPatchProcs(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); @@ -425,8 +406,6 @@ void writePatchField } - const labelList& patchProcessors = allPatchProcs[patchi]; - word pfName = patchName + '.' + fieldName; word timeFile = prepend + itoa(timeIndex); @@ -473,7 +452,6 @@ void writePatchField ensightPatchI, boundaryFaceSets[patchi], nPatchPrims.find(patchName)(), - patchProcessors, ensightFile ); } @@ -488,7 +466,6 @@ void writePatchField ensightPatchI, nullFaceSets, nPatchPrims.find(patchName)(), - patchProcessors, ensightFile ); } @@ -521,7 +498,6 @@ void ensightFieldAscii const cellSets& meshCellSets = eMesh.meshCellSets(); const List& boundaryFaceSets = eMesh.boundaryFaceSets(); const wordList& allPatchNames = eMesh.allPatchNames(); - const List& allPatchProcs = eMesh.allPatchProcs(); const wordHashSet& patchNames = eMesh.patchNames(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); @@ -619,50 +595,23 @@ void ensightFieldAscii forAll(allPatchNames, patchi) { const word& patchName = allPatchNames[patchi]; - const labelList& patchProcessors = allPatchProcs[patchi]; if (patchNames.empty() || patchNames.found(patchName)) { - if (mesh.boundary()[patchi].size()) - { - if + if + ( + writePatchField ( - writePatchField - ( - vf.boundaryField()[patchi], - patchi, - ensightPatchI, - boundaryFaceSets[patchi], - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) + vf.boundaryField()[patchi], + patchi, + ensightPatchI, + boundaryFaceSets[patchi], + nPatchPrims.find(patchName)(), + ensightFile ) - { - ensightPatchI++; - } - - } - else if (Pstream::master()) + ) { - faceSets nullFaceSet; - - if - ( - writePatchField - ( - Field(), - -1, - ensightPatchI, - nullFaceSet, - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) - ) - { - ensightPatchI++; - } + ensightPatchI++; } } } @@ -695,7 +644,6 @@ void ensightFieldBinary const cellSets& meshCellSets = eMesh.meshCellSets(); const List& boundaryFaceSets = eMesh.boundaryFaceSets(); const wordList& allPatchNames = eMesh.allPatchNames(); - const List& allPatchProcs = eMesh.allPatchProcs(); const wordHashSet& patchNames = eMesh.patchNames(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); @@ -819,50 +767,23 @@ void ensightFieldBinary forAll(allPatchNames, patchi) { const word& patchName = allPatchNames[patchi]; - const labelList& patchProcessors = allPatchProcs[patchi]; if (patchNames.empty() || patchNames.found(patchName)) { - if (mesh.boundary()[patchi].size()) - { - if + if + ( + writePatchFieldBinary ( - writePatchFieldBinary - ( - vf.boundaryField()[patchi], - patchi, - ensightPatchI, - boundaryFaceSets[patchi], - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) + vf.boundaryField()[patchi], + patchi, + ensightPatchI, + boundaryFaceSets[patchi], + nPatchPrims.find(patchName)(), + ensightFile ) - { - ensightPatchI++; - } - - } - else if (Pstream::master()) + ) { - faceSets nullFaceSet; - - if - ( - writePatchFieldBinary - ( - Field(), - -1, - ensightPatchI, - nullFaceSet, - nPatchPrims.find(patchName)(), - patchProcessors, - ensightFile - ) - ) - { - ensightPatchI++; - } + ensightPatchI++; } } } diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 4e566e1376..48435c749b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -43,42 +43,6 @@ License // * * * * * * * * * * * * * Private Functions * * * * * * * * * * * * * * // -namespace Foam -{ - //- Proxy-class to hold the patch processor list combination operator - class concatPatchProcs - { - - public: - - void operator() - ( - List& x, - const List& y - ) const - { - forAll(y, i) - { - const labelList& yPatches = y[i]; - - if (yPatches.size()) - { - labelList& xPatches = x[i]; - - label offset = xPatches.size(); - xPatches.setSize(offset + yPatches.size()); - - forAll(yPatches, i) - { - xPatches[i + offset] = yPatches[i]; - } - } - } - } - }; -} // End namespace Foam - - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::ensightMesh::ensightMesh @@ -94,7 +58,6 @@ Foam::ensightMesh::ensightMesh meshCellSets_(mesh_.nCells()), boundaryFaceSets_(mesh_.boundary().size()), allPatchNames_(0), - allPatchProcs_(0), patchNames_(0), nPatchPrims_(0) { @@ -108,6 +71,9 @@ Foam::ensightMesh::ensightMesh if (!args.optionFound("noPatches")) { + // Patches are output. Check that they're synced. + mesh_.boundaryMesh().checkParallelSync(true); + allPatchNames_ = wordList::subList ( mesh_.boundaryMesh().names(), @@ -115,19 +81,6 @@ Foam::ensightMesh::ensightMesh - mesh_.globalData().processorPatches().size() ); - allPatchProcs_.setSize(allPatchNames_.size()); - - forAll(allPatchProcs_, patchi) - { - if (mesh_.boundary()[patchi].size()) - { - allPatchProcs_[patchi].setSize(1); - allPatchProcs_[patchi][0] = Pstream::myProcNo(); - } - } - - combineReduce(allPatchProcs_, concatPatchProcs()); - if (args.optionFound("patches")) { wordList patchNameList(args.optionLookup("patches")()); @@ -275,14 +228,12 @@ Foam::ensightMesh::ensightMesh { if (mesh.boundary()[patchi].size()) { - nfp.nPoints = mesh.boundaryMesh()[patchi].localPoints().size(); nfp.nTris = boundaryFaceSets_[patchi].tris.size(); nfp.nQuads = boundaryFaceSets_[patchi].quads.size(); nfp.nPolys = boundaryFaceSets_[patchi].polys.size(); } } - reduce(nfp.nPoints, sumOp