Skip to content

vtk_fortran_vtk_file_xml_writer_abstract ​

VTK file abstract XML writer.

Source: src/lib/vtk_fortran_vtk_file_xml_writer_abstract.f90

Dependencies

Contents ​

Variables ​

NameTypeAttributesDescription
QUOTE_MARKcharacter(len=1)parameterA " of a user value inside an attribute string (attr_text).

Derived Types ​

xml_writer_abstract ​

VTK file abstract XML writer.

Inheritance

Extends: vtk_writer_abstract

Attributes: abstract

Components ​

NameTypeAttributesDescription
originreal(kind=R8P)Origin of ImageData topologies.
spacingreal(kind=R8P)Spacing of ImageData topologies.
directionreal(kind=R8P)Axes directions of ImageData topologies (row-major 3x3).
is_direction_setlogicalWrite the Direction of ImageData topologies.
is_uint64logicalUse UInt64 (instead of UInt32) bytes count headers.
is_compressedlogicalCompress (zlib) the binary data.
branch_factorinteger(kind=I4P)Branch factor of a HyperTreeGrid (VTKHDF): 2 or 3.
chunk_bytesinteger(kind=I8P)Bytes of a chunk of the VTKHDF datasets at most (default
format_chtype(string)Output format, string code.
topologytype(string)Mesh topology.
ghost_levelinteger(kind=I4P)Ghost level of parallel (P*) topologies.
data_type_overridetype(string)If set, type of the next DataArray tag (then unset).
tag_name_overridetype(string)If set, element name of the next DataArray tag (then unset).
tuples_overrideinteger(kind=I8P)If >= 0, number of tuples of the next DataArray tag (then unset).
component_namescharacter(len=:)allocatableNames of the components of the next DataArray, NUL ended (then unset).
ioffsetinteger(kind=I8P)Offset count.
xmlinteger(kind=I4P)XML Logical unit.
vtm_indexinteger(kind=I4P)allocatableNext child index of each open level of a multi-block file.
vtm_piecelogicalallocatableEach open level is a Piece (a vtkMultiPieceDataSet), not a Block.
errorinteger(kind=I4P)IO Error status.
writertype(xml_writer)FoXy streaming writer (on the file unit, or on memory if volatile).
is_volatilelogicalFlag to check volatile writer.
table_writertype(xml_writer)The file writer, kept while the columns go to memory.
n_tuplesinteger(kind=I8P)Tuples of the DataArray being written (set by each write_dataarray).
table_rowsinteger(kind=I8P)Rows of the columns of a Table, -1 before the first column.
table_columnsinteger(kind=I4P)Columns of a Table written.
is_row_openlogicalThe columns of a Table are being written (location row open).
is_rows_writtenlogicalThe columns of the Table are written (one RowData).
is_htg_openlogicalThe HyperTreeGrid element is written.
is_htg_treeslogicalIts Trees element is written.
htg_dimsinteger(kind=I4P)Points of the root grid along each axis.
htg_normalscharacter(len=:)allocatableCell array of the interface normals (empty: none).
htg_interceptscharacter(len=:)allocatableCell array of the interface intercepts.
htg_idsinteger(kind=I8P)allocatableIds of the trees written (their root cells).
htg_depthsinteger(kind=I8P)allocatableDepth of each tree.
htg_countsinteger(kind=I8P)allocatableCells of each depth of each tree.
htg_bitslogicalallocatableDescriptors of the trees, one after the other.
htg_masklogicalallocatableMask of the cells of the trees.
htg_has_masklogicalA tree has a mask.

Type-Bound Procedures ​

NameAttributesDescription
initializepass(self)Initialize the writer.
finalizepass(self)Finalize the writer.
write_dataarray1_rank1_R8Ppass(self)
write_dataarray1_rank1_R4Ppass(self)
write_dataarray1_rank1_I8Ppass(self)
write_dataarray1_rank1_I4Ppass(self)
write_dataarray1_rank1_I2Ppass(self)
write_dataarray1_rank1_I1Ppass(self)
write_dataarray1_rank2_R8Ppass(self)
write_dataarray1_rank2_R4Ppass(self)
write_dataarray1_rank2_I8Ppass(self)
write_dataarray1_rank2_I4Ppass(self)
write_dataarray1_rank2_I2Ppass(self)
write_dataarray1_rank2_I1Ppass(self)
write_dataarray1_rank3_R8Ppass(self)
write_dataarray1_rank3_R4Ppass(self)
write_dataarray1_rank3_I8Ppass(self)
write_dataarray1_rank3_I4Ppass(self)
write_dataarray1_rank3_I2Ppass(self)
write_dataarray1_rank3_I1Ppass(self)
write_dataarray1_rank4_R8Ppass(self)
write_dataarray1_rank4_R4Ppass(self)
write_dataarray1_rank4_I8Ppass(self)
write_dataarray1_rank4_I4Ppass(self)
write_dataarray1_rank4_I2Ppass(self)
write_dataarray1_rank4_I1Ppass(self)
write_dataarray3_rank1_R8Ppass(self)
write_dataarray3_rank1_R4Ppass(self)
write_dataarray3_rank1_I8Ppass(self)
write_dataarray3_rank1_I4Ppass(self)
write_dataarray3_rank1_I2Ppass(self)
write_dataarray3_rank1_I1Ppass(self)
write_dataarray3_rank3_R8Ppass(self)
write_dataarray3_rank3_R4Ppass(self)
write_dataarray3_rank3_I8Ppass(self)
write_dataarray3_rank3_I4Ppass(self)
write_dataarray3_rank3_I2Ppass(self)
write_dataarray3_rank3_I1Ppass(self)
write_dataarray6_rank1_R8Ppass(self)
write_dataarray6_rank1_R4Ppass(self)
write_dataarray6_rank1_I8Ppass(self)
write_dataarray6_rank1_I4Ppass(self)
write_dataarray6_rank1_I2Ppass(self)
write_dataarray6_rank1_I1Ppass(self)
write_dataarray6_rank3_R8Ppass(self)
write_dataarray6_rank3_R4Ppass(self)
write_dataarray6_rank3_I8Ppass(self)
write_dataarray6_rank3_I4Ppass(self)
write_dataarray6_rank3_I2Ppass(self)
write_dataarray6_rank3_I1Ppass(self)
write_connectivity
write_dataarray
write_fielddata
write_dataarray_unsigned
write_geo
write_piece
close_xml_filepass(self)Close xml file.
open_xml_filepass(self)Open xml file.
freepass(self)Free allocated memory.
get_xml_volatilepass(self)Return the XML volatile string file.
write_polydata_cellspass(self)Write cell blocks of polydata.
write_steppass(self)Start a time step (VTKHDF only).
write_levelpass(self)Start an AMR level (VTKHDF only).
write_treepass(self)Write a hyper tree.
set_interfacepass(self)HyperTreeGrid interface.
htg_finishpass(self)Close a HyperTreeGrid at finalize.
htg_treespass(self)Write the Trees of a HyperTreeGrid.
htg_bit_arraypass(self)Write a Bit DataArray.
htg_attributespass(self)Attributes of a HyperTreeGrid.
write_dataarray_location_tagpass(self)Write dataarray location tag.
write_dataarray_tagpass(self)Write dataarray tag.
write_dataarray_tag_appendedpass(self)Write dataarray appended tag.
write_end_tagpass(self)Write `` end tag.
write_header_tagpass(self)Write header tag.
write_parallel_open_blockpass(self)Write parallel open block.
write_parallel_close_blockpass(self)Write parallel close block.
write_parallel_dataarraypass(self)Write parallel dataarray.
write_parallel_geopass(self)Write parallel geo.
write_self_closing_tagpass(self)Write self closing tag.
write_start_tagpass(self)Write start tag.
write_tagpass(self)Write tag.
write_attributespass(self)Write the attributes of a tag.
is_table_columnpass(self)Check a column of a Table.
write_table_rowspass(self)Open or close the rows of a Table.
write_topology_tagpass(self)Write topology tag.
image_attributespass(self)Return ImageData attributes.
write_parallel_block_filesWrite block list of files.
write_dataarray_appendedpass(self)Write appended.
write_dataarray_unsigned_I1Ppass(self)Write data (array) as UInt8.
write_dataarray_unsigned_I2Ppass(self)Write data (array) as UInt16.
write_dataarray_unsigned_I4Ppass(self)Write data (array) as UInt32.
write_dataarray_unsigned_I8Ppass(self)Write data (array) as UInt64.
write_fielddata1_rank0pass(self)Write FieldData tag (data 1, rank 0).
write_fielddata1_rank1pass(self)Write FieldData tag (data 1, rank 1).
write_fielddata_stringspass(self)Write FieldData tag (strings).
write_dataarray_stringspass(self)Write a string array (point, cell data, Table column).
set_component_namespass(self)Name the components of the next DataArray.
component_names_attributespass(self)The ComponentName attributes of the next DataArray.
write_fielddata1_rank2pass(self)Write FieldData tag (several components).
dataarray_tag_overridespass(self)Apply the one-shot overrides of DataArray tag.
next_vtm_indexpass(self)Return (and count) the next multi-block child index.
write_fielddata_tagpass(self)Write FieldData tag.
write_geo_strg_data1_rank2_R8Ppass(self)Write StructuredGrid mesh (data 1, rank 2, R8P).
write_geo_strg_data1_rank2_R4Ppass(self)Write StructuredGrid mesh (data 1, rank 2, R4P).
write_geo_strg_data1_rank4_R8Ppass(self)Write StructuredGrid mesh (data 1, rank 4, R8P).
write_geo_strg_data1_rank4_R4Ppass(self)Write StructuredGrid mesh (data 1, rank 4, R4P).
write_geo_strg_data3_rank1_R8Ppass(self)Write StructuredGrid mesh (data 3, rank 1, R8P).
write_geo_strg_data3_rank1_R4Ppass(self)Write StructuredGrid mesh (data 3, rank 1, R4P).
write_geo_strg_data3_rank3_R8Ppass(self)Write StructuredGrid mesh (data 3, rank 3, R8P).
write_geo_strg_data3_rank3_R4Ppass(self)Write StructuredGrid mesh (data 3, rank 3, R4P).
write_geo_rect_data3_rank1_R8Ppass(self)Write RectilinearGrid mesh (data 3, rank 1, R8P).
write_geo_rect_data3_rank1_R4Ppass(self)Write RectilinearGrid mesh (data 3, rank 1, R4P).
write_geo_unst_data1_rank2_R8Ppass(self)Write UnstructuredGrid mesh (data 1, rank 2, R8P).
write_geo_unst_data1_rank2_R4Ppass(self)Write UnstructuredGrid mesh (data 1, rank 2, R4P).
write_geo_unst_data3_rank1_R8Ppass(self)Write UnstructuredGrid mesh (data 3, rank 1, R8P).
write_geo_unst_data3_rank1_R4Ppass(self)Write UnstructuredGrid mesh (data 3, rank 1, R4P).
write_geo_unst_data1_rank2_R8P_I8Ppass(self)Write UnstructuredGrid mesh, I8P counts.
write_geo_unst_data1_rank2_R4P_I8Ppass(self)Write UnstructuredGrid mesh, I8P counts.
write_geo_unst_data3_rank1_R8P_I8Ppass(self)Write UnstructuredGrid mesh, I8P counts.
write_geo_unst_data3_rank1_R4P_I8Ppass(self)Write UnstructuredGrid mesh, I8P counts.
write_connectivity_I4Ppass(self)Write connectivity (I4P ids).
write_connectivity_I8Ppass(self)Write connectivity (I8P ids).
write_piece_start_tagpass(self)Write `` start tag.
write_piece_start_tag_unstpass(self)Write `` start tag for unstructured topology.
write_piece_start_tag_polypass(self)Write `` start tag for polydata topology.
write_piece_start_tag_unst_I8Ppass(self)Write `` start tag, unstructured, I8P counts.
write_piece_start_tag_poly_I8Ppass(self)Write `` start tag, polydata, I8P counts.
write_piece_end_tagpass(self)Write `` end tag.
write_parallel_block_filepass(self)Write single file that belong to the current block.
write_parallel_block_files_arraypass(self)Write block list of files (array input).
write_parallel_block_files_stringpass(self)Write block list of files (string input).

Subroutines ​

close_xml_file ​

Close XML file.

fortran
subroutine close_xml_file(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

open_xml_file ​

Open XML file.

fortran
subroutine open_xml_file(self, filename)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
filenamecharacter(len=*)inFile name.

Call graph

free ​

Free allocated memory.

Attributes: elemental

fortran
subroutine free(self, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
errorinteger(kind=I4P)outoptionalError status.

get_xml_volatile ​

Return the eventual XML volatile string file.

Attributes: pure

fortran
subroutine get_xml_volatile(self, xml_volatile, error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inWriter.
xml_volatilecharacter(len=:)outallocatableXML volatile file.
errorinteger(kind=I4P)outoptionalError status.

Call graph

write_end_tag ​

Write </tag_name> end tag.

fortran
subroutine write_end_tag(self, name)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namecharacter(len=*)inTag name.

Call graph

write_header_tag ​

Write header tag.

The header_type (bytes count width) is always declared; when the binary data are compressed, the compressor is declared too: compressor="vtkZLibDataCompressor" header_type="UInt32".

fortran
subroutine write_header_tag(self)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

write_self_closing_tag ​

Write <tag_name.../> self closing tag.

fortran
subroutine write_self_closing_tag(self, name, attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namecharacter(len=*)inTag name.
attributescharacter(len=*)inoptionalTag attributes.

Call graph

write_start_tag ​

Write <tag_name...> start tag.

fortran
subroutine write_start_tag(self, name, attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namecharacter(len=*)inTag name.
attributescharacter(len=*)inoptionalTag attributes.

Call graph

write_tag ​

Write <tag_name...>...</tag_name> tag.

fortran
subroutine write_tag(self, name, attributes, content)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namecharacter(len=*)inTag name.
attributescharacter(len=*)inoptionalTag attributes.
contentcharacter(len=*)inoptionalTag content.

Call graph

write_attributes ​

Write the attributes of the pending start tag, given as a name="value" ... string.

A " of a user value (a name, a file) is given as QUOTE_MARK (attr_text), so that it does not end the value: it is turned back into " here, and FoXy writes it as &quot;.

fortran
subroutine write_attributes(self, attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
attributescharacter(len=*)inTag attributes, name="value" pairs.

Call graph

write_topology_tag ​

Write XML topology tag.

fortran
subroutine write_topology_tag(self, nx1, nx2, ny1, ny2, nz1, nz2, mesh_kind)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
nx1integer(kind=I4P)inoptionalInitial node of x axis.
nx2integer(kind=I4P)inoptionalFinal node of x axis.
ny1integer(kind=I4P)inoptionalInitial node of y axis.
ny2integer(kind=I4P)inoptionalFinal node of y axis.
nz1integer(kind=I4P)inoptionalInitial node of z axis.
nz2integer(kind=I4P)inoptionalFinal node of z axis.
mesh_kindcharacter(len=*)inoptionalKind of mesh data: Float64, Float32, ecc.

Call graph

write_dataarray_tag ​

Write <DataArray...>...</DataArray> tag.

fortran
subroutine write_dataarray_tag(self, data_type, number_of_components, data_name, data_content, is_tuples)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_typecharacter(len=*)inType of dataarray.
number_of_componentsinteger(kind=I4P)inNumber of dataarray components.
data_namecharacter(len=*)inData name.
data_contentcharacter(len=*)inoptionalData content.
is_tupleslogicalinoptionalUse "NumberOfTuples".

Call graph

write_dataarray_tag_appended ​

Write <DataArray.../> tag.

fortran
subroutine write_dataarray_tag_appended(self, data_type, number_of_components, data_name, is_tuples)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_typecharacter(len=*)inType of dataarray.
number_of_componentsinteger(kind=I4P)inNumber of dataarray components.
data_namecharacter(len=*)inData name.
is_tupleslogicalinoptionalUse "NumberOfTuples".

Call graph

dataarray_tag_overrides ​

Return element name, type and count of the next DataArray tag, applying (then unsetting) the one-shot overrides.

The overrides let a caller tag specially one array written through the generic DataArray writers: cell types as UInt8, strings as <Array type="String" NumberOfTuples="n"> (bytes written as Int8), field data arrays with their tuples count.

fortran
subroutine dataarray_tag_overrides(self, data_type, number_of_components, tag_name, data_type_, count)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_typecharacter(len=*)inType of dataarray.
number_of_componentsinteger(kind=I4P)inNumber of dataarray components.
tag_namecharacter(len=:)outallocatableElement name.
data_type_character(len=:)outallocatableType of dataarray.
countcharacter(len=:)outallocatableComponents (or tuples) count.

Call graph

Functions ​

attr_text ​

A user value (a name, a file) for an attribute string of write_attributes: trimmed and adjusted, every " given as QUOTE_MARK (a control character, never in an XML 1.0 document), turned back into " by write_attributes.

Attributes: pure

Returns: character(len=:)

fortran
function attr_text(value) result(text)

Arguments

NameTypeIntentAttributesDescription
valuecharacter(len=*)inUser value.

Call graph

quotes_back ​

An attribute value of write_attributes with each QUOTE_MARK turned back into ".

Attributes: pure

Returns: character(len=:)

fortran
function quotes_back(value) result(text)

Arguments

NameTypeIntentAttributesDescription
valuecharacter(len=*)inAttribute value.

Call graph

image_attributes ​

Return the Origin="..." Spacing="..." [Direction="..."] attributes of ImageData topologies.

Values are written in the shortest form that reads back exactly.

Returns: character(len=:)

fortran
function image_attributes(self) result(attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inWriter.

Call graph

real_values ​

Return space separated values, in the shortest form that reads back exactly, without the + of positive values (PENF no_sign would drop - too).

Returns: character(len=:)

fortran
function real_values(x) result(values)

Arguments

NameTypeIntentAttributesDescription
xreal(kind=R8P)inValues.

Call graph

components_of ​

" NumberOfComponents="n for a tuples-counted DataArray (field data) of more than one component, empty otherwise (the bytes of the one-component tags unchanged).

Attributes: pure

Returns: character(len=:)

fortran
function components_of(number_of_components) result(attribute)

Arguments

NameTypeIntentAttributesDescription
number_of_componentsinteger(kind=I4P)inNumber of components.

Call graph

component_names_attributes ​

The ComponentName<i> attributes of the names set by set_component_names (then unset), as VTK writes them, to put after the value of Name; empty if none.

Returns: character(len=:)

fortran
function component_names_attributes(self) result(attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

is_table_column ​

Inside the rows of a Table (write_dataarray(location='row', action='open')), count the column being written and check its rows against those of the first column (refused, with a message, otherwise: no DataArray written); true outside a Table too.

Returns: logical

fortran
function is_table_column(self, data_name) result(is_ok)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inName of the column.

Call graph

write_table_rows ​

Open (action OPEN) or close (CLOSE) the rows of a Table: one <Piece NumberOfCols NumberOfRows><RowData>, the columns (DataArray, every kind and number of components, the same rows) written in between. They are buffered in memory (a FoXy writer on memory) while the file writer is kept: at the close their counts are known, the Piece tag is written and the columns after it.

Returns: integer(kind=I4P)

fortran
function write_table_rows(self, action) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
actioncharacter(len=*)inOPEN or CLOSE.

Call graph

write_dataarray_location_tag ​

Write <[/]PointData> or <[/]CellData> open/close tag (<[/]PPointData> or <[/]PCellData> for parallel files).

@note must be called before saving the data related to geometric mesh, this function initializes the saving of data variables indicating the location (node or cell centered) of variables that will be saved.

@note A single file can contain both cell and node centered variables. In this case this function must be called two times, before saving cell-centered variables and before saving node-centered variables.

@note When opening, the optional scalars, vectors, normals, tensors, tcoords, global_ids, pedigree_ids, edge_flags, tangents, rational_weights, higher_order_degrees and process_ids arguments designate the active array of each role of VTK, written as the Scalars, Vectors, Normals, Tensors, TCoords, GlobalIds, PedigreeIds, EdgeFlag, Tangents, RationalWeights, HigherOrderDegrees and ProcessIds attributes of the tag (the names VTK writes): readers use it as the array of that role (ParaView the default array to show; VTK the global ids that match the points and cells of partitions, ...). Each argument is the data_name of an array written (or, for parallel files, declared) inside this tag; the name is not checked. They are ignored when closing.

Examples of usage ​

Opening node piece ​

fortran
 error = vtk%write_dataarray('node','OPeN')

Closing node piece ​

fortran
 error = vtk%write_dataarray('node','Close')

Opening cell piece ​

fortran
 error = vtk%write_dataarray('cell','OPEN')

Closing cell piece ​

fortran
 error = vtk%write_dataarray('cell','close')

Opening node piece designating the active scalars and vectors ​

fortran
 error = vtk%write_dataarray(location='node', action='open', scalars='pressure', vectors='velocity')

Returns: integer(kind=I4P)

fortran
function write_dataarray_location_tag(self, location, action, scalars, vectors, normals, tensors, tcoords, global_ids, pedigree_ids, edge_flags, tangents, rational_weights, higher_order_degrees, process_ids) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
locationcharacter(len=*)inLocation of variables: cell or node centered.
actioncharacter(len=*)inAction: open or close tag.
scalarscharacter(len=*)inoptionalName of the active scalars array.
vectorscharacter(len=*)inoptionalName of the active vectors array.
normalscharacter(len=*)inoptionalName of the active normals array.
tensorscharacter(len=*)inoptionalName of the active tensors array.
tcoordscharacter(len=*)inoptionalName of the active texture coordinates array.
global_idscharacter(len=*)inoptionalName of the active global ids (one integer component) array.
pedigree_idscharacter(len=*)inoptionalName of the active pedigree ids array.
edge_flagscharacter(len=*)inoptionalName of the active edge flags array.
tangentscharacter(len=*)inoptionalName of the active tangents (3 components) array.
rational_weightscharacter(len=*)inoptionalName of the active rational weights array.
higher_order_degreescharacter(len=*)inoptionalName of the active higher order degrees array.
process_idscharacter(len=*)inoptionalName of the active process ids array.

Call graph

write_fielddata1_rank0 ​

Write one FieldData value: a number (any kind) or a string.

A number is written as <DataArray ... NumberOfTuples="1">, a string as <Array type="String" NumberOfTuples="1"> (its characters followed by a NUL, as VTK writes strings; trailing blanks are trimmed).

Example of usage ​

fortran
 error = vtk%xml_writer%write_fielddata(action='open')
 error = vtk%xml_writer%write_fielddata(data_name='TIME', x=0.1_R8P)
 error = vtk%xml_writer%write_fielddata(data_name='solver', x='my solver v1.2')
 error = vtk%xml_writer%write_fielddata(action='close')

Returns: integer(kind=I4P)

fortran
function write_fielddata1_rank0(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xclass(*)inData variable.

Call graph

write_fielddata1_rank1 ​

Write a FieldData array: numbers (any kind) or strings, one tuple per element.

Numbers are written as <DataArray ... NumberOfTuples="size(x)"> (one component per tuple), strings as <Array type="String" NumberOfTuples="size(x)"> (each string followed by a NUL, as VTK writes strings; trailing blanks of each element are trimmed).

Example of usage ​

fortran
 error = vtk%xml_writer%write_fielddata(data_name='residuals', x=[1.e-3_R8P, 1.e-4_R8P, 1.e-5_R8P])
 error = vtk%xml_writer%write_fielddata(data_name='species', x=['N2', 'O2'])

Returns: integer(kind=I4P)

fortran
function write_fielddata1_rank1(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xclass(*)inData variable.

Call graph

write_fielddata_strings ​

Write FieldData strings as VTK does: <Array type="String" NumberOfTuples="size(x)">, the bytes of each string (trailing blanks trimmed) followed by a NUL, encoded as any Int8 data in the selected format.

Returns: integer(kind=I4P)

fortran
function write_fielddata_strings(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xcharacter(len=*)inStrings.

Call graph

set_component_names ​

Name the components of the next DataArray written: ComponentName0="..." ComponentName1="...", as VTK writes them (ParaView shows them in its component lists); one name per component (trailing blanks trimmed).

fortran
 error = vtk%xml_writer%set_component_names(['u', 'v', 'w'])
 error = vtk%xml_writer%write_dataarray(data_name='velocity', x=vx, y=vy, z=vz)

Returns: integer(kind=I4P)

fortran
function set_component_names(self, names) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namescharacter(len=*)inNames of the components.

write_fielddata1_rank2 ​

Write a FieldData array of several components, x(components, tuples): <DataArray NumberOfComponents="n" NumberOfTuples="m"> (numbers of any kind).

Returns: integer(kind=I4P)

fortran
function write_fielddata1_rank2(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xclass(*)inData variable, components then tuples.

Call graph

write_dataarray_strings ​

Write a string array of the open location (point data, cell data, a Table column) as VTK does: <Array type="String" NumberOfTuples="size(x)">, the bytes of each string (trailing blanks trimmed) followed by a NUL, encoded as Int8 data in the selected format. One string per tuple (a Table: one per row).

Example of usage ​

fortran
 error = vtk%xml_writer%write_dataarray(location='node', action='open')
 error = vtk%xml_writer%write_dataarray(data_name='label', x=['inlet ', 'wall  ', 'outlet'])
 error = vtk%xml_writer%write_dataarray(location='node', action='close')

Returns: integer(kind=I4P)

fortran
function write_dataarray_strings(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xcharacter(len=*)inStrings.

Call graph

write_fielddata_tag ​

Write <FieldData>/</FieldData> start/end tag.

Returns: integer(kind=I4P)

fortran
function write_fielddata_tag(self, action) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
actioncharacter(len=*)inAction: open or close tag.

Call graph

write_piece_start_tag ​

Write <Piece ...> start tag.

Returns: integer(kind=I4P)

fortran
function write_piece_start_tag(self, nx1, nx2, ny1, ny2, nz1, nz2) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
nx1integer(kind=I4P)inInitial node of x axis.
nx2integer(kind=I4P)inFinal node of x axis.
ny1integer(kind=I4P)inInitial node of y axis.
ny2integer(kind=I4P)inFinal node of y axis.
nz1integer(kind=I4P)inInitial node of z axis.
nz2integer(kind=I4P)inFinal node of z axis.

Call graph

write_piece_start_tag_unst ​

Write <Piece ...> start tag for unstructured topology.

Returns: integer(kind=I4P)

fortran
function write_piece_start_tag_unst(self, np, nc) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I4P)inNumber of points.
ncinteger(kind=I4P)inNumber of cells.

Call graph

write_piece_start_tag_unst_I8P ​

Write <Piece ...> start tag for unstructured topology, 64-bit counts (more than 2^31-1 points or cells).

Returns: integer(kind=I4P)

fortran
function write_piece_start_tag_unst_I8P(self, np, nc) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I8P)inNumber of points.
ncinteger(kind=I8P)inNumber of cells.

Call graph

write_piece_start_tag_poly ​

Write <Piece ...> start tag for polydata topology: the number of points and of cells of each block.

Returns: integer(kind=I4P)

fortran
function write_piece_start_tag_poly(self, np, nverts, nlines, nstrips, npolys) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I4P)inNumber of points.
nvertsinteger(kind=I4P)inNumber of vertex cells (block Verts).
nlinesinteger(kind=I4P)inNumber of line/polyline cells (block Lines).
nstripsinteger(kind=I4P)inNumber of triangle strip cells (block Strips).
npolysinteger(kind=I4P)inNumber of polygon cells (block Polys).

Call graph

write_piece_start_tag_poly_I8P ​

Write <Piece ...> start tag for polydata topology, 64-bit counts (more than 2^31-1 points or cells).

Returns: integer(kind=I4P)

fortran
function write_piece_start_tag_poly_I8P(self, np, nverts, nlines, nstrips, npolys) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I8P)inNumber of points.
nvertsinteger(kind=I8P)inNumber of vertex cells (block Verts).
nlinesinteger(kind=I8P)inNumber of line/polyline cells (block Lines).
nstripsinteger(kind=I8P)inNumber of triangle strip cells (block Strips).
npolysinteger(kind=I8P)inNumber of polygon cells (block Polys).

Call graph

write_piece_end_tag ​

Write </Piece> end tag (a HyperTreeGrid: its trees, if no cell data wrote them; no Piece element).

Returns: integer(kind=I4P)

fortran
function write_piece_end_tag(self) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

write_geo_rect_data3_rank1_R8P ​

Write mesh with RectilinearGrid topology (data 3, rank 1, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_rect_data3_rank1_R8P(self, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
xreal(kind=R8P)inX coordinates.
yreal(kind=R8P)inY coordinates.
zreal(kind=R8P)inZ coordinates.

Call graph

write_geo_rect_data3_rank1_R4P ​

Write mesh with RectilinearGrid topology (data 3, rank 1, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_rect_data3_rank1_R4P(self, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
xreal(kind=R4P)inX coordinates.
yreal(kind=R4P)inY coordinates.
zreal(kind=R4P)inZ coordinates.

Call graph

write_geo_strg_data1_rank2_R8P ​

Write mesh with StructuredGrid topology (data 1, rank 2, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data1_rank2_R8P(self, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
xyzreal(kind=R8P)inX, y, z coordinates [1:3,1:n].

Call graph

write_geo_strg_data1_rank2_R4P ​

Write mesh with StructuredGrid topology (data 1, rank 2, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data1_rank2_R4P(self, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
xyzreal(kind=R4P)inX, y, z coordinates [1:3,:].

Call graph

write_geo_strg_data1_rank4_R8P ​

Write mesh with StructuredGrid topology (data 1, rank 4, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data1_rank4_R8P(self, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
xyzreal(kind=R8P)inX, y, z coordinates [1:3,:,:,:].

Call graph

write_geo_strg_data1_rank4_R4P ​

Write mesh with StructuredGrid topology (data 1, rank 4, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data1_rank4_R4P(self, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
xyzreal(kind=R4P)inX, y, z coordinates [1:3,:,:,:].

Call graph

write_geo_strg_data3_rank1_R8P ​

Write mesh with StructuredGrid topology (data 3, rank 1, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data3_rank1_R8P(self, n, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
ninteger(kind=I4P)inNumber of nodes.
xreal(kind=R8P)inX coordinates.
yreal(kind=R8P)inY coordinates.
zreal(kind=R8P)inZ coordinates.

Call graph

write_geo_strg_data3_rank1_R4P ​

Write mesh with StructuredGrid topology (data 3, rank 1, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data3_rank1_R4P(self, n, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
ninteger(kind=I4P)inNumber of nodes.
xreal(kind=R4P)inX coordinates.
yreal(kind=R4P)inY coordinates.
zreal(kind=R4P)inZ coordinates.

Call graph

write_geo_strg_data3_rank3_R8P ​

Write mesh with StructuredGrid topology (data 3, rank 3, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data3_rank3_R8P(self, n, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
ninteger(kind=I4P)inNumber of nodes.
xreal(kind=R8P)inX coordinates.
yreal(kind=R8P)inY coordinates.
zreal(kind=R8P)inZ coordinates.

Call graph

write_geo_strg_data3_rank3_R4P ​

Write mesh with StructuredGrid topology (data 3, rank 3, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_strg_data3_rank3_R4P(self, n, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
ninteger(kind=I4P)inNumber of nodes.
xreal(kind=R4P)inX coordinates.
yreal(kind=R4P)inY coordinates.
zreal(kind=R4P)inZ coordinates.

Call graph

write_geo_unst_data1_rank2_R8P ​

Write mesh with UnstructuredGrid topology (data 1, rank 2, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data1_rank2_R8P(self, np, nc, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I4P)inNumber of points.
ncinteger(kind=I4P)inNumber of cells.
xyzreal(kind=R8P)inX, y, z coordinates [1:3,:].

Call graph

write_geo_unst_data1_rank2_R8P_I8P ​

Write mesh with UnstructuredGrid topology, 64-bit counts (data 1, rank 2, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data1_rank2_R8P_I8P(self, np, nc, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I8P)inNumber of points.
ncinteger(kind=I8P)inNumber of cells.
xyzreal(kind=R8P)inX, y, z coordinates [1:3,:].

Call graph

write_geo_unst_data1_rank2_R4P ​

Write mesh with UnstructuredGrid topology (data 1, rank 2, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data1_rank2_R4P(self, np, nc, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I4P)inNumber of points.
ncinteger(kind=I4P)inNumber of cells.
xyzreal(kind=R4P)inX, y, z coordinates [1:3,:].

Call graph

write_geo_unst_data1_rank2_R4P_I8P ​

Write mesh with UnstructuredGrid topology, 64-bit counts (data 1, rank 2, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data1_rank2_R4P_I8P(self, np, nc, xyz) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I8P)inNumber of points.
ncinteger(kind=I8P)inNumber of cells.
xyzreal(kind=R4P)inX, y, z coordinates [1:3,:].

Call graph

write_geo_unst_data3_rank1_R8P ​

Write mesh with UnstructuredGrid topology (data 3, rank 1, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data3_rank1_R8P(self, np, nc, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I4P)inNumber of points.
ncinteger(kind=I4P)inNumber of cells.
xreal(kind=R8P)inX coordinates.
yreal(kind=R8P)inY coordinates.
zreal(kind=R8P)inZ coordinates.

Call graph

write_geo_unst_data3_rank1_R8P_I8P ​

Write mesh with UnstructuredGrid topology, 64-bit counts (data 3, rank 1, R8P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data3_rank1_R8P_I8P(self, np, nc, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I8P)inNumber of points.
ncinteger(kind=I8P)inNumber of cells.
xreal(kind=R8P)inX coordinates.
yreal(kind=R8P)inY coordinates.
zreal(kind=R8P)inZ coordinates.

Call graph

write_geo_unst_data3_rank1_R4P ​

Write mesh with UnstructuredGrid topology (data 3, rank 1, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data3_rank1_R4P(self, np, nc, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I4P)inNumber of points.
ncinteger(kind=I4P)inNumber of cells.
xreal(kind=R4P)inX coordinates.
yreal(kind=R4P)inY coordinates.
zreal(kind=R4P)inZ coordinates.

Call graph

write_geo_unst_data3_rank1_R4P_I8P ​

Write mesh with UnstructuredGrid topology, 64-bit counts (data 3, rank 1, R4P).

Returns: integer(kind=I4P)

fortran
function write_geo_unst_data3_rank1_R4P_I8P(self, np, nc, x, y, z) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
npinteger(kind=I8P)inNumber of points.
ncinteger(kind=I8P)inNumber of cells.
xreal(kind=R4P)inX coordinates.
yreal(kind=R4P)inY coordinates.
zreal(kind=R4P)inZ coordinates.

Call graph

write_connectivity_I4P ​

Write mesh connectivity.

Connectivity, offsets and faces are given as I4P (written as Int32) or, with the 64-bit version, as I8P (written as Int64, as VTK does), for pieces with more than 2^31-1 points or connectivity entries; cell types are always I1P.

Must be used when unstructured grid is used, it saves the connectivity of the unstructured gird. @note The vector connect must follow the VTK-XML standard. It is passed as assumed-shape array because its dimensions is related to the mesh dimensions in a complex way. Its dimensions can be calculated by the following equation: (dc = \sum\limits_{i = 1}^{NC} {nvertex_i }). Note that this equation is different from the legacy one. The XML connectivity convention is quite different from the legacy standard. As an example suppose we have a mesh composed by 2 cells, one hexahedron (8 vertices) and one pyramid with square basis (5 vertices) and suppose that the basis of pyramid is constitute by a face of the hexahedron and so the two cells share 4 vertices. The above equation gives (dc=8+5=13). The connectivity vector for this mesh can be:

first cell ​
  • connect(1) = 0 identification flag of (1^\circ) vertex of first cell
  • connect(2) = 1 identification flag of (2^\circ) vertex of first cell
  • connect(3) = 2 identification flag of (3^\circ) vertex of first cell
  • connect(4) = 3 identification flag of (4^\circ) vertex of first cell
  • connect(5) = 4 identification flag of (5^\circ) vertex of first cell
  • connect(6) = 5 identification flag of (6^\circ) vertex of first cell
  • connect(7) = 6 identification flag of (7^\circ) vertex of first cell
  • connect(8) = 7 identification flag of (8^\circ) vertex of first cell
second cell ​
  • connect(9 ) = 0 identification flag of (1^\circ) vertex of second cell
  • connect(10) = 1 identification flag of (2^\circ) vertex of second cell
  • connect(11) = 2 identification flag of (3^\circ) vertex of second cell
  • connect(12) = 3 identification flag of (4^\circ) vertex of second cell
  • connect(13) = 8 identification flag of (5^\circ) vertex of second cell

Therefore this connectivity vector convention is more simple than the legacy convention, now we must create also the offset vector that contains the data now missing in the connect vector. The offset vector for this mesh can be:

first cell ​
  • offset(1) = 8 => summ of nodes of (1^\circ) cell
second cell ​
  • offset(2) = 13 => summ of nodes of (1^\circ) and (2^\circ) cells

The value of every cell-offset can be calculated by the following equation: (offset_c=\sum\limits_{i=1}^{c}{nvertex_i}) where (offset_c) is the value of (c^{th}) cell and (nvertex_i) is the number of vertices of (i^{th}) cell. The function VTK_CON_XML does not calculate the connectivity and offset vectors: it writes the connectivity and offset vectors conforming the VTK-XML standard, but does not calculate them. The vector variable cell_type must conform the VTK-XML standard (see the file VTK-Standard at the Kitware homepage) that is the same of the legacy standard. It contains the type of each cells. For the above example this vector is:

first cell ​
  • cell_type(1) = 12 hexahedron type of first cell
second cell ​
  • cell_type(2) = 14 pyramid type of second cell Add faces and faceoffsets to the cell block for polyhedra. If the cell is not a polyhedron, its offset must be set to -1. They must be children of the Cells element, otherwise readers ignore them (issue #31).

Returns: integer(kind=I4P)

fortran
function write_connectivity_I4P(self, nc, connectivity, offset, cell_type, face, faceoffset) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
ncinteger(kind=I4P)inNumber of cells.
connectivityinteger(kind=I4P)inMesh connectivity.
offsetinteger(kind=I4P)inCell offset.
cell_typeinteger(kind=I1P)inVTK cell type.
faceinteger(kind=I4P)inoptionalface composing the polyhedra.
faceoffsetinteger(kind=I4P)inoptionalface offset.

Call graph

write_connectivity_I8P ​

Write mesh connectivity, 64-bit ids and offsets (written as Int64): see the I4P version.

Returns: integer(kind=I4P)

fortran
function write_connectivity_I8P(self, nc, connectivity, offset, cell_type, face, faceoffset) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
ncinteger(kind=I8P)inNumber of cells.
connectivityinteger(kind=I8P)inMesh connectivity.
offsetinteger(kind=I8P)inCell offset.
cell_typeinteger(kind=I1P)inVTK cell type.
faceinteger(kind=I8P)inoptionalface composing the polyhedra.
faceoffsetinteger(kind=I8P)inoptionalface offset.

Call graph

write_dataarray_unsigned_I1P ​

Write <DataArray type="UInt8" ...>: the bits of x as unsigned integers of the same width.

Example of usage ​

fortran
 error = vtk%xml_writer%write_dataarray(location='cell', action='open')
 error = vtk%xml_writer%write_dataarray_unsigned(data_name='vtkGhostType', x=ghost) ! ghost: integer(I1P), 0 or 1
 error = vtk%xml_writer%write_dataarray(location='cell', action='close')

Returns: integer(kind=I4P)

fortran
function write_dataarray_unsigned_I1P(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xinteger(kind=I1P)inData variable (bits of unsigned integers).

Call graph

write_dataarray_unsigned_I2P ​

Write <DataArray type="UInt16" ...>: the bits of x as unsigned integers of the same width.

Returns: integer(kind=I4P)

fortran
function write_dataarray_unsigned_I2P(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xinteger(kind=I2P)inData variable (bits of unsigned integers).

Call graph

write_dataarray_unsigned_I4P ​

Write <DataArray type="UInt32" ...>: the bits of x as unsigned integers of the same width.

Returns: integer(kind=I4P)

fortran
function write_dataarray_unsigned_I4P(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xinteger(kind=I4P)inData variable (bits of unsigned integers).

Call graph

write_dataarray_unsigned_I8P ​

Write <DataArray type="UInt64" ...>: the bits of x as unsigned integers of the same width.

@note With the ASCII format, values of 2^63 or more (negative x) cannot be printed (there is no wider integer kind): nothing is written and the error status is 1.

Returns: integer(kind=I4P)

fortran
function write_dataarray_unsigned_I8P(self, data_name, x) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
xinteger(kind=I8P)inData variable (bits of unsigned integers).

Call graph

write_polydata_cells ​

Write the cell blocks of polydata topology: <Verts>, <Lines>, <Strips> and <Polys>.

Each block is given by a pair of arrays, as in write_connectivity: the point ids (0-based) of its cells, one cell after the other, and the cumulative offset of the end of each cell. Only the blocks passed are written (VTK readers treat an absent block as empty); a block with only one of its two arrays is an error. The number of cells of each block must match the counts passed to write_piece(np, nverts, nlines, nstrips, npolys).

The arrays are I4P (written as Int32) or I8P (written as Int64, for more than 2^31-1 points or entries); any other type is an error. They are declared class(*): a generic could not tell an I4P version from an I8P one, all arguments being optional.

@note Cell data of polydata are ordered by block: verts, lines, strips, polys.

Example of usage ​

fortran
 ! a square made of two triangles and a polyline of 3 points
 error = vtk%xml_writer%write_polydata_cells(lines_connectivity=[4,5,6], lines_offset=[3], &
                                            polys_connectivity=[0,1,2, 0,2,3], polys_offset=[3,6])

Returns: integer(kind=I4P)

fortran
function write_polydata_cells(self, verts_connectivity, verts_offset, lines_connectivity, lines_offset, strips_connectivity, strips_offset, polys_connectivity, polys_offset) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
verts_connectivityclass(*)inoptionalVertices connectivity.
verts_offsetclass(*)inoptionalVertices offsets.
lines_connectivityclass(*)inoptionalLines connectivity.
lines_offsetclass(*)inoptionalLines offsets.
strips_connectivityclass(*)inoptionalTriangle strips connectivity.
strips_offsetclass(*)inoptionalTriangle strips offsets.
polys_connectivityclass(*)inoptionalPolygons connectivity.
polys_offsetclass(*)inoptionalPolygons offsets.

Call graph

write_step ​

Start a time step: a VTKHDF feature (format='vtkhdf'), an error in the XML formats, whose time series are .pvd collections of files (pvd_file).

Returns: integer(kind=I4P)

fortran
function write_step(self, time) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
timereal(kind=R8P)inTime of the step.

write_level ​

Start a level of an OverlappingAMR: a VTKHDF feature (format='vtkhdf'), an error in the XML formats.

Returns: integer(kind=I4P)

fortran
function write_level(self, level, spacing) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
levelinteger(kind=I4P)inLevel, from 0.
spacingreal(kind=R8P)inSpacing of the level.

write_tree ​

Write the tree tree_id (its root cell, from 0: i + (nx-1)(j + (ny-1)k) of the root grid) of a HyperTreeGrid, in its piece, after its coordinates and before its cell data: descriptor the refinement (true) of its cells breadth first, the children of a cell x fastest, every depth but the deepest (an empty descriptor is a tree of one leaf); mask (optional) one value per cell, breadth first, a refined cell not masked. The trees are kept and written as the Trees element (Descriptors, NumberOfVerticesPerDepth, TreeIds, DepthPerTree, Mask, as VTK 9.7.2 writes a .htg) when the cell data open, or at the end of the piece.

Returns: integer(kind=I4P)

fortran
function write_tree(self, tree_id, descriptor, mask) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
tree_idinteger(kind=I4P)inTree (root cell), from 0.
descriptorlogicalinRefinement of the cells, breadth first.
masklogicalinoptionalMasked cells, breadth first.

htg_trees ​

Write the Trees element of a HyperTreeGrid, as VTK 9.7.2 writes it: Descriptors (Bit), NumberOfVerticesPerDepth (Int64), TreeIds (Int64), DepthPerTree (UInt32: VTK 9.7.2 crashes on another type), Mask (Bit, if a tree has one), each with its NumberOfTuples (VTK reads no tree without them).

Returns: integer(kind=I4P)

fortran
function htg_trees(self) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

htg_bit_array ​

Write a type="Bit" DataArray: one value (0, 1) per bit in ASCII, the bits packed MSB first in bytes otherwise, as vtkBitArray is written; NumberOfTuples the bits.

Returns: integer(kind=I4P)

fortran
function htg_bit_array(self, name, bits) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namecharacter(len=*)inName of the array.
bitslogicalinThe bits.

Call graph

htg_attributes ​

The attributes of the HyperTreeGrid element: BranchFactor, TransposedRootIndexing (0: the trees x fastest), Dimensions (points of the root grid), and the interface arrays if named.

Returns: character(len=:)

fortran
function htg_attributes(self) result(attributes)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inWriter.

Call graph

htg_finish ​

At finalize, close a HyperTreeGrid: its element if no piece wrote it (a grid without trees), its trees if not written; nothing for another topology.

Returns: integer(kind=I4P)

fortran
function htg_finish(self) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

set_interface ​

Name the interface arrays of a HyperTreeGrid (InterfaceNormalsName, InterfaceInterceptsName of its element, as VTK writes them): cell arrays of 3 components. Before its piece (write_piece), which writes the element.

Returns: integer(kind=I4P)

fortran
function set_interface(self, normals, intercepts) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
normalscharacter(len=*)inCell array of the interface normals.
interceptscharacter(len=*)inCell array of the interface intercepts.

write_parallel_open_block ​

Write a block (open) container, or with pieces a Piece (a vtkMultiPieceDataSet: its datasets are its pieces, as VTK writes a multi-piece block of a .vtm).

Blocks can be nested: each open block is a new level. The children of a level (blocks and datasets) are indexed from 0 in the order they are written, as VTK numbers the children of a multi-block dataset.

Returns: integer(kind=I4P)

fortran
function write_parallel_open_block(self, name, pieces) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
namecharacter(len=*)inoptionalBlock name.
pieceslogicalinoptionalA Piece (multi-piece dataset), not a Block.

Call graph

write_parallel_close_block ​

Close a block container.

Returns: integer(kind=I4P)

fortran
function write_parallel_close_block(self) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

next_vtm_index ​

Return the index of the next child (block or dataset) of the current level of a multi-block file, and count it.

Returns: integer(kind=I4P)

fortran
function next_vtm_index(self) result(vtm_index)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.

Call graph

write_parallel_dataarray ​

Write parallel (partitioned) VTK-XML dataarray info: PDataArray, or PArray for the type String (as VTK declares a string array).

Returns: integer(kind=I4P)

fortran
function write_parallel_dataarray(self, data_name, data_type, number_of_components) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
data_namecharacter(len=*)inData name.
data_typecharacter(len=*)inType of dataarray.
number_of_componentsinteger(kind=I4P)inoptionalNumber of dataarray components.

Call graph

write_parallel_geo ​

Write parallel (partitioned) VTK-XML geo source file.

Returns: integer(kind=I4P)

fortran
function write_parallel_geo(self, source, nx1, nx2, ny1, ny2, nz1, nz2) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
sourcecharacter(len=*)inSource file name containing the piece data.
nx1integer(kind=I4P)inoptionalInitial node of x axis.
nx2integer(kind=I4P)inoptionalFinal node of x axis.
ny1integer(kind=I4P)inoptionalInitial node of y axis.
ny2integer(kind=I4P)inoptionalFinal node of y axis.
nz1integer(kind=I4P)inoptionalInitial node of z axis.
nz2integer(kind=I4P)inoptionalFinal node of z axis.

Call graph

write_parallel_block_file ​

Write single file that belong to the current block.

Returns: integer(kind=I4P)

fortran
function write_parallel_block_file(self, file_index, filename, name) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
file_indexinteger(kind=I4P)inIndex of file in the list.
filenamecharacter(len=*)inWrapped file names.
namecharacter(len=*)inoptionalNames attributed to wrapped file.

Call graph

write_parallel_block_files_array ​

Write list of files that belong to the current block (list passed as rank 1 array).

Example of usage: 3 files blocks ​

fortran
 error = vtm%write_files_list_of_block(filenames=['file_1.vts','file_2.vts','file_3.vtu'])

Example of usage: 3 files blocks with custom name ​

fortran
 error = vtm%write_files_list_of_block(filenames=['file_1.vts','file_2.vts','file_3.vtu'],&
                                       names=['block-bar','block-foo','block-baz'])

Returns: integer(kind=I4P)

fortran
function write_parallel_block_files_array(self, filenames, names) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
filenamescharacter(len=*)inList of VTK-XML wrapped file names.
namescharacter(len=*)inoptionalList names attributed to wrapped files.

Call graph

write_parallel_block_files_string ​

Write list of files that belong to the current block (list passed as single string).

Example of usage: 3 files blocks ​

fortran
 error = vtm%write_files_list_of_block(filenames='file_1.vts file_2.vts file_3.vtu')

Example of usage: 3 files blocks with custom name ​

fortran
 error = vtm%write_files_list_of_block(filenames='file_1.vts file_2.vts file_3.vtu',&
                                       names='block-bar block-foo block-baz')

Returns: integer(kind=I4P)

fortran
function write_parallel_block_files_string(self, filenames, names, delimiter) result(error)

Arguments

NameTypeIntentAttributesDescription
selfclass(xml_writer_abstract)inoutWriter.
filenamescharacter(len=*)inList of VTK-XML wrapped file names.
namescharacter(len=*)inoptionalList names attributed to wrapped files.
delimitercharacter(len=*)inoptionalDelimiter character.

Call graph