From 064992634e17bde6d0c4472c82f85216350e6e9c Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 9 Dec 2009 17:39:04 +0000 Subject: [PATCH] Filter out zero sized patches --- .../foamToTecplot360/foamToTecplot360.C | 185 +++++++++++---------- 1 file changed, 97 insertions(+), 88 deletions(-) diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C index 82d02f25..572479eb 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C +++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/foamToTecplot360.C @@ -674,7 +674,7 @@ int main(int argc, char *argv[]) + timeDesc + ".plt" ); - + tecplotWriter writer(runTime); writer.writeInit @@ -909,106 +909,115 @@ int main(int argc, char *argv[]) const polyPatch& pp = patches[patchID]; //INTEGER4 strandID = 1 + i; - Info<< " Writing patch " << patchID << "\t" << pp.name() - << "\tstrand:" << strandID << nl << endl; + if (pp.size() > 0) + { + Info<< " Writing patch " << patchID << "\t" << pp.name() + << "\tstrand:" << strandID << nl << endl; - const indirectPrimitivePatch ipp - ( - IndirectList(pp, identity(pp.size())), - pp.points() - ); + const indirectPrimitivePatch ipp + ( + IndirectList(pp, identity(pp.size())), + pp.points() + ); - writer.writePolygonalZone - ( - pp.name(), - strandID++, //strandID, - ipp, - allVarLocation - ); + writer.writePolygonalZone + ( + pp.name(), + strandID++, //strandID, + ipp, + allVarLocation + ); - // Write coordinates - writer.writeField(ipp.localPoints().component(0)()); - writer.writeField(ipp.localPoints().component(1)()); - writer.writeField(ipp.localPoints().component(2)()); + // Write coordinates + writer.writeField(ipp.localPoints().component(0)()); + writer.writeField(ipp.localPoints().component(1)()); + writer.writeField(ipp.localPoints().component(2)()); - // Write all fields - forAll(vsf, i) - { - writer.writeField - ( - writer.getPatchField + // Write all fields + forAll(vsf, i) + { + writer.writeField ( - nearCellValue, - vsf[i], - patchID - )() - ); - } - forAll(vvf, i) - { - writer.writeField - ( - writer.getPatchField + writer.getPatchField + ( + nearCellValue, + vsf[i], + patchID + )() + ); + } + forAll(vvf, i) + { + writer.writeField ( - nearCellValue, - vvf[i], - patchID - )() - ); - } - forAll(vSpheretf, i) - { - writer.writeField - ( - writer.getPatchField + writer.getPatchField + ( + nearCellValue, + vvf[i], + patchID + )() + ); + } + forAll(vSpheretf, i) + { + writer.writeField ( - nearCellValue, - vSpheretf[i], - patchID - )() - ); - } - forAll(vSymmtf, i) - { - writer.writeField - ( - writer.getPatchField + writer.getPatchField + ( + nearCellValue, + vSpheretf[i], + patchID + )() + ); + } + forAll(vSymmtf, i) + { + writer.writeField ( - nearCellValue, - vSymmtf[i], - patchID - )() - ); - } - forAll(vtf, i) - { - writer.writeField - ( - writer.getPatchField + writer.getPatchField + ( + nearCellValue, + vSymmtf[i], + patchID + )() + ); + } + forAll(vtf, i) + { + writer.writeField ( - nearCellValue, - vtf[i], - patchID - )() - ); - } + writer.getPatchField + ( + nearCellValue, + vtf[i], + patchID + )() + ); + } - forAll(psf, i) - { - writer.writeField - ( - psf[i].boundaryField()[patchID].patchInternalField()() - ); + forAll(psf, i) + { + writer.writeField + ( + psf[i].boundaryField()[patchID].patchInternalField()() + ); + } + forAll(pvf, i) + { + writer.writeField + ( + pvf[i].boundaryField()[patchID].patchInternalField()() + ); + } + + writer.writeConnectivity(ipp); } - forAll(pvf, i) + else { - writer.writeField - ( - pvf[i].boundaryField()[patchID].patchInternalField()() - ); + Info<< " Skipping zero sized patch " << patchID + << "\t" << pp.name() + << nl << endl; } - - writer.writeConnectivity(ipp); } writer.writeEnd(); -- 2.11.4.GIT