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
93 <<
"type: ensight gold" <<
nl 96 <<
"model: 1 " << osGeom.name().name() <<
nl 109 Foam::fileName Foam::surfaceWriters::ensightWriter::writeUncollated
111 const word& fieldName,
137 if (useTimeDir() && !
timeName().empty())
144 outputDir = outputPath_.
path();
147 const fileName baseDir = outputDir / varName;
149 const scalar timeValue = currTime_.value();
151 const fileName outputFile = baseDir / baseName +
".case";
155 Info<<
"Writing case file to " << outputFile <<
nl;
159 tmp<Field<Type>> tfield = adjustField(fieldName, mergeField(localValues));
167 const meshedSurfRef& surf = adjustSurface();
171 if (!
isDir(outputFile.path()))
173 mkDir(outputFile.path());
177 ensightGeoFile osGeom
180 baseName +
".00000000.mesh",
186 baseName +
".00000000." + varName,
191 ensightOutputSurface part
202 part.writeData(osField, tfield(), this->isPointData());
212 <<
"type: ensight gold" <<
nl 215 <<
"model: 1 " << osGeom.name().name() <<
nl 225 <<
setw(15) << varName <<
' ' 226 << baseName.c_str() <<
".********." 227 << ensight::FileName(varName).c_str() <<
nl;
234 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.
static void setTimeFormat(OSstream &os, IOstreamOption::floatFormat timeFmt, const int timePrec)
Set output time format for ensight case file.
IOstreamOption::streamFormat format() const noexcept
The output file format (ascii/binary)
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)
True if process corresponds to the master rank in the communicator.
messageStream Info
Information stream (stdout output on master, null elsewhere)
bool verbose_
Additional output verbosity.
Omanip< int > setw(const int i)