ENH: improvements for foamVtkOutput, foamVtkFormatter (issue #926)

- parallel list output for foamVtkOutput

- simplified '.series' file output

- beginDataArray() method instead of openDataArray() + closeTag()
  since this seems to be the most common use anyhow.
  With an optional argument for leaving the tag open, this works the
  same as openDataArray() which may be deprecated in the future.

- begin/end methods for CellData, PointData, FieldData (commonly used)

- templating parameters for file headers, content version,
  legacy fields. This improves coding robustness and convenience of use.

- use formatter and higher-level methods for legacy output

- attribute quoting character now part of the formatter itself
  instead of as an argument for xmlAttr().
  Toggle with quoting() method.

- pair-wise processing of xml attributes, which also allows them to be
  passed as optional entries when creating an xml tag.

- xmlComment with multiple arguments
This commit is contained in:
Mark Olesen
2018-09-17 08:59:03 +02:00
parent 19e03f7dd1
commit 05427217a0
41 changed files with 1957 additions and 603 deletions

View File

@ -466,10 +466,12 @@ bool Foam::functionObjects::vtkCloud::write()
// Each cloud separately
for (const word& cloudName : cloudNames)
{
const word prefix(cloudName + "_");
const word suffix(".vtp"); // No legacy supported
// Legacy is not to be supported
const fileName outputName(vtkDir/prefix + timeDesc + suffix);
const fileName outputName
(
vtkDir/cloudName + "_" + timeDesc + ".vtp"
);
if (writeCloud(outputName, cloudName))
{
@ -483,9 +485,11 @@ bool Foam::functionObjects::vtkCloud::write()
series_(cloudName).append({time_.value(), timeDesc});
OFstream os(vtkDir/cloudName + ".vtp.series", IOstream::ASCII);
vtk::writeSeries(os, prefix, suffix, series_[cloudName]);
vtk::seriesWrite
(
vtkDir/cloudName + ".vtp",
series_[cloudName]
);
}
}
}