Appearance
vtk_fortran_vtk_file_vtkhdf_reader
VTK file VTKHDF reader: the reading of
.vtkhdffiles behindxml_reader(vtk_file%initialize(filename, action='read')), which dispatches its calls here when the file is an HDF5 one.
It reads every dataset the VTKHDF writer writes, and the same layouts written by VTK: ImageData, RectilinearGrid, StructuredGrid (one piece), UnstructuredGrid (polyhedra included), PolyData (each partition a piece), Table (no pieces: its columns are read with location='row', the rows of the step read; NumberOfRows) and OverlappingAMR (get_levels, set_level: the boxes of the level read, from level 0, are its pieces, read_piece giving their point extents, get_info its spacing and the origin), HyperTreeGrid (its partitions are the pieces: read_geo the coordinates of one as for a RectilinearGrid, get_trees the ids of its trees (x fastest, also for a file with TransposedRootIndexing) and the branch factor, read_tree the descriptor and mask of a tree as write_tree takes them, unpacked from the bits, MSB first; cell data the cells of its trees in their order, breadth first in each); grid arrays with the axes of more than one point (as VTK), another shape refused (error 6), static or time series (Steps: get_steps, set_step; the step 1 by default; through the offsets of Steps, so that a step reusing the mesh or an array of the step before reads it as written in full). The values are read as HDF5 hyperslabs of the piece and step asked for, as the bytes of their type in the file (read_dataarray_bytes), then converted by the caller: the memory used is about the size of the array read. The offsets are returned as VTKFortran writes them (the end of each cell), the faces of the polyhedra as the face stream of write_connectivity: a face shared by two polyhedra (VTKHDF 2.9, a negative id in PolyhedronToFaces for a face traversed in reverse) is given in the stream of each polyhedron, reversed where marked. String datasets (variable or fixed length, as vtkHDFWriter writes a vtkStringArray) are read as the type String.
The error codes are the ones of xml_reader: 1 the file cannot be read, 2 not a VTKHDF file, 3 unsupported (composite files, an unknown type), 4 not found, 5 the kind cannot hold the values, 6 the data do not decode (inconsistent).
Source: src/lib/vtk_fortran_vtk_file_vtkhdf_reader.f90
Dependencies
Contents
- vtkhdf_reader
- close
- forget
- initialize
- get_info
- get_steps
- set_step
- get_levels
- set_level
- read_piece
- get_active
- get_dataarray_names
- get_dataarray_info
- read_dataarray_bytes
- read_geo_R8P
- read_geo_R4P
- read_ids
- get_trees
- read_tree
- tree_layout
- htg_part
- tree_id
- grid_points
- amr_box
- prefix
- amr_steps_name
- is_v23
- is_grid
- part
- step_value
- array_slice
- step_start
- block_start
- count_of
- axis_bytes
- points_bytes
- coordinates_R8P
- coordinates_R4P
- read_bits
- read_I8P
- location_group
- polyhedra_stream
- is_hdf5_file
Variables
| Name | Type | Attributes | Description |
|---|---|---|---|
BLOCKS | character(len=*) | parameter | Groups of the PolyData cells. |
STEP_COLUMN | integer(kind=I4P) | parameter | Column of each block in the [NSteps, 4] offsets of Steps. |
Derived Types
vtkhdf_reader
VTK file VTKHDF reader.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
file_id | integer(kind=hid_kind) | File. | |
root | integer(kind=hid_kind) | Group /VTKHDF. | |
mesh_topology | character(len=:) | allocatable | Dataset type. |
is_initialized | logical | The reader is initialized. | |
n_steps | integer(kind=I8P) | Steps, 0 for a dataset that is not a time series. | |
step | integer(kind=I8P) | Step read. | |
whole_extent | integer(kind=I4P) | Whole extent of a grid. | |
n_levels | integer(kind=I4P) | Levels of an OverlappingAMR. | |
level | integer(kind=I4P) | Level read (from 0). | |
version | integer(kind=I8P) | Version of the file (of the composite if the dataset has none). | |
transposed | logical | HyperTreeGrid with TransposedRootIndexing (tree ids z fastest). |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
close | pass(self) | Close the file and reset the reader. |
forget | pass(self) | Reset the reader without closing the file (pure). |
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_levels | pass(self) | Return the number of levels of an OverlappingAMR. |
get_steps | pass(self) | Return the times of the steps. |
initialize | pass(self) | Initialize the reader: open the file. |
read_dataarray_bytes | pass(self) | Return the bytes, type and components of a dataarray. |
read_geo | Read the geometry. | |
read_geo_R8P | pass(self) | Read the geometry (R8P). |
read_geo_R4P | pass(self) | Read the geometry (R4P). |
read_ids | pass(self) | Read ids of the cells (connectivity, offsets, types, faces). |
read_piece | pass(self) | Read the counts and extent of a piece. |
get_trees | pass(self) | Return the trees of a HyperTreeGrid (of the step read). |
read_tree | pass(self) | Read a tree of a HyperTreeGrid: its descriptor and mask. |
set_level | pass(self) | Select the level read of an OverlappingAMR. |
set_step | pass(self) | Select the step read. |
amr_box | pass(self) | A box of the level and step read of an OverlappingAMR. |
is_v23 | pass(self) | The file is VTKHDF 2.3 or later (OverlappingAMR Steps names). |
amr_steps_name | pass(self) | The name of an OverlappingAMR Steps entry in the file. |
grid_points | pass(self) | Points of the grid along each axis. |
prefix | pass(self) | Group of the point and cell data of the level read (AMR). |
is_grid | pass(self) | The dataset is a grid (one piece). |
part | pass(self) | The partition of a piece of the step, and where it starts. |
step_value | pass(self) | An entry of a dataset of Steps for the step read. |
tree_layout | pass(self) | Where the trees of a HyperTreeGrid (of the step read) are. |
htg_part | pass(self) | A partition of a HyperTreeGrid of the step read: starts, counts. |
tree_id | pass(self) | A tree id of the file in the documented (x fastest) indexing. |
Subroutines
close
Close the file and reset the reader.
fortran
subroutine close(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | inout | Reader. |
Call graph
forget
Reset the reader without closing the file (for the pure free of vtk_file: close closes it).
Attributes: elemental
fortran
subroutine forget(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | inout | Reader. |
Call graph
Functions
initialize
Initialize the reader: open the file, read the type and extent of its dataset and its steps. With dataset, the dataset is the group /VTKHDF/<dataset> of a composite file (a MultiBlockDataSet or PartitionedDataSetCollection: Block_3, a dataset name, or a path through its Assembly, as vtm_file%get_entries gives it).
Returns: integer(kind=I4P)
fortran
function initialize(self, filename, dataset) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | inout | Reader. | |
filename | character(len=*) | in | File name. | |
dataset | character(len=*) | in | optional | A dataset of a composite file. |
Call graph
get_info
Return the information of the dataset, as xml_reader%get_info: the pieces are those of the step read; the header type is HDF5 and the compressor none (HDF5 decompresses its datasets itself).
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(vtkhdf_reader) | in | Reader. | |
mesh_topology | character(len=:) | out | allocatable, optional | Dataset type, e.g. UnstructuredGrid. |
npieces | integer(kind=I4P) | out | optional | Number of pieces (of the step read). |
header_type | character(len=:) | out | allocatable, optional | HDF5. |
compressor | character(len=:) | out | allocatable, optional | none. |
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 | 0. |
Call graph
get_steps
Return the times of the steps (none when the dataset is not a time series).
Returns: integer(kind=I4P)
fortran
function get_steps(self, times) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
times | real(kind=R8P) | out | allocatable | Times of the steps. |
Call graph
set_step
Select the step read, from 1 (a dataset that is not a time series has only the step 1).
Returns: integer(kind=I4P)
fortran
function set_step(self, step) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | inout | Reader. | |
step | integer(kind=I4P) | in | Step, from 1. |
Call graph
get_levels
Return the number of levels of an OverlappingAMR (0 for another dataset).
Returns: integer(kind=I4P)
fortran
function get_levels(self, n_levels) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
n_levels | integer(kind=I4P) | out | Levels. |
Call graph
set_level
Select the level read of an OverlappingAMR, from 0 (level 0 by default): its boxes are the pieces of the following calls.
Returns: integer(kind=I4P)
fortran
function set_level(self, level) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | inout | Reader. | |
level | integer(kind=I4P) | in | Level, from 0. |
Call graph
read_piece
Read the counts and the extent of a piece of the step read (a grid has one piece, its extent the whole extent).
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(vtkhdf_reader) | in | 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 (see xml_reader%get_active) of a location (node or cell): the dataset of the group whose Attribute attribute is the role (case insensitive); empty if none.
Returns: integer(kind=I4P)
fortran
function get_active(self, location, role, data_name, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | 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, field, or row: the columns of a Table), in the order they were written (their names' order if the file does not track it), blank padded to the longest one.
Returns: integer(kind=I4P)
fortran
function get_dataarray_names(self, location, names, piece) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | 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 and the number of tuples (of the piece and step read) of a dataarray.
Returns: integer(kind=I4P)
fortran
function get_dataarray_info(self, location, data_name, piece, data_type, n_components, n_tuples) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | 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. |
n_components | integer(kind=I4P) | out | optional | Number of components. |
n_tuples | integer(kind=I8P) | out | optional | Number of tuples. |
Call graph
read_dataarray_bytes
Return the bytes (of the piece and step read), the VTK type and the number of components of a named dataarray.
Returns: integer(kind=I4P)
fortran
function read_dataarray_bytes(self, location, data_name, piece, bytes, data_type, n_components) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | 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_geo_R8P
Read the geometry of a piece (R8P): the points (UnstructuredGrid, PolyData, StructuredGrid) or the coordinates along each axis (RectilinearGrid). An ImageData has no stored geometry: 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(vtkhdf_reader) | in | 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 points (UnstructuredGrid, PolyData, StructuredGrid) or the coordinates along each axis (RectilinearGrid). An ImageData has no stored geometry: 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(vtkhdf_reader) | in | 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_ids
Read ids of the cells of a piece, as VTKFortran writes them: section Cells (UnstructuredGrid: data_name connectivity, offsets, types, faces, faceoffsets) or a PolyData block (Verts, Lines, Strips, Polys: connectivity, offsets). The offsets are the end of each cell; the faces are the face stream of the polyhedra, faceoffsets the end of the faces of each cell, -1 if it is not a polyhedron (error 4 if the file has no polyhedra). A face shared by two polyhedra (VTKHDF 2.9: stored once, -(n+1) in PolyhedronToFaces for the face n traversed in reverse) is given in the stream of each polyhedron, its points reversed where marked; a face id out of the faces of the partition, or offsets out of their dataset, are error 6.
Returns: integer(kind=I4P)
fortran
function read_ids(self, piece, section, data_name, ids) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
piece | integer(kind=I4P) | in | Piece, from 1. | |
section | character(len=*) | in | Cells, Verts, Lines, Strips or Polys. | |
data_name | character(len=*) | in | connectivity, offsets, types, faces or faceoffsets. | |
ids | integer(kind=I8P) | out | allocatable | Ids. |
Call graph
get_trees
Return the trees of a piece (a partition, default 1) of a HyperTreeGrid, of the step read: the ids of their root cells (i + (nx-1)(j + (ny-1)k), from 0; a file with TransposedRootIndexing has them z fastest, converted), in the order of the file (that of their cells in the cell data), and its branch factor; the names of its interface cell arrays (InterfaceNormalsName, InterfaceInterceptsName; empty without). 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(vtkhdf_reader) | in | Reader. | |
tree_ids | integer(kind=I8P) | out | allocatable | Ids of the trees. |
branch_factor | integer(kind=I4P) | out | optional | Branch factor: 2 or 3. |
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 HyperTreeGrid (of the step read), as write_tree takes it: descriptor the refinement of its cells breadth first, every depth but the deepest (empty for a tree of one leaf); mask one value per cell, breadth first (all false when the file has no mask). The bits are unpacked from Descriptors and Mask (MSB first). Error 4 for another dataset or a tree not in the file (a root cell without tree), 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(vtkhdf_reader) | in | Reader. | |
tree_id | integer(kind=I8P) | in | Id of the tree (its root cell). | |
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
tree_layout
Where the trees of a piece (a partition) of a HyperTreeGrid of the step read are: their ids (as in the file), depths, cells of each depth (tree after tree), the first byte of their descriptors and of their mask (each partition, and each step, from a new byte).
Returns: integer(kind=I4P)
fortran
function tree_layout(self, piece, tree_ids, depths, counts, first_bit, first_mask) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
tree_ids | integer(kind=I8P) | out | allocatable | Ids of the trees. |
depths | integer(kind=I8P) | out | allocatable | Depths of each tree. |
counts | integer(kind=I8P) | out | allocatable | Cells of each depth of each tree. |
first_bit | integer(kind=I8P) | out | First byte of the descriptors. | |
first_mask | integer(kind=I8P) | out | First byte of the mask. |
Call graph
htg_part
The partition piece (from 1, default 1) of a HyperTreeGrid of the step read, the parts of the step, and where the partition starts: start = its first tree (TreeIds, DepthPerTree), depth entry (NumberOfCellsPerTreeDepth), descriptor byte, mask byte, cell (cell data, from the step's start), and its index in the step (0 for the first: the coordinates are Dimensions values per partition); count = its trees, depth entries and cells. The parts of a step come from Steps/PartOffsets and NumberOfParts (a step without them: one part, the step's); a static file has every entry of NumberOfTrees as a partition. Each partition's descriptors and mask start on a new byte (DescriptorsSize bits, NumberOfCells mask bits, of the partitions before). Error 4 for another dataset or a piece out of the step, 6 for an inconsistent file.
Returns: integer(kind=I4P)
fortran
function htg_part(self, piece, n_parts, start, count) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
n_parts | integer(kind=I8P) | out | Parts of the step. | |
start | integer(kind=I8P) | out | Starts of the partition. | |
count | integer(kind=I8P) | out | Trees, depth entries, cells of the partition. |
Call graph
tree_id
A tree id of the file in the documented indexing, x fastest (i + nx(j + ny k), nx, ny, nz the root cells per axis): unchanged, or converted from z fastest (k + nz(j + ny i)) for a file with TransposedRootIndexing (as VTK reads it).
Attributes: elemental
Returns: integer(kind=I8P)
fortran
function tree_id(self, file_id) result(id)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
file_id | integer(kind=I8P) | in | Tree id in the file. |
Call graph
grid_points
Points of the grid along each axis.
Attributes: pure
Returns: integer(kind=I8P)
fortran
function grid_points(self) result(grid)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. |
Call graph
amr_box
The box piece (from 1, default 1) of the level and step read of an OverlappingAMR: its point extent (the cells of its AMRBox row, imin, imax, ..., are the points imin, imax+1, ...), the points and cells of the boxes of the level and step before it (where its data start), and the boxes of the level in the step.
Returns: integer(kind=I4P)
fortran
function amr_box(self, piece, extent, starts, n_boxes) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
piece | integer(kind=I4P) | in | optional | Box, from 1 (default 1). |
extent | integer(kind=I4P) | out | Point extent of the box. | |
starts | integer(kind=I8P) | out | Points and cells of the boxes before it. | |
n_boxes | integer(kind=I8P) | out | Boxes of the level in the step. |
Call graph
prefix
The path of the data groups of the level read of an OverlappingAMR (Level<n>/, for PointData and CellData), empty for the other datasets.
Attributes: pure
Returns: character(len=:)
fortran
function prefix(self, group) result(path)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
group | character(len=*) | in | Data group. |
Call graph
amr_steps_name
The name of an OverlappingAMR Steps entry (from Steps), as the file's Version gives it: plural (singular//suffix) from VTKHDF 2.3, singular before (as VTK 9.7.2 reads them); the other spelling when that one is missing (VTKFortran before #89 wrote the singular names with Version 2.6 for a series with an active array).
Returns: character(len=:)
fortran
function amr_steps_name(self, singular, suffix) result(name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
singular | character(len=*) | in | Singular name, e.g. Level0/AMRBoxOffset. | |
suffix | character(len=*) | in | Plural suffix, s or es. |
Call graph
is_v23
Return true if the file is VTKHDF 2.3 or later: the OverlappingAMR Steps names are plural (AMRBoxOffsets, NumberOfAMRBoxes, PointDataOffsets, CellDataOffsets), singular before, as VTK 9.7.2 reads them.
Attributes: elemental
Returns: logical
fortran
function is_v23(self) result(is_v23_)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. |
Call graph
is_grid
Return true if the dataset is a grid (ImageData, RectilinearGrid, StructuredGrid: one piece).
Attributes: elemental
Returns: logical
fortran
function is_grid(self) result(is_grid_)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. |
Call graph
part
The partition g (from 1, in the whole file) of the piece piece of the step read, the parts of the step, and where the partition starts in the datasets the parts share: first = points, (unused), cells, connectivity ids, face point ids, faces, polyhedra's faces (UnstructuredGrid), each counted from the start of the step (Steps offsets) plus the counts of the parts of the step before it.
Returns: integer(kind=I4P)
fortran
function part(self, piece, g, first, n_parts) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
g | integer(kind=I8P) | out | Partition, from 1. | |
first | integer(kind=I8P) | out | Starts of the partition. | |
n_parts | integer(kind=I8P) | out | Parts of the step. |
Call graph
step_value
The entry of the dataset Steps/name for the step read (the column column of a [NSteps, n] dataset).
Returns: integer(kind=I8P)
fortran
function step_value(self, name, column, error) result(value)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
name | character(len=*) | in | Dataset of Steps. | |
column | integer(kind=I4P) | in | Column, from 1. | |
error | integer(kind=I4P) | out | Error status. |
Call graph
array_slice
Where a dataarray of the piece and step read is: its dataset, the rows to skip and to read along its last dimension (tuples of a partition, a time slice of a grid, the tuples of a step of field data, the rows of a step of a Table column), its type, components, tuples. A column of a time series needs its Steps/RowDataOffsets entry (as VTK).
Returns: integer(kind=I4P)
fortran
function array_slice(self, location, data_name, piece, path, data_type, first, count, n_components, n_tuples) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | 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). |
path | character(len=:) | out | allocatable | Dataset. |
data_type | character(len=:) | out | allocatable | VTK type. |
first | integer(kind=I8P) | out | Rows skipped. | |
count | integer(kind=I8P) | out | Rows read. | |
n_components | integer(kind=I4P) | out | Components. | |
n_tuples | integer(kind=I8P) | out | Tuples. |
Call graph
step_start
Where the step read starts in the points (PointData) or cells (CellData) given by the geometry offsets of Steps.
Returns: integer(kind=I8P)
fortran
function step_start(self, group) result(start)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
group | character(len=*) | in | PointData or CellData. |
Call graph
block_start
Where the partition g starts in the cells (NumberOfCells, CellOffsets) or the ids (NumberOfConnectivityIds, ConnectivityIdOffsets) of the PolyData block b.
Returns: integer(kind=I8P)
fortran
function block_start(self, g, b, counts_name, offsets_name) result(start)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
g | integer(kind=I8P) | in | Partition, from 1. | |
b | integer(kind=I8P) | in | Block, from 1. | |
counts_name | character(len=*) | in | Counts of the block. | |
offsets_name | character(len=*) | in | Offsets of Steps. |
Call graph
count_of
The count of the partition g in the dataset of counts name.
Returns: integer(kind=I8P)
fortran
function count_of(root, name, g, error) result(n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
root | integer(kind=hid_kind) | in | Group /VTKHDF. | |
name | character(len=*) | in | Dataset of counts. | |
g | integer(kind=I8P) | in | Partition, from 1. | |
error | integer(kind=I4P) | inout | Error status: 6 if the count cannot be read. |
Call graph
axis_bytes
The bytes of the coordinates along the axis a (1 x, 2 y, 3 z) of a RectilinearGrid or of a partition of a HyperTreeGrid (of the step read).
Returns: integer(kind=I4P)
fortran
function axis_bytes(self, a, piece, bytes, data_type) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
a | integer(kind=I4P) | in | Axis. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
bytes | integer(kind=I1P) | out | allocatable | Bytes of the coordinates. |
data_type | character(len=:) | out | allocatable | Their VTK type. |
Call graph
points_bytes
The bytes of the points of a piece (of the step read), interleaved: UnstructuredGrid, PolyData, StructuredGrid.
Returns: integer(kind=I4P)
fortran
function points_bytes(self, piece, bytes, data_type) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtkhdf_reader) | in | Reader. | |
piece | integer(kind=I4P) | in | optional | Piece, from 1 (default 1). |
bytes | integer(kind=I1P) | out | allocatable | Bytes of the points. |
data_type | character(len=:) | out | allocatable | Their VTK type. |
Call graph
coordinates_R8P
Coordinates (R8P) from their bytes: real, or integer (VTK writes the coordinates of some datasets as Int64).
Returns: integer(kind=I4P)
fortran
function coordinates_R8P(bytes, data_type, x) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bytes | integer(kind=I1P) | in | Bytes. | |
data_type | character(len=*) | in | VTK type. | |
x | real(kind=R8P) | out | allocatable | Coordinates. |
Call graph
coordinates_R4P
Coordinates (R4P) from their bytes: real, or integer (VTK writes the coordinates of some datasets as Int64).
Returns: integer(kind=I4P)
fortran
function coordinates_R4P(bytes, data_type, x) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
bytes | integer(kind=I1P) | in | Bytes. | |
data_type | character(len=*) | in | VTK type. | |
x | real(kind=R4P) | out | allocatable | Coordinates. |
Call graph
read_bits
Read n bits of the dataset of packed bits name (bytes, MSB first), after skip bits from the byte first_byte.
Returns: integer(kind=I4P)
fortran
function read_bits(root, name, first_byte, skip, n, bits) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
root | integer(kind=hid_kind) | in | Group /VTKHDF. | |
name | character(len=*) | in | Dataset. | |
first_byte | integer(kind=I8P) | in | First byte. | |
skip | integer(kind=I8P) | in | Bits skipped from it. | |
n | integer(kind=I8P) | in | Bits read. | |
bits | logical | out | allocatable | Bits. |
Call graph
read_I8P
Read the slice first+1 ... first+count of an integer dataset into I8P values.
Returns: integer(kind=I4P)
fortran
function read_I8P(root, name, first, count, ids) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
root | integer(kind=hid_kind) | in | Group /VTKHDF. | |
name | character(len=*) | in | Dataset. | |
first | integer(kind=I8P) | in | Values skipped. | |
count | integer(kind=I8P) | in | Values read. | |
ids | integer(kind=I8P) | out | allocatable | Values. |
Call graph
location_group
The group of a location: node PointData, cell CellData, field FieldData, row RowData (case insensitive), empty otherwise.
Returns: character(len=:)
fortran
function location_group(location) result(group)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
location | character(len=*) | in | Location. |
Call graph
polyhedra_stream
The face stream of the polyhedra of a piece (write_connectivity's face) or, want_offsets, the end of the faces of each cell in it (faceoffset, -1 for a cell that is not a polyhedron), from the four arrays of vtkPolyhedronCellArray (VTKHDF PolyhedronOffsets, PolyhedronToFaces, FaceOffsets, FaceConnectivity; XML 2.3+ polyhedron_offsets, polyhedron_to_faces, face_offsets, face_connectivity).
The offsets are given with their start (n+1 entries, any origin). A face shared by two polyhedra (VTKHDF 2.9, XML 2.5: stored once, -(n+1) for the face n traversed in reverse) is given in the stream of each polyhedron, its points reversed where marked. Offsets not increasing or out of their arrays, or a face id out of the faces, are error 6.
Returns: integer(kind=I4P)
fortran
function polyhedra_stream(cell_offsets, cell_faces, face_offsets, faces, want_offsets, ids) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
cell_offsets | integer(kind=I8P) | in | Start of the faces of each cell, then their end. | |
cell_faces | integer(kind=I8P) | in | Face ids of the cells, from 0; -(n+1) reversed. | |
face_offsets | integer(kind=I8P) | in | Start of the points of each face, then their end. | |
faces | integer(kind=I8P) | in | Point ids of the faces. | |
want_offsets | logical | in | Return the end of the faces of each cell, not the stream. | |
ids | integer(kind=I8P) | out | allocatable | Face stream, or end of the faces of each cell. |
Call graph
is_hdf5_file
Return true if the file starts with the HDF5 signature (\\211HDF\\r\\n\\032\\n).
Returns: logical
fortran
function is_hdf5_file(filename) result(is_hdf5)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
filename | character(len=*) | in | File name. |
Call graph