# vtkHyperTreeGrid Paraview example in 2D

**URL:** <https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122>\
**Category:** ParaView Support\
**Created:** [April 20, 2020, 12:49pm UTC](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122 "2020-04-20T12:49:24Z")\
**Posts on this page:** 5\
**Page:** 3

<div class="post-metadata">

**Author:** ![ajp](https://discourse.paraview.org/user_avatar/discourse.paraview.org/ajp/32/3516_2.png) [@ajp](https://discourse.paraview.org/u/ajp)\
**Post date:** [July 7, 2020, 8:23am UTC](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122/41 "2020-07-07T08:23:39Z")

</div>

> [@Yohann\_Bearzi](#):
>
> The global index is unique in the entier htg.

I’ve realised I now need to go from an externally stored (say a std::vector of them) unique global indices obtained from `GetGlobalIndex()`, back to a cursor, is that possible? Does the global index encode some sort of Morton-like ordering?  
Thanks,  
Andy

---

<div class="post-metadata">

**Author:** ![Yohann\_Bearzi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/yohann_bearzi/32/1894_2.png) [@Yohann\_Bearzi](https://discourse.paraview.org/u/Yohann_Bearzi)\
**Post date:** [July 14, 2020, 7:25pm UTC](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122/42 "2020-07-14T19:25:14Z")

</div>

Hi, you can set your own indexing in the cursor by calling `SetGlobalIndexFromLocal`, where you set the index of the current node relative to the hypertree index offset. However, be aware that this API is going to change in next release as when you call this method, `GetGlobalIndexStart` (method used for implicit indexing) will crash. We will have a better design to switch between implicit and explicit indexing.

---

<div class="post-metadata">

**Author:** ![Loic22](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/l/d6d6ee/32.png) [@Loic22](https://discourse.paraview.org/u/Loic22)\
**Post date:** [May 1, 2021, 9:38am UTC](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122/43 "2021-05-01T09:38:49Z")

</div>

Hello,

I think this is the best place to post my question. I am currently looking at the vtkHyperTreeGrid to see how good it fits my needs. Let say that I have a 2D simulation ran over 16 domains using adaptive mesh refinement starting from level 0 up to level max if needed (fully threaded, all domains have the full refinement information but degraded if cells does not belong to the current domain). Until now, I build only one vtkHyperTreeGrid by adding the refinement information of each domains one after another, this works perfectly. Except fot the htg-\>GetPointData()-\>GetArray(“anArray”)-\>GetRange() which gives bad results if no value where added to coarse cells. I would like to exploit the multithreading, is it possible to walk, safely, through the vtkHyperTreeGrid using multiple cursor ?  
For example for a resulting tree looking like this : “R|RRRR|…R. … …R. R.R.| etc” and using 4 threads I could initialize 4 cursors at level 1 (or another fully refined level), and process the tree ? Or maybe its better to process sequentially the tree but adding a multiprocess parallelism to build for example 4 vtkHyperTreeGrid on 4 mpi processes (4 domains/process) ?

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)\
**Post date:** [May 1, 2021, 9:42am UTC](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122/44 "2021-05-01T09:42:30Z")

</div>

Please open your own thread.

---

<div class="post-metadata">

**Author:** ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)\
**Post date:** [May 1, 2021, 9:42am UTC](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122/45 "2021-05-01T09:42:32Z")

</div>

Closed on May 1, 2021, 9:42am UTC



[Previous page](https://discourse.paraview.org/t/vtkhypertreegrid-paraview-example-in-2d/4122.md?page=2)
