ENH: consolidate 'formatOptions' handling for coordSetWriter/surfaceWriter

- replaced ad hoc handling of formatOptions with coordSetWriter and
  surfaceWriter helpers.

  Accompanying this change, it is now possible to specify "default"
  settings to be inherited, format-specific settings and have a
  similar layering with surface-specific overrides.

- snappyHexMesh now conforms to setFormats

  Eg,

      formatOptions
      {
          default
          {
              verbose     true;
              format      binary;
          }
          vtk
          {
              precision   10;
          }
     }

     surfaces
     {
         surf1
         {
             ...

             formatOptions
             {
                 ensight
                 {
                     scale   1000;
                 }
             }
         }
     }
This commit is contained in:
Mark Olesen
2022-11-08 14:52:58 +01:00
committed by Andrew Heather
parent b7592c1ee8
commit 5b29ff0e42
20 changed files with 336 additions and 84 deletions

View File

@ -355,16 +355,20 @@ void Foam::functionObjects::propellerInfo::setSampleDiskSurface
points_
);
// Surface writer
word surfWriterType;
if (sampleDiskDict.readIfPresent("surfaceWriter", surfWriterType))
{
const auto writeOptions = sampleDiskDict.subOrEmptyDict("writeOptions");
// Surface writer (keywords: surfaceWriter, writeOptions)
word writerType;
if (sampleDiskDict.readIfPresent("surfaceWriter", writerType))
{
surfaceWriterPtr_ = surfaceWriter::New
(
surfWriterType,
writeOptions.subOrEmptyDict(surfWriterType)
writerType,
surfaceWriter::formatOptions
(
sampleDiskDict,
writerType,
"writeOptions"
)
);
// Use outputDir/TIME/surface-name