Executes system calls, entered in the form of string lists. More...
Public Member Functions | |
TypeName ("systemCall") | |
systemCall (const word &name, const Time &runTime, const dictionary &dict) | |
virtual | ~systemCall ()=default |
virtual bool | read (const dictionary &dict) |
virtual bool | execute () |
virtual bool | write () |
virtual bool | end () |
![]() | |
declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict)) | |
functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix) | |
autoPtr< functionObject > | clone () const |
virtual | ~functionObject ()=default |
virtual const word & | type () const =0 |
const word & | name () const noexcept |
bool | useNamePrefix () const noexcept |
bool | useNamePrefix (bool on) noexcept |
virtual bool | execute (const label subIndex) |
virtual bool | adjustTimeStep () |
virtual bool | filesModified () const |
virtual void | updateMesh (const mapPolyMesh &mpm) |
virtual void | movePoints (const polyMesh &mesh) |
Protected Member Functions | |
label | dispatch (const stringList &calls) |
systemCall (const systemCall &)=delete | |
void | operator= (const systemCall &)=delete |
![]() | |
word | scopedName (const word &name) const |
Protected Attributes | |
stringList | executeCalls_ |
stringList | writeCalls_ |
stringList | endCalls_ |
bool | masterOnly_ |
Additional Inherited Members | |
![]() | |
static autoPtr< functionObject > | New (const word &name, const Time &runTime, const dictionary &dict) |
![]() | |
bool | log |
![]() | |
static int | debug |
static bool | postProcess |
static bool | defaultUseNamePrefix |
static word | outputPrefix |
Executes system calls, entered in the form of string lists.
Calls can be made at the following points in the calculation:
systemCall1 { type systemCall; libs (utilityFunctionObjects); ... executeCalls ( "echo execute" ); writeCalls ( "echo === writing data ===" ); endCalls ( "echo === echoing .bashrc ===" "cat ~/.bashrc" "echo \*\*\* done \*\*\*" ); }
Where the entries comprise:
Property | Description | Required | Default value |
---|---|---|---|
type | type name: systemCall | yes | |
executeCalls | list of calls on execute | yes | |
writeCalls | list of calls on write | yes | |
endCalls | list of calls on end | yes | |
master | execute on master only | no | false |
systemCall
function object, the allowSystemOperations
must be set to '1'; otherwise, system calls will not be allowed.Additionally, since the system commands are normally sent via the shell, special shell character may require backslash escaping.
Definition at line 136 of file systemCall.H.
|
protecteddelete |
systemCall | ( | const word & | name, |
const Time & | runTime, | ||
const dictionary & | dict | ||
) |
Definition at line 79 of file systemCall.C.
References dict, and Foam::read().
|
virtualdefault |
|
protected |
Definition at line 48 of file systemCall.C.
References UPstream::master(), systemCall::masterOnly_, Pstream::scatter(), and Foam::system().
|
protecteddelete |
TypeName | ( | "systemCall" | ) |
|
virtual |
Reimplemented from functionObject.
Definition at line 97 of file systemCall.C.
References dynamicCode::allowSystemOperations, Foam::foamVersion::api, dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::isAdministrator(), Foam::nl, functionObject::read(), and WarningInFunction.
|
virtual |
Implements functionObject.
Definition at line 145 of file systemCall.C.
|
virtual |
Implements functionObject.
Definition at line 152 of file systemCall.C.
|
virtual |
Reimplemented from functionObject.
Definition at line 159 of file systemCall.C.
|
protected |
Definition at line 145 of file systemCall.H.
|
protected |
Definition at line 148 of file systemCall.H.
|
protected |
Definition at line 151 of file systemCall.H.
|
protected |
Definition at line 154 of file systemCall.H.
Referenced by systemCall::dispatch().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.