Public Member Functions | Protected Member Functions | Protected Attributes
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...

Collaboration diagram for systemCall:
Collaboration graph
[legend]

Public Member Functions

 TypeName ("systemCall")
 Runtime type information. More...
 
 systemCall (const word &name, const objectRegistry &unused, const dictionary &, const bool loadFromFilesUnused=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~systemCall ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the system call set. More...
 
virtual void read (const dictionary &)
 Read the system calls. More...
 
virtual void execute ()
 Execute the "executeCalls" at each time-step. More...
 
virtual void end ()
 Execute the "endCalls" at the final time-loop. More...
 
virtual void timeSet ()
 Called when time was set at the end of the Time::operator++. More...
 
virtual void write ()
 Write, execute the "writeCalls". More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh. More...
 
virtual void movePoints (const polyMesh &)
 Update for changes of mesh. More...
 

Protected Member Functions

 systemCall (const systemCall &)
 Disallow default bitwise copy construct. More...
 
void operator= (const systemCall &)
 Disallow default bitwise assignment. More...
 

Protected Attributes

word name_
 Name of this set of system calls. 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...
 

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;
    functionObjectLibs ("libsystemCall.so");
    ...
    executeCalls
    (
        "echo execute"
    );
    writeCalls
    (
        "echo \*\*\* writing data \*\*\*"
    );
    endCalls
    (
        "echo \*\*\* writing .bashrc \*\*\*"
        "cat ~/.bashrc"
        "echo \*\*\* done \*\*\*"
    );
}


Function object 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::OutputFilterFunctionObject
Source files

Definition at line 131 of file systemCall.H.

Constructor & Destructor Documentation

◆ systemCall() [1/2]

systemCall ( const systemCall )
protected

Disallow default bitwise copy construct.

◆ systemCall() [2/2]

systemCall ( const word name,
const objectRegistry unused,
const dictionary dict,
const bool  loadFromFilesUnused = false 
)

Construct for given objectRegistry and dictionary.

Allow the possibility to load fields from files

Definition at line 41 of file systemCall.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~systemCall()

~systemCall ( )
virtual

Destructor.

Definition at line 59 of file systemCall.C.

Member Function Documentation

◆ operator=()

void operator= ( const systemCall )
protected

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "systemCall"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the system call set.

Definition at line 185 of file systemCall.H.

References systemCall::name_.

◆ read()

void read ( const dictionary dict)
virtual

Read the system calls.

Definition at line 65 of file systemCall.C.

References dynamicCode::allowSystemOperations, dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, Foam::nl, dictionary::readIfPresent(), and WarningInFunction.

Here is the call graph for this function:

◆ execute()

void execute ( )
virtual

Execute the "executeCalls" at each time-step.

Definition at line 96 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

◆ end()

void end ( )
virtual

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

Definition at line 105 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

◆ timeSet()

void timeSet ( )
virtual

Called when time was set at the end of the Time::operator++.

Definition at line 114 of file systemCall.C.

◆ write()

void write ( )
virtual

Write, execute the "writeCalls".

Definition at line 120 of file systemCall.C.

References forAll, and Foam::system().

Here is the call graph for this function:

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 206 of file systemCall.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh.

Definition at line 210 of file systemCall.H.

Field Documentation

◆ name_

word name_
protected

Name of this set of system calls.

Definition at line 138 of file systemCall.H.

Referenced by systemCall::name().

◆ executeCalls_

stringList executeCalls_
protected

List of calls to execute - every step.

Definition at line 141 of file systemCall.H.

◆ endCalls_

stringList endCalls_
protected

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

Definition at line 144 of file systemCall.H.

◆ writeCalls_

stringList writeCalls_
protected

List of calls to execute - write steps.

Definition at line 147 of file systemCall.H.


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