Loading...
Searching...
No Matches

Watches for presence of the named trigger file in the case directory and signals a simulation stop (or other) event if found. More...

#include <abort.H>

Inheritance diagram for abort:
Collaboration diagram for abort:

Public Member Functions

 TypeName ("abort")
 Runtime type information.
 abort (const word &name, const Time &runTime, const dictionary &dict)
 Construct from name, Time and dictionary.
virtual ~abort ()=default
 Destructor.
virtual bool read (const dictionary &dict)
 Read the function-object dictionary.
virtual bool execute ()
 Execute the function-object operations.
virtual bool write ()
 Write the function-object results (no-op).
virtual bool end ()
 Remove the trigger file after the final time-loop.
Public Member Functions inherited from timeFunctionObject
 timeFunctionObject (const word &name, const Time &runTime)
 Construct from Time.
virtual ~timeFunctionObject ()=default
 Destructor.
const Timetime () const
 Return time database.
objectRegistrystoredObjects ()
 Write access to the output objects ("functionObjectObjects") registered on Time.
const objectRegistrystoredObjects () const
 Const access to the output objects ("functionObjectObjects") registered on Time.
Public Member Functions inherited from functionObject
 declareRunTimeSelectionTable (autoPtr, functionObject, dictionary,(const word &name, const Time &runTime, const dictionary &dict),(name, runTime, dict))
 functionObject (const word &name, const bool withNamePrefix=defaultUseNamePrefix)
 Construct from components.
autoPtr< functionObjectclone () const
 Return clone.
virtual ~functionObject ()=default
 Destructor.
virtual const wordtype () const =0
 Runtime type information.
const wordname () const noexcept
 Return the name of this functionObject.
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix.
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix.
virtual bool execute (const label subIndex)
 Execute using the specified subIndex.
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true.
virtual bool filesModified () const
 Did any file get changed during execution?
virtual void updateMesh (const mapPolyMesh &mpm)
 Update for changes of mesh.
virtual void movePoints (const polyMesh &mesh)
 Update for changes of mesh.

Additional Inherited Members

Static Public Member Functions inherited from functionObject
static autoPtr< functionObjectNew (const word &name, const Time &runTime, const dictionary &dict)
 Select from dictionary, based on its "type" entry.
Public Attributes inherited from functionObject
bool log
 Flag to write log into Info.
Static Public Attributes inherited from functionObject
static int debug
 Flag to execute debug content.
static bool postProcess
 Global post-processing mode switch.
static bool defaultUseNamePrefix
 Global default for useNamePrefix.
static word outputPrefix
 Directory prefix.
Protected Member Functions inherited from timeFunctionObject
void clearOutputObjects (const wordList &objNames)
 Remove specified items from "functionObjectObjects".
 timeFunctionObject (const timeFunctionObject &)=delete
 No copy construct.
void operator= (const timeFunctionObject &)=delete
 No copy assignment.
Protected Member Functions inherited from functionObject
word scopedName (const word &name) const
 Return a scoped (prefixed) name.
Protected Attributes inherited from timeFunctionObject
const Timetime_
 Reference to the time database.

Detailed Description

Watches for presence of the named trigger file in the case directory and signals a simulation stop (or other) event if found.

The presence of the trigger file is only checked on the master process.

Currently the following action types are supported:

  • noWriteNow
  • writeNow
  • nextWrite
Usage
Minimal example by using system/controlDict.functions:
abortFO
{
    // Mandatory entries
    type            abort;
    libs            (utilityFunctionObjects);

    // Optional entries
    file            <word>;  // "<case>/GOODBYE";
    action          <word>;

    // Inherited entries
    ...
}

where the entries mean:

Property Description Type Reqd Deflt
type Type name: abort word yes -
libs Library name: utilityFunctionObjects word yes -
file The trigger filename word no <case>/name
action The default action to trigger word no nextWrite

When the trigger file is found, it is checked for the following content which corresponds to actions.

The inherited entries are elaborated in:

Note
The trigger file is considered "sticky". This means that once detected and processed, the trigger is duly noted and the file will not be rechecked. It is not possible or desirable to 'untrigger' an action.
Source files

Definition at line 141 of file abort.H.

Constructor & Destructor Documentation

◆ abort()

abort ( const word & name,
const Time & runTime,
const dictionary & dict )

Construct from name, Time and dictionary.

Definition at line 130 of file abort.C.

References dict, UPstream::master(), functionObject::name(), read(), Foam::rm(), runTime, and timeFunctionObject::timeFunctionObject().

Here is the call graph for this function:

◆ ~abort()

virtual ~abort ( )
virtualdefault

Destructor.

References dict.

Member Function Documentation

◆ TypeName()

TypeName ( "abort" )

Runtime type information.

References dict, functionObject::name(), and runTime.

Here is the call graph for this function:

◆ read()

bool read ( const dictionary & dict)
virtual

Read the function-object dictionary.

Reimplemented from functionObject.

Definition at line 154 of file abort.C.

References dict, Foam::endl(), Foam::Info, Foam::longDescription(), name, Foam::nl, functionObject::read(), Time::saNextWrite, Time::stopAtControlNames, timeFunctionObject::time_, and Foam::type().

Referenced by abort().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ execute()

bool execute ( )
virtual

Execute the function-object operations.

Check existence of the file and take action

Implements functionObject.

Definition at line 194 of file abort.C.

References UPstream::broadcast, Foam::endl(), Foam::getStopAction(), Foam::Info, Foam::isFile(), Foam::longDescription(), UPstream::master(), Time::saUnknown, and timeFunctionObject::time_.

Here is the call graph for this function:

◆ write()

bool write ( )
virtual

Write the function-object results (no-op).

Implements functionObject.

Definition at line 235 of file abort.C.

◆ end()

bool end ( )
virtual

Remove the trigger file after the final time-loop.

Reimplemented from functionObject.

Definition at line 241 of file abort.C.

References UPstream::master(), and Foam::rm().

Here is the call graph for this function:

The documentation for this class was generated from the following files:
  • src/functionObjects/utilities/abort/abort.H
  • src/functionObjects/utilities/abort/abort.C