CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

HashTable use

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 15, 2014, 07:03
Default HashTable use
  #1
New Member
 
NathanaŽl Geng
Join Date: May 2012
Posts: 15
Rep Power: 5
nathanael is on a distinguished road
Hello,

I try to use HashTable for storing data like in a map and I don't understand the behavior:
Code:
// Create the HashTable
HashTable<StoredClass, SortableList<label>, Hash<SortableList<label> > > myMap;

// Add item to it
const face& facePt = topo.faces()[fI];
myMap.insert(SortableList<label>(facePt.pointsLabel()), StoredClassItem);

// Get item back
StoredClass& face = myMap[SortableList<label>(blockFaces[blockFaceLabel])];
This code compile without problem, but ran a fatal error:
Code:
--> FOAM FATAL ERROR: 
4(0 1 2 3) not found in table.  Valid entries: 
24
(
4(2 4 18 21)
4(20 21 22 23)
4(5 7 9 11)
4(14 15 16 17)
4(0 1 2 3) <=== Data exist
4(12 14 24 25)
...
Same applies with find/found, the data is not found inside my HashTable.
I think I miss something with the usage of HashTable.

Thanks in advance for the help.

NathanaŽl.
nathanael is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run time Selection Mechanism - Some help required to understand jaswi OpenFOAM Programming & Development 2 April 18, 2014 07:44
dynamic list (variable size) alquimista OpenFOAM Programming & Development 5 July 19, 2013 13:29
multidimensional hashtable? Farshad_Noravesh OpenFOAM 0 January 24, 2011 10:05
HashTable Binary write format deepsterblue OpenFOAM Bugs 1 March 16, 2010 11:03
Ordered HashTable olesen OpenFOAM 1 January 4, 2007 05:17


All times are GMT -4. The time now is 13:26.