36 const std::string& buffer,
51 const word& fieldName,
56 auto&
field = tfield.ref();
66 <<
"Cannot read file " << is.
name()
67 <<
" for field " << fieldName
78 is.
read(primitiveType);
92 <<
"> but found " << primitiveType <<
nl 93 <<
" This may be okay, but could indicate an error" 107 for (
const faceInfoTuple& facesInfo : faceTypeInfo_)
110 const label endFace = begFace + facesInfo.second();
115 <<
" data:" << facesInfo.second() <<
endl;
117 if (begFace < endFace)
137 for (label facei = begFace; facei < endFace; ++facei)
163 const label fieldIndex
166 if (fieldIndex < 0 || fieldIndex >= fieldNames_.size())
170 <<
" should be in range [0.." << fieldNames_.size() <<
')' <<
nl 171 <<
"Possibly used incorrect field lookup name. Known field names: " 176 const word& fieldName = fieldNames_[fieldIndex];
178 const label fileIndex =
182 : (timeStartIndex_ +
timeIndex*timeIncrement_)
185 const fileName dataFile
193 Pout<<
"Read <" << pTraits<Type>::typeName <<
"> field, file=" 197 return readField<Type>(dataFile, fieldName,
timeIndex);
virtual Istream & read(char *buf, std::streamsize count) override
Binary read.
Input/output streams with (internal or external) character storage.
A class for handling file names.
bool seekTime(const label timeIndex)
Transient single-file: seek to the file position corresponding to the given time index.
bool contains(char c) const noexcept
True if string contains given character (cf. C++23)
errorManipArg< error, int > exit(error &err, const int errNo=1)
static const char * elemNames[nTypes]
The ensight 'Face' element type names.
Ensight names and component order for base types.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
static StringType expand_mask(const StringType &input, const label index)
Replace the '*' mask chars with zero-padded integer value.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
A traits class, which is primarily used for primitives and vector-space.
static bool & parRun() noexcept
Test if this a parallel run.
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh >> &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
static label worldComm
Communicator for all ranks. May differ from commGlobal() if local worlds are in use.
static void broadcast(Type &value, const label comm=UPstream::worldComm)
Broadcast content (contiguous or non-contiguous) to all communicator ranks. Does nothing in non-paral...
static void readFrom(const std::string &buffer, Type &value)
Helper function to return Type from string.
virtual const fileName & name() const override
Read/write access to the name of the stream.
A class for handling words, derived from Foam::string.
A variant of IFstream with specialised handling for Ensight reading of strings, integers and floats (...
#define DebugInfo
Report an information message using Foam::Info.
int debug
Static debugging option.
tmp< Field< Type > > readField(const fileName &dataFile, const word &fieldName, const label timeIndex=0) const
Helper function to return a field.
bool good() const noexcept
True if next operation might succeed.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
#define IOWarningInFunction(ios)
Report an IO warning using Foam::Warning.
A class for managing temporary objects.
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components)
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
FlatOutput::OutputAdaptor< Container, Delimiters > flatOutput(const Container &obj, Delimiters delim)
Global flatOutput() function with specified output delimiters.
static constexpr const zero Zero
Global zero (0)