|
[Sponsors] |
HasTable to store (key,value) pair in OpenFOAM |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 4, 2022, 13:21 |
HasTable to store (key,value) pair in OpenFOAM
|
#1 |
New Member
Join Date: Jan 2015
Posts: 22
Rep Power: 11 |
Does HashTable allow creating (key, value) pairs and accessing the value by key as well as iterating through the items in the object?
I need keys of word type and values of label. I could not find a useful sample usage in the source code. |
|
December 11, 2022, 09:53 |
|
#2 |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,714
Rep Power: 40 |
I suggest you dig a bit more in the code, there are plenty of places using HashTable with a word key (the default) and some type of value (integer or otherwise).
The iterator is a bit special (ie, different than std map etc) in that you would use its key(), val() methods to get the pair of key and value, and its normal dereference operator returns the val() and not the pair. |
|
Tags |
hashtable |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
Deleting files in /constant/polyMesh to reset and store OpenFOAM case | sdfij6354 | OpenFOAM Running, Solving & CFD | 0 | December 21, 2017 08:37 |
OpenFOAM Training Jan-Jul 2017, Virtual, London, Houston, Berlin | CFDFoundation | OpenFOAM Announcements from Other Sources | 0 | January 4, 2017 07:15 |
OpenFOAM Training Beijing 22-26 Aug 2016 | cfd.direct | OpenFOAM Announcements from Other Sources | 0 | May 3, 2016 05:57 |
[OpenFOAM.org] A Mac OS X of23x Development Environment Using Docker | rt08 | OpenFOAM Installation | 1 | February 28, 2016 20:00 |