Executes system calls, entered in the form of a string lists. 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... | |
| systemCall (const systemCall &)=delete | |
| Disallow default bitwise copy construction. More... | |
| virtual | ~systemCall () |
| Destructor. More... | |
| virtual bool | read (const dictionary &) |
| Read the system calls. More... | |
| virtual wordList | fields () const |
| Return the list of fields required. 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... | |
| void | operator= (const systemCall &)=delete |
| Disallow default bitwise assignment. More... | |
Public Member Functions inherited from functionObject | |
| ClassName ("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, const Time &runTime) | |
| Construct from components. More... | |
| functionObject (const word &name, const Time &runTime, const dictionary &dict) | |
| Construct from dictionary. More... | |
| autoPtr< functionObject > | clone () const |
| Return clone. More... | |
| functionObject (const functionObject &)=delete | |
| Disallow default bitwise copy construction. More... | |
| virtual | ~functionObject () |
| Destructor. More... | |
| const word & | name () const |
| Return the name of this functionObject. More... | |
| virtual bool | executeAtStart () const |
| Return true if the functionObject should be executed at the start. More... | |
| virtual scalar | timeToNextAction () |
| Called by Time::adjustTimeStep(). Allows the functionObject to. More... | |
| virtual scalar | maxDeltaT () const |
| Return the maximum time-step for stable operation. More... | |
| virtual void | movePoints (const polyMesh &mesh) |
| Update topology using the given map. More... | |
| virtual void | topoChange (const polyTopoChangeMap &map) |
| Update topology using the given map. More... | |
| virtual void | mapMesh (const polyMeshMap &) |
| Update from another mesh using the given map. More... | |
| virtual void | distribute (const polyDistributionMap &) |
| Redistribute or update using the given distribution map. More... | |
| void | operator= (const functionObject &)=delete |
| Disallow default bitwise assignment. More... | |
Protected Attributes | |
| bool | parallel_ |
| Perform the call by each processor or by the master only. More... | |
| 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... | |
Protected Attributes inherited from functionObject | |
| const Time & | time_ |
| Reference to time. 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... | |
| Switch | executeAtStart_ |
| Switch execute at start time. More... | |
Static Public Attributes inherited from functionObject | |
| static bool | postProcess |
| Global post-processing mode switch. More... | |
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 | |
parallel | execute on all processors | no | false |
executeCalls | list of calls on execute | yes | |
writeCalls | list of calls on write | yes | |
endCalls | list of calls on end | yes |
Note Since this function object executes system calls, there is a potential security risk. In order to use the systemCall function object, the allowSystemOperations must be set to '1'; otherwise, system calls will not be allowed.
Definition at line 133 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 dict, and systemCall::read().

|
delete |
Disallow default bitwise copy construction.
|
virtual |
Destructor.
Definition at line 71 of file systemCall.C.
| TypeName | ( | "systemCall" | ) |
Runtime type information.
|
virtual |
Read the system calls.
Reimplemented from functionObject.
Definition at line 77 of file systemCall.C.
References dynamicCode::allowSystemOperations, dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, and WarningInFunction.
Referenced by systemCall::systemCall().


|
inlinevirtual |
Return the list of fields required.
Implements functionObject.
Definition at line 184 of file systemCall.H.
References List< word >::null().

|
virtual |
Execute the "executeCalls" at each time-step.
Implements functionObject.
Definition at line 112 of file systemCall.C.
References forAll, UPstream::master(), and Foam::system().

|
virtual |
Execute the "endCalls" at the final time-loop.
Reimplemented from functionObject.
Definition at line 126 of file systemCall.C.
References forAll, UPstream::master(), and Foam::system().

|
virtual |
Write, execute the "writeCalls".
Implements functionObject.
Definition at line 140 of file systemCall.C.
References forAll, UPstream::master(), and Foam::system().

|
delete |
Disallow default bitwise assignment.
|
protected |
Perform the call by each processor or by the master only.
Definition at line 142 of file systemCall.H.
|
protected |
List of calls to execute - every step.
Definition at line 145 of file systemCall.H.
|
protected |
List of calls to execute when exiting the time-loop.
Definition at line 148 of file systemCall.H.
|
protected |
List of calls to execute - write steps.
Definition at line 151 of file systemCall.H.