ENH: use vtk::surfaceWriter in shortestPathSet debugging

This commit is contained in:
Mark Olesen
2019-02-07 09:45:13 +01:00
committed by Andrew Heather
parent 3a6e596a09
commit 2016f88eba

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -33,10 +33,8 @@ License
#include "fvMesh.H" #include "fvMesh.H"
#include "volFields.H" #include "volFields.H"
#include "OBJstream.H" #include "OBJstream.H"
#include "surfaceWriter.H"
#include "meshedSurfRef.H"
#include "PatchTools.H" #include "PatchTools.H"
#include "vtkSurfaceWriter.H" #include "foamVtkSurfaceWriter.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -840,20 +838,16 @@ Foam::shortestPathSet::shortestPathSet
{ {
if (debug) if (debug)
{ {
fileName outputDir; fileName outputDir =
if (Pstream::master()) (
{ mesh.time().globalPath()
outputDir = / functionObject::outputPrefix
mesh.time().globalPath() / mesh.pointsInstance()
/ functionObject::outputPrefix );
/ mesh.pointsInstance(); outputDir.clean();
outputDir.clean();
mkDir(outputDir);
Info<< "shortestPathSet : Writing blocked faces to "
<< outputDir << endl;
}
const vtkSurfaceWriter surfWriter; Info<< "shortestPathSet : Writing blocked faces to "
<< outputDir << endl;
const indirectPrimitivePatch setPatch const indirectPrimitivePatch setPatch
( (
@ -864,8 +858,10 @@ Foam::shortestPathSet::shortestPathSet
), ),
mesh.points() mesh.points()
); );
if (Pstream::parRun()) if (Pstream::parRun())
{ {
// Topological merge
labelList pointToGlobal; labelList pointToGlobal;
labelList uniqueMeshPointLabels; labelList uniqueMeshPointLabels;
autoPtr<globalIndex> globalPoints; autoPtr<globalIndex> globalPoints;
@ -891,30 +887,28 @@ Foam::shortestPathSet::shortestPathSet
// Write // Write
if (Pstream::master()) if (Pstream::master())
{ {
surfWriter.write vtk::surfaceWriter writer
( (
outputDir, mergedPoints,
"blockedFace", mergedFaces,
meshedSurfRef (outputDir / "blockedFace"),
( false // serial only - already merged
mergedPoints,
mergedFaces
)
); );
writer.writeGeometry();
} }
} }
else else
{ {
surfWriter.write vtk::surfaceWriter writer
( (
outputDir, setPatch.localPoints(),
"blockedFace", setPatch.localFaces(),
meshedSurfRef (outputDir / "blockedFace"),
( false // serial only - redundant
setPatch.localPoints(),
setPatch.localFaces()
)
); );
writer.writeGeometry();
} }
} }