Create grid with VTK

From Core Physics Wiki
Jump to: navigation, search

Generating a Computational Grid vith VTK files

VTK is the visualization toolkit produced by Kitware VTK.

This page does not describe using the VTK toolkit itself, but instead discusses how you can generate a grid and visualize your data using one of the VTK data file formats. The VTK data file can then be imported into one of the visualization tools like Visit or Paraview.

In this example, I will show how to create the VTK data file directly from one of your computer programs. I will not use the functions in the VTK toolkit.

There are several VTK data file formats. I will describe the ASCII format. There is also a binary file format and an XML file format.

There are two parts to visualizing the data. The first part is to generate the "grid", which is a set of nodes and elements. The second part is to write the data, which can be based on the nodes or the elements.

There is another tutorial that shows how to visualize data points using XYZ coordinates XYZ_Data_with_VTK


Here is an example of a simple cylinder shell using a hexahedron mesh. Cylinder

Here is another example of a Torus using a hexahedron mesh: Torus-Hex

More to come!