1. Description

The Visualization Toolkit (VTK) is an open-source, freely available software system for 3D computer graphics, image processing and visualization, distributed by Kitware, Inc..

The main features of this format are:

  • It can save hybrid meshes, that is, meshes that contain a several types of finite elements.
  • A mesh can be defined by multiple portions called pieces, each one containing its own coordinates, connectivities and fields.
  • The global indexing of nodes, edges, faces and elements are defined by integers.
  • The vertex coordinates and field values are defined by floats.
  • The precission of each DataSet is defined individually.

VTK defines two different styles of file formats, legacy and XML. VTK Legacy (.vtk extension) is the simplest format and VTK XML is a more sophisticated VTK format that allows data streaming and parallel I/O.

The Visualization Toolkit supports five different dataset formats: structured points, structured grid, rectilinear grid, unstructured grid, and polygonal data. feconv only admits unstructured grid since it is the most useful dataset to store finite element meshes. In this regard, VTK only permit Lagrange P1 and P2 finite elements.

2. Features supported by feconv

Feconv can only read and write serial binary VTK XML files containing UnstructuredGrid datasets with extension .vtu

VTK finite element types allowed in feconv

The VTK format describes a lot of different types of finite elements. In the following table you can see the finite elements allowed and its meaning in FEconv.

VTK descriptor VTK name FE type
1 VTK_VERTEX Vertex
2 VTK_POLY_VERTEX Vertex
3 VTK_LINE Edge Lagrange P1
5 VTK_TRIANGLE Triangle Lagrange P1
8 VTK_PIXEL Quadrilateral Lagrange P1
9 VTK_QUAD Quadrilateral Lagrange P1
10 VTK_TETRA Tetrahedron Lagrange P1
11 VTK_VOXEL Hexahedron Lagrange P1
12 VTK_HEXAHEDRON Hexahedron Lagrange P1
13 VTK_WEDGE Wedge Lagrange P1
21 VTK_QUADRATIC_EDGE Edge Lagrange P2
22 VTK_QUADRATIC_TRIANGLE Triangle Lagrange P2
23 VTK_QUADRATIC_QUAD Quadrilateral Lagrange P2
24 VTK_QUADRATIC_TETRA Tetrahedron Lagrange P2
25 VTK_QUADRATIC_HEXAHEDRON Hexahedron Lagrange P2

Local order of nodes

The local index of nodes in each element respect the following rules:


Figure 1: Local index of nodes on Lagrange P1 elements. Note that elements with descriptors 4, 6 and 7 are not supported by feconv.


Figure 2: Local index of nodes on Lagrange P2 elements.

Fields

Field data is a general format without topological and geometric structure, and without a particular dimensionality. FEconv supports scalar and vector field data associated with the points or cells of a dataset.

More than one field of the same type can be included in a file. Each type of field has a data name associated with it and used to identify a particular field.

VTK+ format

The previous formats allow us to save the coordinates of the mesh nodes and the connectivity of the finite elements. However, there is not a standard way to save the reference numbering of nodes, edges, faces and elements. Since the VTK formats also permits to save integer fields associated to the mesh, we have proposed the next procedure to consider reference numbering:

  1. Given an edge or face with a non-zero reference number, include the edge or face as a finite element in the mesh;
  2. Define the following integer fields:
    • the pointdata field vertex_ref takes the node reference number in every node of the mesh;
    • the celldata field edge_ref takes the edge reference number in every edge incorporated to the mesh and zero otherwise;
    • the celldata field face_ref takes the face reference number in every face incorporated to the mesh and zero otherwise;
    • the celldata field element_ref takes the element reference number in every mesh element and zero otherwise;

When a VTK file have these fields its mesh has reference numbers associated to its entities, so its suitable to be used in a finite element solver.

OpenNum recognizes both VTK legacy and VTK XML formats with the mentioned fields. If you plan to create files of these type, you should use the file extension .vtk+ for VTK legacy and .vtu+ for VTK XML UnstructuredGrid.