ReadVTK.jl API

ReadVTK.PVDFileType
PVDFile

Hold all relevant information about a PVD file that has been read in.

Fields

  • filename: original path to the PVTK file that has been read in
  • file_type: currently only "PRectilinearGrid" or "PImageData" are supported
  • vtk_filenames: vector with strings that contain the filenames of each of the files
  • directories: vector with strings that contain the directories where each of the files are
  • timestep: vector with Float64 that contains the time of each of the files
source
ReadVTK.PVDFileMethod
PVDFile(filename)

Read in and parse the PVD XML file specified by its filename.

source
ReadVTK.PVTKDataType
PVTKData

Convenience type to hold information about available data arrays for cells or points.

Supports a collectible/dictionary-like syntax, e.g., keys(pvtk_data) to show available data arrays or pvtk_data["varname"] to retrieve the VTKDataArray for variable varname.

source
ReadVTK.PVTKDataArrayType
PVTKDataArray

Hold information about a parallel PVTK data array (cell data or point data). The actual data can be retrieved by calling get_data on the VTKDataArray object.

See also: get_data

source
ReadVTK.PVTKFileType
PVTKFile

Hold all relevant information about a Parallel VTK XML file that has been read in.

Fields

  • filename: original path to the PVTK file that has been read in
  • xml_file: xml info
  • file_type: currently only "PRectilinearGrid" or "PImageData" are supported
  • version: VTK XML file format version
  • vtk_filenames: vector with strings that contain the filenames of each of the parallel files
  • vtk_files: vector with VTKFile data that contains the info about each of the files
source
ReadVTK.PVTKFileMethod
PVTKFile(filename; dir="")

Read in and parse the PVTK XML file specified by its filename. Optionally, an additional directory name dir can be specified for the location of the underlying (serial) VTK files.

source
ReadVTK.VTKCellsType
VTKCells{Connectivity, Offsets, Types}

Store the connectivity, offsets, and types information from the VTK file as one-dimensional array-like containers. See the VTK file format documentation for information on how to connect the connectivity and offset arrays to the actual geometric points.

You may use length to determine the number of cells from a VTKCells object.

See also: get_points

source
ReadVTK.VTKDataType
VTKData

Convenience type to hold information about available data arrays for cells or points.

Supports a collectible/dictionary-like syntax, e.g., keys(vtk_data) to show available data arrays or vtk_data["varname"] to retrieve the VTKDataArray for variable varname.

source
ReadVTK.VTKDataArrayType
VTKDataArray{T, N, Format}

Hold information about a single VTK data array (cell data or point data).

The data type is encoded as T, N represents the size of the second dimension in case of multi-dimensonal arrays (or 1 for a vector), and Format encodes in which format the data is stored in the XML file.

The actual data can be retrieved by calling get_data on the PVTKDataArray object.

See also: get_data

source
ReadVTK.VTKDataArrayMethod
VTKDataArray(xml_element, vtk_file)

Create a lightweight container for a given xml_element and the corresponding vtk_file.

The xml_element must be of type DataArray and the vtk_file parameter is required for retrieving the actual data. You can pass a VTKDataArray object to get_data to retrieve the actual data.

See also: get_data

source
ReadVTK.VTKFileType
VTKFile

Hold all relevant information about a VTK XML file that has been read in.

Fields

  • filename: original path to the VTK file that has been read in
  • xml_file: object that represents the XML file
  • file_type: currently only "UnstructuredGrid" or "ImageData" are supported
  • version: VTK XML file format version
  • byte_order: can be LittleEndian or BigEndian and must currently be the same as the system's
  • compressor: can be empty (no compression) or vtkZLibDataCompressor
  • appended_data: in case of appended data (see XML documentation), the data is stored here for convenient retrieval (otherwise it is empty)
  • n_points: number of points in the VTK file
  • n_cells: number of cells in the VTK file`
source
ReadVTK.VTKFileMethod
VTKFile(filename)

Read in and parse the VTK XML file specified by its filename.

source
ReadVTK.VTKPrimitivesType
VTKPrimitives{Connectivity, Offsets}

Store the connectivity and offsets information from the VTK PolyData file as one-dimensional array-like containers. See the VTK file format documentation for information on how to connect the connectivity and offset arrays to the actual geometric points.

You may use length to determine the number of cells from a VTKPrimitives object.

source
ReadVTK.get_coordinatesMethod
get_coordinates(pvtk_file::{VTKFile; x_string="x", y_string="y", z_string="z")

Retrieve VTK coordinate vectors in each direction as a tuple of 1D vectors for a PRectilinearGrid file.

Note that in VTK, points are always stored three-dimensional, even for 1D or 2D files, so you will always retrieve a tuple with three vectors.

See also: get_cells

source
ReadVTK.get_coordinatesMethod
get_coordinates(vtk_file::VTKFile; x_string="x", y_string="y", z_string="z")

Retrieve VTK coordinate vectors in each direction as a tuple of 1D vectors for a RectilinearGrid file.

Note that in VTK, points are always stored three-dimensional, even for 1D or 2D files, so you will always retrieve a tuple with three vectors.

See also: get_cells

source
ReadVTK.get_dataFunction
get_data(data_array::VTKDataArray)

Retrieve actual data from a VTKDataArray as a one- or two-dimensional array-like container.

Note: This function is not type stable but could be - help wanted!

source
ReadVTK.get_dataMethod
get_data(data_array::PVTKDataArray)

Retrieve actual data from a PVTKDataArray as a one- or two-dimensional array-like container.

source
ReadVTK.get_data_reshapedMethod

Retrieve actual data from a PVTKDataArray and reshapes it as 1D, 2D, or 3D arrays, in case we deal with parallel structured grids. It also puts it in the correct location the the full grid

source
ReadVTK.get_data_reshapedMethod
get_data_reshaped(data_array::VTKDataArray; cell_data=false)

Retrieve actual data from a VTKDataArray and reshape it as 1D, 2D, or 3D arrays, in case we deal with structured grids. Note that vectors or tensors will have their components stored in the first dimension of the array. As there is no way to automatically tell from the VTK file format whether it is a tensor, the user has to reshape this manually.

source
ReadVTK.get_example_fileMethod
get_example_file(filename; head="main", output_directory=".", force=false)

Retrieve an example file from the ReadVTK_examples repository at commit/branch head and store it in the output_directory. If the file already exists locally, do not download the file again unless force is true. Return the local path to the downloaded file.

source
ReadVTK.get_extentsFunction
get_extents(xml_file, min_extent=[0;0;0])

Retrieve the local size of pieces of a structured grid (ImageData, RectilinearGrid). Note that this always returns three dimensions, even if the data is 1D or 2D.

source
ReadVTK.get_pointsMethod

getpoints(vtkfile::PVTKFile)

Retrieve VTK points as a two-dimensional array-like container for a parallel file

source
ReadVTK.get_pointsMethod
get_points(vtk_file::VTKFile)

Retrieve VTK points as a two-dimensional array-like container.

The points are stored in dimension × points format. Note that in VTK, points are always stored three-dimensional, even for 1D or 2D files.

See also: get_cells

source
ReadVTK.get_primitivesMethod

getprimitives(vtkfile, primitive_type::AbstractString)

Retrieve VTK primitives as an object of type VTKPrimitives. Supported values of primitive type are : "Verts", "Lines", or "Polys".

See also: VTKPrimitives

source
ReadVTK.get_spacingMethod
get_spacing(pvtk_file::PVTKFile)

Retrieve a vector with the regular increments in each coordinate direction of the uniform grid from the given PVTKFile file.

See also: PVTKFile

source
ReadVTK.get_spacingMethod
get_spacing(vtk_file::VTKFile)

Retrieve a vector with the regular increments in each coordinate direction of the uniform grid from the given VTKFile file.

See also: VTKFile

source
ReadVTK.get_wholeextentFunction

getwholeextent(xmlfile, cell_data=false)

Retrieve the size of a structured grid (ImageData, RectilinearGrid). Note that this always returns three dimensions, even if the data is 1D or 2D.

source
ReadVTK.to_meshcellsMethod
to_meshcells(cells::VTKCells)

Convert a VTKCells object, which holds raw point and connectivity data for a number of cells, to a vector of MeshCell objects. The latter can, e.g., be passed to the WriteVTK.jl package for writing new VTK files. See also: VTKCells, VTKBase.MeshCell

source