ENH: improved sample surfaces and surface writers (#1206)

- The writers have changed from being a generic state-less set of
  routines to more properly conforming to the normal notion of a writer.
  These changes allow us to combine output fields (eg, in a single
  VTK/vtp file for each timestep).

  Parallel data reduction and any associated bookkeeping is now part
  of the surface writers.
  This improves their re-usability and avoids unnecessary
  and premature data reduction at the sampling stage.

  It is now possible to have different output formats on a per-surface
  basis.

- A new feature of the surface sampling is the ability to "store" the
  sampled surfaces and fields onto a registry for reuse by other
  function objects.

  Additionally, the "store" can be triggered at the execution phase
  as well
This commit is contained in:
Mark Olesen
2019-02-07 18:11:34 +01:00
committed by Andrew Heather
parent 16bc63864e
commit 181c974b11
70 changed files with 6034 additions and 4784 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -275,22 +275,19 @@ Foam::scalar surfaceNoise::writeSurfaceData
}
}
// Could also have meshedSurface implement meshedSurf
if (writeSurface)
{
fileName outFileName = writerPtr_->write
writerPtr_->open
(
outDir,
fName,
meshedSurfRef
(
surf.points(),
surf.surfFaces()
),
title,
allData,
false
surf.points(),
surf.surfFaces(),
(outDir / fName),
false // serial - already merged
);
writerPtr_->write(title, allData);
writerPtr_->clear();
}
// TO BE VERIFIED: area-averaged values
@ -305,22 +302,19 @@ Foam::scalar surfaceNoise::writeSurfaceData
{
const meshedSurface& surf = readerPtr_->geometry();
// Could also have meshedSurface implement meshedSurf
if (writeSurface)
{
writerPtr_->write
writerPtr_->open
(
outDir,
fName,
meshedSurfRef
(
surf.points(),
surf.surfFaces()
),
title,
data,
false
surf.points(),
surf.surfFaces(),
(outDir / fName),
false // serial - already merged
);
writerPtr_->write(title, data);
writerPtr_->clear();
}
// TO BE VERIFIED: area-averaged values
@ -442,13 +436,12 @@ bool surfaceNoise::read(const dictionary& dict)
const word writerType(dict.get<word>("writer"));
dictionary optDict
writerPtr_ = surfaceWriter::New
(
writerType,
dict.subOrEmptyDict("writeOptions").subOrEmptyDict(writerType)
);
writerPtr_ = surfaceWriter::New(writerType, optDict);
return true;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2015-2018 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2015-2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,7 +111,7 @@ SeeAlso
namespace Foam
{
// Forward declaration of classes
// Forward declarations
class surfaceReader;
class surfaceWriter;