Ensight output with specialized write() for strings, integers and floats. Correctly handles binary write as well. More...
Public Member Functions | |
ensightFile (const fileName &pathname, IOstream::streamFormat format=IOstream::BINARY) | |
ensightFile (const fileName &path, const fileName &name, IOstream::streamFormat format=IOstream::BINARY) | |
~ensightFile ()=default | |
virtual Ostream & | writeKeyword (const keyType &key) |
Ostream & | writeBinaryHeader () |
Ostream & | writeString (const char *str) |
Ostream & | writeString (const std::string &str) |
Ostream & | writeUndef () |
virtual bool | write (const token &) |
virtual Ostream & | write (const char) |
virtual Ostream & | write (const char *buf, std::streamsize count) |
virtual Ostream & | write (const char *str) |
virtual Ostream & | write (const word &str) |
virtual Ostream & | write (const string &str) |
virtual Ostream & | write (const int32_t val) |
virtual Ostream & | write (const int64_t val) |
Ostream & | write (const label value, const label fieldWidth) |
virtual Ostream & | write (const floatScalar val) |
virtual Ostream & | write (const doubleScalar val) |
void | newline () |
void | beginPart (const label index) |
void | beginParticleCoordinates (const label nparticles) |
void | writeLabels (const UList< label > &list) |
template<class Addr > | |
void | writeLabels (const IndirectListBase< label, Addr > &list) |
void | writeList (const UList< label > &field) |
void | writeList (const UList< scalar > &field) |
template<class Addr > | |
void | writeList (const IndirectListBase< scalar, Addr > &field) |
![]() | |
ClassName ("OFstream") | |
OFstream (std::nullptr_t) | |
OFstream (const fileName &pathname, IOstreamOption streamOpt=IOstreamOption(), const bool append=false) | |
OFstream (const fileName &pathname, IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED, const bool append=false) | |
~OFstream ()=default | |
virtual std::ostream & | stdStream () |
virtual const std::ostream & | stdStream () const |
virtual void | rewind () |
void | print (Ostream &os) const |
virtual const fileName & | name () const |
virtual fileName & | name () |
![]() | |
OSstream (const OSstream &)=default | |
void | operator= (const OSstream &)=delete |
OSstream (std::ostream &os, const string &streamName, IOstreamOption streamOpt=IOstreamOption()) | |
OSstream (std::ostream &os, const string &streamName, IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
virtual const fileName & | name () const |
virtual fileName & | name () |
virtual ios_base::fmtflags | flags () const |
virtual Ostream & | writeQuoted (const std::string &str, const bool quoted=true) |
virtual Ostream & | writeRaw (const char *data, std::streamsize count) |
virtual bool | beginRawWrite (std::streamsize count) |
virtual bool | endRawWrite () |
virtual void | indent () |
virtual ios_base::fmtflags | flags (const ios_base::fmtflags f) |
virtual void | flush () |
virtual void | endl () |
virtual char | fill () const |
virtual char | fill (const char fillch) |
virtual int | width () const |
virtual int | width (const int w) |
virtual int | precision () const |
virtual int | precision (const int p) |
![]() | |
Ostream (const Ostream &)=default | |
virtual | ~Ostream ()=default |
Ostream (IOstreamOption streamOpt=IOstreamOption()) | |
Ostream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver=IOstreamOption::currentVersion, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
virtual Ostream & | write (const keyType &kw) |
unsigned short | indentSize () const noexcept |
unsigned short | indentSize (unsigned short val) noexcept |
unsigned short | indentLevel () const noexcept |
unsigned short | indentLevel (unsigned short val) noexcept |
void | incrIndent () noexcept |
void | decrIndent () |
virtual Ostream & | beginBlock (const keyType &kw) |
virtual Ostream & | beginBlock () |
virtual Ostream & | endBlock () |
virtual Ostream & | endEntry () |
template<class T > | |
Ostream & | writeEntry (const keyType &key, const T &value) |
template<class T > | |
Ostream & | writeEntryIfDifferent (const word &key, const T &value1, const T &value2) |
Ostream & | operator() () const |
unsigned short & | indentLevel () noexcept |
unsigned short & | indentSize () noexcept |
![]() | |
IOstream (const IOstream &)=default | |
virtual | ~IOstream ()=default |
IOstream (IOstreamOption streamOpt=IOstreamOption()) | |
IOstream (IOstreamOption::streamFormat fmt, IOstreamOption::versionNumber ver, IOstreamOption::compressionType cmp=IOstreamOption::UNCOMPRESSED) | |
fileName | relativeName () const |
virtual bool | check (const char *operation) const |
bool | fatalCheck (const char *operation) const |
bool | opened () const noexcept |
bool | closed () const noexcept |
bool | good () const noexcept |
bool | eof () const noexcept |
bool | fail () const noexcept |
bool | bad () const noexcept |
operator bool () const noexcept | |
bool | operator! () const noexcept |
unsigned | labelByteSize () const noexcept |
unsigned | scalarByteSize () const noexcept |
void | setLabelByteSize (unsigned nbytes) noexcept |
void | setScalarByteSize (unsigned nbytes) noexcept |
template<class T = label> | |
std::enable_if< std::is_integral< T >::value, bool >::type | checkLabelSize () const noexcept |
template<class T = scalar> | |
std::enable_if< std::is_floating_point< T >::value, bool >::type | checkScalarSize () const noexcept |
label | lineNumber () const noexcept |
label & | lineNumber () noexcept |
label | lineNumber (const label num) noexcept |
void | setEof () noexcept |
void | setFail () noexcept |
void | setBad () |
ios_base::fmtflags | setf (const ios_base::fmtflags f) |
ios_base::fmtflags | setf (const ios_base::fmtflags f, const ios_base::fmtflags mask) |
void | unsetf (const ios_base::fmtflags f) |
void | print (Ostream &os, const int streamState) const |
InfoProxy< IOstream > | info () const |
![]() | |
constexpr | IOstreamOption (streamFormat fmt=streamFormat::ASCII, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
constexpr | IOstreamOption (streamFormat fmt, compressionType comp, versionNumber ver) noexcept |
constexpr | IOstreamOption (streamFormat fmt, versionNumber ver, compressionType comp=compressionType::UNCOMPRESSED) noexcept |
IOstreamOption (const IOstreamOption &opt, streamFormat fmt) noexcept | |
streamFormat | format () const noexcept |
streamFormat | format (const streamFormat fmt) noexcept |
streamFormat | format (const word &formatName) |
compressionType | compression () const noexcept |
compressionType | compression (const compressionType comp) noexcept |
compressionType | compression (const word &compName) |
versionNumber | version () const noexcept |
versionNumber | version (const versionNumber ver) noexcept |
versionNumber | version (const token &tok) |
Static Public Member Functions | |
static const ensightFile & | null () |
static bool | allowUndef () |
static string | mask () |
static string | subDir (const label) |
static void | subDirWidth (const label) |
static label | subDirWidth () |
static bool | allowUndef (bool enabled) |
static scalar | undefValue (const scalar value) |
static bool | isUndef (const UList< scalar > &field) |
template<class Addr > | |
static bool | isUndef (const IndirectListBase< scalar, Addr > &field) |
![]() | |
static unsigned int | defaultPrecision () noexcept |
static unsigned int | defaultPrecision (unsigned int prec) noexcept |
![]() | |
static streamFormat | formatEnum (const word &formatName, const streamFormat deflt=streamFormat::ASCII) |
static streamFormat | formatEnum (const word &key, const dictionary &dict, const streamFormat deflt=streamFormat::ASCII) |
static compressionType | compressionEnum (const word &compName, const compressionType deflt=compressionType::UNCOMPRESSED) |
static compressionType | compressionEnum (const word &key, const dictionary &dict, const compressionType deflt=compressionType::UNCOMPRESSED) |
Static Public Attributes | |
static const char *const | coordinates = "coordinates" |
![]() | |
static unsigned int | precision_ |
![]() | |
static const Enum< streamFormat > | formatNames |
static const versionNumber | currentVersion |
Additional Inherited Members | |
![]() | |
enum | streamAccess : char { CLOSED = 0, OPENED } |
![]() | |
enum | streamFormat : char { ASCII = 0, BINARY } |
enum | compressionType : char { UNCOMPRESSED = 0, COMPRESSED } |
![]() | |
void | setOpened () noexcept |
void | setClosed () noexcept |
void | setState (std::ios_base::iostate state) noexcept |
void | setGood () noexcept |
![]() | |
unsigned short | indentSize_ = 4 |
unsigned short | indentLevel_ = 0 |
![]() | |
std::ios_base::iostate | ioState_ |
streamAccess | openClosed_ |
unsigned char | sizeofLabel_ |
unsigned char | sizeofScalar_ |
label | lineNumber_ |
![]() | |
static constexpr const unsigned short | entryIndentation_ = 16 |
![]() | |
static fileName | staticName_ |
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary write as well.
Definition at line 46 of file ensightFile.H.
|
explicit |
Definition at line 113 of file ensightFile.C.
ensightFile | ( | const fileName & | path, |
const fileName & | name, | ||
IOstream::streamFormat | format = IOstream::BINARY |
||
) |
Definition at line 125 of file ensightFile.C.
|
default |
|
inlinestatic |
Definition at line 88 of file ensightFile.H.
|
static |
Definition at line 139 of file ensightFile.C.
|
static |
Definition at line 43 of file ensightFile.C.
|
static |
Definition at line 49 of file ensightFile.C.
References n.
|
static |
Definition at line 58 of file ensightFile.C.
References n.
|
static |
Definition at line 76 of file ensightFile.C.
Definition at line 145 of file ensightFile.C.
|
static |
Definition at line 153 of file ensightFile.C.
|
virtual |
Reimplemented from Ostream.
Reimplemented in ensightGeoFile.
Definition at line 313 of file ensightFile.C.
References Foam::glTF::key(), and Foam::vtk::write().
Referenced by ensightWriter::writeCollated(), and ensightWriter::writeUncollated().
Foam::Ostream & writeBinaryHeader | ( | ) |
Definition at line 332 of file ensightFile.C.
References IOstreamOption::BINARY, and format().
Foam::Ostream & writeString | ( | const char * | str | ) |
Definition at line 164 of file ensightFile.C.
References IOstreamOption::BINARY, format(), and Foam::vtk::write().
Foam::Ostream & writeString | ( | const std::string & | str | ) |
Definition at line 186 of file ensightFile.C.
Foam::Ostream & writeUndef | ( | ) |
Definition at line 306 of file ensightFile.C.
References Foam::vtk::write().
Reimplemented from OSstream.
Definition at line 170 of file ensightFile.H.
References NotImplemented.
|
inlinevirtual |
Reimplemented from OSstream.
Definition at line 177 of file ensightFile.H.
References NotImplemented.
|
virtual |
Reimplemented from OSstream.
Definition at line 211 of file ensightFile.C.
References Foam::BitOps::count().
|
virtual |
Reimplemented from OSstream.
Definition at line 192 of file ensightFile.C.
|
virtual |
Reimplemented from OSstream.
Definition at line 198 of file ensightFile.C.
|
virtual |
Reimplemented from OSstream.
Definition at line 204 of file ensightFile.C.
|
virtual |
Reimplemented from OSstream.
Definition at line 221 of file ensightFile.C.
References IOstreamOption::BINARY, format(), and Foam::vtk::write().
|
virtual |
Reimplemented from OSstream.
Definition at line 241 of file ensightFile.C.
References Foam::narrowInt32(), and Foam::vtk::write().
Foam::Ostream & write | ( | const label | value, |
const label | fieldWidth | ||
) |
Definition at line 278 of file ensightFile.C.
References IOstreamOption::BINARY, format(), and Foam::vtk::write().
|
virtual |
Reimplemented from OSstream.
Definition at line 249 of file ensightFile.C.
References IOstreamOption::BINARY, format(), and Foam::vtk::write().
|
virtual |
Reimplemented from OSstream.
Definition at line 269 of file ensightFile.C.
References Foam::narrowFloat(), and Foam::vtk::write().
void newline | ( | ) |
Definition at line 297 of file ensightFile.C.
References IOstreamOption::ASCII, format(), and Foam::nl.
void beginPart | ( | const label | index | ) |
Definition at line 347 of file ensightFile.C.
References Foam::vtk::write().
void beginParticleCoordinates | ( | const label | nparticles | ) |
Definition at line 356 of file ensightFile.C.
References Foam::vtk::write().
void writeLabels | ( | const UList< label > & | list | ) |
Definition at line 365 of file ensightFile.C.
References Foam::vtk::write().
void writeLabels | ( | const IndirectListBase< label, Addr > & | list | ) |
Definition at line 41 of file ensightFileTemplates.C.
References Foam::vtk::write().
void writeList | ( | const UList< label > & | field | ) |
Definition at line 375 of file ensightFile.C.
References field(), and Foam::vtk::write().
void writeList | ( | const UList< scalar > & | field | ) |
Definition at line 385 of file ensightFile.C.
References field(), and Foam::vtk::write().
void writeList | ( | const IndirectListBase< scalar, Addr > & | field | ) |
Definition at line 52 of file ensightFileTemplates.C.
References field(), and Foam::vtk::write().
Definition at line 82 of file ensightFile.C.
References field().
|
static |
Definition at line 24 of file ensightFileTemplates.C.
References field().
|
static |
Definition at line 82 of file ensightFile.H.
Referenced by ensightGeoFile::beginCoordinates().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.