Filter out zero-sized patches; add generic capability

This commit is contained in:
mattijs
2009-12-09 17:42:30 +00:00
parent 352ef55b6d
commit e8af5d62d5
2 changed files with 101 additions and 91 deletions

View File

@ -9,4 +9,5 @@ EXE_LIBS = \
-ltecio \ -ltecio \
-llagrangian \ -llagrangian \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \
-lmeshTools -lmeshTools

View File

@ -909,106 +909,115 @@ int main(int argc, char *argv[])
const polyPatch& pp = patches[patchID]; const polyPatch& pp = patches[patchID];
//INTEGER4 strandID = 1 + i; //INTEGER4 strandID = 1 + i;
Info<< " Writing patch " << patchID << "\t" << pp.name() if (pp.size() > 0)
<< "\tstrand:" << strandID << nl << endl;
const indirectPrimitivePatch ipp
(
IndirectList<face>(pp, identity(pp.size())),
pp.points()
);
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 all fields
forAll(vsf, i)
{ {
writer.writeField Info<< " Writing patch " << patchID << "\t" << pp.name()
<< "\tstrand:" << strandID << nl << endl;
const indirectPrimitivePatch ipp
( (
writer.getPatchField IndirectList<face>(pp, identity(pp.size())),
pp.points()
);
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 all fields
forAll(vsf, i)
{
writer.writeField
( (
nearCellValue, writer.getPatchField
vsf[i], (
patchID nearCellValue,
)() vsf[i],
); patchID
} )()
forAll(vvf, i) );
{ }
writer.writeField forAll(vvf, i)
( {
writer.getPatchField writer.writeField
( (
nearCellValue, writer.getPatchField
vvf[i], (
patchID nearCellValue,
)() vvf[i],
); patchID
} )()
forAll(vSpheretf, i) );
{ }
writer.writeField forAll(vSpheretf, i)
( {
writer.getPatchField writer.writeField
( (
nearCellValue, writer.getPatchField
vSpheretf[i], (
patchID nearCellValue,
)() vSpheretf[i],
); patchID
} )()
forAll(vSymmtf, i) );
{ }
writer.writeField forAll(vSymmtf, i)
( {
writer.getPatchField writer.writeField
( (
nearCellValue, writer.getPatchField
vSymmtf[i], (
patchID nearCellValue,
)() vSymmtf[i],
); patchID
} )()
forAll(vtf, i) );
{ }
writer.writeField forAll(vtf, i)
( {
writer.getPatchField writer.writeField
( (
nearCellValue, writer.getPatchField
vtf[i], (
patchID nearCellValue,
)() vtf[i],
); patchID
} )()
);
}
forAll(psf, i) forAll(psf, i)
{ {
writer.writeField writer.writeField
( (
psf[i].boundaryField()[patchID].patchInternalField()() psf[i].boundaryField()[patchID].patchInternalField()()
); );
} }
forAll(pvf, i) forAll(pvf, i)
{ {
writer.writeField writer.writeField
( (
pvf[i].boundaryField()[patchID].patchInternalField()() pvf[i].boundaryField()[patchID].patchInternalField()()
); );
} }
writer.writeConnectivity(ipp); writer.writeConnectivity(ipp);
}
else
{
Info<< " Skipping zero sized patch " << patchID
<< "\t" << pp.name()
<< nl << endl;
}
} }
writer.writeEnd(); writer.writeEnd();