OpenFOAM is compiled for maximal performance (default)
Floating point error (e.g. division by zero):
Foam::error::printStack(Foam::Ostream&) at ??:?
Foam::sigFpe::sigHandler(int) at ??:?
? in "/lib/x86_64-linux-gnu/libc.so.6"
OpenFOAM compiled with debug modus (poor performance):
Program received signal SIGFPE, Arithmetic exception.
0x00007ffff6668e5f in Foam::divide <double> (res=..., f1=...,
at /home/bram/openfoam4_debug/src/OpenFOAM/lnInclude/FieldFunctions.C:631/
631 BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
Notice: specific error info, file location, # line, etc.
Without debug version:
With debug version:
Warning: Live session incoming!
GDB is really useful when developing OpenFOAM applications, not only for debugging but also as sandbox.
Intellisense:
Smart code completion based on variable types, function definitions and imported modules. Reads all OpenFOAM classes, functions, templates.
I don't program in OpenFOAM, why is this useful?