CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Debug switch

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2005, 14:16
Default Hi Everyone, There seem to
  #1
Member
 
Pierre Le Fur
Join Date: Mar 2009
Location: UK
Posts: 60
Rep Power: 17
pierre is on a distinguished road
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
pierre is offline   Reply With Quote

Old   October 18, 2005, 14:29
Default Edit ~/.OpenFOAM-1.2/controlDi
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
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
hjasak is offline   Reply With Quote

Old   November 7, 2005, 08:28
Default Hi Pierre, I also first got
  #3
New Member
 
Mattias Liefvendahl
Join Date: Mar 2009
Posts: 5
Rep Power: 17
matlie is on a distinguished road
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
matlie is offline   Reply With Quote

Old   November 7, 2005, 08:31
Default Hi Pierre, I also first got
  #4
New Member
 
Mattias Liefvendahl
Join Date: Mar 2009
Posts: 5
Rep Power: 17
matlie is on a distinguished road
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)
matlie is offline   Reply With Quote

Old   November 8, 2005, 04:01
Default Usually the names are similar
  #5
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
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.
mattijs is offline   Reply With Quote

Old   July 5, 2007, 19:38
Default if a class has: //- R
  #6
Senior Member
 
Maka Mohu
Join Date: Mar 2009
Posts: 305
Rep Power: 18
maka is on a distinguished road
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.
maka is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
About "debug=T" sammi Phoenics 0 June 14, 2008 07:18
Fluent Switch FLuentSwitch FLUENT 0 February 26, 2008 14:21
switch 81 isidro Siemens 1 February 19, 2004 15:24
switch n.1 roadracer Siemens 11 July 8, 2003 06:07
switch Moon Siemens 4 February 25, 2003 02:23


All times are GMT -4. The time now is 07:13.