Skip to content

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'), a MultiBlockDataSet) into which the .vtkhdf files 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 ​

Derived Types ​

vtm_file ​

VTM file class.

Components ​

NameTypeAttributesDescription
xml_writerclass(xml_writer_abstract)allocatableXML writer.
scratch_unitinteger(kind=I4P)allocatableScratch units for very large list of named blocks.
xmltype(xml_index)Index of the file read (action='read', FoXy).
is_readinglogicalThe file is open for reading.
is_vtkhdflogicalThe file is a VTKHDF one.
file_idinteger(kind=hid_kind)VTKHDF file.
rootinteger(kind=hid_kind)Its group /VTKHDF.
nodecharacter(len=:)allocatablePath of the open block in the Assembly.
childreninteger(kind=I4P)allocatableChildren written in each open level.
n_leavesinteger(kind=I4P)Datasets copied.
leaf_linkscharacter(len=:)allocatableEach dataset linked: its name, NUL, its group
version_minorinteger(kind=I8P)Minor version (the highest of the blocks).
n_stepsinteger(kind=I8P)Steps of the blocks: -1 none yet, 0 static.
timesreal(kind=R8P)allocatableTimes of the steps of a time series.
is_collectionlogicalA PartitionedDataSetCollection.
is_reading_vtkhdflogicalA VTKHDF composite is read.
entry_levelinteger(kind=I4P)allocatableNesting level of the entries, from 1.
entry_is_blocklogicalallocatableThe entry is a block (else a dataset).
entry_indexinteger(kind=I4P)allocatableIndex of the entries among their siblings.
entry_textinteger(kind=I4P)allocatableStart and length in entry_chars of the
entry_charscharacter(len=:)allocatableNames, files and paths of the entries.
entry_is_piecelogicalallocatableThe entry is a piece (XML .vtpc partitions).
is_xml_collectionlogicalAn XML .vtpc is written.
is_xml_pdslogicalAn XML .vtpd is written.
xml_namescharacter(len=:)allocatableNames of the datasets written.
xml_filescharacter(len=:)allocatableFiles of the datasets written.
xml_assemblycharacter(len=:)allocatableBody of the DataAssembly.
xml_opencharacter(len=:)allocatableOpen nodes of the assembly.
xml_idsinteger(kind=I4P)Assembly node ids given (the root is 0).
is_xml_amrlogicalAn XML .vthb is written.
amr_filenamecharacter(len=:)allocatableIts file name.
amr_originreal(kind=R8P)Origin (of every box).
amr_desccharacter(len=:)allocatableGrid description: XYZ, XY, ...
amr_levelsinteger(kind=I4P)Levels written.
amr_spacingreal(kind=R8P)allocatableSpacing of each level (3, levels).
amr_boxesinteger(kind=I4P)allocatableLevel and cells (lo hi per axis) of each box.
amr_filescharacter(len=:)allocatableFile of each box, followed by NUL.

Type-Bound Procedures ​

NameAttributesDescription
initializepass(self)Initialize file.
finalizepass(self)Finalize file.
get_entriespass(self)Return the blocks and datasets of a file read.
write_levelpass(self)Write a level of an OverlappingAMR (.vthb).
write_blockWrite one block dataset.
write_block_arraypass(self)Write one block dataset (array input).
write_block_stringpass(self)Write one block dataset (string input).
parse_scratch_filespass(self)Parse scratch files.
write_block_scratchpass(self)Write one block dataset on scratch files.
vtkhdf_close_blockpass(self)Close the open block of a VTKHDF file.
vtkhdf_entriespass(self)Gather the entries of a VTKHDF composite read.
free_entriespass(self)Free the entries of a VTKHDF composite read.
vtkhdf_add_entriespass(self)Gather the entries of a block of its Assembly.
vtkhdf_unlinked_entriespass(self)The datasets of a collection the Assembly misses.
vtkhdf_datasetpass(self)Copy a dataset file into a VTKHDF file.
vtkhdf_open_blockpass(self)Open a block of a VTKHDF file.
vtkhdf_referencepass(self)Place a dataset already copied in the open block.
xml_part_open_blockpass(self)Open a node of the assembly of a .vtpc.
xml_part_close_blockpass(self)Close the open node of the assembly.
xml_part_datasetpass(self)A dataset of a .vtpc (a Partitions) or .vtpd (a DataSet).
xml_part_referencepass(self)Place a dataset already written in the open node.
xml_part_finalizepass(self)Write the Partitions/DataSets and the DataAssembly.
xml_part_entriespass(self)Gather the entries of a .vtpc or .vtpd read.
add_entrypass(self)Append an entry to the entries read.
add_partitionspass(self)Append the entries of a Partitions element.
xml_amr_finalizepass(self)Write the levels and boxes of a .vthb.
xml_amr_entriespass(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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
partinteger(kind=I4P)inThe Partitions element.
levelinteger(kind=I4P)inIts level.
siblinginteger(kind=I4P)inIts 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
levelinteger(kind=I4P)inNesting level.
is_blocklogicalinA block.
is_piecelogicalinA piece.
siblinginteger(kind=I4P)inIndex among its siblings.
namecharacter(len=*)inName.
filecharacter(len=*)inFile.

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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
filenamecharacter(len=*)inFile name of output VTM file.
scratch_units_numberinteger(kind=I4P)inoptionalNumber of scratch units for very large list of named blocks.
actioncharacter(len=*)inoptionalAction: write (default) or read.
formatcharacter(len=*)inoptionalFormat: xml (default) or vtkhdf.
compositecharacter(len=*)inoptionalPartitionedDataSetCollection.

Call graph

finalize ​

Finalize file (writer).

Returns: integer(kind=I4P)

fortran
function finalize(self) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inVTM file.
levelinteger(kind=I4P)outallocatable, optionalNesting level of the entries, from 1.
kindcharacter(len=:)outallocatable, optionalKind of the entries: block, dataset or piece.
indexinteger(kind=I4P)outallocatable, optionalIndex of the entries among their siblings.
namecharacter(len=:)outallocatable, optionalName of the entries.
filecharacter(len=:)outallocatable, optionalFile 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
filenamescharacter(len=*)inFile names of VTK files grouped into current block.
namescharacter(len=*)inoptionalAuxiliary names attributed to each files.
namecharacter(len=*)inoptionalBlock name
actioncharacter(len=*)inoptionalAction: '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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
actioncharacter(len=*)inoptionalAction: [open, close, write, pieces].
filenamescharacter(len=*)inoptionalFile names of VTK files grouped into current block.
namescharacter(len=*)inoptionalAuxiliary names attributed to each files.
namecharacter(len=*)inoptionalBlock name
referencescharacter(len=*)inoptionalDatasets 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
scratchinteger(kind=I4P)inScratch unit.
actioncharacter(len=*)inAction: [open, write].
filenamecharacter(len=*)inoptionalFile name of VTK file grouped into current block.
namecharacter(len=*)inoptionalBlock 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
namecharacter(len=*)inoptionalBlock 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
filenamecharacter(len=*)inFile 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
file_idinteger(kind=hid_kind)inFile.
rootinteger(kind=hid_kind)inGroup /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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
rootinteger(kind=hid_kind)inGroup /VTKHDF.
pathcharacter(len=*)inBlock, from /VTKHDF.
levelinteger(kind=I4P)inNesting level of its members.
afterinteger(kind=I4P)inEntry 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
namecharacter(len=*)inoptionalBlock 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
filenamecharacter(len=*)inFile of the dataset.
namecharacter(len=*)inoptionalDataset 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
labelcharacter(len=*)inName 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
rootinteger(kind=I4P)inIndex of the VTKFile element.
file_typecharacter(len=*)invtkPartitionedDataSet 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

NameTypeIntentAttributesDescription
textcharacter(len=*)inAttribute value.
defaultinteger(kind=I4P)inDefault.

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

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

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

NameTypeIntentAttributesDescription
namecharacter(len=*)inName.

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

NameTypeIntentAttributesDescription
textcharacter(len=*)inText.

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

NameTypeIntentAttributesDescription
rootinteger(kind=hid_kind)inGroup /VTKHDF.
datasetcharacter(len=*)inDataset 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
filenamecharacter(len=*)inFile of the dataset.
namecharacter(len=*)inoptionalDataset 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
labelcharacter(len=*)inName 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
levelinteger(kind=I4P)inLevel, from 0.
filenamescharacter(len=*)inFiles 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM 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

NameTypeIntentAttributesDescription
selfclass(vtm_file)inoutVTM file.
rootinteger(kind=I4P)inIndex of the VTKFile element.
file_typecharacter(len=*)invtkOverlappingAMR or vtkHierarchicalBoxDataSet.

Call graph