Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
abortCalculation Class Reference

Watches for presence of the named file in the $FOAM_CASE directory and aborts the calculation if it is present. More...

Collaboration diagram for abortCalculation:
Collaboration graph
[legend]

Public Types

enum  actionType { noWriteNow, writeNow, nextWrite }
 Enumeration defining the type of action. More...
 

Public Member Functions

 TypeName ("abort")
 Runtime type information. More...
 
 abortCalculation (const word &name, const objectRegistry &, const dictionary &, const bool loadFromFilesUnused=false)
 Construct for given objectRegistry and dictionary. More...
 
virtual ~abortCalculation ()
 Destructor. More...
 
virtual const wordname () const
 Return name of the abort file. More...
 
virtual void read (const dictionary &)
 Read the dictionary settings. More...
 
virtual void execute ()
 Execute, check existence of abort file and take action. More...
 
virtual void end ()
 Execute at the final time-loop, used for cleanup. More...
 
virtual void timeSet ()
 Called when time was set at the end of the Time::operator++. More...
 
virtual void write ()
 Execute, check existence of abort file and take action. More...
 
virtual void updateMesh (const mapPolyMesh &)
 Update for changes of mesh - does nothing. More...
 
virtual void movePoints (const polyMesh &)
 Update for changes of mesh - does nothing. More...
 

Private Member Functions

void removeFile () const
 Remove abort file. More...
 
 abortCalculation (const abortCalculation &)
 Disallow default bitwise copy construct. More...
 
void operator= (const abortCalculation &)
 Disallow default bitwise assignment. More...
 

Private Attributes

word name_
 Name of the abort file unless otherwise specified. More...
 
const objectRegistryobr_
 
fileName abortFile_
 The fully-qualified name of the abort file. More...
 
actionType action_
 The type of action. More...
 

Static Private Attributes

static const NamedEnum< actionType, 3 > actionTypeNames_
 Action type names. More...
 

Detailed Description

Watches for presence of the named file in the $FOAM_CASE directory and aborts the calculation if it is present.

Currently the following action types are supported:

Source files

Definition at line 64 of file abortCalculation.H.

Member Enumeration Documentation

◆ actionType

enum actionType

Enumeration defining the type of action.

Enumerator
noWriteNow 

stop immediately without writing data

writeNow 

write data and stop immediately

nextWrite 

stop the next time data are written

Definition at line 71 of file abortCalculation.H.

Constructor & Destructor Documentation

◆ abortCalculation() [1/2]

abortCalculation ( const abortCalculation )
private

Disallow default bitwise copy construct.

◆ abortCalculation() [2/2]

abortCalculation ( const word name,
const objectRegistry obr,
const dictionary dict,
const bool  loadFromFilesUnused = false 
)

Construct for given objectRegistry and dictionary.

Definition at line 81 of file abortCalculation.C.

References dict, and Foam::read().

Here is the call graph for this function:

◆ ~abortCalculation()

~abortCalculation ( )
virtual

Destructor.

Definition at line 103 of file abortCalculation.C.

Member Function Documentation

◆ removeFile()

void removeFile ( ) const
private

Remove abort file.

Definition at line 65 of file abortCalculation.C.

References abortCalculation::abortFile_, Foam::isFile(), UPstream::master(), Foam::reduce(), and Foam::rm().

Here is the call graph for this function:

◆ operator=()

void operator= ( const abortCalculation )
private

Disallow default bitwise assignment.

◆ TypeName()

TypeName ( "abort"  )

Runtime type information.

◆ name()

virtual const word& name ( ) const
inlinevirtual

Return name of the abort file.

Definition at line 134 of file abortCalculation.H.

References abortCalculation::name_.

◆ read()

void read ( const dictionary dict)
virtual

Read the dictionary settings.

Definition at line 109 of file abortCalculation.C.

References dict, dictionary::found(), dictionary::lookup(), and dictionary::readIfPresent().

Here is the call graph for this function:

◆ execute()

void execute ( )
virtual

Execute, check existence of abort file and take action.

Definition at line 127 of file abortCalculation.C.

References Foam::endl(), Foam::Info, Foam::isFile(), Foam::reduce(), Time::saNextWrite, Time::saNoWriteNow, and Time::saWriteNow.

Here is the call graph for this function:

◆ end()

void end ( )
virtual

Execute at the final time-loop, used for cleanup.

Definition at line 176 of file abortCalculation.C.

◆ timeSet()

void timeSet ( )
virtual

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

Definition at line 182 of file abortCalculation.C.

◆ write()

void write ( )
virtual

Execute, check existence of abort file and take action.

Definition at line 188 of file abortCalculation.C.

◆ updateMesh()

virtual void updateMesh ( const mapPolyMesh )
inlinevirtual

Update for changes of mesh - does nothing.

Definition at line 155 of file abortCalculation.H.

◆ movePoints()

virtual void movePoints ( const polyMesh )
inlinevirtual

Update for changes of mesh - does nothing.

Definition at line 159 of file abortCalculation.H.

Field Documentation

◆ name_

word name_
private

Name of the abort file unless otherwise specified.

Definition at line 83 of file abortCalculation.H.

Referenced by abortCalculation::name().

◆ obr_

const objectRegistry& obr_
private

Definition at line 85 of file abortCalculation.H.

◆ abortFile_

fileName abortFile_
private

The fully-qualified name of the abort file.

Definition at line 88 of file abortCalculation.H.

Referenced by abortCalculation::removeFile().

◆ actionTypeNames_

const Foam::NamedEnum< Foam::abortCalculation::actionType, 3 > actionTypeNames_
staticprivate

Action type names.

Definition at line 91 of file abortCalculation.H.

◆ action_

actionType action_
private

The type of action.

Definition at line 94 of file abortCalculation.H.


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