This function object executes system calls, entered in the form of a string lists. Calls can be made at the following points in the calculation: More...
Public Member Functions | |
TypeName ("systemCall") | |
Runtime type information. More... | |
systemCall (const word &name, const Time &runTime, const dictionary &dict) | |
Construct from Time and dictionary. More... | |
virtual | ~systemCall () |
Destructor. More... | |
virtual bool | read (const dictionary &) |
Read the system calls. More... | |
virtual bool | execute () |
Execute the "executeCalls" at each time-step. More... | |
virtual bool | end () |
Execute the "endCalls" at the final time-loop. More... | |
virtual bool | write () |
Write, execute the "writeCalls". More... | |
Public Member Functions inherited from functionObject | |
virtual const word & | type () const =0 |
Runtime type information. More... | |
declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict)) | |
functionObject (const word &name) | |
Construct from components. More... | |
autoPtr< functionObject > | clone () const |
Return clone. More... | |
virtual | ~functionObject () |
Destructor. More... | |
const word & | name () const |
Return the name of this functionObject. More... | |
virtual bool | adjustTimeStep () |
Called at the end of Time::adjustDeltaT() if adjustTime is true. More... | |
virtual void | updateMesh (const mapPolyMesh &mpm) |
Update for changes of mesh. More... | |
virtual void | movePoints (const polyMesh &mesh) |
Update for changes of mesh. More... | |
Protected Attributes | |
stringList | executeCalls_ |
List of calls to execute - every step. More... | |
stringList | endCalls_ |
List of calls to execute when exiting the time-loop. More... | |
stringList | writeCalls_ |
List of calls to execute - write steps. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from functionObject | |
static autoPtr< functionObject > | New (const word &name, const Time &, const dictionary &) |
Select from dictionary, based on its "type" entry. More... | |
Public Attributes inherited from functionObject | |
Switch | log |
Switch write log to Info. More... | |
Static Public Attributes inherited from functionObject | |
static int | debug |
static bool | postProcess |
Global post-processing mode switch. More... | |
This function object executes system calls, entered in the form of a string lists. Calls can be made at the following points in the calculation:
Example of function object specification:
systemCall1 { type systemCall; libs ("libutilityFunctionObjects.so"); ... executeCalls ( "echo execute" ); writeCalls ( "echo \*\*\* writing data \*\*\*" ); endCalls ( "echo \*\*\* writing .bashrc \*\*\*" "cat ~/.bashrc" "echo \*\*\* done \*\*\*" ); }
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 |
systemCall
function object, the allowSystemOperations
must be set to '1'; otherwise, system calls will not be allowed.Definition at line 127 of file systemCall.H.
systemCall | ( | const word & | name, |
const Time & | runTime, | ||
const dictionary & | dict | ||
) |
Construct from Time and dictionary.
Definition at line 52 of file systemCall.C.
References Foam::read().
|
virtual |
Destructor.
Definition at line 69 of file systemCall.C.
TypeName | ( | "systemCall" | ) |
Runtime type information.
|
virtual |
Read the system calls.
Reimplemented from functionObject.
Definition at line 75 of file systemCall.C.
References dynamicCode::allowSystemOperations, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, dictionary::readIfPresent(), and WarningInFunction.
|
virtual |
Execute the "executeCalls" at each time-step.
Implements functionObject.
Definition at line 108 of file systemCall.C.
References forAll, and Foam::system().
|
virtual |
Execute the "endCalls" at the final time-loop.
Reimplemented from functionObject.
Definition at line 119 of file systemCall.C.
References forAll, and Foam::system().
|
virtual |
Write, execute the "writeCalls".
Implements functionObject.
Definition at line 130 of file systemCall.C.
References forAll, and Foam::system().
|
protected |
List of calls to execute - every step.
Definition at line 136 of file systemCall.H.
|
protected |
List of calls to execute when exiting the time-loop.
Definition at line 139 of file systemCall.H.
|
protected |
List of calls to execute - write steps.
Definition at line 142 of file systemCall.H.