|
[Sponsors] |
October 18, 2005, 15:16 |
Hi Everyone,
There seem to
|
#1 |
Member
Pierre Le Fur
Join Date: Mar 2009
Location: UK
Posts: 60
Rep Power: 17 |
Hi Everyone,
There seem to be quite a few debug switches, that give extra information on the on-going calculations in the code. How does one turn on/off Ex: In src/OpenFOAM/matrices/lduMatrix/solvers/ICCG.C i want to turn on if (lduMatrix::debug >= 2) { Info<< " Normalisation factor = " << normFactor << endl; } How do I do That? Apologies if it's a stupid question? Pierre |
|
October 18, 2005, 15:29 |
Edit ~/.OpenFOAM-1.2/controlDi
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
Edit ~/.OpenFOAM-1.2/controlDict and you will find some of the switches. For the full list, run the foamDebugSwitches app and it will print them out for you. (and read the manual) :-)
Enjoy, Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
November 7, 2005, 09:28 |
Hi Pierre,
I also first got
|
#3 |
New Member
Mattias Liefvendahl
Join Date: Mar 2009
Posts: 5
Rep Power: 17 |
Hi Pierre,
I also first got stuck on the setting of debug switches. What I missed is that it is not necessary that the name of the debug switch in the file ~/.OpenFOAM-1.2/controlDict is not necessarily the same as the name of the variable in the code. Example: In the file: polyMeshMorph In the code: morphDebug The variable is created via the global function: debug::debugSwitch |
|
November 7, 2005, 09:31 |
Hi Pierre,
I also first got
|
#4 |
New Member
Mattias Liefvendahl
Join Date: Mar 2009
Posts: 5
Rep Power: 17 |
Hi Pierre,
I also first got stuck on the setting of debug switches. What I missed is that it is not necessary that the name of the debug switch in the file ~/.OpenFOAM-1.2/controlDict is not the same as the name of the variable in the code. Example: In the file: polyMeshMorph In the code: morphDebug The debug variable can be created via the global function: debug::debugSwitch It can also be created via the define: DefineTypeNameAndDebug (in className.H) |
|
November 8, 2005, 05:01 |
Usually the names are similar
|
#5 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Usually the names are similar but look in the source code to make sure.
They are defined by a 'ClassName' macro in the .H file and a 'defineTypeNameAndDebug' macro in the .C file (for non-templated code). See e.g. dictionary.H, dictionary.C This causes the name to be defined and put onto a big table of global names which get read in from the controlDict or get the default value specified in the 'defineTypeNameAndDebug' call. This way one can add debugging switches to any code. The only limitation is that the name (i.e. the 'ClassName') should be unique. |
|
July 5, 2007, 20:38 |
if a class has:
//- R
|
#6 |
Senior Member
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18 |
if a class has:
//- Runtime type information TypeName("nuSgsWallFunction"); in its header file, like in nuSgsWallFunction.H and we add: // Declare name of the class and it's debug switch ClassName("nuSgsWallFunctionSwitch"); then we get the error: wallFunc/nuSgsWallFunction/nuSgsRoughWallFunctionFvPatchScalarField.H:67: error: 'static const char* Foam::LESmodels::nuSgsRoughWallFunctionFvPatchScal arField::typeName_()' cannot be overloa ded it seems that both are doing the same thing. then if I comment ClassName line and try to retrieve the name by member function type() wallFunc/nuSgsWallFunction/nuSgsRoughWallFunctionFvPatchScalarField.C:44: error: expected initi alizer before '::' token It seems that I got something wrong. What is it? Best regards, Maka. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
About "debug=T" | sammi | Phoenics | 0 | June 14, 2008 08:18 |
Fluent Switch | FLuentSwitch | FLUENT | 0 | February 26, 2008 15:21 |
switch 81 | isidro | Siemens | 1 | February 19, 2004 16:24 |
switch n.1 | roadracer | Siemens | 11 | July 8, 2003 07:07 |
switch | Moon | Siemens | 4 | February 25, 2003 03:23 |