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 objectRegistry &unused, const dictionary &, const bool loadFromFilesUnused=false) | |
Construct for given objectRegistry and dictionary. More... | |
virtual | ~systemCall () |
Destructor. More... | |
virtual const word & | name () 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... | |
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; 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 |
systemCall
function object, the allowSystemOperations
must be set to '1'; otherwise, system calls will not be allowed.Definition at line 131 of file systemCall.H.
|
protected |
Disallow default bitwise copy construct.
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().
|
virtual |
Destructor.
Definition at line 59 of file systemCall.C.
|
protected |
Disallow default bitwise assignment.
TypeName | ( | "systemCall" | ) |
Runtime type information.
|
inlinevirtual |
Return name of the system call set.
Definition at line 185 of file systemCall.H.
References systemCall::name_.
|
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.
|
virtual |
Execute the "executeCalls" at each time-step.
Definition at line 96 of file systemCall.C.
References forAll, and Foam::system().
|
virtual |
Execute the "endCalls" at the final time-loop.
Definition at line 105 of file systemCall.C.
References forAll, and Foam::system().
|
virtual |
Called when time was set at the end of the Time::operator++.
Definition at line 114 of file systemCall.C.
|
virtual |
Write, execute the "writeCalls".
Definition at line 120 of file systemCall.C.
References forAll, and Foam::system().
|
inlinevirtual |
Update for changes of mesh.
Definition at line 206 of file systemCall.H.
|
inlinevirtual |
Update for changes of mesh.
Definition at line 210 of file systemCall.H.
|
protected |
Name of this set of system calls.
Definition at line 138 of file systemCall.H.
Referenced by systemCall::name().
|
protected |
List of calls to execute - every step.
Definition at line 141 of file systemCall.H.
|
protected |
List of calls to execute when exiting the time-loop.
Definition at line 144 of file systemCall.H.
|
protected |
List of calls to execute - write steps.
Definition at line 147 of file systemCall.H.
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.