Classes | Public Member Functions | Static Public Member Functions | List of all members
sigFpe Class Reference

Set up trapping for floating point exceptions (signal FPE). More...

Classes

class  ignore
 Helper to locally ignore SIGFPE handling. More...
 

Public Member Functions

 sigFpe ()
 Constructor calls set() to activate the FPE signal handler if it was was not previously activate and requested() returns true. More...
 
 ~sigFpe ()
 Destructor calls unset() to deactivate the FPE signal handler as required. More...
 

Static Public Member Functions

static bool requested ()
 Check if SIGFPE signals handler is to be enabled. More...
 
static bool active ()
 True if SIGFPE handling is currently active. More...
 
static bool nanActive ()
 True if NaN memory initialisation is currently active. More...
 
static void set (bool verbose=false)
 Activate SIGFPE signal handler when FOAM_SIGFPE is set. More...
 
static void unset (bool verbose=false)
 Deactivate SIGFPE signal handler and NaN memory initialisation. More...
 
static void fillNan (UList< scalar > &list)
 Fill data block with NaN values. More...
 

Detailed Description

Set up trapping for floating point exceptions (signal FPE).

Defined by controlDict InfoSwitch entries:

Source files

Definition at line 69 of file sigFpe.H.

Constructor & Destructor Documentation

◆ sigFpe()

sigFpe ( )

Constructor calls set() to activate the FPE signal handler if it was was not previously activate and requested() returns true.

Definition at line 127 of file sigFpe.C.

◆ ~sigFpe()

~sigFpe ( )

Destructor calls unset() to deactivate the FPE signal handler as required.

Definition at line 146 of file sigFpe.C.

References sigFpe::unset().

Here is the call graph for this function:

Member Function Documentation

◆ requested()

bool requested ( )
static

Check if SIGFPE signals handler is to be enabled.

This is controlled by the trapFpe entry or the FOAM_SIGFPE environment variable

Definition at line 170 of file sigFpe.C.

References isTrue().

Referenced by sigFpe::set().

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

◆ active()

static bool active ( )
inlinestatic

True if SIGFPE handling is currently active.

Definition at line 137 of file sigFpe.H.

◆ nanActive()

static bool nanActive ( )
inlinestatic

True if NaN memory initialisation is currently active.

Definition at line 145 of file sigFpe.H.

◆ set()

void set ( bool  verbose = false)
static

Activate SIGFPE signal handler when FOAM_SIGFPE is set.

Fill memory with NaN when FOAM_SETNAN is set

Definition at line 176 of file sigFpe.C.

References Foam::endl(), Foam::Info, isTrue(), sigFpe::requested(), and Foam::setHandler().

Referenced by argList::parse(), and sigFpe::ignore::restore().

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

◆ unset()

void unset ( bool  verbose = false)
static

Deactivate SIGFPE signal handler and NaN memory initialisation.

Definition at line 234 of file sigFpe.C.

References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, Foam::Info, and Foam::resetHandler().

Referenced by sigFpe::ignore::ignore(), and sigFpe::~sigFpe().

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

◆ fillNan()

void fillNan ( UList< scalar > &  list)
static

Fill data block with NaN values.

Definition at line 270 of file sigFpe.C.

Referenced by dynamicRefineFvMesh::mapFields().

Here is the caller graph for this function:

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