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_;
156 strncpy(buf, str, 80);
175 return writeString(str.c_str());
181 return writeString(str);
187 return writeString(str);
193 return writeString(str);
200 std::streamsize
count 203 stdStream().write(buf,
count);
215 reinterpret_cast<const char *>(&val),
221 stdStream().width(10);
234 return write(ivalue);
244 reinterpret_cast<const char *>(&val),
250 stdStream().width(12);
263 return write(fvalue);
270 const label fieldWidth
279 stdStream().width(fieldWidth);
280 stdStream() << value;
309 writeString(
key +
" undef");
328 writeString(
"C Binary");
350 writeString(
"particle coordinates");
352 write(nparticles, 8);
359 for (
const label val : list)
369 for (
const label val :
field)
379 for (
const float val :
field)
396 for (
const double val :
field)
Ostream & writeUndef()
Write undef value.
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 INVALID.
A class for handling words, derived from Foam::string.
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)
word format(conversionProperties.get< word >("format"))
Ostream & writeBinaryHeader()
Write "C Binary" string for binary files (eg, geometry/measured)
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)
virtual Ostream & writeKeyword(const keyType &key)
Write element keyword with trailing newline, optionally with undef and the value for undefined...
virtual bool write(const token &)
Writing token does not make sense.
constexpr floatScalar floatScalarVGREAT
static float undefValue(float value) noexcept
Assign the value to represent undef in the results.
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)
Ostream & writeString(const char *str)
Write C-string as "%79s" or as binary (max 80 chars)