Commit 255e4735 authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

BUG: surface writer for surfaceNoise was not Time-aware

- the updated surface writers must be explicitly tagged as being
  Time-aware (useTimeDir) to have them splice Time (in this case freq)
  into the output path.

  The older writers worked in the opposite way. They extracted a time
  value from the naming of the output directory (which was fragile).
parent a2906d43
...@@ -235,7 +235,7 @@ Foam::scalar surfaceNoise::writeSurfaceData ...@@ -235,7 +235,7 @@ Foam::scalar surfaceNoise::writeSurfaceData
{ {
Info<< " processing " << title << " for frequency " << freq << endl; Info<< " processing " << title << " for frequency " << freq << endl;
const fileName outDir(outDirBase/Foam::name(freq)); const instant freqInst(freq, Foam::name(freq));
if (Pstream::parRun()) if (Pstream::parRun())
{ {
...@@ -277,16 +277,20 @@ Foam::scalar surfaceNoise::writeSurfaceData ...@@ -277,16 +277,20 @@ Foam::scalar surfaceNoise::writeSurfaceData
if (writeSurface) if (writeSurface)
{ {
// Time-aware, with time spliced into the output path
writerPtr_->beginTime(freqInst);
writerPtr_->open writerPtr_->open
( (
surf.points(), surf.points(),
surf.surfFaces(), surf.surfFaces(),
(outDir / fName), (outDirBase / fName),
false // serial - already merged false // serial - already merged
); );
writerPtr_->write(title, allData); writerPtr_->write(title, allData);
writerPtr_->endTime();
writerPtr_->clear(); writerPtr_->clear();
} }
...@@ -304,16 +308,20 @@ Foam::scalar surfaceNoise::writeSurfaceData ...@@ -304,16 +308,20 @@ Foam::scalar surfaceNoise::writeSurfaceData
if (writeSurface) if (writeSurface)
{ {
// Time-aware, with time spliced into the output path
writerPtr_->beginTime(freqInst);
writerPtr_->open writerPtr_->open
( (
surf.points(), surf.points(),
surf.surfFaces(), surf.surfFaces(),
(outDir / fName), (outDirBase / fName),
false // serial - already merged false // serial - already merged
); );
writerPtr_->write(title, data); writerPtr_->write(title, data);
writerPtr_->endTime();
writerPtr_->clear(); writerPtr_->clear();
} }
...@@ -442,6 +450,9 @@ bool surfaceNoise::read(const dictionary& dict) ...@@ -442,6 +450,9 @@ bool surfaceNoise::read(const dictionary& dict)
dict.subOrEmptyDict("writeOptions").subOrEmptyDict(writerType) dict.subOrEmptyDict("writeOptions").subOrEmptyDict(writerType)
); );
// Use outputDir/TIME/surface-name
writerPtr_->useTimeDir() = true;
return true; return true;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment