37 bool Foam::ensightFile::allowUndef_ =
false;
48 for (
const float val :
field)
62 for (
const double val :
field)
76 void Foam::ensightFile::init()
82 std::ios_base::floatfield
90 Foam::ensightFile::ensightFile
102 Foam::ensightFile::ensightFile
131 bool old = allowUndef_;
142 float old = undefValue_;
154 if (len > 80) len = 80;
158 std::copy_n(str, len, buf);
159 std::fill_n(buf + len, (80 - len),
'\0');
181 writeString(str, strlen(str));
187 writeString(str.data(), str.size());
193 writeString(str, strlen(str));
200 writeString(str.data(), str.size());
207 writeString(str.data(), str.size());
215 std::streamsize
count 218 stdStream().write(buf,
count);
230 reinterpret_cast<const char *>(&val),
236 stdStream().width(10);
249 return write(ivalue);
259 reinterpret_cast<const char *>(&val),
265 stdStream().width(12);
278 return write(fvalue);
285 const label fieldWidth
294 stdStream().width(fieldWidth);
295 stdStream() << value;
323 writeString(
key +
" undef");
342 writeString(
"C Binary");
350 writeString(
"BEGIN TIME STEP");
357 writeString(
"END TIME STEP");
377 writeString(
"particle coordinates");
379 write(nparticles, 8);
386 for (
const label val : list)
396 for (
const label val :
field)
406 for (
const float val :
field)
423 for (
const double val :
field)
void writeBinaryHeader()
Write "C Binary" string for binary files (eg, geometry/measured)
A class for handling keywords in dictionaries.
A class for handling file names.
float narrowFloat(const double val)
Type narrowing from double to float.
Output to file stream, using an OSstream.
constexpr char nl
The newline '\n' character (0x0a)
A simple container for options an IOstream can normally have.
static const char *const coordinates
The keyword "coordinates".
void beginPart(const label index)
Begin a part (0-based index internally).
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
int32_t narrowInt32(const int64_t val)
Type narrowing from int64_t to int32_t.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
void writeUndef()
Write undef value.
A class for handling words, derived from Foam::string.
void beginTimeStep()
Write "BEGIN TIME STEP" string and newline.
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
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())
void beginParticleCoordinates(const label nparticles)
Begin a "particle coordinates" block (measured data)
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.
word format(conversionProperties.get< word >("format"))
void newline()
Add carriage return to ascii stream.
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.
streamFormat
Data format (ascii | binary)
constexpr floatScalar floatScalarVGREAT
static float undefValue(float value) noexcept
Assign the value to represent undef in the results.
void endTimeStep()
Write "END TIME STEP" string and newline.
static bool hasUndef(const UList< float > &field)
Check for any NaN in the field.
static bool allowUndef() noexcept
Return setting for whether 'undef' values are allowed in results.
IOstream & scientific(IOstream &io)
virtual Ostream & writeKeyword(const keyType &key) override
Write element keyword with trailing newline, optionally with undef and the value for undefined...