Appearance
vtk_fortran_vtk_file_xml_reader
VTK file XML reader.
The reader indexes the file when it is initialized: one pass over the XML that records the elements and attributes and the positions of the data, without loading them (the scan stops at the appended data). Each read then decodes only the data asked for: the memory used is about the size of the dataarray read, not of the file.
It reads the serial XML formats (ImageData, RectilinearGrid, StructuredGrid, UnstructuredGrid, PolyData, and Table: .vtt, no pieces, npieces 0, its columns the data arrays of location='row', their tuples its NumberOfRows) written by VTKFortran or by VTK, in every format (ascii, binary, raw and base64 appended), uncompressed or zlib compressed (vtkZLibDataCompressor), with UInt32 or UInt64 headers, LittleEndian or BigEndian (the binary headers and values of a file of the other byte order than the host's are reversed when read). Other compressors are not supported. Bit arrays (vtkBitArray, packed MSB first in the binary formats) are read as integers 0 and 1. The polyhedra of an UnstructuredGrid are read from the faces/faceoffsets arrays VTKFortran writes or from the four arrays VTK 9.7.2 writes (XML 2.3: face_connectivity, face_offsets, polyhedron_to_faces, polyhedron_offsets; a shared face -(n+1), 2.5), returned as the face stream of write_connectivity either way.
It reads VTKHDF files too (.vtkhdf, HDF5, when the library is built with HDF5): initialize recognizes them by the HDF5 signature, and every call is then answered by a vtkhdf_reader (vtk_fortran_vtk_file_vtkhdf_reader), the API unchanged; a VTKHDF time series is read one step at a time (get_steps, set_step; the step 1 by default). A VTKHDF Table has no pieces (npieces 0): its columns are the data arrays of location='row'. A VTKHDF OverlappingAMR is read one level at a time (get_levels, set_level; level 0 by default), its boxes the pieces of the level. A VTKHDF HyperTreeGrid has one piece (its root grid, read_geo its coordinates), its trees read with get_trees and read_tree, its cell data the cells of its trees. A dataset of a VTKHDF composite file is read with initialize(filename, dataset=) (its path under /VTKHDF, from vtm_file%get_entries).
It reads the parallel headers too (PImageData, PRectilinearGrid, PStructuredGrid, PUnstructuredGrid, PPolyData): their information, the declared arrays (get_dataarray_names, get_dataarray_info), the pieces (get_sources, read_piece for their extents) and the check of the pieces against the header (check_pieces). They hold no data.
All procedures return an error status:
| Error | Meaning |
|---|---|
| 0 | success |
| 1 | the file cannot be read |
| 2 | the file is not a VTK XML file (malformed XML, no VTKFile element or dataset element) |
| 3 | unsupported feature (compressor, byte order, parallel or unknown dataset type, encoding) |
| 4 | not found (piece, data array, geometry or cells absent), or the reader is not initialized |
| 5 | the output kind cannot hold the values of the data array |
| 6 | the data do not decode (inconsistent sizes, malformed base64, zlib failure) |
| 7 | the pieces of a parallel header do not match it (see check_pieces) |
Source: src/lib/vtk_fortran_vtk_file_xml_reader.f90
Dependencies
Contents
- xml_reader
- get_fixed_attribute
- close
- finalize
- b64_decode_bytes
- piece_counts
- get_fixed_attribute_I4P
- get_fixed_attribute_R8P
- initialize
- get_info
- read_piece
- get_active
- get_dataarray_names
- get_dataarray_info
- read_dataarray_strings
- read_geo_R8P
- read_geo_R4P
- read_connectivity_I8P
- read_connectivity_I4P
- read_polydata_cells_I8P
- read_polydata_cells_I4P
- get_steps
- set_step
- get_levels
- set_level
- get_trees
- read_tree
- get_sources
- check_pieces
- dataarray_bytes
- find_dataarray
- geometry_dataarrays
- piece_element
- read_faces
- read_ids
- read_named_dataarray
- read_dataarray_rank1_R8P
- read_dataarray_rank1_R4P
- read_dataarray_rank1_I8P
- read_dataarray_rank1_I4P
- read_dataarray_rank1_I2P
- read_dataarray_rank1_I1P
- read_dataarray_rank2_R8P
- read_dataarray_rank2_R4P
- read_dataarray_rank2_I8P
- read_dataarray_rank2_I4P
- read_dataarray_rank2_I2P
- read_dataarray_rank2_I1P
- read_coordinate_R8P
- read_coordinate_R4P
- read_appended_raw
- read_appended_base64
- polydata_section
- scan_error
- find_marker
- read_chars
- read_bytes
- to_I4P
- is_dataarray
- lower_case
- htg_extent
- htg_layout
- htg_tree_id
- location_tuples
Derived Types
xml_reader
VTK file XML reader.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
filename | character(len=:) | allocatable | File name. |
xml | type(xml_index) | Index of the XML elements (FoXy). | |
mesh_topology | character(len=:) | allocatable | Dataset type. |
word_size | integer(kind=I8P) | Size of the binary header words: 4 (UInt32) or 8 (UInt64). | |
is_swapped | logical | The file is of the other byte order than the host's. | |
is_compressed | logical | The binary data are zlib compressed. | |
is_initialized | logical | The reader is initialized. | |
dataset | integer(kind=I4P) | Index of the dataset element. | |
pieces_number | integer(kind=I4P) | Number of pieces. | |
is_appended_raw | logical | The appended data are raw (base64 otherwise). | |
appended_start | integer(kind=I8P) | Position of the first byte of the appended data, 0 if none. | |
is_parallel | logical | The file is a parallel header (P* dataset type). | |
is_hdf | logical | The file is a VTKHDF one, read by hdf. | |
hdf | type(vtkhdf_reader) | Reader of a VTKHDF file. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
check_pieces | pass(self) | Check the pieces of a parallel header against it. |
close | pass(self) | Close the file read and finalize the reader. |
finalize | pass(self) | Finalize the reader (free memory). |
get_dataarray_info | pass(self) | Return the type, components and tuples of a dataarray. |
get_active | pass(self) | Return the name of the active array of a role. |
get_dataarray_names | pass(self) | Return the names of the dataarrays of a location. |
get_info | pass(self) | Return the information of the dataset. |
get_sources | pass(self) | Return the files of the pieces of a parallel header. |
get_steps | pass(self) | Return the times of the steps of a VTKHDF time series. |
initialize | pass(self) | Initialize the reader: index the file. |
read_connectivity | Read the cells. | |
read_dataarray | Read a dataarray. | |
read_geo | Read the geometry. | |
read_piece | pass(self) | Read the counts and extent of a piece. |
set_step | pass(self) | Select the step read of a VTKHDF time series. |
get_levels | pass(self) | Return the number of levels of a VTKHDF OverlappingAMR. |
set_level | pass(self) | Select the level read of a VTKHDF OverlappingAMR. |
get_trees | pass(self) | Return the trees of a VTKHDF HyperTreeGrid. |
read_tree | pass(self) | Read a tree of a VTKHDF HyperTreeGrid. |
read_polydata_cells | Read polydata cells. | |
dataarray_bytes | pass(self) | Return the bytes of a dataarray element. |
find_dataarray | pass(self) | Return the index of a named dataarray element. |
geometry_dataarrays | pass(self) | Return the indexes of the geometry dataarray elements. |
piece_element | pass(self) | Return the index of a piece element. |
htg_extent | pass(self) | The extent of the root grid of a .htg. |
location_tuples | pass(self) | The tuples of a location element of a piece. |
htg_layout | pass(self) | The trees of a .htg. |
htg_tree_id | pass(self) | Tree ids of a .htg, x fastest. |
read_connectivity_I4P | pass(self) | Read the cells (I4P). |
read_connectivity_I8P | pass(self) | Read the cells (I8P). |
read_dataarray_rank1_R8P | pass(self) | Read a dataarray (rank 1, R8P). |
read_dataarray_rank1_R4P | pass(self) | Read a dataarray (rank 1, R4P). |
read_dataarray_rank1_I8P | pass(self) | Read a dataarray (rank 1, I8P). |
read_dataarray_rank1_I4P | pass(self) | Read a dataarray (rank 1, I4P). |
read_dataarray_rank1_I2P | pass(self) | Read a dataarray (rank 1, I2P). |
read_dataarray_rank1_I1P | pass(self) | Read a dataarray (rank 1, I1P). |
read_dataarray_rank2_R8P | pass(self) | Read a dataarray (rank 2, R8P). |
read_dataarray_rank2_R4P | pass(self) | Read a dataarray (rank 2, R4P). |
read_dataarray_rank2_I8P | pass(self) | Read a dataarray (rank 2, I8P). |
read_dataarray_rank2_I4P | pass(self) | Read a dataarray (rank 2, I4P). |
read_dataarray_rank2_I2P | pass(self) | Read a dataarray (rank 2, I2P). |
read_dataarray_rank2_I1P | pass(self) | Read a dataarray (rank 2, I1P). |
read_dataarray_strings | pass(self) | Read a dataarray of strings. |
read_geo_R8P | pass(self) | Read the geometry (R8P). |
read_geo_R4P | pass(self) | Read the geometry (R4P). |
read_ids | pass(self) | Read a dataarray of ids (I8P) of a piece section. |
read_faces | pass(self) | Read the faces of the polyhedra of a piece (any layout). |
read_named_dataarray | pass(self) | Return the bytes of a named dataarray. |
read_polydata_cells_I4P | pass(self) | Read polydata cells (I4P). |
read_polydata_cells_I8P | pass(self) | Read polydata cells (I8P). |
Interfaces
get_fixed_attribute
Get an attribute holding a fixed number of values.
Module procedures: get_fixed_attribute_I4P, get_fixed_attribute_R8P
Subroutines
close
Close the file read (a VTKHDF file is open while read) and finalize the reader.
fortran
subroutine close(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | inout | XML reader. |
Call graph
finalize
Finalize the reader (free memory). A VTKHDF file is forgotten, not closed: close closes it.
Attributes: elemental
fortran
subroutine finalize(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | inout | XML reader. |
Call graph
b64_decode_bytes
Decode a base64 code into bytes.
fortran
subroutine b64_decode_bytes(code, bytes)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
code | character(len=*) | in | Base64 code. | |
bytes | integer(kind=I1P) | inout | Bytes, of the decoded size. |
Call graph
piece_counts
Return the counts (points, cells, verts, lines, strips, polys) and the extent of a piece element.
fortran
subroutine piece_counts(xml, id, mesh_topology, counts, extent, error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
xml | type(xml_index) | in | Index of the XML elements. | |
id | integer(kind=I4P) | in | Index of the piece element. | |
mesh_topology | character(len=*) | in | Dataset type. | |
counts | integer(kind=I8P) | out | Points, cells, verts, lines, strips, polys. | |
extent | integer(kind=I4P) | out | Extent. | |
error | integer(kind=I4P) | out | Error status. |
Call graph
get_fixed_attribute_I4P
Get an attribute holding exactly size(values) integers: values keep their defaults if it is missing, error is set to 6 if it is malformed, has another number of values or, if is_required, is missing.
fortran
subroutine get_fixed_attribute_I4P(xml, id, name, values, error, is_required)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
xml | type(xml_index) | in | Index of the XML elements. | |
id | integer(kind=I4P) | in | Index of the element. | |
name | character(len=*) | in | Attribute name. | |
values | integer(kind=I4P) | inout | Values. | |
error | integer(kind=I4P) | inout | Error status, set to 6 on error. | |
is_required | logical | in | optional | The attribute must exist. |
get_fixed_attribute_R8P
Get an attribute holding exactly size(values) reals (see get_fixed_attribute_I4P).
fortran
subroutine get_fixed_attribute_R8P(xml, id, name, values, error, is_required)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
xml | type(xml_index) | in | Index of the XML elements. | |
id | integer(kind=I4P) | in | Index of the element. | |
name | character(len=*) | in | Attribute name. | |
values | real(kind=R8P) | inout | Values. | |
error | integer(kind=I4P) | inout | Error status, set to 6 on error. | |
is_required | logical | in | optional | The attribute must exist. |
Functions
initialize
Initialize the reader: index the file. dataset (VTKHDF only) reads a dataset of a VTKHDF composite file (its path under /VTKHDF, as vtm_file%get_entries gives it); error 3 with an XML file, 4 for a missing dataset.
Returns: integer(kind=I4P)
fortran
function initialize(self, filename, dataset) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | inout | XML reader. | |
filename | character(len=*) | in | File name. | |
dataset | character(len=*) | in | optional | A dataset of a VTKHDF composite file. |
Call graph
get_info
Return the information of the dataset.
The whole extent (nx1...nz2) is returned for the structured topologies (ImageData, RectilinearGrid, StructuredGrid); origin, spacing and direction for ImageData (direction is the identity when the file has none); ghost_level for parallel headers (0 when the file has none).
Returns: integer(kind=I4P)
fortran
function get_info(self, mesh_topology, npieces, header_type, compressor, nx1, nx2, ny1, ny2, nz1, nz2, origin, spacing, direction, ghost_level) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
mesh_topology | character(len=:) | out | allocatable, optional | Dataset type, e.g. UnstructuredGrid. |
npieces | integer(kind=I4P) | out | optional | Number of pieces. |
header_type | character(len=:) | out | allocatable, optional | Header of the binary data: UInt32 or UInt64. |
compressor | character(len=:) | out | allocatable, optional | Compressor of the binary data: none or zlib. |
nx1 | integer(kind=I4P) | out | optional | Initial node of x axis. |
nx2 | integer(kind=I4P) | out | optional | Final node of x axis. |
ny1 | integer(kind=I4P) | out | optional | Initial node of y axis. |
ny2 | integer(kind=I4P) | out | optional | Final node of y axis. |
nz1 | integer(kind=I4P) | out | optional | Initial node of z axis. |
nz2 | integer(kind=I4P) | out | optional | Final node of z axis. |
origin | real(kind=R8P) | out | optional | Origin of ImageData. |
spacing | real(kind=R8P) | out | optional | Spacing of ImageData. |
direction | real(kind=R8P) | out | optional | Axes directions of ImageData (row-major). |
ghost_level | integer(kind=I4P) | out | optional | Number of ghost levels of a parallel header. |
Call graph
read_piece
Read the counts and the extent of a piece.
For the structured topologies the counts are computed from the extent of the piece. For PolyData nc is the number of all the cells (vertices, lines, strips and polygons).
Returns: integer(kind=I4P)
fortran
function read_piece(self, piece, np, nc, nx1, nx2, ny1, ny2, nz1, nz2, nverts, nlines, nstrips, npolys) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
np | integer(kind=I8P) | out | optional | Number of points. |
nc | integer(kind=I8P) | out | optional | Number of cells. |
nx1 | integer(kind=I4P) | out | optional | Initial node of x axis. |
nx2 | integer(kind=I4P) | out | optional | Final node of x axis. |
ny1 | integer(kind=I4P) | out | optional | Initial node of y axis. |
ny2 | integer(kind=I4P) | out | optional | Final node of y axis. |
nz1 | integer(kind=I4P) | out | optional | Initial node of z axis. |
nz2 | integer(kind=I4P) | out | optional | Final node of z axis. |
nverts | integer(kind=I8P) | out | optional | Number of vertices (PolyData). |
nlines | integer(kind=I8P) | out | optional | Number of lines (PolyData). |
nstrips | integer(kind=I8P) | out | optional | Number of strips (PolyData). |
npolys | integer(kind=I8P) | out | optional | Number of polygons (PolyData). |
Call graph
get_active
Return the name of the active array of a role of a location (node or cell): role one of Scalars, Vectors, Normals, Tensors, TCoords, GlobalIds, PedigreeIds, EdgeFlag, Tangents, RationalWeights, HigherOrderDegrees, ProcessIds (case insensitive); data_name empty if no array has the role. Error 4 for an unknown location or role, or a missing piece.
Returns: integer(kind=I4P)
fortran
function get_active(self, location, role, data_name, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node or cell. | |
role | character(len=*) | in | Role. | |
data_name | character(len=:) | out | allocatable | Name of the active array, empty if none. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
get_dataarray_names
Return the names of the dataarrays of a location (node, cell or field), in the order of the file.
The names are blank padded to the length of the longest one; a location without dataarrays returns no names.
Returns: integer(kind=I4P)
fortran
function get_dataarray_names(self, location, names, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
names | character(len=:) | out | allocatable | Names of the dataarrays. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
get_dataarray_info
Return the VTK type, the number of components, the number of tuples and the component names of a dataarray, without reading it.
The number of tuples is the NumberOfTuples attribute when present, otherwise the number of points or cells of the piece; -1 when unknown (field data without NumberOfTuples, arrays declared by a parallel header).
Returns: integer(kind=I4P)
fortran
function get_dataarray_info(self, location, data_name, piece, data_type, n_components, n_tuples, component_names) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
data_type | character(len=:) | out | allocatable, optional | VTK type, e.g. Float64, Int32, UInt8, String. |
n_components | integer(kind=I4P) | out | optional | Number of components. |
n_tuples | integer(kind=I8P) | out | optional | Number of tuples. |
component_names | character(len=:) | out | allocatable, optional | Names of the components (ComponentName), |
Call graph
read_dataarray_strings
Read a dataarray of strings (type String, as field data strings are written).
Returns: integer(kind=I4P)
fortran
function read_dataarray_strings(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | character(len=:) | out | allocatable | Strings, blank padded to the longest one. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_geo_R8P
Read the geometry of a piece (R8P): the coordinates of the points, or the coordinates along each axis of a RectilinearGrid. ImageData have no stored geometry (see get_info): the error is 4.
Returns: integer(kind=I4P)
fortran
function read_geo_R8P(self, x, y, z, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
x | real(kind=R8P) | out | allocatable | X coordinates. |
y | real(kind=R8P) | out | allocatable | Y coordinates. |
z | real(kind=R8P) | out | allocatable | Z coordinates. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
read_geo_R4P
Read the geometry of a piece (R4P): the coordinates of the points, or the coordinates along each axis of a RectilinearGrid. ImageData have no stored geometry (see get_info): the error is 4.
Returns: integer(kind=I4P)
fortran
function read_geo_R4P(self, x, y, z, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
x | real(kind=R4P) | out | allocatable | X coordinates. |
y | real(kind=R4P) | out | allocatable | Y coordinates. |
z | real(kind=R4P) | out | allocatable | Z coordinates. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
read_connectivity_I8P
Read the cells of an UnstructuredGrid piece (I8P): connectivity, offsets, types and, if present, polyhedra faces.
The ids can be of any integer type in the file. Asking for face/faceoffset when the file has none is an error 4.
Returns: integer(kind=I4P)
fortran
function read_connectivity_I8P(self, connectivity, offset, cell_type, face, faceoffset, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
connectivity | integer(kind=I8P) | out | allocatable | Connectivity. |
offset | integer(kind=I8P) | out | allocatable | Offsets: end of each cell in the connectivity. |
cell_type | integer(kind=I1P) | out | allocatable, optional | VTK cell types. |
face | integer(kind=I8P) | out | allocatable, optional | Faces stream of the polyhedra. |
faceoffset | integer(kind=I8P) | out | allocatable, optional | End of the faces of each cell, -1 if none. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
read_connectivity_I4P
Read the cells of an UnstructuredGrid piece (I4P): connectivity, offsets, types and, if present, polyhedra faces.
The ids can be of any integer type in the file (VTK writes Int64): values that do not fit I4P are an error 5.
Returns: integer(kind=I4P)
fortran
function read_connectivity_I4P(self, connectivity, offset, cell_type, face, faceoffset, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
connectivity | integer(kind=I4P) | out | allocatable | Connectivity. |
offset | integer(kind=I4P) | out | allocatable | Offsets: end of each cell in the connectivity. |
cell_type | integer(kind=I1P) | out | allocatable, optional | VTK cell types. |
face | integer(kind=I4P) | out | allocatable, optional | Faces stream of the polyhedra. |
faceoffset | integer(kind=I4P) | out | allocatable, optional | End of the faces of each cell, -1 if none. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
read_polydata_cells_I8P
Read one block of cells of a PolyData piece (I8P): block is verts, lines, strips or polys (case insensitive).
A block absent from the file, with no cells in the piece, returns empty arrays.
Returns: integer(kind=I4P)
fortran
function read_polydata_cells_I8P(self, block, connectivity, offset, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
block | character(len=*) | in | Block of cells: verts, lines, strips or polys. | |
connectivity | integer(kind=I8P) | out | allocatable | Connectivity. |
offset | integer(kind=I8P) | out | allocatable | Offsets: end of each cell in the connectivity. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
read_polydata_cells_I4P
Read one block of cells of a PolyData piece (I4P): block is verts, lines, strips or polys (case insensitive).
A block absent from the file, with no cells in the piece, returns empty arrays. Values that do not fit I4P are an error 5.
Returns: integer(kind=I4P)
fortran
function read_polydata_cells_I4P(self, block, connectivity, offset, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
block | character(len=*) | in | Block of cells: verts, lines, strips or polys. | |
connectivity | integer(kind=I4P) | out | allocatable | Connectivity. |
offset | integer(kind=I4P) | out | allocatable | Offsets: end of each cell in the connectivity. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
get_steps
Return the times of the steps of a VTKHDF time series; none for any other file (an XML time series is a .pvd collection, read by pvd_file).
Returns: integer(kind=I4P)
fortran
function get_steps(self, times) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
times | real(kind=R8P) | out | allocatable | Times of the steps. |
Call graph
set_step
Select the step read (from 1) of a VTKHDF time series: the following calls read that step. A file that is not a time series has the step 1 only.
Returns: integer(kind=I4P)
fortran
function set_step(self, step) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | inout | XML reader. | |
step | integer(kind=I4P) | in | Step, from 1. |
Call graph
get_levels
Return the number of levels of a VTKHDF OverlappingAMR (0 for another dataset, and for an XML file).
Returns: integer(kind=I4P)
fortran
function get_levels(self, n_levels) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
n_levels | integer(kind=I4P) | out | Levels. |
Call graph
set_level
Select the level read (from 0) of a VTKHDF OverlappingAMR: its boxes are the pieces of the following calls (get_info gives their number and the spacing of the level, read_piece the point extent of each box).
Returns: integer(kind=I4P)
fortran
function set_level(self, level) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | inout | XML reader. | |
level | integer(kind=I4P) | in | Level, from 0. |
Call graph
get_trees
Return the trees of a piece (a partition) of a HyperTreeGrid (a .htg, one piece; a VTKHDF file, of the step read): the ids of their root cells (i + (nx-1)(j + (ny-1)k), from 0, also for a file with TransposedRootIndexing), in the order of the file (that of their cells in the cell data), and its branch factor (2 or 3); the names of its interface cell arrays (empty without, set_interface of the writer). Error 4 for another dataset or piece.
Returns: integer(kind=I4P)
fortran
function get_trees(self, tree_ids, branch_factor, piece, interface_normals, interface_intercepts) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
tree_ids | integer(kind=I8P) | out | allocatable | Ids of the trees. |
branch_factor | integer(kind=I4P) | out | optional | Branch factor. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
interface_normals | character(len=:) | out | allocatable, optional | Cell array of the interface normals. |
interface_intercepts | character(len=:) | out | allocatable, optional | Cell array of the interface intercepts. |
Call graph
read_tree
Read the tree tree_id of a piece of a HyperTreeGrid (a .htg; a VTKHDF file, of the step read) as write_tree takes it: descriptor the refinement of its cells breadth first, every depth but the deepest; mask one value per cell (all false when the file has none). Error 4 for another dataset or a tree not in the piece, 6 for an inconsistent file.
Returns: integer(kind=I4P)
fortran
function read_tree(self, tree_id, descriptor, mask, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
tree_id | integer(kind=I8P) | in | Id of the tree (its root cell, as get_trees gives it). | |
descriptor | logical | out | allocatable | Refinement of its cells. |
mask | logical | out | allocatable, optional | Masked cells. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
Call graph
get_sources
Return the files of the pieces of a parallel header (the Source attributes), as written in the file.
Relative paths are relative to the directory of the header. The names are blank padded to the length of the longest one. The extents of the pieces of structured grids are returned by read_piece(piece, nx1, ...).
Returns: integer(kind=I4P)
fortran
function get_sources(self, sources) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
sources | character(len=:) | out | allocatable | Files of the pieces. |
check_pieces
Check the pieces of a parallel header against it.
Each piece file is read (its index only, not its data) and must be a dataset of the type of the header (e.g. an UnstructuredGrid for a PUnstructuredGrid), with points or coordinates of the declared type (PPoints, PCoordinates) and, in every one of its pieces, every array declared by PPointData and PCellData with the same type and number of components (a piece can hold more arrays). VTK readers otherwise drop arrays, fill them with zeros or fail.
The error is 0 when all the pieces match, 7 when one does not, or the error of reading a piece (1, 2, 3); message then describes the first mismatch found.
Returns: integer(kind=I4P)
fortran
function check_pieces(self, message) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
message | character(len=:) | out | allocatable, optional | Description of the first mismatch, empty if none. |
Call graph
dataarray_bytes
Return the bytes (native byte order), the VTK type and the number of components of a dataarray element.
Returns: integer(kind=I4P)
fortran
function dataarray_bytes(self, id, bytes, data_type, n_components) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
id | integer(kind=I4P) | in | Index of the dataarray element. | |
bytes | integer(kind=I1P) | out | allocatable | Bytes of the dataarray. |
data_type | character(len=:) | out | allocatable | VTK type. |
n_components | integer(kind=I4P) | out | Number of components. |
Call graph
find_dataarray
Return the index of a named dataarray element of a location, and of the location element (0 if absent).
Returns: integer(kind=I4P)
fortran
function find_dataarray(self, location, data_name, piece, id, section) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
id | integer(kind=I4P) | out | Index of the dataarray element, 0 if not found. | |
section | integer(kind=I4P) | out | Index of the location element, 0 if not found. |
Call graph
geometry_dataarrays
Return the indexes of the geometry dataarray elements of a piece: Points (n=1) or the 3 Coordinates (n=3).
Returns: integer(kind=I4P)
fortran
function geometry_dataarrays(self, piece, id, n) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
id | integer(kind=I4P) | out | Indexes of the geometry dataarray elements. | |
n | integer(kind=I4P) | out | Number of geometry dataarray elements. |
Call graph
piece_element
Return the index of a piece element.
Returns: integer(kind=I4P)
fortran
function piece_element(self, piece, id) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
id | integer(kind=I4P) | out | Index of the piece element. |
Call graph
read_faces
Read the faces of the polyhedra of an UnstructuredGrid piece: data_name faces (the face stream of write_connectivity) or faceoffsets (the end of the faces of each cell, -1 if none), from the faces/faceoffsets arrays (the layout VTKFortran writes) or, without them, from the four arrays VTK 9.7.2 writes since XML 2.3 (face_connectivity, face_offsets, polyhedron_to_faces, polyhedron_offsets, end offsets; a shared face -(n+1) since 2.5). A piece without polyhedra is an error 4.
Returns: integer(kind=I4P)
fortran
function read_faces(self, piece, data_name, ids) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
data_name | character(len=*) | in | faces or faceoffsets. | |
ids | integer(kind=I8P) | out | allocatable | Face stream, or end of the faces of each cell. |
Call graph
read_ids
Read a dataarray of ids (any integer type) of a section of a piece (e.g. Cells, Polys) into I8P.
Returns: integer(kind=I4P)
fortran
function read_ids(self, piece, section, data_name, ids) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
section | character(len=*) | in | Name of the section element. | |
data_name | character(len=*) | in | Name of the dataarray. | |
ids | integer(kind=I8P) | out | allocatable | Ids. |
Call graph
read_named_dataarray
Return the bytes, the VTK type and the number of components of a named dataarray of a location.
Returns: integer(kind=I4P)
fortran
function read_named_dataarray(self, location, data_name, piece, bytes, data_type, n_components) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
bytes | integer(kind=I1P) | out | allocatable | Bytes of the dataarray. |
data_type | character(len=:) | out | allocatable | VTK type. |
n_components | integer(kind=I4P) | out | Number of components. |
Call graph
read_dataarray_rank1_R8P
Read a dataarray, flattened (components interleaved), into an array (R8P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank1_R8P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | real(kind=R8P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank1_R4P
Read a dataarray, flattened (components interleaved), into an array (R4P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank1_R4P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | real(kind=R4P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank1_I8P
Read a dataarray, flattened (components interleaved), into an array (I8P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank1_I8P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I8P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank1_I4P
Read a dataarray, flattened (components interleaved), into an array (I4P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank1_I4P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I4P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank1_I2P
Read a dataarray, flattened (components interleaved), into an array (I2P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank1_I2P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I2P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank1_I1P
Read a dataarray, flattened (components interleaved), into an array (I1P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank1_I1P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I1P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank2_R8P
Read a dataarray into an array of shape (number of components, number of tuples) (R8P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank2_R8P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | real(kind=R8P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank2_R4P
Read a dataarray into an array of shape (number of components, number of tuples) (R4P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank2_R4P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | real(kind=R4P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank2_I8P
Read a dataarray into an array of shape (number of components, number of tuples) (I8P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank2_I8P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I8P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank2_I4P
Read a dataarray into an array of shape (number of components, number of tuples) (I4P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank2_I4P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I4P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank2_I2P
Read a dataarray into an array of shape (number of components, number of tuples) (I2P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank2_I2P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I2P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_dataarray_rank2_I1P
Read a dataarray into an array of shape (number of components, number of tuples) (I1P).
Returns: integer(kind=I4P)
fortran
function read_dataarray_rank2_I1P(self, location, data_name, x, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
location | character(len=*) | in | Location: node, cell, field or row (Table). | |
data_name | character(len=*) | in | Name of the dataarray. | |
x | integer(kind=I1P) | out | allocatable | Values. |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1, ignored for field data). |
Call graph
read_coordinate_R8P
Read a geometry dataarray element into R8P, checking its number of components (default 1).
Returns: integer(kind=I4P)
fortran
function read_coordinate_R8P(self, id, x, n_components) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
id | integer(kind=I4P) | in | Index of the dataarray element. | |
x | real(kind=R8P) | out | allocatable | Values. |
n_components | integer(kind=I4P) | in | optional | Expected number of components. |
Call graph
read_coordinate_R4P
Read a geometry dataarray element into R4P, checking its number of components (default 1).
Returns: integer(kind=I4P)
fortran
function read_coordinate_R4P(self, id, x, n_components) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
id | integer(kind=I4P) | in | Index of the dataarray element. | |
x | real(kind=R4P) | out | allocatable | Values. |
n_components | integer(kind=I4P) | in | optional | Expected number of components. |
Call graph
read_appended_raw
Read the data of a dataarray from raw appended data: the bytes count (or the compressed data header) and the data.
Returns: integer(kind=I4P)
fortran
function read_appended_raw(self, pos, bytes) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
pos | integer(kind=I8P) | in | Position of the dataarray in the file. | |
bytes | integer(kind=I1P) | out | allocatable | Data bytes. |
Call graph
read_appended_base64
Read the data of a dataarray from base64 appended data (offsets count characters).
The length of the code of a dataarray is computed from its header: the bytes count (uncompressed, one base64 stream with the data) or the header of the compressed data (a base64 stream of its own, followed by the blocks).
Returns: integer(kind=I4P)
fortran
function read_appended_base64(self, pos, bytes) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
pos | integer(kind=I8P) | in | Position of the dataarray in the file. | |
bytes | integer(kind=I1P) | out | allocatable | Data bytes. |
Call graph
polydata_section
Return the name of the element of a block of polydata cells, empty if the block is absent and has no cells.
Returns: integer(kind=I4P)
fortran
function polydata_section(self, block, piece, section) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
block | character(len=*) | in | Block of cells: verts, lines, strips or polys. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
section | character(len=:) | out | allocatable | Name of the block element. |
Call graph
scan_error
Return the reader error of the scan of a file: 0 if scanned, 2 if malformed XML, 1 if it cannot be read.
Attributes: elemental
Returns: integer(kind=I4P)
fortran
function scan_error(iostat) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
iostat | integer(kind=I4P) | in | IO status of the scan. |
Call graph
find_marker
Return the position following the '_' marker of the appended data, searched from a position (0 if not found).
Returns: integer(kind=I8P)
fortran
function find_marker(filename, pos) result(start)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
filename | character(len=*) | in | File name. | |
pos | integer(kind=I8P) | in | Position where the search starts. |
Call graph
read_chars
Read the characters of a file between two positions (none if last < first).
Returns: integer(kind=I4P)
fortran
function read_chars(filename, first, last, chars) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
filename | character(len=*) | in | File name. | |
first | integer(kind=I8P) | in | First position. | |
last | integer(kind=I8P) | in | Last position. | |
chars | character(len=:) | out | allocatable | Characters read. |
Call graph
read_bytes
Read bytes of a file from a position.
Returns: integer(kind=I4P)
fortran
function read_bytes(filename, pos, n, bytes) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
filename | character(len=*) | in | File name. | |
pos | integer(kind=I8P) | in | First position. | |
n | integer(kind=I8P) | in | Number of bytes. | |
bytes | integer(kind=I1P) | out | allocatable | Bytes read. |
Call graph
to_I4P
Convert ids into I4P, checking that they fit.
Returns: integer(kind=I4P)
fortran
function to_I4P(ids, x) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
ids | integer(kind=I8P) | in | Ids. | |
x | integer(kind=I4P) | out | allocatable | Ids, I4P. |
Call graph
is_dataarray
Return .true. if an element name is a data array: DataArray, Array (strings), PDataArray or PArray (strings) of a parallel header.
Attributes: elemental
Returns: logical
fortran
function is_dataarray(name) result(is_array)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in | Element name. |
Call graph
lower_case
Return a string in lower case (ASCII letters only).
Attributes: pure
Returns: character(len=len(string))
fortran
function lower_case(string) result(lower)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
string | character(len=*) | in | Input string. |
Call graph
htg_extent
The extent of the root grid of a .htg (its points, from 0), from its Dimensions. Error 6 if malformed.
Returns: integer(kind=I4P)
fortran
function htg_extent(self, extent) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
extent | integer(kind=I4P) | inout | Extent. |
Call graph
htg_layout
The trees of a .htg: their ids in the file (TreeIds), depths (DepthPerTree) and the cells of each of their depths (NumberOfVerticesPerDepth), checked against each other (error 6 if they disagree, 4 without trees).
Returns: integer(kind=I4P)
fortran
function htg_layout(self, ids, depths, counts) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
ids | integer(kind=I8P) | out | allocatable | Ids of the trees, as in the file. |
depths | integer(kind=I8P) | out | allocatable | Depth of each tree. |
counts | integer(kind=I8P) | out | allocatable | Cells of each depth of each tree. |
Call graph
htg_tree_id
Tree ids of a .htg in the documented indexing, x fastest: unchanged, or converted from z fastest for a file with TransposedRootIndexing="1" (as VTK reads it).
Returns: integer(kind=I8P)
fortran
function htg_tree_id(self, file_ids) result(ids)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
file_ids | integer(kind=I8P) | in | Tree ids in the file. |
Call graph
location_tuples
The tuples of a location element of a piece (PointData, CellData, RowData): the points or cells of the piece (from its counts or extent; the root grid and the trees of a HyperTreeGrid), the rows of a Table. Error 6 if unknown.
Returns: integer(kind=I4P)
fortran
function location_tuples(self, section, n_tuples) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(xml_reader) | in | XML reader. | |
section | integer(kind=I4P) | in | Index of the location element. | |
n_tuples | integer(kind=I8P) | out | Tuples. |
Call graph