Function t8_vtk_reader_cmesh

Function Documentation

t8_cmesh_t t8_vtk_reader_cmesh(const char *filename, const int partition, const int main_proc, sc_MPI_Comm comm, const vtk_file_type_t vtk_file_type, const int package_id, const int starting_key)

Given a filename to a vtkUnstructuredGrid or vtkPolyData read the file and construct a cmesh.

This is a two stage process. First the file is read and stored in a vtkDataSet using t8_vtk_reader and t8_file_to_vtkGrid. In the second stage a cmesh is constructed from the vtkDataSet using t8_vtkGrid_to_cmesh. The vtk data arrays will be associated with the cmesh trees and saved as tree attributes using the provided user application package_id. The keys for the tree attributes start at starting_key.

Both stages use the vtk-library, therefore the function is only available if t8code is linked against VTK.

Parameters:
  • filename[in] The name of the file

  • partition[in] Flag if the constructed mesh should be partitioned

  • main_proc[in] The main reading processor

  • comm[in] An mpi-communicator

  • vtk_file_type[in] A vtk-filetype that is readable by t8code.

  • package_id[in] The package id of the application. It is generated with the usage of sc_package_register.

  • starting_key[in] If the application already registered attributes, the starting key is used so that the existing attributes are not overwritten.

Returns:

A committed cmesh.