32 const bool writeTracks
48 const word& fieldName,
50 elemOutputType elemOutput
54 const bool geomChanged = (!upToDate_);
75 const char* fmt =
"%08d";
76 const char* mask =
"data/********/";
79 const fileName baseDir = outputPath_;
82 const scalar timeValue = currTime_.value();
84 const fileName outputFile = baseDir / baseName +
".case";
88 Info<<
"Writing case file to " << outputFile <<
endl;
100 const bool stateChanged =
113 const label
timeIndex = caching_.latestTimeIndex();
114 const label geomIndex = caching_.latestGeomIndex();
131 osCase.
setf(ios_base::left);
132 osCase.
setf(ios_base::scientific, ios_base::floatfield);
137 Info<<
"Writing case file to " << osCase.
name() <<
endl;
146 const label tsGeom = caching_.geometryTimeset();
150 <<
"type: ensight gold" <<
nl
158 <<
"model: " << tsGeom <<
" "
159 << mask << geometryName.
name() <<
nl;
166 << geometryName.c_str() <<
nl;
174 for (
const entry& dEntry : caching_.fieldsDict())
196 <<
setw(15) << varName <<
' '
197 << mask << varName <<
nl;
212 caching_.geometries()
216 osCase <<
"# end" <<
nl;
227 const fileName geomFile(baseDir/geometryName);
233 Info<<
"Writing geometry to " << geomFile.
name() <<
endl;
258 Info<<
"Writing field file to " << osField.
name() <<
endl;
263 writeTrackField<Type>(osField, fieldPtrs);
270 <<
"# timestep time" <<
nl
271 << 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 pointers to objects of type <T>, without allocation/deallocation management of the pointers...
bool wroteGeom_
Track if geometry has been written since the last open.
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...
Specialized Ensight output with extra geometry file header.
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.
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.