mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
committed by
Andrew Heather
parent
b7592c1ee8
commit
5b29ff0e42
@ -161,11 +161,12 @@ bool Foam::functionObjects::Curle::read(const dictionary& dict)
|
||||
<< abort(FatalIOError);
|
||||
}
|
||||
|
||||
const word surfaceType(dict.get<word>("surfaceType"));
|
||||
const word writerType = dict.get<word>("surfaceType");
|
||||
|
||||
surfaceWriterPtr_ = surfaceWriter::New
|
||||
(
|
||||
surfaceType,
|
||||
dict.subOrEmptyDict("formatOptions").subOrEmptyDict(surfaceType)
|
||||
writerType,
|
||||
surfaceWriter::formatOptions(dict, writerType)
|
||||
);
|
||||
|
||||
// Use outputDir/TIME/surface-name
|
||||
|
||||
@ -1138,14 +1138,14 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
|
||||
|
||||
if (writeFields_)
|
||||
{
|
||||
const word formatName(dict.get<word>("surfaceFormat"));
|
||||
const word writerType = dict.get<word>("surfaceFormat");
|
||||
|
||||
surfaceWriterPtr_.reset
|
||||
(
|
||||
surfaceWriter::New
|
||||
(
|
||||
formatName,
|
||||
dict.subOrEmptyDict("formatOptions").subOrEmptyDict(formatName)
|
||||
writerType,
|
||||
surfaceWriter::formatOptions(dict, writerType)
|
||||
)
|
||||
);
|
||||
|
||||
@ -1159,7 +1159,7 @@ bool Foam::functionObjects::fieldValues::surfaceFieldValue::read
|
||||
|
||||
if (surfaceWriterPtr_->enabled())
|
||||
{
|
||||
Info<< " surfaceFormat = " << formatName << nl;
|
||||
Info<< " surfaceFormat = " << writerType << nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -181,7 +181,7 @@ bool Foam::areaWrite::read(const dictionary& dict)
|
||||
|
||||
const dictionary writerOptions
|
||||
(
|
||||
dict.subOrEmptyDict("formatOptions").subOrEmptyDict(writerType)
|
||||
surfaceWriter::formatOptions(dict, writerType)
|
||||
);
|
||||
|
||||
for (const word& areaName : meshes_.keys())
|
||||
|
||||
Reference in New Issue
Block a user