Skip to content

How to understand vti files

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #5814
    Rishabh
    Participant

    I have cut the cylinder3d program down to the part where it outputs the voxel image only. I removed everything else so that now the only file generated is the geometry_iT0000000C00000.vti file. Also, I chose the number of cuboids as 1. I did all this to get a single file that contains the information about the nodes and the material numbers for all of them.
    It works perfectly well in paraview, and I got the desired results, but I want to be able to understand how the entire data (the points and locations of the nodes, the material numbers for each, etc.) is stored.
    Opening the files I see that the file is defined as a vtk Image data file, but I am not able to understand how should I decode the data stored between:

    <DataArray type=”Float32″ Name=”geometry” NumberOfComponents=”1″ format=”binary” encoding=”base64″>
    THE DATA I WANT TO INTERPRET
    </DataArray>

    I know this is binary data encoded in Base64, but decoding that gives me binary numbers, how should I interpret them? What values do they signify?
    For example,
    <DataArray type=”Float32″ Name=”geometry” NumberOfComponents=”1″ format=”binary” encoding=”base64″>
    AQAAAIQDAACEAwAAJQAAAA==eJxjYBjWwAEPprYaagEi7HIAshvsseBB7OZBF86DBgAAT+4S/A==
    </DataArray>
    How do I find the material numbers of the nodes and the coordinates of those points from this data which has 225 points in it (since I deliberately made a very low-resolution geometry)?

    #5816
    Adrian
    Keymaster

    This is the compressed VTK data (storing everything in raw XML would significantly increase the file size). Why do you want to parse the VTK file manually?

    If you want to access the material numbers for further processing in your program, the straight forward way is to access the SuperGeometry directly.

    If you want to do further post-processing of VTK output outside of OpenLB, I would suggest to check whether there is a VTK library / binding available for your language of choice.

    #5818
    Rishabh
    Participant

    Yes, I actually wanted to access the material numbers for further processing. But I wanted to understand how it is stored in the SuperGeometry, is it possible to extract it as a raw XML file? And how is that data stored within the SuperGeometry3D structure? Is it represented as an array within?

    #5819
    Adrian
    Keymaster

    The SuperGeometry(2,3)D stores a vector of BlockGeometry(2,3)D instances (this pattern is present all throughout OpenLB), one for each cuboid assigned to the process. At the lowest level, all material numbers of a block are stored in a plain array.

    It should be possible to write raw XML VTK files by setting compress=false in the SuperVTMwriter3D constructor.

    #5820
    Rishabh
    Participant

    Dear Adrian,
    I’d like to thank you for your prompt response. I did exactly as you said and it worked perfectly. I got exactly what I was looking for. Now the data contained is directly in material numbers, and I was even able to edit the numbers myself via a text editor.
    I see what you meant about the size of the file being larger. However, it will suffice for now.
    I’d like to thank you again for your kind help.

    Best regards,
    Rishabh

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.