1
$\begingroup$

Based on my readings this is what I have gathered:

Dimensions: Number of data points in the x, y, z directions

Spacing: Space between points in each dimension

Origin: Location of origin

Cell data: Number of total points

I must have a misunderstanding somewhere, as the file I am working with has dimensions 13 13 13, yet my cell data is 1728. Would anyone be able to assist in pointing out my misunderstanding?

Also, following all the above declarations I see the VTK file outputs a lot of numbers. What do these numbers represent exactly?

Thank you.

$\endgroup$
  • $\begingroup$ Have you looked at the official documentation of the VTK file format? $\endgroup$ – Wolfgang Bangerth Aug 12 at 23:57
  • $\begingroup$ @WolfgangBangerth Yes I have read through it but am still a little confused on certain parts, I tried looking for another resource or example but was unable to find anything. $\endgroup$ – WBSS Aug 13 at 1:03
  • $\begingroup$ Consider a 1-D line that's been divided into two cells. You will get 3 nodes and nodal data of dimension 3, but the cell-centered data will be of dimension 2. $\endgroup$ – Biswajit Banerjee Aug 13 at 1:38
  • $\begingroup$ @BiswajitBanerjee Ahh I see that makes sense, thank you. Regarding the second question, take the answer to the following question as an example: stackoverflow.com/questions/28323373/vtk-structured-point-file. How come despite the dimensions being 3x4x2, the values at the bottom are arrays of size 6? $\endgroup$ – WBSS Aug 13 at 2:17
  • $\begingroup$ The arrays are not of size 6, they're just printed that way. Each line contains the index (i j k) and vector values (x y z). The best way I can think of for you is to try out the VTK functionality in Python (pypi.org/project/vtk) to get an understanding of the data structures (and agorithms) and then moving to C++ when you need speed or integration with a C++ framework. $\endgroup$ – Biswajit Banerjee Aug 13 at 6:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.