CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Debug Switches

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By Peter Müller

Reply
 
LinkBack Thread Tools Display Modes
Old   September 24, 2013, 09:27
Default Debug Switches
  #1
Member
 
Join Date: Oct 2011
Posts: 36
Rep Power: 5
Peter Müller is on a distinguished road
Hi together

I created my own boundary condition derived from a fixedValue boundary condition.
I've seen that at the beginning of each class there is the statement.

namespace Foam
{
defineTypeNameAndDebug(impMPPolyPatch, 0);
addToRunTimeSelectionTable(polyPatch, impMPPolyPatch, word);
addToRunTimeSelectionTable(polyPatch, impMPPolyPatch, dictionary);
}

The boundary condition works nicely but I would like to switch on/off some Info statements and saw the possibility of doing this with the debug switches. Problems is that nether of what I try, whether adding impMPPolyPatch = 1 to the global OpenFOAM controlDict in etc nor in system/controlDict seams to change this switch. Can somebody give me a hint?

Thanks in advance
Lucian
Peter Müller is offline   Reply With Quote

Old   September 29, 2013, 07:23
Default
  #2
Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 8,516
Blog Entries: 34
Rep Power: 86
wyldckat is just really nicewyldckat is just really nicewyldckat is just really nicewyldckat is just really nice
Hi Lucian,

A few questions:
  1. Can you share an example case?
  2. And how exactly are you loading the boundary condition to memory?

Nonetheless, my guess is that if you are loading the new BC through the "libs" entry on "controlDict", it's not reloading the debug flags from either "controlDict" files.

Best regards,
Bruno
wyldckat is offline   Reply With Quote

Old   September 30, 2013, 02:23
Default
  #3
Member
 
Join Date: Oct 2011
Posts: 36
Rep Power: 5
Peter Müller is on a distinguished road
Hi Bruno.

Yes I've created an own library with all the boundary conditions I use. In the Make/files I compile them into $FOAM_LIBBIN and afterwards I include the boundaries by loading with libs from controlDict. Anyway I found a way to bypass this issue.
During the call of the constructor I set the value of a boolean to the value I set in the controlDict. And It works for both, case controlDict and global controlDict.

bool myDebugFlag = Foam::debug::debugSwitch("impMPPolyPatch",0);

This seams to look for impMPPolyPatch or sets myDebugFlag to zero if its not existing. I still don't really get why its possible to search for impMPPolyPatch like this, but the defineTypeNameAndDebug seams not to work.

Kind regards
Peter

Quote:
Originally Posted by wyldckat View Post
Hi Lucian,

A few questions:
  1. Can you share an example case?
  2. And how exactly are you loading the boundary condition to memory?

Nonetheless, my guess is that if you are loading the new BC through the "libs" entry on "controlDict", it's not reloading the debug flags from either "controlDict" files.

Best regards,
Bruno
wyldckat likes this.
Peter Müller is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Switching to debug mode? NJG OpenFOAM Installation 4 March 4, 2013 19:08
how to use gdb to debug openfoam? houkensjtu OpenFOAM Programming & Development 2 October 16, 2012 02:05
Eclipse - case debug error Bufacchi OpenFOAM 1 February 7, 2012 16:15
create the file *.foam phongstar OpenFOAM 11 July 26, 2010 19:23
How to compile OF-1.5 in the debug mode? sandy OpenFOAM Running, Solving & CFD 4 July 8, 2009 08:43


All times are GMT -4. The time now is 11:37.