31 Foam::fileName Foam::surfaceWriters::ensightWriter::writeUncollated()
54 const fileName outputFile = outputDir / baseName +
".case";
58 Info<<
"Writing case file to " << outputFile <<
endl;
67 if (!
isDir(outputDir))
75 baseName +
".00000000.mesh",
79 ensightOutputSurface part
88 OFstream osCase(outputFile);
91 <<
"type: ensight gold" <<
nl 94 <<
"model: 1 " << osGeom.name().name() <<
nl 107 Foam::fileName Foam::surfaceWriters::ensightWriter::writeUncollated
109 const word& fieldName,
135 if (useTimeDir() && !
timeName().empty())
142 outputDir = outputPath_.
path();
145 const fileName baseDir = outputDir / varName;
147 const scalar timeValue = currTime_.value();
149 const fileName outputFile = baseDir / baseName +
".case";
153 Info<<
"Writing case file to " << outputFile <<
nl;
157 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
165 const meshedSurfRef& surf = adjustSurface();
169 if (!
isDir(outputFile.path()))
171 mkDir(outputFile.path());
175 ensightGeoFile osGeom
178 baseName +
".00000000.mesh",
184 baseName +
".00000000." + varName,
189 ensightOutputSurface part
200 part.writeData(osField, tfield(), this->isPointData());
208 osCase.setf(ios_base::left);
214 <<
"type: ensight gold" <<
nl 217 <<
"model: 1 " << osGeom.name().name() <<
nl 227 <<
setw(15) << varName <<
' ' 228 << baseName.c_str() <<
".********." 229 << ensight::FileName(varName).c_str() <<
nl;
236 osCase <<
"# end" <<
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.
Specification of a valid Ensight file-name.
void checkOpen() const
Verify that the outputPath_ has been set or FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const meshedSurfRef & adjustSurface() const
Merge surfaces (if not upToDate) and return merged (parallel) or regular surface (non-parallel) and a...
static std::string path(const std::string &str)
Return directory path name (part before last /)
bool parallel_
Writing in parallel (via master)
bool wroteGeom_
Track if geometry has been written since the last open.
const word & timeName() const
The current time value/name.
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.
const char *const typeName
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Specification of a valid Ensight variable-name.
bool useTimeDir() const noexcept
Should a time directory be spliced into the output path?
fileName outputPath_
The full output directory and file (surface) name.
static bool master(const label communicator=worldComm)
Am I the master rank.
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool verbose_
Additional output verbosity.
Omanip< int > setw(const int i)
IOstream & scientific(IOstream &io)