61 filePtrs_.setSize(names_.size());
118 <<
"Request for file() can only be done by the master process"
122 if (filePtrs_.size() != 1)
125 <<
"Requested single file, but multiple files are present"
129 if (!filePtrs_.set(0))
132 <<
"File pointer at index " << 0 <<
" not allocated"
145 <<
"Request for files() can only be done by the master process"
158 <<
"Request for file(i) can only be done by the master process"
162 if (!filePtrs_.set(i))
165 <<
"File pointer at index " << i <<
" not allocated"
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
#define forAll(list, i)
Loop across all elements in list.
static bool master(const label communicator=0)
Am I the master process.
const word & name() const
Return const reference to name.
A class for handling file names.
const wordList & toc() const
Return the list of log file names.
virtual void resetNames(const wordList &names)
Reset the list of names from a wordList.
virtual void createFiles()
Create the output file.
PtrList< OFstream > filePtrs_
File pointer.
PtrList< OFstream > & files()
Return access to the files.
virtual void resetName(const word &name)
Reset the list of names to a single name entry.
wordList names_
File names.
OFstream & file()
Return access to the file (if only 1)
const wordList & names() const
Return the list of log file names.
virtual void writeFileHeader(const label i=0)=0
File header information.
virtual ~logFiles()
Destructor.
logFiles(const objectRegistry &obr, const word &prefix)
Construct from objectRegistry and prefix.
virtual bool write()
Write function.
functionObject base class for writing single files
fileName baseFileDir() const
Return the base directory for output.
const word prefix_
Prefix.
void initStream(Ostream &os) const
Initialise the output stream for writing.
const objectRegistry & fileObr_
Reference to the region objectRegistry.
Registry of regIOobjects.
const Time & time() const
Return time.
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define WarningInFunction
Report a warning using Foam::Warning.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool mkDir(const fileName &, mode_t=0777)
Make a directory and return an error if it could not be created.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const bool)
Return a word representation of a bool.
errorManip< error > abort(error &err)