Public Member Functions | Protected Attributes | List of all members
systemCall Class Reference

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...

Inheritance diagram for systemCall:
Inheritance graph
[legend]
Collaboration diagram for systemCall:
Collaboration graph
[legend]

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 wordtype () 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< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()
 Destructor. More...
 
const wordname () 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< functionObjectNew (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...
 

Detailed Description

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:

- every time step

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 \*\*\*"
    );
}
Usage
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
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.
See also
Foam::functionObject Foam::functionObjects::timeControl
Source files

Definition at line 127 of file systemCall.H.

Constructor & Destructor Documentation

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().

Here is the call graph for this function:

~systemCall ( )
virtual

Destructor.

Definition at line 69 of file systemCall.C.

Member Function Documentation

TypeName ( "systemCall"  )

Runtime type information.

bool read ( const dictionary dict)
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.

Here is the call graph for this function:

bool execute ( )
virtual

Execute the "executeCalls" at each time-step.

Implements functionObject.

Definition at line 108 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

bool end ( )
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().

Here is the call graph for this function:

bool write ( )
virtual

Write, execute the "writeCalls".

Implements functionObject.

Definition at line 130 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

Member Data Documentation

stringList executeCalls_
protected

List of calls to execute - every step.

Definition at line 136 of file systemCall.H.

stringList endCalls_
protected

List of calls to execute when exiting the time-loop.

Definition at line 139 of file systemCall.H.

stringList writeCalls_
protected

List of calls to execute - write steps.

Definition at line 142 of file systemCall.H.


The documentation for this class was generated from the following files: