poor performance in exodus.get_block_id_map() #661
Replies: 3 comments 6 replies
-
|
If there are going to be many queries of this type or lots of blocks, I usually get all of the block ids via given element with index X, find i such that |
Beta Was this translation helpful? Give feedback.
-
|
I don't think that elem_id_map buys you much in this case. If you are using the element INDEX, then elem_id_map just runs from 1..number_elements. If you don't mind using storage of size num_elements, you can do something similar to what I had above, create an array of size num_elements, and then fill the first count[0] elements with the value of elem_blk_ids[0], similarly for i = 1 .. number_element_blocks (the next count[1] elements have elem_blk_ids[1], ...) and then you have a direct mapping that block_id = array[element_index] |
Beta Was this translation helpful? Give feedback.
-
|
And rereading your comment, I think what I originally gave you does what you want. Once you do the sum of the counts, then given block_id For example, if So If I have id =200, I search and see that it is at index 1 in Hope that makes sense and I am reading the question correctly. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to look up the element ids of a given block id using the
exodus.get_block_id_map()method and getting poor performance on my mesh with > 1000 blocks. (I suspect it is doing a linear lookup and I'm doing this for all N blocks, so O(N^2) performance). Is there a better way to get the block that an element belongs to or vice versa?Beta Was this translation helpful? Give feedback.
All reactions