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

Inheritance diagram for abort:
[legend]
Collaboration diagram for abort:
[legend]

Public Member Functions

 TypeName ("abort")
 Runtime type information. More...
 
 abort (const word &name, const Time &runTime, const dictionary &dict)
 Construct from Time and dictionary. More...
 
virtual ~abort ()=default
 Destructor. More...
 
virtual bool read (const dictionary &dict)
 Read the dictionary settings. More...
 
virtual bool execute ()
 Check existence of the file and take action. More...
 
virtual bool write ()
 No-op. More...
 
virtual bool end ()
 Remove the trigger file after the final time-loop. More...
 
- Public Member Functions inherited from timeFunctionObject
 timeFunctionObject (const word &name, const Time &runTime)
 Construct from Time. More...
 
virtual ~timeFunctionObject ()=default
 Destructor. More...
 
const Timetime () const
 Return time database. More...
 
objectRegistrystoredObjects ()
 
const objectRegistrystoredObjects () const
 
- 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. More...
 
autoPtr< functionObjectclone () const
 Return clone. More...
 
virtual ~functionObject ()=default
 Destructor. More...
 
virtual const wordtype () const =0
 Runtime type information. More...
 
const wordname () const noexcept
 Return the name of this functionObject. More...
 
bool useNamePrefix () const noexcept
 Return the flag for adding a scoping name prefix. More...
 
bool useNamePrefix (bool on) noexcept
 Modify the flag for adding a scoping name prefix. More...
 
virtual bool execute (const label subIndex)
 Execute using the specified subIndex. More...
 
virtual bool adjustTimeStep ()
 Called at the end of Time::adjustDeltaT() if adjustTime is true. More...
 
virtual bool filesModified () const
 Did any file get changed during execution? 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...
 

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. More...
 
- Public Attributes inherited from functionObject
bool log
 Flag to write log into Info. More...
 
- Static Public Attributes inherited from functionObject
static int debug
 Flag to execute debug content. More...
 
static bool postProcess
 Global post-processing mode switch. More...
 
static bool defaultUseNamePrefix
 Global default for useNamePrefix. More...
 
static word outputPrefix
 Directory prefix. More...
 
- Protected Member Functions inherited from timeFunctionObject
void clearOutputObjects (const wordList &objNames)
 Remove specified items from "functionObjectObjects". More...
 
 timeFunctionObject (const timeFunctionObject &)=delete
 No copy construct. More...
 
void operator= (const timeFunctionObject &)=delete
 No copy assignment. More...
 
- Protected Member Functions inherited from functionObject
word scopedName (const word &name) const
 Return a scoped (prefixed) name. More...
 
- Protected Attributes inherited from timeFunctionObject
const Timetime_
 Reference to the time database. More...
 

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

Example of function object specification:

abort
{
    type    abort;
    libs    (utilityFunctionObjects);

    file    "<case>/GOODBYE";
    action  writeNow
}


Function object usage

Property Description Required Default
type Type name: abort yes
file The trigger filename no <case>/name
action The default action to trigger no nextWrite

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

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 125 of file abort.H.

Constructor & Destructor Documentation

◆ abort()

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

Construct from Time and dictionary.

Definition at line 138 of file abort.C.

References dict, Foam::blockMeshTools::read(), and Foam::rm().

Here is the call graph for this function:

◆ ~abort()

virtual ~abort ( )
virtualdefault

Destructor.

Member Function Documentation

◆ TypeName()

TypeName ( "abort"  )

Runtime type information.

◆ read()

bool read ( const dictionary dict)
virtual

Read the dictionary settings.

Reimplemented from functionObject.

Definition at line 161 of file abort.C.

References fileName::clean(), dict, Foam::endl(), string::expand(), Enum< EnumType >::getOrDefault(), TimePaths::globalPath(), Foam::Info, fileName::isAbsolute(), Foam::longDescription(), functionObject::name(), Foam::nl, functionObject::read(), Time::stopAtControlNames, timeFunctionObject::time_, and functionObject::type().

Here is the call graph for this function:

◆ execute()

bool execute ( )
virtual

Check existence of the file and take action.

Implements functionObject.

Definition at line 201 of file abort.C.

References Foam::endl(), Foam::getStopAction(), Foam::Info, Foam::isFile(), Foam::longDescription(), UPstream::master(), and Pstream::scatter().

Here is the call graph for this function:

◆ write()

bool write ( )
virtual

No-op.

Implements functionObject.

Definition at line 242 of file abort.C.

◆ end()

bool end ( )
virtual

Remove the trigger file after the final time-loop.

Reimplemented from functionObject.

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