CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Debug Switches (https://www.cfd-online.com/Forums/openfoam-programming-development/123923-debug-switches.html)

Peter Müller September 24, 2013 09:27

Debug Switches
 
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

wyldckat September 29, 2013 07:23

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

Peter Müller September 30, 2013 02:23

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 (Post 454133)
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



All times are GMT -4. The time now is 12:41.