37bool Foam::ensightFile::allowUndef_ =
false;
60 sprintf(buf, dirFmt_.c_str(),
n);
74 std::ostringstream oss;
75 oss <<
"%0" <<
n <<
"d";
91 for (
const scalar& val :
field)
105void Foam::ensightFile::initialize()
110 ios_base::scientific,
154 bool old = allowUndef_;
155 allowUndef_ = enabled;
165 scalar old = undefValue_;
177 strncpy(buf, str, 80);
195 return writeString(str.c_str());
201 return writeString(str);
207 return writeString(str);
213 return writeString(str);
220 std::streamsize count
223 stdStream().write(buf, count);
234 reinterpret_cast<const char *
>(&val),
240 stdStream().width(10);
252 return write(ivalue);
262 reinterpret_cast<const char *
>(&val),
268 stdStream().width(12);
280 return write(fvalue);
287 const label fieldWidth
296 stdStream().width(fieldWidth);
297 stdStream() << value;
324 writeString(key +
" undef");
343 writeString(
"C Binary");
365 writeString(
"particle coordinates");
367 write(nparticles, 8);
374 for (
const label val : list)
384 for (
const label val :
field)
394 for (
const scalar val :
field)
streamFormat
Data format (ascii | binary)
@ ASCII
"ascii" (normal default)
Output to file stream, using an OSstream.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Ostream & writeBinaryHeader()
Write "C Binary" string for binary files (eg, geometry/measured)
static const char *const coordinates
The keyword "coordinates".
static bool isUndef(const UList< scalar > &field)
Check for any NaN in the field.
virtual Ostream & writeKeyword(const keyType &key)
void beginPart(const label index)
Begin a part (0-based index internally).
static bool allowUndef()
Return setting for whether 'undef' values are allowed in results.
static label subDirWidth()
Return current width of subDir and mask.
void writeList(const UList< label > &field)
Write a list of integers as float values.
void writeLabels(const UList< label > &list)
Write a list of integers.
Ostream & writeUndef()
Write undef value.
static scalar undefValue(const scalar value)
Assign the value to represent undef in the results.
static string subDir(const label)
Consistent zero-padded numbers for subdirectories.
void beginParticleCoordinates(const label nparticles)
Begin a "particle coordinates" block (measured data)
Ostream & writeString(const char *str)
Write C-string as "%79s" or as binary (max 80 chars)
void newline()
Add carriage return to ascii stream.
static string mask()
The '*' mask appropriate for subDir.
A class for handling file names.
virtual bool write()
Write the output fields.
A class for handling keywords in dictionaries.
A class for handling character strings derived from std::string.
A class for handling words, derived from Foam::string.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
constexpr floatScalar floatScalarVGREAT
float narrowFloat(const double val)
Type narrowing from double to float.
double doubleScalar
A typedef for double.
int32_t narrowInt32(const int64_t val)
Type narrowing from int64_t to int32_t.
float floatScalar
A typedef for float.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
constexpr char nl
The newline '\n' character (0x0a)
word format(conversionProperties.get< word >("format"))