38 namespace functionObjects
45 timeActivatedFileUpdate,
54 void Foam::functionObjects::timeActivatedFileUpdate::updateFile()
61 i < timeVsFile_.size()-1
70 const fileName& srcFile = timeVsFile_[i].second();
100 Foam::functionObjects::timeActivatedFileUpdate::timeActivatedFileUpdate
126 dict.readEntry(
"fileToUpdate", fileToUpdate_);
127 dict.readEntry(
"timeVsFile", timeVsFile_);
130 fileToUpdate_.expand();
132 if (fileToUpdate_.empty() || timeVsFile_.empty())
135 <<
"Bad entries for fileToUpdate and/or timeVsFile" <<
endl 140 <<
" time vs file list:" <<
nl;
142 for (
auto& tuple : timeVsFile_)
148 Info<<
" " << tuple.first() <<
tab 149 << time_.relativePath(srcFile,
true) <<
nl;
159 <<
"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...
refPtr< fileOperation > fileHandler(std::nullptr_t)
Delete current file handler - forwards to fileOperation::handler()
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 expressions::valueTypeCode::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.
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)
True if process corresponds to the master rank in the communicator.
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.