diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C index b1f8c3bed2..5013a4e6a2 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C @@ -38,7 +38,7 @@ solidWallHeatFluxTemperatureFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(p, iF), + fixedGradientFvPatchScalarField(p, iF), q_(p.size(), 0.0), KName_("undefined-K") {} @@ -53,7 +53,7 @@ solidWallHeatFluxTemperatureFvPatchScalarField const fvPatchFieldMapper& mapper ) : - fixedValueFvPatchScalarField(ptf, p, iF, mapper), + fixedGradientFvPatchScalarField(ptf, p, iF, mapper), q_(ptf.q_, mapper), KName_(ptf.KName_) {} @@ -67,7 +67,7 @@ solidWallHeatFluxTemperatureFvPatchScalarField const dictionary& dict ) : - fixedValueFvPatchScalarField(p, iF, dict), + fixedGradientFvPatchScalarField(p, iF, dict), q_("q", dict, p.size()), KName_(dict.lookup("K")) {} @@ -79,7 +79,7 @@ solidWallHeatFluxTemperatureFvPatchScalarField const solidWallHeatFluxTemperatureFvPatchScalarField& tppsf ) : - fixedValueFvPatchScalarField(tppsf), + fixedGradientFvPatchScalarField(tppsf), q_(tppsf.q_), KName_(tppsf.KName_) {} @@ -92,7 +92,7 @@ solidWallHeatFluxTemperatureFvPatchScalarField const DimensionedField& iF ) : - fixedValueFvPatchScalarField(tppsf, iF), + fixedGradientFvPatchScalarField(tppsf, iF), q_(tppsf.q_), KName_(tppsf.KName_) {} @@ -105,7 +105,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::autoMap const fvPatchFieldMapper& m ) { - fixedValueFvPatchScalarField::autoMap(m); + fixedGradientFvPatchScalarField::autoMap(m); q_.autoMap(m); } @@ -116,7 +116,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::rmap const labelList& addr ) { - fixedValueFvPatchScalarField::rmap(ptf, addr); + fixedGradientFvPatchScalarField::rmap(ptf, addr); const solidWallHeatFluxTemperatureFvPatchScalarField& hfptf = refCast(ptf); @@ -132,14 +132,14 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs() return; } - const scalarField& Kw = - patch().lookupPatchField(KName_); + const scalarField& Kw = patch().lookupPatchField + ( + KName_ + ); - const fvPatchScalarField& Tw = *this; + gradient() = q_/Kw; - operator==(q_/(patch().deltaCoeffs()*Kw) + Tw.patchInternalField()); - - fixedValueFvPatchScalarField::updateCoeffs(); + fixedGradientFvPatchScalarField::updateCoeffs(); } @@ -148,9 +148,10 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write Ostream& os ) const { - fixedValueFvPatchScalarField::write(os); + fixedGradientFvPatchScalarField::write(os); q_.writeEntry("q", os); os.writeKeyword("K") << KName_ << token::END_STATEMENT << nl; + this->writeEntry("value", os); } diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H index 85a1ef1cf1..d621e4d15a 100644 --- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H +++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.H @@ -46,7 +46,7 @@ SourceFiles #ifndef solidWallHeatFluxTemperatureFvPatchScalarField_H #define solidWallHeatFluxTemperatureFvPatchScalarField_H -#include "fixedValueFvPatchFields.H" +#include "fixedGradientFvPatchFields.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,7 +59,7 @@ namespace Foam class solidWallHeatFluxTemperatureFvPatchScalarField : - public fixedValueFvPatchScalarField + public fixedGradientFvPatchScalarField { // Private data diff --git a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H index 27ddd24544..10855d9cc6 100644 --- a/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H +++ b/applications/solvers/incompressible/boundaryFoam/interrogateWallPatches.H @@ -11,7 +11,7 @@ forAll(patches, patchi) { const fvPatch& currPatch = patches[patchi]; - if (isType(currPatch)) + if (isA(currPatch)) { const vectorField nf = currPatch.nf(); diff --git a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C index 0ccb7a6862..03832883cc 100644 --- a/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C +++ b/applications/utilities/mesh/conversion/polyDualMesh/polyDualMeshApp.C @@ -358,9 +358,22 @@ int main(int argc, char *argv[]) timeSelector::addOptions(true, false); argList::validArgs.append("feature angle[0-180]"); - argList::addBoolOption("splitAllFaces"); - argList::addBoolOption("concaveMultiCells"); - argList::addBoolOption("doNotPreserveFaceZones"); + argList::addBoolOption + ( + "splitAllFaces", + "have multiple faces inbetween cells" + ); + argList::addBoolOption + ( + "concaveMultiCells", + "split cells on concave boundary edges into multiple cells" + ); + argList::addBoolOption + ( + "doNotPreserveFaceZones", + "disable the default behaviour of preserving faceZones by having" + " multiple faces inbetween cells" + ); # include "setRootCase.H" # include "createTime.H" diff --git a/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C b/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C index ba13659a18..ad4bffa3b7 100644 --- a/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C +++ b/applications/utilities/mesh/conversion/star3ToFoam/createCoupleMatches.C @@ -884,7 +884,7 @@ void starMesh::createCoupleMatches() << "newSlaveEdges: " << newSlaveEdges << endl; # endif - edge startEdge; + edge startEdge(-1, -1); // Remember where the start edge was found: // 0 for not found diff --git a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C index 364c59075f..f0aa4a0aaa 100644 --- a/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C +++ b/applications/utilities/mesh/manipulation/checkMesh/checkTopology.C @@ -71,7 +71,7 @@ Foam::label Foam::checkTopology { Info<< " ***FaceZone " << mesh.faceZones()[zoneI].name() << " is not correctly synchronised" - << " acrosss coupled boundaries." + << " across coupled boundaries." << " (coupled faces both" << " present in set but with opposite flipmap)" << endl; noFailedChecks++; diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options index 45ab666e24..8f8010fff7 100644 --- a/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options +++ b/applications/utilities/parallelProcessing/redistributeMeshPar/Make/options @@ -8,5 +8,4 @@ EXE_LIBS = \ -lfiniteVolume \ -ldecompositionMethods \ -lmeshTools \ - -ldynamicMesh \ - -L$(FOAM_MPI_LIBBIN) -lparMetisDecompositionMethod + -ldynamicMesh diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C index 1204ac5976..e446dcac89 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C @@ -110,40 +110,30 @@ void writeAllData { if (nPrims) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - if (!Pstream::master()) - { - UOPstream toMaster(Pstream::masterNo(), pBufs); - for (direction cmpt=0; cmpt::nComponents; cmpt++) - { - toMaster<< map(vf, prims, cmpt); - } - } - - pBufs.finishedSends(); - if (Pstream::master()) { ensightFile << key << nl; - PtrList fromSlaves(Pstream::nProcs()); - for (int slave=1; slave::nComponents; cmpt++) { writeData(map(vf, prims, cmpt), ensightFile); for (int slave=1; slave::nComponents; cmpt++) + { + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); + toMaster<< map(vf, prims, cmpt); + } + } } } @@ -160,40 +150,30 @@ void writeAllDataBinary { if (nPrims) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - if (!Pstream::master()) - { - UOPstream toMaster(Pstream::masterNo(), pBufs); - for (direction cmpt=0; cmpt::nComponents; cmpt++) - { - toMaster<< map(vf, prims, cmpt); - } - } - - pBufs.finishedSends(); - if (Pstream::master()) { writeEnsDataBinary(key,ensightFile); - PtrList fromSlaves(Pstream::nProcs()); - for (int slave=1; slave::nComponents; cmpt++) { writeEnsDataBinary(map(vf, prims, cmpt), ensightFile); for (int slave=1; slave::nComponents; cmpt++) + { + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); + toMaster<< map(vf, prims, cmpt); + } + } } } @@ -210,40 +190,31 @@ void writeAllFaceData { if (nPrims) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - if (!Pstream::master()) - { - UOPstream toMaster(Pstream::masterNo(), pBufs); - for (direction cmpt=0; cmpt::nComponents; cmpt++) - { - toMaster<< map(pf, prims, cmpt); - } - } - - pBufs.finishedSends(); - if (Pstream::master()) { ensightFile << key << nl; - PtrList fromSlaves(Pstream::nProcs()); - for (int slave=1; slave::nComponents; cmpt++) { writeData(map(pf, prims, cmpt), ensightFile); for (int slave=1; slave::nComponents; cmpt++) + { + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); + toMaster<< map(pf, prims, cmpt); + } + } } } @@ -260,40 +231,31 @@ void writeAllFaceDataBinary { if (nPrims) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - if (!Pstream::master()) - { - UOPstream toMaster(Pstream::masterNo(), pBufs); - for (direction cmpt=0; cmpt::nComponents; cmpt++) - { - toMaster<< map(pf, prims, cmpt); - } - } - - pBufs.finishedSends(); - if (Pstream::master()) { writeEnsDataBinary(key,ensightFile); - PtrList fromSlaves(Pstream::nProcs()); - for (int slave=1; slave::nComponents; cmpt++) { writeEnsDataBinary(map(pf, prims, cmpt), ensightFile); for (int slave=1; slave::nComponents; cmpt++) + { + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); + toMaster<< map(pf, prims, cmpt); + } + } } } @@ -539,6 +501,10 @@ void ensightFieldAscii const wordHashSet& patchNames = eMesh.patchNames(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); + const List& faceZoneFaceSets = eMesh.faceZoneFaceSets(); + const wordHashSet& faceZoneNames = eMesh.faceZoneNames(); + const HashTable& + nFaceZonePrims = eMesh.nFaceZonePrims(); const labelList& tets = meshCellSets.tets; const labelList& pyrs = meshCellSets.pyrs; @@ -557,7 +523,7 @@ void ensightFieldAscii postProcPath/ensightFileName, runTime.writeFormat(), runTime.writeVersion(), - runTime.writeCompression() + IOstream::UNCOMPRESSED ); } @@ -567,6 +533,8 @@ void ensightFieldAscii if (patchNames.empty()) { + eMesh.barrier(); + if (Pstream::master()) { if (timeIndex == 0) @@ -592,29 +560,10 @@ void ensightFieldAscii if (meshCellSets.nHexesWedges) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - if (!Pstream::master()) - { - UOPstream toMaster(Pstream::masterNo(), pBufs); - for (direction cmpt=0; cmpt::nComponents; cmpt++) - { - toMaster<< map(vf, hexes, wedges, cmpt); - } - } - - pBufs.finishedSends(); - if (Pstream::master()) { ensightFile << "hexa8" << nl; - PtrList fromSlaves(Pstream::nProcs()); - for (int slave=1; slave::nComponents; cmpt++) { writeData @@ -625,17 +574,57 @@ void ensightFieldAscii for (int slave=1; slave::nComponents; cmpt++) + { + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); + toMaster<< map(vf, hexes, wedges, cmpt); + } + } } - writeAllData("penta6", vf, prisms, meshCellSets.nPrisms, ensightFile); - writeAllData("pyramid5", vf, pyrs, meshCellSets.nPyrs, ensightFile); - writeAllData("tetra4", vf, tets, meshCellSets.nTets, ensightFile); - writeAllData("nfaced", vf, polys, meshCellSets.nPolys, ensightFile); + writeAllData + ( + "penta6", + vf, + prisms, + meshCellSets.nPrisms, + ensightFile + ); + + writeAllData + ( + "pyramid5", + vf, + pyrs, + meshCellSets.nPyrs, + ensightFile + ); + + writeAllData + ( + "tetra4", + vf, + tets, + meshCellSets.nTets, + ensightFile + ); + + writeAllData + ( + "nfaced", + vf, + polys, + meshCellSets.nPolys, + ensightFile + ); } label ensightPatchI = eMesh.patchPartOffset(); @@ -644,6 +633,8 @@ void ensightFieldAscii { const word& patchName = allPatchNames[patchi]; + eMesh.barrier(); + if (patchNames.empty() || patchNames.found(patchName)) { if @@ -664,6 +655,80 @@ void ensightFieldAscii } } + // write faceZones, if requested + if (faceZoneNames.size()) + { + // Interpolates cell values to faces - needed only when exporting + // faceZones... + GeometricField sf + ( + linearInterpolate(vf) + ); + + forAllConstIter(wordHashSet, faceZoneNames, iter) + { + const word& faceZoneName = iter.key(); + + eMesh.barrier(); + + label zoneID = mesh.faceZones().findZoneID(faceZoneName); + + const faceZone& fz = mesh.faceZones()[zoneID]; + + // Prepare data to write + label nIncluded = 0; + forAll(fz, i) + { + if (eMesh.faceToBeIncluded(fz[i])) + { + ++nIncluded; + } + } + + Field values(nIncluded); + + // Loop on the faceZone and store the needed field values + label j = 0; + forAll(fz, i) + { + label faceI = fz[i]; + if (mesh.isInternalFace(faceI)) + { + values[j] = sf[faceI]; + ++j; + } + else + { + if (eMesh.faceToBeIncluded(faceI)) + { + label patchI = mesh.boundaryMesh().whichPatch(faceI); + const polyPatch& pp = mesh.boundaryMesh()[patchI]; + label patchFaceI = pp.whichFace(faceI); + Type value = sf.boundaryField()[patchI][patchFaceI]; + values[j] = value; + ++j; + } + } + } + + if + ( + writePatchField + ( + values, + zoneID, + ensightPatchI, + faceZoneFaceSets[zoneID], + nFaceZonePrims.find(faceZoneName)(), + ensightFile + ) + ) + { + ensightPatchI++; + } + } + } + if (Pstream::master()) { delete ensightFilePtr; @@ -695,6 +760,10 @@ void ensightFieldBinary const wordHashSet& patchNames = eMesh.patchNames(); const HashTable& nPatchPrims = eMesh.nPatchPrims(); + const List& faceZoneFaceSets = eMesh.faceZoneFaceSets(); + const wordHashSet& faceZoneNames = eMesh.faceZoneNames(); + const HashTable& + nFaceZonePrims = eMesh.nFaceZonePrims(); const labelList& tets = meshCellSets.tets; const labelList& pyrs = meshCellSets.pyrs; @@ -722,6 +791,8 @@ void ensightFieldBinary if (patchNames.empty()) { + eMesh.barrier(); + if (Pstream::master()) { if (timeIndex == 0) @@ -743,29 +814,10 @@ void ensightFieldBinary if (meshCellSets.nHexesWedges) { - PstreamBuffers pBufs(Pstream::nonBlocking); - - if (!Pstream::master()) - { - UOPstream toMaster(Pstream::masterNo(), pBufs); - for (direction cmpt=0; cmpt::nComponents; cmpt++) - { - toMaster<< map(vf, hexes, wedges, cmpt); - } - } - - pBufs.finishedSends(); - if (Pstream::master()) { writeEnsDataBinary("hexa8",ensightFile); - PtrList fromSlaves(Pstream::nProcs()); - for (int slave=1; slave::nComponents; cmpt++) { writeEnsDataBinary @@ -776,11 +828,20 @@ void ensightFieldBinary for (int slave=1; slave::nComponents; cmpt++) + { + OPstream toMaster(Pstream::scheduled, Pstream::masterNo()); + toMaster<< map(vf, hexes, wedges, cmpt); + } + } } writeAllDataBinary @@ -826,6 +887,8 @@ void ensightFieldBinary { const word& patchName = allPatchNames[patchi]; + eMesh.barrier(); + if (patchNames.empty() || patchNames.found(patchName)) { if @@ -844,6 +907,81 @@ void ensightFieldBinary ensightPatchI++; } } + + } + + // write faceZones, if requested + if (faceZoneNames.size()) + { + // Interpolates cell values to faces - needed only when exporting + // faceZones... + GeometricField sf + ( + linearInterpolate(vf) + ); + + forAllConstIter(wordHashSet, faceZoneNames, iter) + { + const word& faceZoneName = iter.key(); + + eMesh.barrier(); + + label zoneID = mesh.faceZones().findZoneID(faceZoneName); + + const faceZone& fz = mesh.faceZones()[zoneID]; + + // Prepare data to write + label nIncluded = 0; + forAll(fz, i) + { + if (eMesh.faceToBeIncluded(fz[i])) + { + ++nIncluded; + } + } + + Field values(nIncluded); + + // Loop on the faceZone and store the needed field values + label j = 0; + forAll(fz, i) + { + label faceI = fz[i]; + if (mesh.isInternalFace(faceI)) + { + values[j] = sf[faceI]; + ++j; + } + else + { + if (eMesh.faceToBeIncluded(faceI)) + { + label patchI = mesh.boundaryMesh().whichPatch(faceI); + const polyPatch& pp = mesh.boundaryMesh()[patchI]; + label patchFaceI = pp.whichFace(faceI); + Type value = sf.boundaryField()[patchI][patchFaceI]; + values[j] = value; + ++j; + } + } + } + + if + ( + writePatchFieldBinary + ( + values, + zoneID, + ensightPatchI, + faceZoneFaceSets[zoneID], + nFaceZonePrims.find(faceZoneName)(), + ensightFile + ) + ) + { + ensightPatchI++; + } + } } if (Pstream::master()) diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C index 5f848736be..daece0473b 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C +++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C @@ -30,11 +30,14 @@ License #include "fvMesh.H" #include "globalMeshData.H" #include "PstreamCombineReduceOps.H" +#include "processorPolyPatch.H" #include "cellModeller.H" #include "IOmanip.H" #include "itoa.H" #include "ensightWriteBinary.H" +#include "globalIndex.H" #include "mapDistribute.H" +#include "stringListOps.H" #include @@ -56,7 +59,11 @@ Foam::ensightMesh::ensightMesh boundaryFaceSets_(mesh_.boundary().size()), allPatchNames_(0), patchNames_(0), - nPatchPrims_(0) + nPatchPrims_(0), + faceZoneFaceSets_(mesh_.faceZones().size()), + faceZoneNames_(0), + nFaceZonePrims_(0), + boundaryFaceToBeIncluded_(0) { const cellShapeList& cellShapes = mesh.cellShapes(); @@ -80,10 +87,7 @@ Foam::ensightMesh::ensightMesh if (args.optionFound("patches")) { - wordList patchNameList - ( - args.optionLookup("patches")() - ); + wordList patchNameList(args.optionLookup("patches")()); if (patchNameList.empty()) { @@ -218,7 +222,6 @@ Foam::ensightMesh::ensightMesh } } - forAll(allPatchNames_, patchi) { const word& patchName = allPatchNames_[patchi]; @@ -240,6 +243,133 @@ Foam::ensightMesh::ensightMesh nPatchPrims_.insert(patchName, nfp); } + + // faceZones + if (args.optionFound("faceZones")) + { + wordList patchNameList(args.optionLookup("faceZones")()); + + const wordList faceZoneNamesAll = mesh_.faceZones().names(); + + // Find out faceZone names that match with what requested at command + // line + forAll(patchNameList, i) + { + labelList matches = findStrings(patchNameList[i], faceZoneNamesAll); + + forAll(matches, matchI) + { + faceZoneNames_.insert(faceZoneNamesAll[matches[matchI]]); + } + } + + // Build list of boundary faces to be exported + boundaryFaceToBeIncluded_.setSize + ( + mesh_.nFaces() + - mesh_.nInternalFaces(), + 1 + ); + + forAll(mesh_.boundaryMesh(), patchI) + { + const polyPatch& pp = mesh_.boundaryMesh()[patchI]; + if + ( + isA(pp) + && !refCast(pp).owner() + ) + { + label bFaceI = pp.start()-mesh_.nInternalFaces(); + forAll(pp, i) + { + boundaryFaceToBeIncluded_[bFaceI++] = 0; + } + } + } + + // Count face types in each faceZone + forAll(faceZoneNamesAll, zoneI) + { + //const word& zoneName = faceZoneNamesAll[zoneI]; + + const faceZone& fz = mesh.faceZones()[zoneI]; + + if (fz.size()) + { + labelList& tris = faceZoneFaceSets_[zoneI].tris; + labelList& quads = faceZoneFaceSets_[zoneI].quads; + labelList& polys = faceZoneFaceSets_[zoneI].polys; + + tris.setSize(fz.size()); + quads.setSize(fz.size()); + polys.setSize(fz.size()); + + label nTris = 0; + label nQuads = 0; + label nPolys = 0; + + label faceCounter = 0; + + forAll(fz, i) + { + label faceI = fz[i]; + + // Avoid counting faces on processor boundaries twice + if (faceToBeIncluded(faceI)) + { + const face& f = mesh_.faces()[faceI]; + + if (f.size() == 3) + { + tris[nTris++] = faceCounter; + } + else if (f.size() == 4) + { + quads[nQuads++] = faceCounter; + } + else + { + polys[nPolys++] = faceCounter; + } + + ++faceCounter; + } + } + + tris.setSize(nTris); + quads.setSize(nQuads); + polys.setSize(nPolys); + } + } + + forAll(faceZoneNamesAll, zoneI) + { + const word& zoneName = faceZoneNamesAll[zoneI]; + nFacePrimitives nfp; + + if (faceZoneNames_.found(zoneName)) + { + if + ( + faceZoneFaceSets_[zoneI].tris.size() + || faceZoneFaceSets_[zoneI].quads.size() || + faceZoneFaceSets_[zoneI].polys.size() + ) + { + nfp.nTris = faceZoneFaceSets_[zoneI].tris.size(); + nfp.nQuads = faceZoneFaceSets_[zoneI].quads.size(); + nfp.nPolys = faceZoneFaceSets_[zoneI].polys.size(); + } + } + + reduce(nfp.nTris, sumOp