Skip to content

API Reference ​

Auto-generated from Fortran source doc comments using FORMAL.

src/lib ​

Key type-bound procedures ​

vtk_file / pvtk_file ​

ProcedureDescription
%initialize(format, filename, mesh_topology, ...)Open the file, select the writer (format='vtkhdf': an HDF5 file, every topology), write the header; for ImageData/PImageData also origin, spacing (required) and direction; header_type='UInt64' for binary arrays larger than 2 GiB; compressor='zlib' to compress binary data; is_volatile=.true. to write into memory (vtk_file only)
%initialize(filename, mesh_topology, mesh_kind, ..., ghost_level)pvtk_file: no format (a header is ASCII); mesh_kind ('Float64' or 'Float32') the type of the coordinates of the pieces, required but for PImageData; ghost_level the number of layers of ghost cells of the pieces (default 0)
%initialize(filename=..., action='read')Open a file for reading through %xml_reader: a serial file (vtk_file) or a parallel header (pvtk_file), see below
%initialize(format='vtkhdf', filename=..., action='append')Reopen a VTKHDF time series to append steps (restart): the rest comes from the file
%finalize()Flush and close the file (or free the reader)
%get_xml_volatile(xml_volatile), %free()Return the file written with is_volatile=.true. as a string, then free its memory (vtk_file only)
%xml_writer%write_fielddata(...)Write global FieldData: scalars, rank-1 arrays (all kinds), strings and arrays of strings
%xml_writer%write_piece(...)Open or close a Piece element (extents, np/nc, or np/nverts/nlines/nstrips/npolys for PolyData; counts I4P or I8P)
%xml_writer%write_geo(...)Write geometry (coordinates; unstructured np/nc counts I4P or I8P)
%xml_writer%write_connectivity(...)Write unstructured connectivity, offsets, and cell types (ids I4P or I8P)
%xml_writer%write_polydata_cells(...)Write the cell blocks of PolyData: vertices, lines, triangle strips, polygons (ids I4P or I8P)
%xml_writer%write_step(time)Start a time step of a VTKHDF time series (format='vtkhdf'); an error in the XML formats, whose series are .pvd collections
%xml_writer%write_dataarray(location, action, scalars, vectors, normals, tensors, tcoords)Open (action='open') or close the point (location='node') or cell ('cell') data; designate the active arrays
%xml_writer%write_dataarray(data_name, x, one_component), (data_name, x, y, z), (data_name, u, v, w, x, y, z)Write a data array: all kinds, ranks 1 to 4, components from the shape, see Writing arrays
%xml_writer%write_dataarray_unsigned(data_name, x)Write a rank-1 integer array as unsigned (I1P…I8P as UInt8…UInt64)
%xml_writer%write_parallel_geo(...)Write a <P*> geometry piece reference (pvtk_file only)
%xml_writer%write_parallel_dataarray(...)Write a parallel data array descriptor (pvtk_file only)

vtk_file / pvtk_file reading (%xml_reader) ​

initialize(filename=..., action='read'), then get_info, read_piece, read_geo, read_connectivity, read_polydata_cells, get_dataarray_names, get_dataarray_info, read_dataarray, and for a parallel header get_sources and check_pieces; for a VTKHDF time series get_steps(times) and set_step(step) (see VTKHDF files): every procedure with its arguments and what it returns is in the table of Reading files, the error codes below it.

vtm_file ​

ProcedureDescription
%initialize(filename, scratch_units_number)Create the .vtm wrapper file; scratch_units_number blocks to fill in any order
%initialize(filename, action='read')Open a .vtm file for reading
%initialize(filename, format='vtkhdf')Create a VTKHDF multi-block file: the same write_block calls copy the .vtkhdf datasets into it
%get_entries(level, kind, index, name, file)Blocks and datasets of a file read, flattened depth first
%write_block(filenames, names, name, action)Add a named block of files; action='open'/'close' to nest blocks, 'write' to add datasets to the current block (filenames and names as arrays or blank-separated strings)
%write_block(scratch, action, filename, name)Open (action='open', name) the block of a scratch unit, or add a file to it (action='write', filename); the blocks are written by finalize, see Blocks filled in any order
%finalize()Close the .vtm file

pvd_file ​

ProcedureDescription
%initialize(filename, action)Create the .pvd collection (action='new', default), reopen it to add steps (action='append') or read it (action='read')
%get_datasets(timestep, part, group, name, file)Datasets of a collection read
%write_dataset(filename, timestep, part, group, name)Add a dataset (file) with its time step; the collection is valid after each call
%finalize()Close the .pvd file

write_xml_volatile ​

A module-level function (not a type-bound procedure), write_xml_volatile(xml_volatile, filename): it writes to disk a file held in memory, as returned by get_xml_volatile. Useful for parallel workflows where only one process accesses the file system, see Volatile XML output.