Set up trapping for floating point exceptions (signal FPE). More...
Public Member Functions | |
sigFpe () | |
Construct null. More... | |
~sigFpe () | |
Destructor. More... | |
Static Public Member Functions | |
static void | set (const bool verbose) |
Activate SIGFPE signal handler when FOAM_SIGFPE is set. More... | |
static void | unset (const bool verbose) |
Deactivate SIGFPE signal handler and NaN memory initialisation. More... | |
static void | fillNan (UList< scalar > &) |
Fill block of data with NaN. More... | |
Static Public Attributes | |
static bool | mallocNanActive_ = false |
Flag to indicate mallocNan is enabled. More... | |
Static Private Attributes | |
static struct sigaction | oldAction_ |
Saved old signal trapping setting. More... | |
static bool | sigFpeActive_ = false |
Flag to indicate floating point trapping is enabled. More... | |
Set up trapping for floating point exceptions (signal FPE).
FOAM_SIGFPE | exception trapping |
FOAM_SETNAN | initialization of all malloced memory to NaN. If FOAM_SIGFPE also set, this will cause usage of uninitialized scalars to trigger an abort. |
Can be used either directly through the static member functions or through the scope of the object (constructor sets trapping; destructor restores original).
|
static |
Activate SIGFPE signal handler when FOAM_SIGFPE is set.
Fill memory with NaN when FOAM_SETNAN is set
Definition at line 131 of file sigFpe.C.
References Foam::abort(), Foam::endl(), Foam::env(), Foam::FatalError, FatalErrorInFunction, and Foam::Info.
Referenced by argList::parse(), and runTimePostProcessing::write().
|
static |
Deactivate SIGFPE signal handler and NaN memory initialisation.
Definition at line 226 of file sigFpe.C.
References Foam::abort(), Foam::endl(), Foam::FatalError, FatalErrorInFunction, and Foam::Info.
Referenced by runTimePostProcessing::write().
|
static |
Fill block of data with NaN.
Definition at line 50 of file sigFpe.C.
Referenced by dynamicRefineFvMesh::refine().
|
staticprivate |
|
staticprivate |
|
static |
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.