From a4f6836f3e06855dcd1d7087e30a10ea4b5aa9e7 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Wed, 29 Jun 2016 23:11:27 +0200 Subject: [PATCH] BUG: avoid duplicate ensight surface mesh/geometries (issue #167) - ensight does supports geometry in a separate file, but for the surface writer we claim that this is not true. This allows the field writers to control where the mesh/case files land. With 'true', the uncollated output would incidentally create things like this: Previous (w/ fields) | Now (w/ fields) ----------------------------+---------------------- 0.05/surf.case | 0.05/surf.mesh | 0.05/p/surf.case | 0.05/p/surf.case 0.05/p/surf.mesh | 0.05/p/surf.mesh 0.05/p/surf.0000.p | 0.05/p/surf.0000.p Previous (w/o fields) | Now (w/o fields) ----------------------------+---------------------- 0.05/surf.case | 0.05/surf.mesh 0.05/surf.case | 0.05/surf.mesh Move the separateGeometry() flag to the *.C code, where it is less likely to be mistakenly altered. --- .../writers/ensight/ensightSurfaceWriter.C | 11 +++++++++++ .../writers/ensight/ensightSurfaceWriter.H | 5 +---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C index e8c5589d7d..c81f727add 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.C @@ -68,6 +68,17 @@ Foam::ensightSurfaceWriter::~ensightSurfaceWriter() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +// Note that ensight does supports geometry in a separate file, +// but setting this true leaves mesh files in the wrong places +// (when there are fields). +// +// Make this false to let the field writers take back control +bool Foam::ensightSurfaceWriter::separateGeometry() const +{ + return false; +} + + Foam::fileName Foam::ensightSurfaceWriter::write ( const fileName& outputDir, diff --git a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H index 67da74a193..d04e69146d 100644 --- a/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H +++ b/src/sampling/sampledSurface/writers/ensight/ensightSurfaceWriter.H @@ -126,10 +126,7 @@ public: //- True if the surface format supports geometry in a separate file. // False if geometry and field must be in a single file - virtual bool separateGeometry() const - { - return !collateTimes_; - } + virtual bool separateGeometry() const; //- Write single surface geometry to file.