|
[Sponsors] |
Find List of Options for given dictionary key programmatically |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
June 29, 2018, 18:30 |
Find List of Options for given dictionary key programmatically
|
#1 |
Member
James Wright
Join Date: Oct 2015
Posts: 40
Rep Power: 11 |
So I'm working on a vim plugin for OpenFOAM that will hopefully provide some completion help.
To do that, I need a list of possible options for a given dictionary key. How can I access the available options easily and programmatically? I've found a brute force way of doing it; misname a option and the error message will show the available options: Code:
--> FOAM FATAL IO ERROR: Unknown ddt scheme Eulers Valid ddt schemes are : 8 ( CoEuler CrankNicolson Euler SLTS backward bounded localEuler steadyState ) The way I see it, it could be done by two ways: either go through OpenFOAM to find it (ie. mangle around with C++ or use a builtin function that I don't know about) OR find out how it creates the list in the first place. I've tried looking at the source code (look at "OpenFOAM/OpenFOAM-v1712/src/finiteVolume/lnInclude/ddtScheme.C" at line 76 for the code that created the output of the above example), but I have no experience in C++ (or any statically typed language for that matter) and have had a very difficult time figuring it out. Any help would be greatly appreciated! |
|
July 3, 2018, 13:32 |
|
#2 |
Member
James Wright
Join Date: Oct 2015
Posts: 40
Rep Power: 11 |
Update on the "How do they know whether an option is available?" problem; The list that is output through the error message comes from a runTimeSelectionTable.
Now my question turns to how can I access said runTimeSelectionTable? Last edited by u2berggeist; July 3, 2018 at 13:33. Reason: grammar |
|
Tags |
dictionary, openfoam, options |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
GPU Linear Solvers for OpenFOAM | gocarts | OpenFOAM Announcements from Other Sources | 37 | August 17, 2022 15:22 |
OpenFOAM 1.6-ext git installation on Ubuntu 11.10 x64 | Attesz | OpenFOAM Installation | 45 | January 13, 2012 13:38 |
Problem Building OF on Centos cluster (no admin rights) | CKH | OpenFOAM Installation | 5 | November 13, 2011 07:32 |
OpenFOAM on MinGW crosscompiler hosted on Linux | allenzhao | OpenFOAM Installation | 127 | January 30, 2009 20:08 |
Errors running allwmake in OpenFOAM141dev with WM_COMPILE_OPTION%3ddebug | unoder | OpenFOAM Installation | 11 | January 30, 2008 21:30 |