36 #ifndef Foam_ensightFile_H 37 #define Foam_ensightFile_H 60 static bool allowUndef_;
63 static float undefValue_;
97 return NullObjectRef<ensightFile>();
198 virtual Ostream&
write(
const std::string& str)
override;
207 Ostream&
write(
const label value,
const label fieldWidth);
static const ensightFile & null()
Return a null ensightFile.
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
void writeBinaryHeader()
Write "C Binary" string for binary files (eg, geometry/measured)
A class for handling keywords in dictionaries.
A class for handling file names.
Output to file stream, using an OSstream.
A token holds an item read from Istream.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
static const char *const coordinates
The keyword "coordinates".
void beginPart(const label index)
Begin a part (0-based index internally).
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void writeUndef()
Write undef value.
void beginTimeStep()
Write "BEGIN TIME STEP" string and newline.
void writeLabels(const UList< label > &list)
Write a list of integers.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
void beginParticleCoordinates(const label nparticles)
Begin a "particle coordinates" block (measured data)
float floatType
Ensight uses float not double for floating-point.
void writeString(const char *str, size_t len)
Write character/string content as "%79s" or as binary (max 80 chars)
virtual bool write(const token &) override
Writing token does not make sense.
void newline()
Add carriage return to ascii stream.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
void writeList(const UList< label > &field)
Write a list of integers as float values.
streamFormat
Data format (ascii | binary)
static float undefValue(float value) noexcept
Assign the value to represent undef in the results.
void endTimeStep()
Write "END TIME STEP" string and newline.
static bool hasUndef(const UList< float > &field)
Check for any NaN in the field.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
~ensightFile()=default
Destructor.
static bool allowUndef() noexcept
Return setting for whether 'undef' values are allowed in results.
Ostream(const Ostream &)=default
Copy construct.
virtual Ostream & writeKeyword(const keyType &key) override
Write element keyword with trailing newline, optionally with undef and the value for undefined...