36 #ifndef Foam_ensightFile_H 37 #define Foam_ensightFile_H 61 static bool allowUndef_;
64 static float undefValue_;
68 int64_t origFileSize_;
117 return NullObjectRef<ensightFile>();
221 void writeInt(const int32_t val, const
int fieldWidth);
224 void writeInt(const int64_t val, const
int fieldWidth);
227 void writeFloat(const
float val, const
int fieldWidth);
230 void writeFloat(const
double val, const
int fieldWidth);
264 virtual Ostream&
write(
const std::string& str)
override;
305 timeStepOffsets_.
clear();
312 return timeStepOffsets_.
size();
319 return timeStepOffsets_;
330 void beginPart(
const label index,
const std::string& description);
345 void writeLabels(
const IndirectListBase<label, Addr>& list);
382 static bool hasUndef(
const IndirectListBase<float, Addr>&
field);
386 static bool hasUndef(
const IndirectListBase<double, Addr>&
field);
A variant of OFstream with specialised handling for Ensight writing of strings, integers and floats (...
void writeBinaryHeader()
Write "C Binary" string for binary files (eg, geometry/measured)
A class for handling keywords in dictionaries.
void size(const label n)
Older name for setAddressableSize.
int64_t endTimeStep()
Write "END TIME STEP" string and newline (for transient single-file format)
A class for handling file names.
Output to file stream as an OSstream, normally using std::ofstream for the actual output...
A token holds an item read from Istream.
A simple container for options an IOstream can normally have.
virtual const fileName & name() const override
Get the name of the output serial stream. (eg, the name of the Fstream file name) ...
int64_t writeTimeStepFooter()
Transient single-file: write the time-step file-offsets as footer information.
static const char *const coordinates
The keyword "coordinates".
int64_t beginTimeStep()
Write "BEGIN TIME STEP" string and newline (for transient single-file format).
void beginPart(const label index)
Begin a part (0-based index internally).
void clearTimeSteps() noexcept
Transient single-file: forget time-step file positions (advanced use)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
void writeUndef()
Write undef value.
const UList< int64_t > & timeStepOffets() const noexcept
Transient single-file: the current file-offsets for time steps within the file.
~ensightFile()
Destructor. Commits the time-step footer information (if any)
no append (truncates existing)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void writeLabels(const UList< label > &list)
Write a list of integers.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
label nTimes() const noexcept
Transient single-file: the current number of time steps.
void beginParticleCoordinates(const label nparticles)
Begin a "particle coordinates" block (measured data)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
void beginCoordinates(const label nparticles)
Begin a "coordinates" block. Only used for geometry files.
float floatType
Ensight uses float not double for floating-point.
appendType
File appending (NO_APPEND | APPEND_APP | APPEND_ATE)
void writeString(const char *str, size_t len)
Write character/string content as "%79s" or as binary (max 80 chars)
virtual bool write(const token &) override
Writing token does not make sense.
void newline()
Add carriage return to ascii stream.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
void writeList(const UList< label > &field)
Write a list of integers as float values.
void writeInt(const int32_t val, const int fieldWidth)
Write integer value with specified width or as binary.
streamFormat
Data format (ascii | binary)
static const ensightFile & null() noexcept
Return a null ensightFile.
static float undefValue(float value) noexcept
Assign the value to represent undef in the results.
void operator=(const ensightFile &)=delete
No copy assignment.
static bool hasUndef(const UList< float > &field)
Check for any NaN in the field.
#define NotImplemented
Issue a FatalErrorIn for a function not currently implemented.
static bool allowUndef() noexcept
Return setting for whether 'undef' values are allowed in results.
Ostream(const Ostream &)=default
Copy construct.
void writeFloat(const float val, const int fieldWidth)
Write floating-point with specified width or as binary.
virtual Ostream & writeKeyword(const keyType &key) override
Write element keyword with trailing newline, optionally with undef and the value for undefined...