Pointed out by Henrik Rusche: Foam loses memory and the cause is the profiling code.
Reason was that as singleton was created with the first Time-object but never created (ratio was that when the Time-object is destroyed the program ends anyway)
This merge request fixes this by destroying the singleton in the destructor of the Time-object. The second commit makes sure that only the Time-object that created the singleton will destroy it (this is important for programs that have more than one instance of Time)
profilingPool-singleton also destroys it (for programs with more than one
Time-instance)
Also protect the initiation and destruction of the singleton so that only a
Time-instance can do this
This is a major modification to the definition and handling of global control switches, namely the DebugSwitches, InfoSwitches, OptimisationSwitches, Tolerances and DimensionedConstants defined in the
Those values are now defined as objects, and are no longer defined using simple types like scalar or int.
It is now possible to override any of those control switches from the command-line, like this:
simpleFoam -help
Usage: simpleFoam [-DebugSwitches key1=val1,key2=val2,...] [-DimensionedConstants key1=val1,key2=val2,...] [-InfoSwitches key1=val1,key2=val2,...] [-OptimisationSwitches key1=val1,key2=val2,...] [-Tol
or
simpleFoam -DebugSwitches fvVectorMatrix=1,fvScalarMatrix=1
The 'banana' test is also implemented in order to dump the list of all the known control switches for a given application. One can use any bogus key name in order to get the list:
simpleFoam -DebugSwitches banana=1
The global controlDict file '$WM_PROJECT_DIR/etc/controlDict' is gone. One can still use a file to override a whole bunch of control switches by using the environment variable FOAM_GLOBAL_CONTROLDICT
One can also override case specific controlSwitches by using the case system/controlDict file.
Here is the order of precedence for the definition/overriding of the control switches, from lowest to highest:
- source code definitions from the various libraries/solvers
- file specified by the env. variable FOAM_GLOBAL_CONTROLDICT
- case's system/controlDict file
- command-line parameters
The application 'foamDebugSwitches' is gone. Instead, one can use the command-line option '-dumpControlSwitches' to print at the console the full list of control switches for a given application. The
At the source code level, when creating a control switch object, one can now add an optional description string in order to document its behaviour or purpose. That string description will be written a
Martin Beaudoin
Reorganisation of global controlDict by Hrvoje Jasak.