Go to the documentation of this file.
39 namespace functionObjects
66 for (
const string& call : calls)
108 executeCalls_.clear();
112 dict.readIfPresent(
"executeCalls", executeCalls_);
113 dict.readIfPresent(
"writeCalls", writeCalls_);
114 dict.readIfPresent(
"endCalls", endCalls_);
115 masterOnly_ =
dict.getOrDefault(
"master",
false);
117 if (executeCalls_.empty() && endCalls_.empty() && writeCalls_.empty())
120 <<
"No executeCalls, endCalls or writeCalls defined."
126 <<
"System calls should not be executed by someone"
127 <<
" with administrator rights for security reasons." <<
nl
134 <<
"Executing user-supplied system calls may have been disabled"
135 <<
" by default" <<
nl
136 <<
"for security reasons." <<
nl
137 <<
"If you trust the code, you may enable this by adding"
139 <<
" allowSystemOperations 1" <<
nl <<
nl
140 <<
"to the InfoSwitches setting in the system controlDict." <<
nl
141 <<
"The system controlDict is any of" <<
nl <<
nl
143 <<
" ~/.OpenFOAM/controlDict" <<
nl
144 <<
" $WM_PROJECT_DIR/etc/controlDict" <<
nl <<
endl
154 dispatch(executeCalls_);
161 dispatch(writeCalls_);
virtual bool end()
Execute the "endCalls" at the final time-loop.
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A class for handling words, derived from Foam::string.
bool read(const char *buf, int32_t &val)
Same as readInt32.
int system(const std::string &command, const bool bg=false)
Execute the specified command via the shell.
static void scatter(const List< commsStruct > &comms, T &Value, const int tag, const label comm)
Scatter data. Distribute without modification. Reverse of gather.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Abstract base-class for Time/database function objects.
static int allowSystemOperations
Flag if system operations are allowed.
bool isAdministrator()
Is the current user the administrator (root)
label dispatch(const stringList &calls)
Dispatch specified calls.
word name(const complex &c)
Return string representation of complex.
virtual bool read(const dictionary &dict)
Read and set the function object if its data have changed.
systemCall(const systemCall &)=delete
No copy construct.
virtual bool read(const dictionary &dict)
Read the system calls.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
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.
virtual bool write()
Write, execute the "writeCalls".
addToRunTimeSelectionTable(functionObject, ObukhovLength, dictionary)
defineTypeNameAndDebug(ObukhovLength, 0)
virtual bool execute()
Execute the "executeCalls" at each time-step.
bool masterOnly_
Perform system calls on the master only.
#define WarningInFunction
Report a warning using Foam::Warning.