Appearance
vtk_fortran_vtm_file
VTM file class: a multi-block dataset, a
.vtm(XML) whose blocks list VTK files, or one VTKHDF file (initialize(..., format='vtkhdf'), aMultiBlockDataSet) into which the.vtkhdffiles of the blocks are copied.
In the VTKHDF format the same write_block calls build the file: each dataset file (a .vtkhdf written by vtk_file) is copied as the group Block_<n> of /VTKHDF, and the tree of the blocks is the group Assembly, whose groups are the blocks and whose soft links, named after the datasets (names, or the file names without directory and extension), point to the copies.
Time series: a file is either static or a time series, decided by its first block. The blocks of a time series must all have the same steps (NSteps, and the times of Steps/Values compared exactly), as the VTKHDF specification requires. ParaView 6.1.1 plays every step of every block (it reads no RectilinearGrid nor StructuredGrid VTKHDF file); VTK 9.7.2 reads every step with vtkHDFReader%SetStep before its first update, but its pipeline time (UpdateTimeStep) leaves an UnstructuredGrid or PolyData block at the first step and a grid block without arrays (its own files too). Refused: a time-series Table block (VTK 9.7.2 reads it without rows), a static block in a time series or the reverse (VTK fails on the mix, VTK issue 19963), a series with other steps; a composite source (a MultiBlockDataSet or a PartitionedDataSetCollection: the blocks of a composite are not composite, VTKHDF specification; its absolute Assembly links would point at this file's blocks, and VTK 9.7.2 crashes on it) and an OverlappingAMR (a composite in VTK: VTK 9.7.2 reads the multi-block without that block). A refused file leaves the block that write_block opened for it open (as a missing file does). The names of the blocks and of the datasets (names, or the file names without directory and extension) cannot be empty nor contain / or . (VTKHDF names): such a name is refused, never renamed.
With initialize(..., format='vtkhdf', composite='PartitionedDataSetCollection') the file is a VTKHDF PartitionedDataSetCollection (VTK's composite of choice) instead: each dataset is copied once as the group of its name (/VTKHDF/<name>, the name VTK gives it), with the attribute Index (0, 1, ... in the order written); the blocks are the nodes of Assembly, as for a multi-block file, and a dataset already copied can be placed in other blocks without a new copy (write_block(references='name ...'), soft links to the copy). A dataset name is then unique in the file (a second dataset of the same name is refused: reference the first one) and cannot be Assembly. The time series rules are those of the multi-block file. A multi-block file places a dataset in other blocks the same way (references, the name of one dataset written before; a name given to several datasets cannot be referenced): VTK reads it in each.
Source: src/lib/vtk_fortran_vtm_file.F90
Dependencies
Contents
- vtm_file
- free_entries
- add_partitions
- add_entry
- initialize
- finalize
- get_entries
- write_block_array
- write_block_string
- parse_scratch_files
- write_block_scratch
- vtkhdf_open_block
- vtkhdf_entries
- vtkhdf_unlinked_entries
- vtkhdf_add_entries
- xml_part_open_block
- xml_part_close_block
- xml_part_dataset
- xml_part_reference
- xml_part_finalize
- xml_part_entries
- index_of
- count_nul
- is_xml_name
- strip
- has_type
- vtkhdf_close_block
- vtkhdf_dataset
- vtkhdf_reference
- write_level
- xml_amr_finalize
- xml_amr_entries
Derived Types
vtm_file
VTM file class.
Components
| Name | Type | Attributes | Description |
|---|---|---|---|
xml_writer | class(xml_writer_abstract) | allocatable | XML writer. |
scratch_unit | integer(kind=I4P) | allocatable | Scratch units for very large list of named blocks. |
xml | type(xml_index) | Index of the file read (action='read', FoXy). | |
is_reading | logical | The file is open for reading. | |
is_vtkhdf | logical | The file is a VTKHDF one. | |
file_id | integer(kind=hid_kind) | VTKHDF file. | |
root | integer(kind=hid_kind) | Its group /VTKHDF. | |
node | character(len=:) | allocatable | Path of the open block in the Assembly. |
children | integer(kind=I4P) | allocatable | Children written in each open level. |
n_leaves | integer(kind=I4P) | Datasets copied. | |
leaf_links | character(len=:) | allocatable | Each dataset linked: its name, NUL, its group |
version_minor | integer(kind=I8P) | Minor version (the highest of the blocks). | |
n_steps | integer(kind=I8P) | Steps of the blocks: -1 none yet, 0 static. | |
times | real(kind=R8P) | allocatable | Times of the steps of a time series. |
is_collection | logical | A PartitionedDataSetCollection. | |
is_reading_vtkhdf | logical | A VTKHDF composite is read. | |
entry_level | integer(kind=I4P) | allocatable | Nesting level of the entries, from 1. |
entry_is_block | logical | allocatable | The entry is a block (else a dataset). |
entry_index | integer(kind=I4P) | allocatable | Index of the entries among their siblings. |
entry_text | integer(kind=I4P) | allocatable | Start and length in entry_chars of the |
entry_chars | character(len=:) | allocatable | Names, files and paths of the entries. |
entry_is_piece | logical | allocatable | The entry is a piece (XML .vtpc partitions). |
is_xml_collection | logical | An XML .vtpc is written. | |
is_xml_pds | logical | An XML .vtpd is written. | |
xml_names | character(len=:) | allocatable | Names of the datasets written. |
xml_files | character(len=:) | allocatable | Files of the datasets written. |
xml_assembly | character(len=:) | allocatable | Body of the DataAssembly. |
xml_open | character(len=:) | allocatable | Open nodes of the assembly. |
xml_ids | integer(kind=I4P) | Assembly node ids given (the root is 0). | |
is_xml_amr | logical | An XML .vthb is written. | |
amr_filename | character(len=:) | allocatable | Its file name. |
amr_origin | real(kind=R8P) | Origin (of every box). | |
amr_desc | character(len=:) | allocatable | Grid description: XYZ, XY, ... |
amr_levels | integer(kind=I4P) | Levels written. | |
amr_spacing | real(kind=R8P) | allocatable | Spacing of each level (3, levels). |
amr_boxes | integer(kind=I4P) | allocatable | Level and cells (lo hi per axis) of each box. |
amr_files | character(len=:) | allocatable | File of each box, followed by NUL. |
Type-Bound Procedures
| Name | Attributes | Description |
|---|---|---|
initialize | pass(self) | Initialize file. |
finalize | pass(self) | Finalize file. |
get_entries | pass(self) | Return the blocks and datasets of a file read. |
write_level | pass(self) | Write a level of an OverlappingAMR (.vthb). |
write_block | Write one block dataset. | |
write_block_array | pass(self) | Write one block dataset (array input). |
write_block_string | pass(self) | Write one block dataset (string input). |
parse_scratch_files | pass(self) | Parse scratch files. |
write_block_scratch | pass(self) | Write one block dataset on scratch files. |
vtkhdf_close_block | pass(self) | Close the open block of a VTKHDF file. |
vtkhdf_entries | pass(self) | Gather the entries of a VTKHDF composite read. |
free_entries | pass(self) | Free the entries of a VTKHDF composite read. |
vtkhdf_add_entries | pass(self) | Gather the entries of a block of its Assembly. |
vtkhdf_unlinked_entries | pass(self) | The datasets of a collection the Assembly misses. |
vtkhdf_dataset | pass(self) | Copy a dataset file into a VTKHDF file. |
vtkhdf_open_block | pass(self) | Open a block of a VTKHDF file. |
vtkhdf_reference | pass(self) | Place a dataset already copied in the open block. |
xml_part_open_block | pass(self) | Open a node of the assembly of a .vtpc. |
xml_part_close_block | pass(self) | Close the open node of the assembly. |
xml_part_dataset | pass(self) | A dataset of a .vtpc (a Partitions) or .vtpd (a DataSet). |
xml_part_reference | pass(self) | Place a dataset already written in the open node. |
xml_part_finalize | pass(self) | Write the Partitions/DataSets and the DataAssembly. |
xml_part_entries | pass(self) | Gather the entries of a .vtpc or .vtpd read. |
add_entry | pass(self) | Append an entry to the entries read. |
add_partitions | pass(self) | Append the entries of a Partitions element. |
xml_amr_finalize | pass(self) | Write the levels and boxes of a .vthb. |
xml_amr_entries | pass(self) | Gather the entries of a .vthb read. |
Subroutines
free_entries
Free the entries of a VTKHDF composite read.
Attributes: pure
fortran
subroutine free_entries(self)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
add_partitions
Append the entries of a Partitions element: a dataset with the file of its only DataSet, or without file and its DataSets as pieces.
fortran
subroutine add_partitions(self, part, level, sibling)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
part | integer(kind=I4P) | in | The Partitions element. | |
level | integer(kind=I4P) | in | Its level. | |
sibling | integer(kind=I4P) | in | Its index among its siblings. |
Call graph
add_entry
Append an entry to the entries read (no path).
fortran
subroutine add_entry(self, level, is_block, is_piece, sibling, name, file)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
level | integer(kind=I4P) | in | Nesting level. | |
is_block | logical | in | A block. | |
is_piece | logical | in | A piece. | |
sibling | integer(kind=I4P) | in | Index among its siblings. | |
name | character(len=*) | in | Name. | |
file | character(len=*) | in | File. |
Call graph
Functions
initialize
Initialize file: open it for writing (default) or for reading.
With format='vtkhdf' (case insensitive) the file is a VTKHDF MultiBlockDataSet (the library built with HDF5), built by the same write_block calls from .vtkhdf files, which are copied into it; scratch units are not used. Its blocks are all static or all time series of UnstructuredGrid and PolyData with the same steps (module header). composite='PartitionedDataSetCollection' (case insensitive; MultiBlockDataSet by default) writes a collection instead, whose datasets can be referenced from several blocks (module header): VTKHDF, or an XML .vtpc (its Partitions and DataAssembly); composite='PartitionedDataSet' an XML .vtpd (a flat list of DataSets).
With action='read' (case insensitive) the file is indexed: its blocks and datasets are returned by get_entries, and each dataset file can then be read with vtk_file (or pvtk_file); finalize frees the index. The error is 1 if the file cannot be read, 2 if it is not a multi-block file (vtkMultiBlockDataSet) nor a partitioned one (.vtpc, .vtpd). A VTKHDF MultiBlockDataSet or PartitionedDataSetCollection is read too: its blocks are the groups of its Assembly, its datasets the links in them, the file of each the dataset path for vtk_file%initialize(filename, action='read', dataset=file).
Returns: integer(kind=I4P)
fortran
function initialize(self, filename, scratch_units_number, action, format, composite) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
filename | character(len=*) | in | File name of output VTM file. | |
scratch_units_number | integer(kind=I4P) | in | optional | Number of scratch units for very large list of named blocks. |
action | character(len=*) | in | optional | Action: write (default) or read. |
format | character(len=*) | in | optional | Format: xml (default) or vtkhdf. |
composite | character(len=*) | in | optional | PartitionedDataSetCollection. |
Call graph
finalize
Finalize file (writer).
Returns: integer(kind=I4P)
fortran
function finalize(self) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
get_entries
Return the blocks and datasets of a file read (initialize(..., action='read')), in the order of the file.
The hierarchy is flattened depth first: each entry has its nesting level (1 for the children of the root), its kind (block, dataset, or piece for a vtkMultiPieceDataSet, written by VTK or by write_block(..., action='pieces'), whose DataSets follow at the next level), its index among the children of its parent (-1 if the file has none), its name and, for datasets, its file (empty for blocks and pieces, or for datasets without file). The children of an entry are the following entries of the next level. The names and files are blank padded to the longest one; relative files are relative to the directory of the .vtm file. A VTKHDF composite: the groups (blocks) and links (datasets, file the dataset under /VTKHDF) of its Assembly, then, for a collection, its datasets (Index) that no link reaches, at level 1 in the order of their Index.
fortran
type(vtm_file) :: vtm
integer(I4P), allocatable :: level(:)
character(len=:), allocatable :: kind(:), file(:)
error = vtm%initialize(filename='assembly.vtm', action='read')
error = vtm%get_entries(level=level, kind=kind, file=file)
error = vtm%finalize()Returns: integer(kind=I4P)
fortran
function get_entries(self, level, kind, index, name, file) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | in | VTM file. | |
level | integer(kind=I4P) | out | allocatable, optional | Nesting level of the entries, from 1. |
kind | character(len=:) | out | allocatable, optional | Kind of the entries: block, dataset or piece. |
index | integer(kind=I4P) | out | allocatable, optional | Index of the entries among their siblings. |
name | character(len=:) | out | allocatable, optional | Name of the entries. |
file | character(len=:) | out | allocatable, optional | File of the datasets. |
write_block_array
Write one block dataset (array input).
By default the files are wrapped in a new block; with action='write' they are written as datasets of the current (open) block, without a new block; with action='pieces' (an XML .vtm) they are wrapped in a Piece, a vtkMultiPieceDataSet whose pieces they are (as VTK writes the partitions of a dataset in a .vtm).
Example of usage: 3 files blocks
fortran
error = vtm%write_block(filenames=['file_1.vts', 'file_2.vts', 'file_3.vtu'], name='my_block')Example of usage: 3 files blocks with custom name
fortran
error = vtm%write_block(filenames=['file_1.vts', 'file_2.vts', 'file_3.vtu'], &
names=['block-bar', 'block-foo', 'block-baz'], name='my_block')Example of usage: nested blocks
fortran
error = vtm%write_block(action='open', name='assembly')
error = vtm%write_block(filenames=['part_1.vtu', 'part_2.vtu'], action='write') ! datasets 0, 1 of assembly
error = vtm%write_block(filenames=['bolt_1.vtu', 'bolt_2.vtu'], name='bolts') ! block 2 of assembly
error = vtm%write_block(action='close')Returns: integer(kind=I4P)
fortran
function write_block_array(self, filenames, names, name, action) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
filenames | character(len=*) | in | File names of VTK files grouped into current block. | |
names | character(len=*) | in | optional | Auxiliary names attributed to each files. |
name | character(len=*) | in | optional | Block name |
action | character(len=*) | in | optional | Action: 'write' (datasets of the current block) or default. |
Call graph
write_block_string
Write one block dataset (string input).
With action the block is written in steps, so blocks can be nested: 'open' opens a (child) block, 'write' writes the files as datasets of the current block, 'close' closes it. The children of a block (blocks and datasets) are indexed from 0 in the order they are written. 'pieces' (an XML .vtm only) wraps the files in a Piece, a vtkMultiPieceDataSet whose pieces they are.
Example of usage: 3 files blocks
fortran
error = vtm%write_block(filenames='file_1.vts file_2.vts file_3.vtu', name='my_block')Example of usage: 3 files blocks with custom name
fortran
error = vtm%write_block(filenames='file_1.vts file_2.vts file_3.vtu', names='block-bar block-foo block-baz', name='my_block')In a VTKHDF file (PartitionedDataSetCollection or multi-block) or a .vtpc, references (blank separated) places datasets already written (by their names) in the block too, without a new copy: soft links to their copies (VTKHDF), after the datasets of filenames.
Example of usage: a dataset in two blocks of a collection
fortran
error = vtm%initialize(filename='plant.vtkhdf', format='vtkhdf', composite='PartitionedDataSetCollection')
error = vtm%write_block(filenames='pump.vtkhdf pipe.vtkhdf', name='hydraulics')
error = vtm%write_block(references='pump', name='rotating')Returns: integer(kind=I4P)
fortran
function write_block_string(self, action, filenames, names, name, references) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
action | character(len=*) | in | optional | Action: [open, close, write, pieces]. |
filenames | character(len=*) | in | optional | File names of VTK files grouped into current block. |
names | character(len=*) | in | optional | Auxiliary names attributed to each files. |
name | character(len=*) | in | optional | Block name |
references | character(len=*) | in | optional | Datasets already written, placed in the block. |
Call graph
parse_scratch_files
Parse scratch files.
Returns: integer(kind=I4P)
fortran
function parse_scratch_files(self) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
write_block_scratch
Write one block dataset on scratch files.
Returns: integer(kind=I4P)
fortran
function write_block_scratch(self, scratch, action, filename, name) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
scratch | integer(kind=I4P) | in | Scratch unit. | |
action | character(len=*) | in | Action: [open, write]. | |
filename | character(len=*) | in | optional | File name of VTK file grouped into current block. |
name | character(len=*) | in | optional | Block name |
vtkhdf_open_block
Open a block of a VTKHDF file: a group of the open block of the Assembly, named name or block_<index>.
Returns: integer(kind=I4P)
fortran
function vtkhdf_open_block(self, name) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
name | character(len=*) | in | optional | Block name. |
Call graph
vtkhdf_entries
Open a VTKHDF composite file (action read) and gather its entries from its Assembly: the groups are blocks, the soft links datasets (their file the dataset under /VTKHDF they point to, the dataset of vtk_file%initialize(..., action='read', dataset=)), in creation order, depth first: the members of a block are inserted right after it, and the list is walked forward. The file is closed after. Error 1 if it cannot be read, 2 if it is not a VTKHDF MultiBlockDataSet or PartitionedDataSetCollection.
Returns: integer(kind=I4P)
fortran
function vtkhdf_entries(self, filename) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
filename | character(len=*) | in | File name. |
Call graph
vtkhdf_unlinked_entries
Append, at the top level and in the order of their Index, the datasets of a collection (the groups of /VTKHDF with an Index attribute, the dataset list of the VTKHDF specification) that no soft link of its Assembly reaches (vtkHDFWriter writes such files: VTK reads every dataset of the list).
Returns: integer(kind=I4P)
fortran
function vtkhdf_unlinked_entries(self, file_id, root) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
file_id | integer(kind=hid_kind) | in | File. | |
root | integer(kind=hid_kind) | in | Group /VTKHDF. |
Call graph
vtkhdf_add_entries
Insert the members of the block path of the Assembly (nesting level level) after the entry after (0: first).
Returns: integer(kind=I4P)
fortran
function vtkhdf_add_entries(self, root, path, level, after) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
root | integer(kind=hid_kind) | in | Group /VTKHDF. | |
path | character(len=*) | in | Block, from /VTKHDF. | |
level | integer(kind=I4P) | in | Nesting level of its members. | |
after | integer(kind=I4P) | in | Entry after which they go. |
Call graph
xml_part_open_block
Open a node of the assembly of an XML collection (.vtpc): an element named name (block_<n> by default), as VTK names the nodes of a vtkDataAssembly. Refused in a .vtpd (no blocks) and for a name that is not an XML element name.
Returns: integer(kind=I4P)
fortran
function xml_part_open_block(self, name) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
name | character(len=*) | in | optional | Block name. |
Call graph
xml_part_close_block
Close the open node of the assembly of an XML collection.
Returns: integer(kind=I4P)
fortran
function xml_part_close_block(self) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
xml_part_dataset
A dataset of an XML collection (a Partitions of one DataSet, named name or after the file, placed in the open node of the assembly) or of a .vtpd (a DataSet). An empty file name is an empty dataset (no file). A name is used once in a collection (place a dataset in other blocks with references).
Returns: integer(kind=I4P)
fortran
function xml_part_dataset(self, filename, name) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
filename | character(len=*) | in | File of the dataset. | |
name | character(len=*) | in | optional | Dataset name. |
Call graph
xml_part_reference
Place a dataset already written into the open node of the assembly of an XML collection: a dataset element with its index, no new Partitions.
Returns: integer(kind=I4P)
fortran
function xml_part_reference(self, label) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
label | character(len=*) | in | Name of the dataset. |
Call graph
xml_part_finalize
Write the datasets of an XML collection (Partitions index name, a DataSet index file each) and its assembly (DataAssembly encoding="base64": the vtkDataAssembly XML, as VTK writes it), or the DataSets of a .vtpd.
Returns: integer(kind=I4P)
fortran
function xml_part_finalize(self) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
xml_part_entries
Gather the entries of an XML PartitionedDataSet (its DataSets, datasets at level 1) or PartitionedDataSetCollection (the nodes of its DataAssembly, depth first: elements are blocks, dataset elements its Partitions of that index, then the Partitions the assembly does not reach, at level 1). A Partitions of one DataSet is a dataset with its file; of several, a dataset without file followed by its DataSets as pieces.
Returns: integer(kind=I4P)
fortran
function xml_part_entries(self, root, file_type) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
root | integer(kind=I4P) | in | Index of the VTKFile element. | |
file_type | character(len=*) | in | vtkPartitionedDataSet or vtkPartitionedDataSetCollection. |
Call graph
index_of
An integer attribute value, default if it is not one.
Attributes: pure
Returns: integer(kind=I4P)
fortran
function index_of(text, default) result(n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in | Attribute value. | |
default | integer(kind=I4P) | in | Default. |
Call graph
count_nul
The NUL characters of a text: the names of a NUL-ended list.
Attributes: pure
Returns: integer(kind=I4P)
fortran
function count_nul(text) result(n)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in | Text. |
Call graph
is_xml_name
True if name is an XML element name (ASCII: a letter or _, then letters, digits, _, -, .), as the nodes of a vtkDataAssembly are; xml is reserved, and dataset (the dataset nodes of the assembly).
Attributes: pure
Returns: logical
fortran
function is_xml_name(name) result(is_name)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
name | character(len=*) | in | Name. |
Call graph
strip
A text without its white space (blanks, tabs, line ends).
Attributes: pure
Returns: character(len=:)
fortran
function strip(text) result(stripped)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
text | character(len=*) | in | Text. |
Call graph
has_type
Return true if the dataset group dataset of /VTKHDF has a Type attribute (false for an empty dataset).
Returns: logical
fortran
function has_type(root, dataset) result(has)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
root | integer(kind=hid_kind) | in | Group /VTKHDF. | |
dataset | character(len=*) | in | Dataset group, from /VTKHDF. |
Call graph
vtkhdf_close_block
Close the open block of a VTKHDF file.
Returns: integer(kind=I4P)
fortran
function vtkhdf_close_block(self) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
vtkhdf_dataset
Copy the dataset of a .vtkhdf file into the VTKHDF file, as Block_<n> (as <name> with the attribute Index in a collection), and link it in the open block, named name or after the file (without directory and extension). The time series rules are checked on the file before the copy: the first block decides whether the file is static or a time series; a series block has the steps of the first one (their number and times, compared exactly), and is not a Table (VTK 9.7.2 reads a Table-series block without rows). An empty filename is an empty dataset (VTK's null block) of a multi-block file: a group Block_<n> without attributes, linked as name (or Block_<n>); it does not take part in the time series rules. It is refused in a collection (VTK 9.7.2 then reads none of its datasets).
Returns: integer(kind=I4P)
fortran
function vtkhdf_dataset(self, filename, name) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
filename | character(len=*) | in | File of the dataset. | |
name | character(len=*) | in | optional | Dataset name. |
Call graph
vtkhdf_reference
Place a dataset already copied in the open block: a soft link to the copy, named label, no new copy. In a collection the copy /VTKHDF/<label> (with its Index); in a multi-block the copy (Block_<n>) of the one dataset written before under that name (a name given to several datasets is refused: ambiguous).
Returns: integer(kind=I4P)
fortran
function vtkhdf_reference(self, label) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
label | character(len=*) | in | Name of the dataset. |
Call graph
write_level
Write the level level (0, 1, ... in order, each once) of an OverlappingAMR (initialize(..., composite='OverlappingAMR'), a .vthb): its boxes, each an ImageData file (.vti) written before with the origin of the AMR, the spacing of the level and its extent in the point indices of the level (nx1...nz2). The files are read: the origin (the same for every box), the spacing (the same in a level, the level's) and the extent (the amr_box, in cells: lo, hi of each axis; a flat axis 0 -1) are taken from them, so the .vthb agrees with its data. A relative file is relative to the directory of the .vthb, and written as given.
fortran
error = amr%initialize(filename='amr.vthb', composite='OverlappingAMR')
error = amr%write_level(level=0, filenames=['amr/amr_0.vti'])
error = amr%write_level(level=1, filenames=['amr/amr_1.vti', 'amr/amr_2.vti'])
error = amr%finalize()Returns: integer(kind=I4P)
fortran
function write_level(self, level, filenames) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
level | integer(kind=I4P) | in | Level, from 0. | |
filenames | character(len=*) | in | Files of its boxes. |
Call graph
xml_amr_finalize
Write the .vthb of an OverlappingAMR: a Block level spacing for each level, a DataSet index amr_box file for each of its boxes, as vtkXMLUniformGridAMRWriter writes them (version 1.1).
Returns: integer(kind=I4P)
fortran
function xml_amr_finalize(self) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. |
Call graph
xml_amr_entries
Gather the entries of an XML OverlappingAMR read (vtkOverlappingAMR, .vthb; or vtkHierarchicalBoxDataSet, a former .vth): its Blocks (the levels) are blocks at level 1 (index the level), their DataSets (the boxes) datasets at level 2 with their files (index the index, or dataset of a former file).
Returns: integer(kind=I4P)
fortran
function xml_amr_entries(self, root, file_type) result(error)Arguments
| Name | Type | Intent | Attributes | Description |
|---|---|---|---|---|
self | class(vtm_file) | inout | VTM file. | |
root | integer(kind=I4P) | in | Index of the VTKFile element. | |
file_type | character(len=*) | in | vtkOverlappingAMR or vtkHierarchicalBoxDataSet. |
Call graph