View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000640 | OpenFOAM | Bug | public | 2012-08-30 11:40 | 2014-01-02 09:29 |
Reporter | dhora | Assigned To | |||
Priority | none | Severity | feature | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Summary | 0000640: case specific central controlDict | ||||
Description | The central controlDict can be located in ~/.OpenFOAM/VERSION or $WM_PROJECT_DIR/etc. Sometimes it would be nice to have the possibility to change certain debug flags only for a specific case, e.g. by having the central controlDict in the case/system directory. Of course that would require a different file name. | ||||
Tags | No tags attached. | ||||
|
If it is just to set a debug flag you could use a dummy #codeStream in the system/controlDict ;-) //- Enable debug flag abc #codeStream { codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude #}; codeLibs #{ -lfiniteVolume #}; codeInclude #{ #include "volPointInterpolation.H" #}; code #{ volPointInterpolation::debug = 1; os << "123"; #}; }; |
|
Yes, a possible solution. Unfortunately it has the drawback that you have to allow system operations. |
|
This reminds me of issue #236... I remembered it because I was thinking of basing myself on "foamDebugSwitches" for creating a function object for this, but ended up figuring out that the debug flags are a _one way street_: the flags are definable only when initializing every library at start, or if you hard-code the access to the flag you want. Anyway, attached are two files: * dummyFunctionObject.tar.gz - a base structure for creating function objects. * finiteVolumeDebugFlagsFunctionObject.tar.gz - a proof-of-concept function object for controlling the debug flags on "finiteVolume". "wmake libso" to build the libraries. Each has an example "controlDict". Both attachments follow OpenFOAM's file structure (and coding standard?), but are designed for user-side build+usage. I.e., the headers have been _tweaked_... In "finiteVolumeDebugFlags.H", the main comment section indicates the commands I've used to generate lists of the embeddable code. It's not bullet proof, since "fv" and "SRC" sub-namespaces were not detected automatically. @mattijs: the generation for this function object could be generalized and made automatic for each library (at least after figuring out how to detect sub-namespaces). This way it wouldn't require changing OpenFOAM's source code and could possibly be placed in a section for users to build this themselves... at least to avoid having twice as many libraries... |
|
|
|
|
|
I gave it a shot and tried creating a "magical" script that would generate these function objects. Conclusion: it's impractical due to several reasons. Some of them are: * Some debug variables are private inside the class they're in. * The connection between class names and files isn't tight enough to allow such a "simple minded" script to work. * Templates sometimes "get in the way", or at least it looked like it. The script I ended up with is available here: https://github.com/wyldckat/genDebugFlagsFunctionObjects Instructions are available in the readme file for anyone who wants to play with it. It looks like that a proper implementation of the feature request requires an additional hash list with names<->pointers to said "debug" flags, for making it possible to access them via a function object library, solver or utility, without direct linking. |
|
The DebugSwitches entry in the case controlDict is pretty good (for non-templated classes). See e.g. http://www.openfoam.org/version2.2.0/runtime-control.php |
Date Modified | Username | Field | Change |
---|---|---|---|
2012-08-30 11:40 | dhora | New Issue | |
2012-08-30 12:26 |
|
Note Added: 0001648 | |
2012-08-30 14:28 | dhora | Note Added: 0001649 | |
2012-08-31 15:00 | wyldckat | Note Added: 0001657 | |
2012-08-31 15:00 | wyldckat | File Added: dummyFunctionObject.tar.gz | |
2012-08-31 15:00 | wyldckat | File Added: finiteVolumeDebugFlagsFunctionObject.tar.gz | |
2012-09-01 13:22 | wyldckat | Note Added: 0001668 | |
2014-01-02 09:29 |
|
Note Added: 0002737 | |
2014-01-02 09:29 |
|
Status | new => closed |
2014-01-02 09:29 |
|
Assigned To | => user4 |
2014-01-02 09:29 |
|
Resolution | open => fixed |
2014-01-02 09:29 |
|
Fixed in Version | => 2.2.x |