writing octrees using vtk

688 views
Skip to first unread message

Andrés Castillo-Castellanos

unread,
Aug 8, 2017, 5:17:50 AM8/8/17
to basilisk-fr
Hello all,

I've been reading about using the hyper-octree class in VTK as an alternative to write results from quad- and octree simulations. In this format, the topology is given by a binary tree, where each leaf node is given a value of 1 and each parent is given a value 0. Each parent must be followed by its children (4 if quadtree, 8 if octree).  I wrote an example using this format as a .vto file which can be read using Paraview (if the required plugin is activated), see attachment. 

In this case, the topology is given by 21 bits, each representing a cell. Of those, only 16 are leafs. Only the values at the leafs are required.  The values at the parent nodes are deduced from the child nodes. The problem is that the values are written level by level instead of following the structure of the binary like Baslisk does.



Is there a way to write the results following this order?

Cheers,

Andrés
Capture du 2017-08-07 14-27-29.png
tree_lvl2.vto
Auto Generated Inline Image 1

Stephane Popinet

unread,
Aug 21, 2017, 11:34:11 AM8/21/17
to basil...@googlegroups.com
Hi Andres,

First of all, being able to use the octree VTK format could be very
useful, I have been waiting for a feature like this for years... Do you
know when this format was introduced in VTK?

> Is there a way to write the results following this order?

Do you mean the order in the picture attached to your message? It seems
strange, I don't understand the logic. Basilisk uses N-ordering for
dumps, GFS etc...

cheers

Stephane

Stephane Popinet

unread,
Aug 22, 2017, 4:47:57 AM8/22/17
to basil...@googlegroups.com
According to this (reasonably recent) thread it looks like paraview/VTK
does not really support octrees. (looks like I will need to wait a few
more years...)

http://public.kitware.com/pipermail/paraview/2016-July/037496.html

cheers

Stephane

I

unread,
Nov 16, 2017, 9:24:10 AM11/16/17
to basilisk-fr
This sort of set off my OCD.  Paraview does in fact support octrees; it is just missing proper (any) documentation.  Enclosed is a minimum working example.
To make it work, you must enable the HyperOctree Reader, which is part of VTK, but not part of the default Paraview readers.
To enable it, choose Tools -> Manage Plugins -> Load New and Select the enclosed file XMLHyperOctreeReader.xml.
Now, the octree.vto file can be opened.
To do anything useful with the data, you must enable the vtkHyperOctreeXXX classes as custom filters as described (poorly) here:
I am not sure how to do that.  There is a vtkHyperOctreeContourFilter filter that returns a vtkUnstructured, class, so using this filer on the HyperOctree grid
would convert it to vtkUnstructured, if the clipping is set such that nothing is clipped.  This will in turn enable more or less all of Paraview's functionality.

The grid structure is given such that for each parent node (denoted by zero), the grid must be traversed down to the leaf level (denoted by one) before the parent node numbering can continue.  I think.

BR, Arne




octree.vto
XMLHyperOctreeReader.xml
Reply all
Reply to author
Forward
Message has been deleted
0 new messages