41#ifndef Foam_ensightCase_H
42#define Foam_ensightCase_H
89 const std::unique_ptr<options> options_;
92 mutable std::unique_ptr<OFstream> os_;
101 mutable bool changed_;
146 void writeHeader()
const;
150 scalar writeTimeset()
const;
157 const scalar timeCorrection = 0
162 void noteGeometry(
const bool moving)
const;
172 const char* ensightType
179 const char* ensightType
213 const word& caseName,
221 const word& caseName,
236 static word padded(
const int nwidth,
const label index);
239 template<
class StringType>
242 const StringType& input,
288 void setTime(const scalar t, const label index);
315 const
bool isPointData = false
341 inline
Ostream& operator()() const;
369 const scalar timeValue
387 const
UList<scalar>& times
404 const
UList<scalar>& times,
463 const word& formatKeyword,
483 int timePrecision() const
noexcept {
return timePrecision_; }
489 word
padded(
const label i)
const;
492 int width() const
noexcept {
return width_; }
495 bool overwrite() const
noexcept {
return overwrite_; }
505 void width(
const int i);
514 void timePrecision(
int prec)
noexcept { timePrecision_ = prec; }
523 void overwrite(
bool on)
noexcept { overwrite_ = on; }
526 void separateCloud(
bool on)
noexcept { separateCloud_ = on; }
538 void nodeValues(
bool on)
noexcept { nodeValues_ = on; }
551 #include "ensightCase.txx"
const word cloudName(propsDict.get< word >("cloud"))
A HashTable with keys but without contents that is similar to std::unordered_set.
A HashTable similar to std::unordered_map.
A simple container for options an IOstream can normally have.
floatFormat
Float formats (eg, time directory name formats).
streamFormat
Data format (ascii | binary | coherent).
A HashTable to objects of type <T> with a label key.
Generic output stream using a standard (STL) stream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Configuration options for the ensightCase.
IOstreamOption::floatFormat timeFormat() const noexcept
Time format for case file (general/fixed/scientific).
int timePrecision() const noexcept
Time precision for case file.
void timePrecision(int prec) noexcept
Set the time precision for case file.
options(IOstreamOption::streamFormat fmt=IOstreamOption::BINARY)
Construct with the specified format (default is binary).
bool nodeValues() const noexcept
Forced use of values per node instead of per element.
void nodeValues(bool on) noexcept
Force use of values per node instead of per element.
void separateCloud(bool on) noexcept
Write clouds into their own directory instead in "data" directory.
bool overwrite() const noexcept
Remove existing directory and sub-directories on creation.
void timeFormat(IOstreamOption::floatFormat fmt) noexcept
Set the time format for case file.
int width() const noexcept
Return current width of mask and padded.
bool separateCloud() const noexcept
Write clouds into their own directory instead in "data" directory.
const word & mask() const noexcept
The '*' mask appropriate for sub-directories.
void overwrite(bool on) noexcept
Remove existing directory and sub-directories on creation.
IOstreamOption::streamFormat format() const noexcept
The output file format (ascii/binary).
Supports writing of ensight cases as well as providing common factory methods to open new files.
const word & mask() const
The output '*' mask.
autoPtr< ensightFile > newCloud(const word &cloudName) const
Open stream for new cloud positions (on master).
static const char * dataDirName
The name for data subdirectory: "data".
autoPtr< ensightFile > newData(const word &varName, const bool isPointData=false) const
Open stream for new data file (on master), with current index.
void write() const
Write the case file.
autoPtr< ensightFile > newPointData(const word &varName) const
Open stream for new data file (on master), with current index and marking as containing POINT_DATA.
static StringType expand_mask(const StringType &input, const label index)
Replace the '*' mask chars with zero-padded integer value.
Ostream & printInfo(Ostream &os) const
Print some general information.
const fileName & path() const noexcept
The nominal path to the case file.
bool nodeValues() const
Force use of values per node instead of per element.
autoPtr< ensightGeoFile > newGeometry(bool moving=false) const
Open stream for new geometry file (on master). Does not include beginGeometry() marker.
void setTime(const scalar t, const label index)
Set current index and time for time-set 1.
~ensightCase()=default
Destructor.
autoPtr< ensightFile > newCloudData(const word &cloudName, const word &varName) const
Open stream for new cloud data file (on master), with current index.
static const char * geometryName
The name for geometry files: "geometry".
void operator=(const ensightCase &)=delete
No copy assignment.
void rewind() const
Rewind the output stream (master only).
bool separateCloud() const
Write clouds into their own directory instead in "data" directory.
static word mask(const int nwidth)
A '*' mask of specified width.
void nextTime(const scalar t)
Set time for time-set 1, using next available index.
const ensightCase::options & option() const
Reference to the case options.
ensightCase(const ensightCase &)=delete
No copy construct.
IOstreamOption::streamFormat format() const
The output file format (ascii/binary).
static void setTimeFormat(OSstream &os, IOstreamOption::floatFormat timeFmt, const int timePrec)
Set output time format for ensight case file.
static word padded(const int nwidth, const label index)
Stringified zero-padded integer value of specified width.
static void printTimeset(OSstream &os, const label ts, const scalar timeValue)
Print time-set for ensight case file with a single time.
A variant of OFstream with specialised handling for Ensight writing of strings, integers and floats (...
A variant of ensightFile (Ensight writing) that includes the extra geometry file header information.
A class for handling file names.
An instant of time. Contains the time value and name. Uses Foam::Time when formatting the name.
Lookup type of boundary radiation properties.
A class for handling words, derived from Foam::string.
OBJstream os(runTime.globalPath()/outputName)
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.