44 os.
setf(ios_base::scientific, ios_base::floatfield);
57 fileObr_.time().globalPath()
62 const auto*
meshPtr = isA<polyMesh>(fileObr_);
65 baseDir /=
meshPtr->regionName();
75 return baseFileDir()/prefix_/fileObr_.time().timeName();
91 timeValue = fileObr_.time().timeToUserTime(timeValue);
103 IFstream is(outputDir/(fName +
".dat"));
129 return createFile(
name, startTime_);
137 filePtr_ = createFile(fileName_);
146 return setw(writePrecision_ + addChars + offset);
154 fileObr_(wf.fileObr_),
156 fileName_(wf.fileName_),
158 writePrecision_(wf.writePrecision_),
159 writeToFile_(wf.writeToFile_),
160 updateHeader_(wf.updateHeader_),
161 writtenHeader_(wf.writtenHeader_),
162 useUserTime_(wf.useUserTime_),
163 startTime_(wf.startTime_)
172 const bool writeToFile
179 writePrecision_(
IOstream::defaultPrecision()),
180 writeToFile_(writeToFile),
182 writtenHeader_(false),
184 startTime_(obr.time().
startTime().value())
194 const bool writeToFile
213 dict.getCheckOrDefault
220 updateHeader_ =
dict.getOrDefault(
"updateHeader", updateHeader_);
227 useUserTime_ =
dict.getOrDefault(
"useUserTime",
true);
243 <<
"File pointer not allocated\n";
258 return writeToFile_ && (updateHeader_ || !writtenHeader_);
264 return writePrecision_ + addChars;
279 <<
setf(ios_base::left) <<
setw(charWidth() - 2) << str.c_str();
290 os <<
tab <<
setw(charWidth()) << str.c_str();
300 writeCommented(
os, str);
307 const scalar timeValue =
310 ? fileObr_.time().timeOutputValue()
311 : fileObr_.time().value()
Input from file stream, using an ISstream.
An IOstream is an abstract base class for all input/output systems; be they streams,...
bool good() const noexcept
True if next operation might succeed.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
static unsigned int defaultPrecision() noexcept
Return the default precision.
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
Output to file stream, using an OSstream.
virtual int precision() const
Get precision of output field.
virtual int width() const
Get width of output field.
An Ostream manipulator taking arguments.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
virtual bool read()
Re-read model coefficients if they have changed.
virtual word timeName() const
Return current time name.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
bool good() const noexcept
True if the managed pointer is non-null.
void reset(autoPtr< T > &&other) noexcept
Delete managed object and set to new given pointer.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
static bool clean(std::string &str)
static word outputPrefix
Directory prefix.
Base class for writing single files from the function objects.
fileName baseFileDir() const
Return the base directory for output.
label writePrecision_
Write precision.
virtual void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
word fileName_
Name of file.
virtual label charWidth() const
Return width of character stream output.
Omanip< int > valueWidth(const label offset=0) const
Return the value width when writing to stream with optional offset.
virtual void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
virtual bool read(const dictionary &dict)
Read.
virtual void writeBreak(Ostream &os) const
Write a break marker to the stream.
virtual autoPtr< OFstream > createFile(const word &name, scalar timeValue) const
Return autoPtr to a new file for a given time.
void initStream(Ostream &os) const
Initialise the output stream for writing.
bool writeToFile_
Flag to enable/disable writing to file.
virtual OFstream & file()
Return access to the file (if only 1)
static label addChars
Additional characters for writing.
autoPtr< OFstream > filePtr_
File pointer.
virtual void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
virtual void writeCurrentTime(Ostream &os) const
Write the current time to stream.
virtual bool writeToFile() const
Flag to allow writing to file.
fileName baseTimeDir() const
Return the base directory for the current time value.
virtual void resetFile(const word &name)
Reset internal file pointer to new file with new name.
virtual bool canWriteHeader() const
Flag to allow writing the header.
Registry of regIOobjects.
splitCell * master() const
A class for handling words, derived from Foam::string.
Foam::autoPtr< Foam::dynamicFvMesh > meshPtr
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
static void writeHeader(Ostream &os, const word &fieldName)
OFstream Snull
Global predefined null output stream "/dev/null".
Omanip< int > setw(const int i)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
constexpr char tab
The tab '\t' character(0x09)