Skip to content

vtk_fortran_vtk_file_vtkhdf_reader ​

VTK file VTKHDF reader: the reading of .vtkhdf files behind xml_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 ​

Variables ​

NameTypeAttributesDescription
BLOCKScharacter(len=*)parameterGroups of the PolyData cells.
STEP_COLUMNinteger(kind=I4P)parameterColumn of each block in the [NSteps, 4] offsets of Steps.

Derived Types ​

vtkhdf_reader ​

VTK file VTKHDF reader.

Components ​

NameTypeAttributesDescription
file_idinteger(kind=hid_kind)File.
rootinteger(kind=hid_kind)Group /VTKHDF.
mesh_topologycharacter(len=:)allocatableDataset type.
is_initializedlogicalThe reader is initialized.
n_stepsinteger(kind=I8P)Steps, 0 for a dataset that is not a time series.
stepinteger(kind=I8P)Step read.
whole_extentinteger(kind=I4P)Whole extent of a grid.
n_levelsinteger(kind=I4P)Levels of an OverlappingAMR.
levelinteger(kind=I4P)Level read (from 0).
versioninteger(kind=I8P)Version of the file (of the composite if the dataset has none).
transposedlogicalHyperTreeGrid with TransposedRootIndexing (tree ids z fastest).

Type-Bound Procedures ​

NameAttributesDescription
closepass(self)Close the file and reset the reader.
forgetpass(self)Reset the reader without closing the file (pure).
get_dataarray_infopass(self)Return the type, components and tuples of a dataarray.
get_activepass(self)Return the name of the active array of a role.
get_dataarray_namespass(self)Return the names of the dataarrays of a location.
get_infopass(self)Return the information of the dataset.
get_levelspass(self)Return the number of levels of an OverlappingAMR.
get_stepspass(self)Return the times of the steps.
initializepass(self)Initialize the reader: open the file.
read_dataarray_bytespass(self)Return the bytes, type and components of a dataarray.
read_geoRead the geometry.
read_geo_R8Ppass(self)Read the geometry (R8P).
read_geo_R4Ppass(self)Read the geometry (R4P).
read_idspass(self)Read ids of the cells (connectivity, offsets, types, faces).
read_piecepass(self)Read the counts and extent of a piece.
get_treespass(self)Return the trees of a HyperTreeGrid (of the step read).
read_treepass(self)Read a tree of a HyperTreeGrid: its descriptor and mask.
set_levelpass(self)Select the level read of an OverlappingAMR.
set_steppass(self)Select the step read.
amr_boxpass(self)A box of the level and step read of an OverlappingAMR.
is_v23pass(self)The file is VTKHDF 2.3 or later (OverlappingAMR Steps names).
amr_steps_namepass(self)The name of an OverlappingAMR Steps entry in the file.
grid_pointspass(self)Points of the grid along each axis.
prefixpass(self)Group of the point and cell data of the level read (AMR).
is_gridpass(self)The dataset is a grid (one piece).
partpass(self)The partition of a piece of the step, and where it starts.
step_valuepass(self)An entry of a dataset of Steps for the step read.
tree_layoutpass(self)Where the trees of a HyperTreeGrid (of the step read) are.
htg_partpass(self)A partition of a HyperTreeGrid of the step read: starts, counts.
tree_idpass(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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inoutReader.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inoutReader.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inoutReader.
filenamecharacter(len=*)inFile name.
datasetcharacter(len=*)inoptionalA 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
mesh_topologycharacter(len=:)outallocatable, optionalDataset type, e.g. UnstructuredGrid.
npiecesinteger(kind=I4P)outoptionalNumber of pieces (of the step read).
header_typecharacter(len=:)outallocatable, optionalHDF5.
compressorcharacter(len=:)outallocatable, optionalnone.
nx1integer(kind=I4P)outoptionalInitial node of x axis.
nx2integer(kind=I4P)outoptionalFinal node of x axis.
ny1integer(kind=I4P)outoptionalInitial node of y axis.
ny2integer(kind=I4P)outoptionalFinal node of y axis.
nz1integer(kind=I4P)outoptionalInitial node of z axis.
nz2integer(kind=I4P)outoptionalFinal node of z axis.
originreal(kind=R8P)outoptionalOrigin of ImageData.
spacingreal(kind=R8P)outoptionalSpacing of ImageData.
directionreal(kind=R8P)outoptionalAxes directions of ImageData (row-major).
ghost_levelinteger(kind=I4P)outoptional0.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
timesreal(kind=R8P)outallocatableTimes 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inoutReader.
stepinteger(kind=I4P)inStep, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
n_levelsinteger(kind=I4P)outLevels.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inoutReader.
levelinteger(kind=I4P)inLevel, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
npinteger(kind=I8P)outoptionalNumber of points.
ncinteger(kind=I8P)outoptionalNumber of cells.
nx1integer(kind=I4P)outoptionalInitial node of x axis.
nx2integer(kind=I4P)outoptionalFinal node of x axis.
ny1integer(kind=I4P)outoptionalInitial node of y axis.
ny2integer(kind=I4P)outoptionalFinal node of y axis.
nz1integer(kind=I4P)outoptionalInitial node of z axis.
nz2integer(kind=I4P)outoptionalFinal node of z axis.
nvertsinteger(kind=I8P)outoptionalNumber of vertices (PolyData).
nlinesinteger(kind=I8P)outoptionalNumber of lines (PolyData).
nstripsinteger(kind=I8P)outoptionalNumber of strips (PolyData).
npolysinteger(kind=I8P)outoptionalNumber 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
locationcharacter(len=*)inLocation: node or cell.
rolecharacter(len=*)inRole.
data_namecharacter(len=:)outallocatableName of the active array, empty if none.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
locationcharacter(len=*)inLocation: node, cell, field or row (Table).
namescharacter(len=:)outallocatableNames of the dataarrays.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
locationcharacter(len=*)inLocation: node, cell, field or row (Table).
data_namecharacter(len=*)inName of the dataarray.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1, ignored for field data).
data_typecharacter(len=:)outallocatable, optionalVTK type, e.g. Float64, Int32, UInt8.
n_componentsinteger(kind=I4P)outoptionalNumber of components.
n_tuplesinteger(kind=I8P)outoptionalNumber 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
locationcharacter(len=*)inLocation: node, cell, field or row (Table).
data_namecharacter(len=*)inName of the dataarray.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1, ignored for field data).
bytesinteger(kind=I1P)outallocatableBytes of the dataarray.
data_typecharacter(len=:)outallocatableVTK type.
n_componentsinteger(kind=I4P)outNumber 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
xreal(kind=R8P)outallocatableX coordinates.
yreal(kind=R8P)outallocatableY coordinates.
zreal(kind=R8P)outallocatableZ coordinates.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
xreal(kind=R4P)outallocatableX coordinates.
yreal(kind=R4P)outallocatableY coordinates.
zreal(kind=R4P)outallocatableZ coordinates.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inPiece, from 1.
sectioncharacter(len=*)inCells, Verts, Lines, Strips or Polys.
data_namecharacter(len=*)inconnectivity, offsets, types, faces or faceoffsets.
idsinteger(kind=I8P)outallocatableIds.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
tree_idsinteger(kind=I8P)outallocatableIds of the trees.
branch_factorinteger(kind=I4P)outoptionalBranch factor: 2 or 3.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
interface_normalscharacter(len=:)outallocatable, optionalCell array of the interface normals.
interface_interceptscharacter(len=:)outallocatable, optionalCell 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
tree_idinteger(kind=I8P)inId of the tree (its root cell).
descriptorlogicaloutallocatableRefinement of its cells.
masklogicaloutallocatable, optionalMasked cells.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
tree_idsinteger(kind=I8P)outallocatableIds of the trees.
depthsinteger(kind=I8P)outallocatableDepths of each tree.
countsinteger(kind=I8P)outallocatableCells of each depth of each tree.
first_bitinteger(kind=I8P)outFirst byte of the descriptors.
first_maskinteger(kind=I8P)outFirst 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
n_partsinteger(kind=I8P)outParts of the step.
startinteger(kind=I8P)outStarts of the partition.
countinteger(kind=I8P)outTrees, 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
file_idinteger(kind=I8P)inTree 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inoptionalBox, from 1 (default 1).
extentinteger(kind=I4P)outPoint extent of the box.
startsinteger(kind=I8P)outPoints and cells of the boxes before it.
n_boxesinteger(kind=I8P)outBoxes 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
groupcharacter(len=*)inData 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
singularcharacter(len=*)inSingular name, e.g. Level0/AMRBoxOffset.
suffixcharacter(len=*)inPlural 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
ginteger(kind=I8P)outPartition, from 1.
firstinteger(kind=I8P)outStarts of the partition.
n_partsinteger(kind=I8P)outParts 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
namecharacter(len=*)inDataset of Steps.
columninteger(kind=I4P)inColumn, from 1.
errorinteger(kind=I4P)outError 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
locationcharacter(len=*)inLocation: node, cell, field or row (Table).
data_namecharacter(len=*)inName of the dataarray.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1, ignored for field data).
pathcharacter(len=:)outallocatableDataset.
data_typecharacter(len=:)outallocatableVTK type.
firstinteger(kind=I8P)outRows skipped.
countinteger(kind=I8P)outRows read.
n_componentsinteger(kind=I4P)outComponents.
n_tuplesinteger(kind=I8P)outTuples.

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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
groupcharacter(len=*)inPointData 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
ginteger(kind=I8P)inPartition, from 1.
binteger(kind=I8P)inBlock, from 1.
counts_namecharacter(len=*)inCounts of the block.
offsets_namecharacter(len=*)inOffsets 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

NameTypeIntentAttributesDescription
rootinteger(kind=hid_kind)inGroup /VTKHDF.
namecharacter(len=*)inDataset of counts.
ginteger(kind=I8P)inPartition, from 1.
errorinteger(kind=I4P)inoutError 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
ainteger(kind=I4P)inAxis.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
bytesinteger(kind=I1P)outallocatableBytes of the coordinates.
data_typecharacter(len=:)outallocatableTheir 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

NameTypeIntentAttributesDescription
selfclass(vtkhdf_reader)inReader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
bytesinteger(kind=I1P)outallocatableBytes of the points.
data_typecharacter(len=:)outallocatableTheir 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

NameTypeIntentAttributesDescription
bytesinteger(kind=I1P)inBytes.
data_typecharacter(len=*)inVTK type.
xreal(kind=R8P)outallocatableCoordinates.

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

NameTypeIntentAttributesDescription
bytesinteger(kind=I1P)inBytes.
data_typecharacter(len=*)inVTK type.
xreal(kind=R4P)outallocatableCoordinates.

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

NameTypeIntentAttributesDescription
rootinteger(kind=hid_kind)inGroup /VTKHDF.
namecharacter(len=*)inDataset.
first_byteinteger(kind=I8P)inFirst byte.
skipinteger(kind=I8P)inBits skipped from it.
ninteger(kind=I8P)inBits read.
bitslogicaloutallocatableBits.

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

NameTypeIntentAttributesDescription
rootinteger(kind=hid_kind)inGroup /VTKHDF.
namecharacter(len=*)inDataset.
firstinteger(kind=I8P)inValues skipped.
countinteger(kind=I8P)inValues read.
idsinteger(kind=I8P)outallocatableValues.

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

NameTypeIntentAttributesDescription
locationcharacter(len=*)inLocation.

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

NameTypeIntentAttributesDescription
cell_offsetsinteger(kind=I8P)inStart of the faces of each cell, then their end.
cell_facesinteger(kind=I8P)inFace ids of the cells, from 0; -(n+1) reversed.
face_offsetsinteger(kind=I8P)inStart of the points of each face, then their end.
facesinteger(kind=I8P)inPoint ids of the faces.
want_offsetslogicalinReturn the end of the faces of each cell, not the stream.
idsinteger(kind=I8P)outallocatableFace 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

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.

Call graph