Inactive debug switches for fvOption SemiImplicitSource
I seem to be unable to report an issue with the mantis system. However, I post the information here, and will report it later, unless someone has an alternative explanation.
When I run the injection tutorial case from the twoPhaseEulerFoam tutorials and I add the following lines to controlDict no debug information is printed: Code:
DebugSwitches The class SemiImplicitSource contains some debug output like this: Code:
if (debug) The file semiImplicitSource.C contains the following "macro call" Code:
makeFvOption(SemiImplicitSource, scalar); Code:
#define makeFvOption(Option, Type) \ Code:
#Type#Option the macro argument is Code:
"scalar""SemiImplicitSource" The macro Code:
makeFvOption(SemiImplicitSource, scalar); Code:
template<> const ::Foam::word SemiImplicitSource<scalar>::typeName("scalar""SemiImplicitSource"); I wonder why there is no compiler error message, however, the debug switch does not work. I think Code:
#Type#Option Code:
Type##Option |
Greetings Gerhard,
Fortunately there is no bug, but in fact it's a missing feature. The problem is that the flags defined in the case's "system/controlDict" only work in some situations. In this situation, you will need to define it at the level of the global "controlDict" or similar, such as: Code:
$HOME/.OpenFOAM/2.3.x/controlDict Quote:
As for your suggestion of using "Type##Option" instead of "#Type#Option", that's incorrect. The interpretation of the two is as follows:
Bruno |
Quote:
My guess was that the macros that create all this debug run-time magic need to get the data type passed instead of a string. I will take another close look and compare the workings of the pre-processor magic with non-templated and templated classes. Anyway, I will post my findings when I had a look. |
1 Attachment(s)
Some time ago I took a look at the non-templated macro magic of the SchillerNaumann drag model class, see the attached pdf.
There the macro Code:
/* Layout-provided Styles */ div.standard { margin-bottom: 2ex; }defineTypeNameAndDebug(SchillerNaumann, 0); The macro above is defined as Code:
/* Layout-provided Styles */ div.standard { margin-bottom: 2ex; } //- Define the typeName and debug information Code:
/* Layout-provided Styles */ div.standard { margin-bottom: 2ex; } defineTypeNameWithName(Type, Type::typeName_()) The argument Type is needed to correctly address namespaces and datatypes. However, I still have to look more closely into the templated stuff. |
Hi Gerhard,
The ability to also control the debug flags for template classes has been implemented in the OpenFOAM-dev repository: https://github.com/OpenFOAM/OpenFOAM-dev/ It was implemented in this commit: https://github.com/OpenFOAM/OpenFOAM...09b8cb4b967baa Best regards, Bruno |
Hi Bruno,
thanks for the hint. Allow me a related off-topic question. Is the OpenFOAM-dev repo something new or newly made public? I started noticing links and references to this repo a few month ago. Cheers Gerhard |
Quote:
|
All times are GMT -4. The time now is 20:14. |