38 namespace functionObjects
45 timeActivatedFileUpdate,
54 void Foam::functionObjects::timeActivatedFileUpdate::updateFile()
61 i < timeVsFile_.size()-1
70 const fileName& srcFile = timeVsFile_[i].second();
93 Foam::functionObjects::timeActivatedFileUpdate::timeActivatedFileUpdate
119 dict.readEntry(
"fileToUpdate", fileToUpdate_);
120 dict.readEntry(
"timeVsFile", timeVsFile_);
123 fileToUpdate_.expand();
125 if (fileToUpdate_.empty() || timeVsFile_.empty())
128 <<
"Bad entries for fileToUpdate and/or timeVsFile" <<
endl 133 <<
" time vs file list:" <<
nl;
135 for (
auto& tuple : timeVsFile_)
141 Info<<
" " << tuple.first() <<
tab 142 << time_.relativePath(srcFile,
true) <<
nl;
150 <<
"File not found: " << srcFile <<
endl const Type & value() const noexcept
Return const reference to value.
defineTypeNameAndDebug(ObukhovLength, 0)
bool mv(const fileName &src, const fileName &dst, const bool followLink=false)
Rename src to dst.
A class for handling file names.
scalar deltaTValue() const noexcept
Return time step value.
virtual bool execute()
Execute file updates.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual bool filesModified() const
Did any file get changed during execution?
A list of keyword definitions, which are a keyword followed by a number of values (eg...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
bool cp(const fileName &src, const fileName &dst, const bool followLink=true)
Copy the source to the destination (recursively if necessary).
fileName relativePath(const fileName &input, const bool caseTag=false) const
Return the input relative to the globalPath by stripping off a leading value of the globalPath...
constexpr char tab
The tab '\t' character(0x09)
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
Macros for easy insertion into run-time selection tables.
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
virtual const word & type() const =0
Runtime type information.
virtual bool write()
Do nothing.
pid_t pid()
Return the PID of this process.
bool distributed() const noexcept
True if case running with parallel distributed directories (ie. not NFS mounted)
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
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?
string & expand(const bool allowEmpty=false)
Inplace expand initial tags, tildes, and all occurrences of environment variables as per stringOps::e...
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
static bool master(const label communicator=worldComm)
Am I the master rank.
messageStream Info
Information stream (stdout output on master, null elsewhere)
IOerror FatalIOError
Error stream (stdout output on all processes), with additional 'FOAM FATAL IO ERROR' header text and ...
const Time & time_
Reference to the time database.