31Foam::fileName Foam::surfaceWriters::ensightWriter::writeUncollated()
54 const fileName outputFile = outputDir / baseName +
".case";
58 Info<<
"Writing case file to " << outputFile <<
endl;
67 if (!
isDir(outputDir))
72 OFstream osCase(outputFile);
76 baseName +
".00000000.mesh",
82 <<
"type: ensight gold" <<
nl
85 <<
"model: 1 " << osGeom.name().name() <<
nl
91 ensightOutputSurface part
108 const word& fieldName,
134 if (useTimeDir() && !
timeName().empty())
141 outputDir = outputPath_.
path();
144 const fileName baseDir = outputDir / varName;
146 const scalar timeValue = currTime_.value();
148 const fileName outputFile = baseDir / baseName +
".case";
152 Info<<
"Writing case file to " << outputFile <<
nl;
156 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
176 osCase.
setf(ios_base::left);
177 osCase.
setf(ios_base::scientific, ios_base::floatfield);
184 baseName +
".00000000.mesh",
190 baseName +
".00000000." + varName,
196 <<
"type: ensight gold" <<
nl
209 <<
setw(15) << varName <<
' '
210 << baseName.c_str() <<
".********." << varName <<
nl;
217 osCase <<
"# end" <<
nl;
231 part.
writeData(osField, tfield(), this->isPointData());
Generic templated field type.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
Output to file stream, using an OSstream.
virtual const fileName & name() const
Read/write access to the name of the stream.
virtual int precision() const
Get precision of output field.
static void printTimeset(OSstream &os, const label ts, const scalar timeValue)
Print time-set for ensight case file with a single time.
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
virtual Ostream & writeKeyword(const keyType &key)
Specialized Ensight output with extra geometry file header.
A variant of ensightFaces that holds references to contiguous points/faces with its own encapsulated ...
void write(ensightGeoFile &os) const
Write processor-local geometry (serial-only)
void writeData(ensightFile &os, const Field< Type > &fld, const bool isPointData=false) const
Write a field of face or point values (serial-only)
Specification of a valid Ensight file-name.
Specification of a valid Ensight variable-name.
A class for handling file names.
static std::string path(const std::string &str)
Return directory path name (part before last /)
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Implements a meshed surface by referencing another meshed surface or faces/points components.
virtual const pointField & points() const
The points used for the surface.
virtual const faceList & faces() const
The faces used for the surface.
splitCell * master() const
bool wroteGeom_
Track if geometry has been written since the last open.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
const word & timeName() const
The current time value/name.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
bool parallel_
Writing in parallel (via master)
bool empty() const
The surface to write is empty if the global number of faces is zero.
bool verbose_
Additional output verbosity.
const meshedSurfRef & adjustSurface() const
fileName outputPath_
The full output directory and file (surface) name.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a)
Ensight names and component order for base types.