Go to the documentation of this file.
31 Foam::fileName Foam::surfaceWriters::ensightWriter::writeUncollated()
54 const fileName outputFile = outputDir / surfName +
".case";
58 Info<<
"Writing case file to " << outputFile <<
endl;
62 const meshedSurf& surf =
surface();
66 if (!
isDir(outputDir))
71 OFstream osCase(outputFile);
75 surfName +
".00000000.mesh",
81 <<
"type: ensight gold" <<
nl
84 <<
"model: 1 " << osGeom.name().name() <<
nl
88 printTimeset(osCase, 1, 0.0);
90 ensightPartFaces ensPart
107 Foam::fileName Foam::surfaceWriters::ensightWriter::writeUncollated
109 const word& fieldName,
135 if (useTimeDir() && !
timeName().empty())
142 outputDir = outputPath_.
path();
145 const fileName baseDir = outputDir / varName;
147 const scalar timeValue = currTime_.value();
149 const fileName outputFile = baseDir / surfName +
".case";
153 Info<<
"Writing case file to " << outputFile <<
endl;
172 osCase.
setf(ios_base::left);
179 surfName +
".00000000.mesh",
185 surfName +
".00000000." + varName,
191 <<
"type: ensight gold" <<
nl
204 <<
setw(15) << varName <<
' '
205 << surfName.c_str() <<
".********." << varName <<
nl;
211 printTimeset(osCase, 1, timeValue);
212 osCase <<
"# end" <<
nl;
228 if (this->isPointData())
A class for handling words, derived from Foam::string.
A class for handling file names.
virtual const fileName & name() const
Read/write access to the name of the stream.
static std::string path(const std::string &str)
Return directory path name (part before last /)
A class for managing temporary objects.
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
bool useTimeDir() const
Should a time directory be spliced into the output path?
virtual const faceList & faces() const =0
The faces used for the surface.
const meshedSurf & surface() const
Abstract definition of a meshed surface defined by faces and points.
Ostream & endl(Ostream &os)
Add newline and flush stream.
const word & timeName() const
The current time value/name.
virtual Ostream & writeKeyword(const keyType &key)
Write element keyword with trailing newline, optionally with undef.
Conversion of OpenFOAM pTraits into the Ensight equivalent.
Specialized Ensight output with extra geometry file header.
Specification of a valid Ensight file-name.
Specification of a valid Ensight variable-name.
Generic templated field type.
bool writePointField(const Field< Type > &fld, const ensightFaces &part, ensightFile &os)
Write a field of point (node) values (already compacted?)
messageStream Info
Information stream (uses stdout - output is on the master only)
bool parallel_
Writing in parallel (via master)
bool checkOpen() const
Verify that the outputPath_ has been set or FatalError.
fileName outputPath_
The full output directory and file (surface) name.
virtual const pointField & points() const =0
The points used for the surface.
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Omanip< int > setw(const int i)
IOstream & scientific(IOstream &io)
Output to file stream, using an OSstream.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
static bool master(const label communicator=0)
Am I the master process.
virtual int precision() const
Get precision of output field.
bool writeFaceField(const Field< Type > &fld, const ensightFaces &part, ensightFile &os, bool parallel)
An implementation of ensightPart to hold mesh faces.
bool wroteGeom_
Track if geometry has been written since the last open.
bool verbose_
Additional output verbosity.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?