32 const bool writeTracks
48 const word& fieldName,
50 elemOutputType elemOutput
54 const bool geomChanged = (!upToDate_);
75 const int maskWidth = 8;
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();
119 const fileName geometryName
128 const fileName dataDir
137 const fileName geomFile(baseDir/geometryName);
143 Info<<
"Writing geometry to " << geomFile.name() <<
endl;
147 ensightGeoFile osGeom
168 Info<<
"Writing field file to " << osField.name() <<
endl;
173 writeTrackField<Type>(osField, fieldPtrs);
182 osCase.setf(ios_base::left);
188 Info<<
"Writing case file to " << osCase.name() <<
endl;
197 const label tsGeom = caching_.geometryTimeset();
201 <<
"type: ensight gold" <<
nl 209 <<
"model: " << tsGeom <<
" " 210 << mask << geometryName.name() <<
nl;
217 << geometryName.c_str() <<
nl;
225 for (
const entry& dEntry : caching_.fieldsDict())
227 const dictionary& subDict = dEntry.dict();
229 const word varType(subDict.get<word>(
"type"));
232 subDict.getOrDefault<word>
247 <<
setw(15) << varName <<
' ' 248 << mask << ensight::FileName(varName).c_str() <<
nl;
263 caching_.geometries()
267 osCase <<
"# end" <<
nl;
272 OFstream timeStamp(dataDir/
"time");
274 <<
"# timestep time" <<
nl 275 << dataDir.name() <<
' ' << timeValue <<
nl;
static void printTimeset(OSstream &os, const label ts, const scalar timeValue)
Print time-set for ensight case file with a single time.
A class for handling file names.
static word padded(const int nwidth, const label value)
Stringified zero-padded integer value.
bool wroteGeom_
Track if geometry has been written since the last open.
Specification of a valid Ensight file-name.
constexpr char nl
The newline '\n' character (0x0a)
static const fileName null
An empty fileName.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static std::string path(const std::string &str)
Return directory path name (part before last /)
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY 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.
Generic templated field type.
A class for handling words, derived from Foam::string.
static const char * geometryName
The name for geometry files: "geometry".
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?
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const char *const typeName
Specification of a valid Ensight variable-name.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Omanip< int > setw(const int i)
IOstream & scientific(IOstream &io)