46 const word& fieldName,
51 const bool geomChanged = (!upToDate_);
72 const char* fmt =
"%08d";
73 const char* mask =
"data/********/";
77 const fileName baseDir = outputPath_;
80 const scalar timeValue = currTime_.value();
82 const fileName outputFile = baseDir / surfName +
".case";
86 Info<<
"Writing case file to " << outputFile <<
nl;
90 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
107 const bool stateChanged =
120 const label
timeIndex = caching_.latestTimeIndex();
121 const label geomIndex = caching_.latestGeomIndex();
138 osCase.
setf(ios_base::left);
139 osCase.
setf(ios_base::scientific, ios_base::floatfield);
144 Info<<
"Writing case file to " << osCase.
name() <<
endl;
152 const label tsGeom = caching_.geometryTimeset();
156 <<
"type: ensight gold" <<
nl
165 <<
"model: " << tsGeom <<
" "
166 << mask << geometryName.
name() <<
nl;
173 << geometryName.c_str() <<
nl;
181 for (
const entry& dEntry : caching_.fieldsDict())
203 <<
setw(15) << varName <<
' '
204 << mask << varName <<
nl;
219 caching_.geometries()
223 osCase <<
"# end" <<
nl;
234 const fileName geomFile(baseDir/geometryName);
248 Info<<
"Writing geometry to " << geomFile.
name() <<
endl;
271 Info<<
"Writing field file to " << osField.
name() <<
endl;
276 part.
writeData(osField, tfield(), this->isPointData());
282 <<
"# timestep time" <<
nl
283 << dataDir.
name() <<
' ' << timeValue <<
nl;
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.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
static const char * geometryName
The name for geometry files: "geometry".
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 keyword and a list of tokens is an 'entry'.
A class for handling file names.
static const fileName null
An empty fileName.
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.
A class for managing temporary objects.
A class for handling words, derived from Foam::string.
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
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.