ReadVTK.jl API
ReadVTK.PVDFile — TypePVDFileHold all relevant information about a PVD file that has been read in.
Fields
filename: original path to the PVTK file that has been read infile_type: currently only"PRectilinearGrid"or"PImageData"are supportedvtk_filenames: vector with strings that contain the filenames of each of the filesdirectories: vector with strings that contain the directories where each of the files aretimestep: vector withFloat64that contains the time of each of the files
ReadVTK.PVDFile — MethodPVDFile(filename)Read in and parse the PVD XML file specified by its filename.
ReadVTK.PVTKData — TypePVTKDataConvenience 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.
ReadVTK.PVTKDataArray — TypePVTKDataArrayHold 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
ReadVTK.PVTKFile — TypePVTKFileHold 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 inxml_file: xml infofile_type: currently only"PRectilinearGrid"or"PImageData"are supportedversion: VTK XML file format versionvtk_filenames: vector with strings that contain the filenames of each of the parallel filesvtk_files: vector withVTKFiledata that contains the info about each of the files
ReadVTK.PVTKFile — MethodPVTKFile(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.
ReadVTK.VTKCells — TypeVTKCells{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
ReadVTK.VTKData — TypeVTKDataConvenience 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.
ReadVTK.VTKDataArray — TypeVTKDataArray{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
ReadVTK.VTKDataArray — MethodVTKDataArray(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
ReadVTK.VTKFile — TypeVTKFileHold 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 inxml_file: object that represents the XML filefile_type: currently only"UnstructuredGrid"or"ImageData"are supportedversion: VTK XML file format versionbyte_order: can beLittleEndianorBigEndianand must currently be the same as the system'scompressor: can be empty (no compression) orvtkZLibDataCompressorappended_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 filen_cells: number of cells in the VTK file`
ReadVTK.VTKFile — MethodVTKFile(filename)Read in and parse the VTK XML file specified by its filename.
ReadVTK.VTKPrimitives — TypeVTKPrimitives{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.
ReadVTK.get_cell_data — Methodget_cell_data(pvtk_file::PVTKFile)Retrieve a lightweight vector with PVTKData objects with the cell data of the given PVTK files. Only numeric data (i.e., DataArray) elements will be read.
See also: PVTKData, get_point_data, get_field_data
ReadVTK.get_cell_data — Methodget_cell_data(vtk_file::VTKFile)Retrieve a lightweight VTKData object with the cell data of the given VTK file. Only numeric data (i.e., DataArray) elements will be read.
See also: VTKData, get_point_data, get_field_data
ReadVTK.get_cells — MethodReadVTK.get_coordinate_data — Methodget_coordinate_data(pvtk_file::PVTKFile)Retrieve a lightweight {VTKData object with the coordinate data of the given VTK file. Only coordinates of numeric data (i.e., DataArray) elements will be read.
See also: PVTKData, get_point_data, get_cell_data, get_field_data
ReadVTK.get_coordinate_data — Methodget_coordinate_data(vtk_file::VTKFile)Retrieve a lightweight VTKData object with the coordinate data of the given VTK file. Only coordinates of numeric data (i.e., DataArray) elements will be read.
See also: VTKData, get_point_data, get_cell_data, get_field_data
ReadVTK.get_coordinates — Methodget_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
ReadVTK.get_coordinates — Methodget_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
ReadVTK.get_data — Functionget_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!
ReadVTK.get_data — Methodget_data(data_array::PVTKDataArray)Retrieve actual data from a PVTKDataArray as a one- or two-dimensional array-like container.
ReadVTK.get_data_reshaped — MethodRetrieve 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
ReadVTK.get_data_reshaped — Methodget_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.
ReadVTK.get_example_file — Methodget_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.
ReadVTK.get_extents — Functionget_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.
ReadVTK.get_field_data — Methodget_field_data(vtk_file::VTKFile)Retrieve a lightweight VTKData object with the field data of the given VTK file.
See also: VTKData, get_point_data, get_cell_data
ReadVTK.get_imagedata_dataset — Methodget_imagedata_dataset(pvtk_file::PVTKFile)Retrieve a vector of ImageData datasets from the given PVTKFile file.
See also: PVTKFile
ReadVTK.get_imagedata_dataset — Methodget_imagedata_dataset(vtk_file::VTKFile)Retrieve ImageData dataset from the given VTKFile file.
See also: VTKFile
ReadVTK.get_origin — Methodget_origin(pvtk_file::PVTKFile)Retrieve the vector of coordinates of the origin of a uniform grid from the given PVTKFile file.
See also: PVTKFile
ReadVTK.get_origin — Methodget_origin(vtk_file::VTKFile)Retrieve the vector of coordinates of the origin of a uniform grid from the given VTKFile file.
See also: VTKFile
ReadVTK.get_point_data — Methodget_point_data(pvtk_file::PVTKFile)Retrieve a lightweight vector with PVTKData objects with the point data of the given PVTK files. Only numeric data (i.e., DataArray) elements will be read.
See also: PVTKData, get_cell_data, get_field_data
ReadVTK.get_point_data — Methodget_point_data(vtk_file::VTKFile)Retrieve a lightweight VTKData object with the point data of the given VTK file. Only numeric data (i.e., DataArray) elements will be read.
See also: VTKData, get_cell_data, get_field_data
ReadVTK.get_points — Methodgetpoints(vtkfile::PVTKFile)
Retrieve VTK points as a two-dimensional array-like container for a parallel file
ReadVTK.get_points — Methodget_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
ReadVTK.get_primitives — Methodgetprimitives(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
ReadVTK.get_spacing — Methodget_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
ReadVTK.get_spacing — Methodget_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
ReadVTK.get_whole_extent — Methodget_whole_extent(pvtk_file::PVTKFile)Retrieve a vector with the WholeExtent 6-entry vector from the uniform grid PVTKFile file.
See also: PVTKFile
ReadVTK.get_whole_extent — Methodget_whole_extent(vtk_file::VTKFile)Retrieve a vector with the WholeExtent 6-entry vector from the uniform grid VTKFile file.
See also: VTKFile
ReadVTK.get_wholeextent — Functiongetwholeextent(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.
ReadVTK.isstructured — Methodisstructured(xml_file)Returns true if it is a structured grid.
ReadVTK.to_meshcells — Methodto_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