Go to the documentation of this file.
37 bool 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)
105 void Foam::ensightFile::initialize()
119 Foam::ensightFile::ensightFile
131 Foam::ensightFile::ensightFile
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)
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
double doubleScalar
A typedef for double.
A class for handling words, derived from Foam::string.
A class for handling file names.
float floatScalar
A typedef for float.
static string mask()
The '*' mask appropriate for subDir.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Ostream & writeBinaryHeader()
Write "C Binary" string for binary files (eg, geometry/measured)
A class for handling character strings derived from std::string.
virtual Ostream & writeKeyword(const keyType &key)
void writeLabels(const UList< label > &list)
Write a list of integers.
A class for handling keywords in dictionaries.
word format(conversionProperties.get< word >("format"))
Specification of a valid Ensight file-name.
void beginParticleCoordinates(const label nparticles)
Begin a "particle coordinates" block (measured data)
void newline()
Add carriage return to ascii stream.
Ostream & writeUndef()
Write undef value.
static label subDirWidth()
Return current width of subDir and mask.
static string subDir(const label)
Consistent zero-padded numbers for subdirectories.
static bool allowUndef()
Return setting for whether 'undef' values are allowed in results.
static const char *const coordinates
The keyword "coordinates".
streamFormat
Data format (ascii | binary)
virtual bool write(const token &)
Writing token does not make sense.
float narrowFloat(const double val)
Type narrowing from double to float.
IOstream & scientific(IOstream &io)
static bool isUndef(const UList< scalar > &field)
Check for any NaN in the field.
Output to file stream, using an OSstream.
static scalar undefValue(const scalar value)
Assign the value to represent undef in the results.
Ostream & writeString(const char *str)
Write C-string as "%79s" or as binary (max 80 chars)
unsigned int count(const UList< bool > &bools, const bool val=true)
Count number of 'true' entries.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
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)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void writeList(const UList< label > &field)
Write a list of integers as float values.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
constexpr floatScalar floatScalarVGREAT
int32_t narrowInt32(const int64_t val)
Type narrowing from int64_t to int32_t.