-
-
Notifications
You must be signed in to change notification settings - Fork 78
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use an OpenFOAM dictionary for configuration #30
Comments
In this context, we should also include an additional option for the kind of each couplingDataUser. Currently, we use the name (e.g. Thanks to @davidscn for reporting a relevant problem. |
A few weeks back I made some progress on this. The latest work-in-progress state can be found in the branch config-dict. I am currently stuck in transforming the nested lists logic of YAML to dictionaries. For example: interfaces:
- mesh: Solid-to-Inner-Fluid
patch: inner-interface
read-data: [Sink-Temperature-Inner-Fluid, Heat-Transfer-Coefficient-Inner-Fluid]
write-data: [Sink-Temperature-Solid, Heat-Transfer-Coefficient-Solid]
- mesh: Solid-to-Outer-Fluid
patch: outer-interface
read-data: [Sink-Temperature-Outer-Fluid, Heat-Transfer-Coefficient-Outer-Fluid]
write-data: [Sink-Temperature-Solid, Heat-Transfer-Coefficient-Solid] This example is from the heat exchanger tutorial (for CalculiX, but the logic is the same). What I originally wanted to do was represent this as a list of dictionaries. This could be quite tricky and a better idea (@olesenm) would be to have these dictionaries unconnected to each other and then get them from the table of contents. But I still have have not tried to implement this. |
To clarify, a list of dictionaries isn't intrinsically more difficult. You can either read them as an entry (see https://develop.openfoam.com/Development/OpenFOAM-plus/blob/master/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H) and them loop over them. Another way is to have the same syntax and use that entry to create a PtrList of your interfacing objects. Finally can just have them as a collection of subdicts (as discussed). One advantage of the collection of subdicts is that you will able to use changeDictionary to rewrite/modify the entries. If they are a list (with the '(...)' delimiters) they are locked away from easy dictionary manipulation. Probably worth the effort to combine both. Have subdicts, but pass off them each off to a construct from dictionary and save as a PtrList. |
This was closed with #105. |
We currently use yaml-cpp to parse our
precice-adapter-config.yml
YAML file (see more in our wiki)Although YAML is a nice language to use for configuration files, there are some problems:
Therefore, it would be good to allow configuring the adapter through a dictionary. This could be done alongside or instead our current YAML-based file.
The text was updated successfully, but these errors were encountered: