diff --git a/src/surfMesh/writers/null/nullSurfaceWriter.H b/src/surfMesh/writers/null/nullSurfaceWriter.H index 2174a566945a2f7500415d74107a944ffc06d935..e8817c4e0265e5f644da1a6d4a5ed8e31bf16d9c 100644 --- a/src/surfMesh/writers/null/nullSurfaceWriter.H +++ b/src/surfMesh/writers/null/nullSurfaceWriter.H @@ -108,7 +108,7 @@ public: virtual void setSurface ( const meshedSurf& s, - bool parallel = Pstream::parRun() + bool parallel ); // override //- Change association with a surface (no-op). @@ -116,7 +116,7 @@ public: ( const pointField& points, const faceList& faces, - bool parallel = Pstream::parRun() + bool parallel ); // override diff --git a/src/surfMesh/writers/surfaceWriter.C b/src/surfMesh/writers/surfaceWriter.C index 625a82505622949497f686dedf4846f828ccf68a..dbdc60e2d087c16f10068292f663e44aa392fefa 100644 --- a/src/surfMesh/writers/surfaceWriter.C +++ b/src/surfMesh/writers/surfaceWriter.C @@ -185,6 +185,12 @@ Foam::surfaceWriter::surfaceWriter } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceWriter::~surfaceWriter() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::surfaceWriter::setTime(const instant& inst) @@ -264,6 +270,31 @@ void Foam::surfaceWriter::open } +void Foam::surfaceWriter::open +( + const meshedSurf& surf, + const fileName& outputPath +) +{ + close(); + setSurface(surf, parallel_); + open(outputPath); +} + + +void Foam::surfaceWriter::open +( + const pointField& points, + const faceList& faces, + const fileName& outputPath +) +{ + close(); + setSurface(points, faces, parallel_); + open(outputPath); +} + + void Foam::surfaceWriter::close() { outputPath_.clear(); @@ -286,6 +317,7 @@ void Foam::surfaceWriter::setSurface { expire(); surf_ = std::cref<meshedSurf>(surf); + parallel_ = (parallel && Pstream::parRun()); } @@ -301,6 +333,25 @@ void Foam::surfaceWriter::setSurface } +void Foam::surfaceWriter::setSurface +( + const meshedSurf& surf +) +{ + setSurface(surf, parallel_); +} + + +void Foam::surfaceWriter::setSurface +( + const pointField& points, + const faceList& faces +) +{ + setSurface(points, faces, parallel_); +} + + bool Foam::surfaceWriter::needsUpdate() const { return !upToDate_; diff --git a/src/surfMesh/writers/surfaceWriter.H b/src/surfMesh/writers/surfaceWriter.H index 47ff76137161da8362afb8ff1323f0a14040687c..0686d333047237e0b5d0d808beda871cce7bf095 100644 --- a/src/surfMesh/writers/surfaceWriter.H +++ b/src/surfMesh/writers/surfaceWriter.H @@ -261,7 +261,7 @@ public: //- Destructor - virtual ~surfaceWriter() = default; + virtual ~surfaceWriter(); // Member Functions @@ -301,19 +301,36 @@ public: // Surface association - //- Change association with a surface and expire the writer + //- Change association with a surface, expire the writer + //- with defined parallel/serial treatment virtual void setSurface ( const meshedSurf& surf, - bool parallel = Pstream::parRun() + bool parallel ); - //- Change association with a surface and expire the writer + //- Change association with a surface, expire the writer + //- with defined parallel/serial treatment virtual void setSurface ( const pointField& points, const faceList& faces, - bool parallel = Pstream::parRun() + bool parallel + ); + + //- Change association with a surface, expire the writer + //- with the current parallel/serial treatment + virtual void setSurface + ( + const meshedSurf& surf + ); + + //- Change association with a surface, expire the writer + //- with the current parallel/serial treatment + virtual void setSurface + ( + const pointField& points, + const faceList& faces ); @@ -407,7 +424,7 @@ public: const pointField& points, const faceList& faces, const fileName& outputPath, - bool parallel = Pstream::parRun() + bool parallel ); //- Open from components @@ -415,7 +432,22 @@ public: ( const meshedSurf& surf, const fileName& outputPath, - bool parallel = Pstream::parRun() + bool parallel + ); + + //- Open from components, with the current parallel/serial treatment + virtual void open + ( + const pointField& points, + const faceList& faces, + const fileName& outputPath + ); + + //- Open from components, with the current parallel/serial treatment + virtual void open + ( + const meshedSurf& surf, + const fileName& outputPath ); //- Finish output, performing any necessary cleanup diff --git a/src/surfMesh/writers/vtk/vtkSurfaceWriter.C b/src/surfMesh/writers/vtk/vtkSurfaceWriter.C index 65fd1b122e5d71e037bb542f8acc42e0f4709636..a259d8dc183508a3fb8250c5e0f693f92530400d 100644 --- a/src/surfMesh/writers/vtk/vtkSurfaceWriter.C +++ b/src/surfMesh/writers/vtk/vtkSurfaceWriter.C @@ -150,6 +150,12 @@ Foam::surfaceWriters::vtkWriter::vtkWriter } +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceWriters::vtkWriter::~vtkWriter() +{} + + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // void Foam::surfaceWriters::vtkWriter::close() diff --git a/src/surfMesh/writers/vtk/vtkSurfaceWriter.H b/src/surfMesh/writers/vtk/vtkSurfaceWriter.H index d9872b35cfbaffd1fc048063cd69f158d0f9cc3d..2c4e2652fd5d2da16375d7bf41b54a0033211c29 100644 --- a/src/surfMesh/writers/vtk/vtkSurfaceWriter.H +++ b/src/surfMesh/writers/vtk/vtkSurfaceWriter.H @@ -159,7 +159,7 @@ public: //- Destructor - virtual ~vtkWriter() = default; + virtual ~vtkWriter(); // Member Functions