foanToVTK: Compatibility with NCC

foamToVTK now supports cases with non-conformal patches. These are
excluded from the final output because their faces do not correspond to
anything in the conformal polyMesh.

In addition, patches are now excluded due to type or selection
consistently, regardless of the presence of the -allPatches option.
This commit is contained in:
Will Bainbridge
2022-08-10 11:23:37 +01:00
parent 436c6e4403
commit 65b7979147

View File

@ -137,6 +137,7 @@ Usage
#include "pointMesh.H"
#include "volPointInterpolation.H"
#include "emptyPolyPatch.H"
#include "nonConformalPolyPatch.H"
#include "labelIOField.H"
#include "scalarIOField.H"
#include "sphericalTensorIOField.H"
@ -204,12 +205,13 @@ labelList getSelectedPatches
if
(
isType<emptyPolyPatch>(pp)
isA<emptyPolyPatch>(pp)
|| isA<nonConformalPolyPatch>(pp)
|| (Pstream::parRun() && isType<processorPolyPatch>(pp))
)
{
Info<< " discarding empty/processor patch " << patchi
<< " " << pp.name() << endl;
Info<< " discarding empty/nonConformal/processor patch "
<< patchi << " " << pp.name() << endl;
}
else if (findStrings(excludePatches, pp.name()))
{
@ -222,6 +224,7 @@ labelList getSelectedPatches
Info<< " patch " << patchi << " " << pp.name() << endl;
}
}
return patchIDs.shrink();
}
@ -873,6 +876,8 @@ int main(int argc, char *argv[])
const polyBoundaryMesh& patches = mesh.boundaryMesh();
const labelList patchIDs(getSelectedPatches(patches, excludePatches));
if (allPatches)
{
mkDir(fvPath/"allPatches");
@ -944,12 +949,10 @@ int main(int argc, char *argv[])
}
else
{
forAll(patches, patchi)
forAll(patchIDs, i)
{
const polyPatch& pp = patches[patchi];
const polyPatch& pp = patches[patchIDs[i]];
if (!findStrings(excludePatches, pp.name()))
{
mkDir(fvPath/pp.name());
fileName patchFileName;
@ -979,11 +982,9 @@ int main(int argc, char *argv[])
binary,
nearCellValue,
patchFileName,
labelList(1, patchi)
labelList(1, patchIDs[i])
);
if (!isA<emptyPolyPatch>(pp))
{
// VolFields + patchID
vtkWriteOps::writeCellDataHeader
(
@ -1033,8 +1034,6 @@ int main(int argc, char *argv[])
}
}
}
}
}
//---------------------------------------------------------------------
//