Go to the documentation of this file.
55 baseDir = baseDir/
".."/outputPrefix;
59 baseDir = baseDir/outputPrefix;
63 if (isA<polyMesh>(obr_))
78 return baseFileDir()/prefix_/obr_.time().timeName();
91 const word startTimeName =
92 obr_.time().timeName(obr_.time().startTime().value());
94 fileName outputDir(baseFileDir()/prefix_/startTimeName);
101 IFstream is(outputDir/(fName +
".dat"));
104 fName = fName +
"_" + obr_.time().timeName();
107 osPtr.
set(
new OFstream(outputDir/(fName +
".dat")));
119 filePtr_ = createFile(fileName_);
139 fileName_(
"undefined"),
165 filePtr_ = createFile(fileName_);
196 if (!filePtr_.valid())
199 <<
"File pointer not allocated";
224 os <<
setw(1) <<
"#" <<
setw(1) <<
' '
225 <<
setw(charWidth() - 2) << str.c_str();
235 os <<
tab <<
setw(charWidth()) << str.c_str();
245 os <<
setw(1) <<
"#" <<
setw(1) <<
' '
246 <<
setf(ios_base::left) <<
setw(charWidth() - 2) << str.c_str() <<
nl;
252 os <<
setw(charWidth()) << obr_.time().timeName();
Smanip< ios_base::fmtflags > setf(const ios_base::fmtflags flags)
void writeTime(Ostream &os) const
Write the current time to stream.
virtual Omanip< int > valueWidth(const label offset=0) const
Return the value width when writing to stream with optional offset.
OFstream Snull
Global predefined null output stream "/dev/null".
A class for handling words, derived from string.
A class for handling file names.
virtual fileName baseFileDir() const
Return the base directory for output.
static word defaultRegion
Return the default region name.
bool read(const char *, int32_t &)
functionObjectFile(const functionObjectFile &)
Disallow default bitwise copy construct.
label charWidth() const
Return width of character stream output.
void writeTabbed(Ostream &os, const string &str) const
Write a tabbed string to stream.
static bool & parRun()
Is this a parallel run?
fileName path() const
Return directory path name (part before last /)
T lookupOrDefault(const word &, const T &, bool recursive=false, bool patternMatch=true) const
Find and return a T,.
void read(const dictionary &dict)
Read.
Mesh consisting of general polyhedral cells.
virtual int precision() const =0
Get precision of output field.
Registry of regIOobjects.
OFstream & file()
Return access to the file (if only 1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void set(T *)
Set pointer to that given.
virtual void initStream(Ostream &os) const
Initialise the output stream for writing.
static const word outputPrefix
Directory prefix.
A list of keyword definitions, which are a keyword followed by any number of values (e....
void writeHeader(Ostream &os, const string &str) const
Write a commented header to stream.
Omanip< int > setw(const int i)
IOstream & scientific(IOstream &io)
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
bool writeToFile() const
Return true if can write to file.
static bool master(const label communicator=0)
Am I the master process.
virtual void resetFile(const word &name)
Reset internal file pointer to new file with new name.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
static label addChars
Additional characters for writing.
static unsigned int defaultPrecision()
Return the default precision.
virtual autoPtr< OFstream > createFile(const word &name) const
Return an autoPtr to a new file.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
bool good() const
Return true if next operation might succeed.
void writeCommented(Ostream &os, const string &str) const
Write a commented string to stream.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
virtual fileName baseTimeDir() const
Return the base directory for the current time value.
label writePrecision_
Write precision.
word name(const complex &)
Return a string representation of a complex.
const word & name() const
Return reference to name.
virtual ~functionObjectFile()
Destructor.
virtual int width() const =0
Get width of output field.