ENH: support user specification of ensight time format/precision (#2999)

- new format option keywords: timeFormat, timePrecision

CONFIG: default ensight output is now consistently BINARY

- this removes some uncertainty with the ensightWrite functionObject
  which was previously dependent on the simulation writeFormat
  and makes its behaviour consistent with foamToEnsight

  Note: binary Ensight output is consistent with the
  defaults for VTP output (inline binary)

ENH: minor adjustment of ensight writing methods
This commit is contained in:
Mark Olesen
2023-10-17 15:00:29 +02:00
committed by Andrew Heather
parent 8ec35d0b26
commit dafae668d1
23 changed files with 458 additions and 225 deletions

View File

@ -34,23 +34,32 @@ License
void Foam::ensightGeoFile::init()
{
writeBinaryHeader();
beginGeometry();
}
void Foam::ensightGeoFile::beginGeometry()
{
// Description line 1
write("Ensight Geometry File");
writeString("Ensight Geometry File");
newline();
// Description line 2
write(string("Written by OpenFOAM " + std::to_string(foamVersion::api)));
writeString("Written by OpenFOAM " + std::to_string(foamVersion::api));
newline();
write("node id assign");
writeString("node id assign");
newline();
write("element id assign");
writeString("element id assign");
newline();
}
void Foam::ensightGeoFile::endGeometry()
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::ensightGeoFile::ensightGeoFile
@ -96,7 +105,7 @@ Foam::Ostream& Foam::ensightGeoFile::writeKeyword(const keyType& key)
void Foam::ensightGeoFile::beginPart
(
const label index,
const string& description
const std::string& description
)
{
beginPart(index);