Go to the documentation of this file.
38 namespace functionObjects
45 timeActivatedFileUpdate,
54 void Foam::functionObjects::timeActivatedFileUpdate::updateFile()
61 i < timeVsFile_.size()-1
70 Log <<
nl <<
type() <<
": copying file" <<
nl << timeVsFile_[i].second()
71 <<
nl <<
"to:" <<
nl << fileToUpdate_ <<
nl <<
endl;
77 cp(timeVsFile_[i].second(), destFile);
78 mv(destFile, fileToUpdate_);
88 Foam::functionObjects::timeActivatedFileUpdate::timeActivatedFileUpdate
96 fileToUpdate_(
"unknown-fileToUpdate"),
114 dict.readEntry(
"fileToUpdate", fileToUpdate_);
115 dict.readEntry(
"timeVsFile", timeVsFile_);
118 fileToUpdate_.expand();
121 <<
" time vs file list:" <<
endl;
125 timeVsFile_[i].second() = timeVsFile_[i].second().expand();
126 if (!
isFile(timeVsFile_[i].second()))
129 <<
"File: " << timeVsFile_[i].second() <<
" not found"
133 Info<<
" " << timeVsFile_[i].first() <<
tab
134 << timeVsFile_[i].second() <<
endl;
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
virtual bool execute()
Execute file updates.
const Time & time_
Reference to the time database.
bool read(const char *buf, int32_t &val)
Same as readInt32.
Virtual base class for function objects with a reference to Time.
virtual bool read(const dictionary &)
Read the timeActivatedFileUpdate data.
bool isFile(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist as a FILE in the file system?
Ostream & endl(Ostream &os)
Add newline and flush stream.
const Type & value() const
Return const reference to value.
#define forAll(list, i)
Loop across all elements in list.
virtual bool write()
Do nothing.
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
pid_t pid()
Return the PID of this process.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
Macros for easy insertion into run-time selection tables.
errorManipArg< error, int > exit(error &err, const int errNo=1)
static bool master(const label communicator=0)
Am I the master process.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
virtual const word & type() const =0
Runtime type information.
scalar deltaTValue() const
Return time step value.
virtual bool filesModified() const
Did any file get changed during execution?
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
defineTypeNameAndDebug(ObukhovLength, 0)