FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

Ensight output with specialized write() for strings, integers and floats. Correctly handles binary write as well. More...

#include <conversion/ensightFile.H>


Detailed Description

Ensight output with specialized write() for strings, integers and floats. Correctly handles binary write as well.

Definition at line 48 of file ensightFile.H.

Inheritance diagram for ensightFile:
Collaboration diagram for ensightFile:

List of all members.

Public Member Functions

 ensightFile (const fileName &pathname, IOstream::streamFormat format=IOstream::BINARY)
 Construct from pathname.
 ~ensightFile ()
virtual Ostream &  write (const char *buf, std::streamsize count)
 binary write
virtual Ostream &  writeKeyword (const string &key)
 write element keyword with trailing newline, optionally with undef
Ostream &  writeBinaryHeader ()
 write "C Binary" for binary files (eg, geometry/measured)
Ostream &  writeUndef ()
 write undef value
Ostream &  write (const string &value)
 write string as "%80s" or as binary
Ostream &  write (const label &value)
 write integer as "%10d" or as binary
Ostream &  write (const label &value, const label fieldWidth)
 write integer with specified width or as binary
Ostream &  write (const scalar &value)
 write float as "%12.5e" or as binary
void  newline ()
 Add carriage return to ascii stream.

Static Public Member Functions

static bool  allowUndef ()
 Return setting for whether 'undef' values are allowed in results.
static string  mask ()
 '*' mask appropriate for subDir
static string  subDir (const label)
 consistent zero-padded numbers for subdirectories
static bool  allowUndef (bool)
static scalar  undefValue (const scalar &)
 Assign the value to represent undef in the results.

Constructor & Destructor Documentation

ensightFile ( const fileName &   pathname,
IOstream::streamFormat   format = IOstream::BINARY  
)

Construct from pathname.

Definition at line 37 of file ensightFile.C.

References Foam::scientific(), and Foam::setf().

~ensightFile (  )

Definition at line 56 of file ensightFile.C.


Member Function Documentation

bool allowUndef (  ) [static]

Return setting for whether 'undef' values are allowed in results.

Definition at line 62 of file ensightFile.C.

Referenced by ensightPart::writeScalarField(), and ensightPart::writeVectorField().

Foam::string mask (  ) [static]

'*' mask appropriate for subDir

Definition at line 252 of file ensightFile.C.

Foam::string subDir ( const label   n  ) [static]

consistent zero-padded numbers for subdirectories

Definition at line 259 of file ensightFile.C.

bool allowUndef ( bool   value  ) [static]

Definition at line 68 of file ensightFile.C.

Foam::scalar undefValue ( const scalar &   value  ) [static]

Assign the value to represent undef in the results.

Returns the previous value NB: do not use values larger than floatScalarVGREAT

Definition at line 76 of file ensightFile.C.

Foam::Ostream & write ( const char *   buf,
std::streamsize   count  
) [virtual]

binary write

Reimplemented from OSstream.

Definition at line 88 of file ensightFile.C.

References Ostream::write().

Referenced by ensightPart::writeFieldList(), ensightPart::writeGeometry(), and ensightPart::writeHeader().

Foam::Ostream & writeKeyword ( const string &   key  ) [virtual]

write element keyword with trailing newline, optionally with undef

Reimplemented in ensightGeoFile.

Definition at line 221 of file ensightFile.C.

Referenced by ensightPart::writeField(), ensightPart::writeScalarField(), and ensightPart::writeVectorField().

Foam::Ostream & writeBinaryHeader (  )

write "C Binary" for binary files (eg, geometry/measured)

Definition at line 239 of file ensightFile.C.

References IOstream::BINARY, and format().

Foam::Ostream & writeUndef (  )

write undef value

Definition at line 214 of file ensightFile.C.

Referenced by ensightPart::writeFieldList().

Foam::Ostream & write ( const string &   value  ) [virtual]

write string as "%80s" or as binary

Reimplemented from OSstream.

Definition at line 98 of file ensightFile.C.

References IOstream::BINARY, and format().

Foam::Ostream & write ( const label &   value  )

write integer as "%10d" or as binary

Definition at line 135 of file ensightFile.C.

References IOstream::BINARY, and format().

Foam::Ostream & write ( const label &   value,
const label   fieldWidth  
)

write integer with specified width or as binary

Definition at line 158 of file ensightFile.C.

References IOstream::BINARY, and format().

Foam::Ostream & write ( const scalar &   value  )

write float as "%12.5e" or as binary

Definition at line 183 of file ensightFile.C.

References IOstream::BINARY, and format().

void newline (  )

Add carriage return to ascii stream.

Definition at line 205 of file ensightFile.C.

References IOstream::ASCII, format(), and Foam::nl.

Referenced by ensightPart::writeFieldList(), ensightPart::writeGeometry(), and ensightPart::writeHeader().


The documentation for this class was generated from the following files: