Skip to content

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) 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. BigEndian files and other compressors are not supported.

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:

ErrorMeaning
0success
1the file cannot be read
2the file is not a VTK XML file (malformed XML, no VTKFile element or dataset element)
3unsupported feature (BigEndian, compressor, parallel or unknown dataset type, encoding)
4not found (piece, data array, geometry or cells absent), or the reader is not initialized
5the output kind cannot hold the values of the data array
6the data do not decode (inconsistent sizes, malformed base64, zlib failure)
7the pieces of a parallel header do not match it (see check_pieces)

Source: src/lib/vtk_fortran_vtk_file_xml_reader.f90

Dependencies

Contents ​

Derived Types ​

xml_reader ​

VTK file XML reader.

Components ​

NameTypeAttributesDescription
filenamecharacter(len=:)allocatableFile name.
xmltype(xml_scanner)Index of the XML elements.
mesh_topologycharacter(len=:)allocatableDataset type.
word_sizeinteger(kind=I8P)Size of the binary header words: 4 (UInt32) or 8 (UInt64).
is_compressedlogicalThe binary data are zlib compressed.
is_initializedlogicalThe reader is initialized.
datasetinteger(kind=I4P)Index of the dataset element.
pieces_numberinteger(kind=I4P)Number of pieces.
is_appended_rawlogicalThe appended data are raw (base64 otherwise).
appended_startinteger(kind=I8P)Position of the first byte of the appended data, 0 if none.
is_parallellogicalThe file is a parallel header (P* dataset type).

Type-Bound Procedures ​

NameAttributesDescription
check_piecespass(self)Check the pieces of a parallel header against it.
finalizepass(self)Finalize the reader (free memory).
get_dataarray_infopass(self)Return the type, components and tuples of a dataarray.
get_dataarray_namespass(self)Return the names of the dataarrays of a location.
get_infopass(self)Return the information of the dataset.
get_sourcespass(self)Return the files of the pieces of a parallel header.
initializepass(self)Initialize the reader: index the file.
read_connectivityRead the cells.
read_dataarrayRead a dataarray.
read_geoRead the geometry.
read_piecepass(self)Read the counts and extent of a piece.
read_polydata_cellsRead polydata cells.
dataarray_bytespass(self)Return the bytes of a dataarray element.
find_dataarraypass(self)Return the index of a named dataarray element.
geometry_dataarrayspass(self)Return the indexes of the geometry dataarray elements.
piece_elementpass(self)Return the index of a piece element.
read_connectivity_I4Ppass(self)Read the cells (I4P).
read_connectivity_I8Ppass(self)Read the cells (I8P).
read_dataarray_rank1_R8Ppass(self)Read a dataarray (rank 1, R8P).
read_dataarray_rank1_R4Ppass(self)Read a dataarray (rank 1, R4P).
read_dataarray_rank1_I8Ppass(self)Read a dataarray (rank 1, I8P).
read_dataarray_rank1_I4Ppass(self)Read a dataarray (rank 1, I4P).
read_dataarray_rank1_I2Ppass(self)Read a dataarray (rank 1, I2P).
read_dataarray_rank1_I1Ppass(self)Read a dataarray (rank 1, I1P).
read_dataarray_rank2_R8Ppass(self)Read a dataarray (rank 2, R8P).
read_dataarray_rank2_R4Ppass(self)Read a dataarray (rank 2, R4P).
read_dataarray_rank2_I8Ppass(self)Read a dataarray (rank 2, I8P).
read_dataarray_rank2_I4Ppass(self)Read a dataarray (rank 2, I4P).
read_dataarray_rank2_I2Ppass(self)Read a dataarray (rank 2, I2P).
read_dataarray_rank2_I1Ppass(self)Read a dataarray (rank 2, I1P).
read_dataarray_stringspass(self)Read a dataarray of strings.
read_geo_R8Ppass(self)Read the geometry (R8P).
read_geo_R4Ppass(self)Read the geometry (R4P).
read_idspass(self)Read a dataarray of ids (I8P) of a piece section.
read_named_dataarraypass(self)Return the bytes of a named dataarray.
read_polydata_cells_I4Ppass(self)Read polydata cells (I4P).
read_polydata_cells_I8Ppass(self)Read polydata cells (I8P).

Subroutines ​

finalize ​

Finalize the reader (free memory).

Attributes: elemental

fortran
subroutine finalize(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_reader)inoutXML reader.

Call graph

b64_decode_bytes ​

Decode a base64 code into bytes.

fortran
subroutine b64_decode_bytes(code, bytes)

Arguments

NameTypeIntentAttributesDescription
codecharacter(len=*)inBase64 code.
bytesinteger(kind=I1P)inoutBytes, 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(element, mesh_topology, counts, extent, error)

Arguments

NameTypeIntentAttributesDescription
elementtype(xml_element)inPiece element.
mesh_topologycharacter(len=*)inDataset type.
countsinteger(kind=I8P)outPoints, cells, verts, lines, strips, polys.
extentinteger(kind=I4P)outExtent.
errorinteger(kind=I4P)outError status.

Call graph

Functions ​

initialize ​

Initialize the reader: index the file.

Returns: integer(kind=I4P)

fortran
function initialize(self, filename) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_reader)inoutXML reader.
filenamecharacter(len=*)inFile name.

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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
mesh_topologycharacter(len=:)outallocatable, optionalDataset type, e.g. UnstructuredGrid.
npiecesinteger(kind=I4P)outoptionalNumber of pieces.
header_typecharacter(len=:)outallocatable, optionalHeader of the binary data: UInt32 or UInt64.
compressorcharacter(len=:)outallocatable, optionalCompressor of the binary data: none or zlib.
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)outoptionalNumber 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
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_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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
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 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) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
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, String.
n_componentsinteger(kind=I4P)outoptionalNumber of components.
n_tuplesinteger(kind=I8P)outoptionalNumber of tuples.

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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xcharacter(len=:)outallocatableStrings, blank padded to the longest one.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
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 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
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_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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
connectivityinteger(kind=I8P)outallocatableConnectivity.
offsetinteger(kind=I8P)outallocatableOffsets: end of each cell in the connectivity.
cell_typeinteger(kind=I1P)outallocatable, optionalVTK cell types.
faceinteger(kind=I8P)outallocatable, optionalFaces stream of the polyhedra.
faceoffsetinteger(kind=I8P)outallocatable, optionalEnd of the faces of each cell, -1 if none.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
connectivityinteger(kind=I4P)outallocatableConnectivity.
offsetinteger(kind=I4P)outallocatableOffsets: end of each cell in the connectivity.
cell_typeinteger(kind=I1P)outallocatable, optionalVTK cell types.
faceinteger(kind=I4P)outallocatable, optionalFaces stream of the polyhedra.
faceoffsetinteger(kind=I4P)outallocatable, optionalEnd of the faces of each cell, -1 if none.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
blockcharacter(len=*)inBlock of cells: verts, lines, strips or polys.
connectivityinteger(kind=I8P)outallocatableConnectivity.
offsetinteger(kind=I8P)outallocatableOffsets: end of each cell in the connectivity.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
blockcharacter(len=*)inBlock of cells: verts, lines, strips or polys.
connectivityinteger(kind=I4P)outallocatableConnectivity.
offsetinteger(kind=I4P)outallocatableOffsets: end of each cell in the connectivity.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
sourcescharacter(len=:)outallocatableFiles of the pieces.

Call graph

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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
messagecharacter(len=:)outallocatable, optionalDescription 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
idinteger(kind=I4P)inIndex of the dataarray element.
bytesinteger(kind=I1P)outallocatableBytes of the dataarray.
data_typecharacter(len=:)outallocatableVTK type.
n_componentsinteger(kind=I4P)outNumber 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1, ignored for field data).
idinteger(kind=I4P)outIndex of the dataarray element, 0 if not found.
sectioninteger(kind=I4P)outIndex 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
idinteger(kind=I4P)outIndexes of the geometry dataarray elements.
ninteger(kind=I4P)outNumber 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
idinteger(kind=I4P)outIndex of the piece element.

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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
sectioncharacter(len=*)inName of the section element.
data_namecharacter(len=*)inName of the dataarray.
idsinteger(kind=I8P)outallocatableIds.

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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
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_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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xreal(kind=R8P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xreal(kind=R4P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I8P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I4P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I2P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I1P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xreal(kind=R8P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xreal(kind=R4P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I8P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I4P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I2P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
locationcharacter(len=*)inLocation: node, cell or field.
data_namecharacter(len=*)inName of the dataarray.
xinteger(kind=I1P)outallocatableValues.
pieceinteger(kind=I4P)inoptionalPiece, 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
idinteger(kind=I4P)inIndex of the dataarray element.
xreal(kind=R8P)outallocatableValues.
n_componentsinteger(kind=I4P)inoptionalExpected 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
idinteger(kind=I4P)inIndex of the dataarray element.
xreal(kind=R4P)outallocatableValues.
n_componentsinteger(kind=I4P)inoptionalExpected 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
posinteger(kind=I8P)inPosition of the dataarray in the file.
bytesinteger(kind=I1P)outallocatableData 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
posinteger(kind=I8P)inPosition of the dataarray in the file.
bytesinteger(kind=I1P)outallocatableData 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

NameTypeIntentAttributesDescription
selfclass(xml_reader)inXML reader.
blockcharacter(len=*)inBlock of cells: verts, lines, strips or polys.
pieceinteger(kind=I4P)inoptionalPiece, from 1 (default 1).
sectioncharacter(len=:)outallocatableName of the block element.

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

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.
posinteger(kind=I8P)inPosition 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

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.
firstinteger(kind=I8P)inFirst position.
lastinteger(kind=I8P)inLast position.
charscharacter(len=:)outallocatableCharacters 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

NameTypeIntentAttributesDescription
filenamecharacter(len=*)inFile name.
posinteger(kind=I8P)inFirst position.
ninteger(kind=I8P)inNumber of bytes.
bytesinteger(kind=I1P)outallocatableBytes 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

NameTypeIntentAttributesDescription
idsinteger(kind=I8P)inIds.
xinteger(kind=I4P)outallocatableIds, I4P.

Call graph

is_dataarray ​

Return .true. if an element name is a data array: DataArray, Array (field data strings) or PDataArray (parallel).

Attributes: elemental

Returns: logical

fortran
function is_dataarray(name) result(is_array)

Arguments

NameTypeIntentAttributesDescription
namecharacter(len=*)inElement 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

NameTypeIntentAttributesDescription
stringcharacter(len=*)inInput string.

Call graph