systemCall Class Reference

Executes system calls, entered in the form of a string lists. More...

Inheritance diagram for systemCall:
Collaboration diagram for systemCall:

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 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 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...
 
 functionObject (const functionObject &)=delete
 Disallow default bitwise copy construction. More...
 
virtual ~functionObject ()
 Destructor. More...
 
const wordname () 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 timeToNextWrite ()
 Called by Time::adjustTimeStep(). Allows the functionObject to. 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...
 
void operator= (const functionObject &)=delete
 Disallow default bitwise assignment. 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...
 
Switch executeAtStart_
 Switch write log to Info. More...
 
- Static Public Attributes inherited from functionObject
static bool postProcess
 Global post-processing mode switch. More...
 

Detailed Description

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
  • every output time
  • end of 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 \*\*\*"
    );
}
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 124 of file systemCall.H.

Constructor & Destructor Documentation

◆ systemCall() [1/2]

systemCall ( const word name,
const Time runTime,
const dictionary dict 
)

Construct from Time and dictionary.

Definition at line 53 of file systemCall.C.

References Foam::read().

Here is the call graph for this function:

◆ systemCall() [2/2]

systemCall ( const systemCall )
delete

Disallow default bitwise copy construction.

◆ ~systemCall()

~systemCall ( )
virtual

Destructor.

Definition at line 70 of file systemCall.C.

Member Function Documentation

◆ TypeName()

TypeName ( "systemCall"  )

Runtime type information.

◆ read()

bool read ( const dictionary dict)
virtual

Read the system calls.

Reimplemented from functionObject.

Definition at line 76 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:

◆ execute()

bool execute ( )
virtual

Execute the "executeCalls" at each time-step.

Implements functionObject.

Definition at line 109 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

◆ end()

bool end ( )
virtual

Execute the "endCalls" at the final time-loop.

Reimplemented from functionObject.

Definition at line 120 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

◆ write()

bool write ( )
virtual

Write, execute the "writeCalls".

Implements functionObject.

Definition at line 131 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

◆ operator=()

void operator= ( const systemCall )
delete

Disallow default bitwise assignment.

Member Data Documentation

◆ executeCalls_

stringList executeCalls_
protected

List of calls to execute - every step.

Definition at line 133 of file systemCall.H.

◆ endCalls_

stringList endCalls_
protected

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

Definition at line 136 of file systemCall.H.

◆ writeCalls_

stringList writeCalls_
protected

List of calls to execute - write steps.

Definition at line 139 of file systemCall.H.


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