Go to the documentation of this file.
31 int Foam::surfaceWriters::ensightWriter::geometryTimeset()
const
36 if (geoms.count() <= 1)
42 if (geoms.size() == times.size() && geoms.all())
55 Foam::fileName Foam::surfaceWriters::ensightWriter::writeCollated()
70 const word& fieldName,
75 const bool geomChanged = (!upToDate_);
96 const char* fmt =
"%08d";
97 const char* mask =
"data/********/";
101 const fileName baseDir = outputPath_;
104 const scalar timeValue = currTime_.value();
106 const fileName outputFile = baseDir / surfName +
".case";
110 Info<<
"Writing case file to " << outputFile <<
endl;
127 const bool stateChanged =
140 const label
timeIndex = caching_.latestTimeIndex();
141 const label geomIndex = caching_.latestGeomIndex();
158 osCase.
setf(ios_base::left);
164 Info<<
"Writing case file to " << osCase.
name() <<
endl;
172 const label tsGeom = geometryTimeset();
176 <<
"type: ensight gold" <<
nl
185 <<
"model: " << tsGeom <<
" "
186 << mask << geometryName.
name() <<
nl;
193 << geometryName.c_str() <<
nl;
201 for (
const entry& dEntry : caching_.fieldsDict())
223 <<
setw(15) << varName <<
' '
224 << mask << varName <<
nl;
231 printTimeset(osCase, 1, caching_.times());
239 caching_.geometries()
243 osCase <<
"# end" <<
nl;
254 const fileName geomFile(baseDir/geometryName);
268 Info<<
"Writing geometry to " << geomFile.
name() <<
endl;
291 Info<<
"Writing field file to " << osField.
name() <<
endl;
296 part.writeData(osField, tfield(), this->isPointData());
302 <<
"# timestep time" <<
nl
303 << dataDir.
name() <<
' ' << timeValue <<
nl;
A keyword and a list of tokens is an 'entry'.
List< scalar > scalarList
A List of scalars.
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 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.
Ensight names and component order for base types.
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
virtual const faceList & faces() const =0
The faces used for the surface.
Abstract definition of a meshed surface defined by faces and points.
static bool master(const label communicator=worldComm)
Am I the master process.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
virtual Ostream & writeKeyword(const keyType &key)
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.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual const pointField & points() const =0
The points used for the surface.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
virtual bool write(const token &)
Writing token does not make sense.
const bitSet & geometries() const
Indices in times() when geometry (mesh) has been written.
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Omanip< int > setw(const int i)
IOstream & scientific(IOstream &io)
static const fileName null
An empty fileName.
Output to file stream, using an OSstream.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
virtual int precision() const
Get precision of output field.
A variant of ensightFaces that holds references to contiguous points/faces with its own encapsulated ...
const scalarList & times() const
The output times for fields.
static word printf(const char *fmt, const PrimitiveType &val)
Use a printf-style formatter for a primitive.
T getOrDefault(const word &keyword, const T &deflt, enum keyType::option matchOpt=keyType::REGEX) const
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
static const char * geometryName
The name for geometry files: "geometry".
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?