37 IOobjectOption::readOption readAverage
40 is >>
static_cast<Field<Type>&
>(*this);
42 if (IOobjectOption::isReadRequired(readAverage))
47 else if (IOobjectOption::isReadOptional(readAverage))
70 IOobjectOption::readOption readAverage
73 if (isReadRequired() || isReadOptional())
75 bool haveFile =
false;
76 bool haveHeader =
false;
81 const fileName fName(filePath());
84 autoPtr<ISstream> isPtr(
fileHandler().NewIFstream(fName));
86 if (isPtr && isPtr->good())
92 const token firstToken(is);
94 haveHeader = is.good() && firstToken.isWord(
"FoamFile");
99 Pout<<
"rawIOField : object:" <<
name()
100 <<
" haveFile:" << haveFile
101 <<
" haveHeader:" << haveHeader <<
endl;
110 Istream& is = readStream(word::null);
114 readContents(is, readAverage);
121 autoPtr<ISstream> isPtr(
fileHandler().NewIFstream(objectPath()));
123 if (isPtr && isPtr->good())
125 readContents(*isPtr, readAverage);
130 if (isReadRequired())
133 <<
"Trying to read raw field" <<
endl 141 Pout<<
"rawIOField : object:" <<
name()
142 <<
" size:" << this->size() <<
endl;
166 warnNoRereading<rawIOField<Type>>();
168 readContents(readAverage);
176 const bool readAverage
202 rawIOField<Type> reader(rio);
213 os << static_cast<const Field<Type>&>(*this);
errorManipArg< error, int > exit(error &err, const int errNo=1)
rawIOField(const rawIOField &)=default
Default copy construct.
bool throwing() const noexcept
Return the current exception throwing state (on or off)
virtual bool writeData(Ostream &os) const
The writeData method for regIOobject write operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
Like IOField but falls back to raw IFstream if no header found. Optionally reads average value...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Generic templated field type.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
int debug
Static debugging option.
OBJstream os(runTime.globalPath()/outputName)
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
bool good() const noexcept
True if next operation might succeed.
A simple container of IOobject preferences. Can also be used for general handling of read/no-read/rea...
regIOobject is an abstract class derived from IOobject to handle automatic object registration with t...
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
Defines the attributes of an object for which implicit objectRegistry management is supported...
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
Do not request registration (bool: false)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
static constexpr const zero Zero
Global zero (0)
readOption
Enumeration defining read preferences.