|
[Sponsors] |
![]() |
![]() |
#1 |
Senior Member
Join Date: Mar 2018
Posts: 115
Rep Power: 8 ![]() |
Hello,
I have an OpenFOAM code that compiles and runs properly under OpenFOAM 6. Now I switched to OpenFOAM V1806 but unfortunately the code doesn't compile. After reading the errors reported by the compiler, I understand that the problem is caused by hashtable, so I decided to isolate the problem and I created the sample code below that produces the same error: The code: Code:
#include "fvCFD.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // void fillHashTable(HashTable<List<label>, label>& hashTable, label maxN); int main(int argc, char *argv[]) { HashTable<List<label>, label> table1; fillHashTable(table1, 5); Info << table1 << endl; Info<< "End\n" << endl; return 0; } void fillHashTable(HashTable<List<label>, label>& hashTable, label maxN) { List<label> tmpList; for(int i=0; i < maxN; ++i) { tmpList.clear(); tmpList = {2*i, i*i, i*i*i}; hashTable.insert(i , tmpList); } } Code:
... /home/evren/OpenFOAM/OpenFOAM-v1806/src/OpenFOAM/lnInclude/HashTableI.H:35: error: no match for call to ‘(Foam::string::hash) (const int&)’ return Hash()(key) & (capacity_ - 1); ~~~~~~^~~~~ ... Could you please help me debug this problem, is it a bug? Update: After changing the type of key to word it works, Could you please confirm that hashtables in OpenFOAM v1806 work only with string keys? Last edited by anon_q; November 6, 2018 at 12:45. |
|
![]() |
![]() |
Tags |
openfoam, openfoam 1806 |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
[OpenFOAM.org] OpenFOAM 4.0 compilation fails with latest Intel compiler | mstud | OpenFOAM Installation | 3 | October 6, 2016 16:01 |
Modified interFoam compilation fails | voingiappone | OpenFOAM Programming & Development | 6 | October 1, 2013 03:47 |
OpenFOAM compilation fails on applicationsutilitiesmesh | geoffjay | OpenFOAM Installation | 12 | April 29, 2008 15:26 |
Compilation fails on Linuxx86 | agrahn | OpenFOAM Bugs | 21 | August 31, 2007 04:10 |
Compilation fails on suse linux 101 | su_junwei | OpenFOAM Bugs | 2 | July 20, 2007 04:56 |