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 ​

Derived Types ​

xml_writer_abstract ​

VTK file abstract XML writer.

Inheritance

Attributes: abstract

Components ​

NameTypeAttributesDescription
format_chtype(string)Output format, string code.
topologytype(string)Mesh topology.
indentinteger(kind=I4P)Indent count.
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).
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.
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.
errorinteger(kind=I4P)IO Error status.
tagtype(xml_tag)XML tags handler.
is_volatilelogicalFlag to check volatile writer.
xml_volatiletype(string)XML file volatile (not a physical file).

Type-Bound Procedures ​

NameAttributesDescription
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_connectivityWrite connectivity.
write_polydata_cellspass(self)Write cell blocks of polydata.
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_topology_tagpass(self)Write topology tag.
image_attributespass(self)Return ImageData attributes.
initializepass(self)Initialize writer.
finalizepass(self)Finalize writer.
write_dataarrayWrite data (array).
write_fielddataWrite FieldData tag.
write_dataarray_unsignedWrite data (array) as unsigned integers.
write_geoWrite mesh.
write_parallel_block_filesWrite block list of files.
write_pieceWrite Piece start/end tag.
write_dataarray1_rank1_R8Ppass(self)Data 1, rank 1, R8P.
write_dataarray1_rank1_R4Ppass(self)Data 1, rank 1, R4P.
write_dataarray1_rank1_I8Ppass(self)Data 1, rank 1, I8P.
write_dataarray1_rank1_I4Ppass(self)Data 1, rank 1, I4P.
write_dataarray1_rank1_I2Ppass(self)Data 1, rank 1, I2P.
write_dataarray1_rank1_I1Ppass(self)Data 1, rank 1, I1P.
write_dataarray1_rank2_R8Ppass(self)Data 1, rank 2, R8P.
write_dataarray1_rank2_R4Ppass(self)Data 1, rank 2, R4P.
write_dataarray1_rank2_I8Ppass(self)Data 1, rank 2, I8P.
write_dataarray1_rank2_I4Ppass(self)Data 1, rank 2, I4P.
write_dataarray1_rank2_I2Ppass(self)Data 1, rank 2, I2P.
write_dataarray1_rank2_I1Ppass(self)Data 1, rank 2, I1P.
write_dataarray1_rank3_R8Ppass(self)Data 1, rank 3, R8P.
write_dataarray1_rank3_R4Ppass(self)Data 1, rank 3, R4P.
write_dataarray1_rank3_I8Ppass(self)Data 1, rank 3, I8P.
write_dataarray1_rank3_I4Ppass(self)Data 1, rank 3, I4P.
write_dataarray1_rank3_I2Ppass(self)Data 1, rank 3, I2P.
write_dataarray1_rank3_I1Ppass(self)Data 1, rank 3, I1P.
write_dataarray1_rank4_R8Ppass(self)Data 1, rank 4, R8P.
write_dataarray1_rank4_R4Ppass(self)Data 1, rank 4, R4P.
write_dataarray1_rank4_I8Ppass(self)Data 1, rank 4, I8P.
write_dataarray1_rank4_I4Ppass(self)Data 1, rank 4, I4P.
write_dataarray1_rank4_I2Ppass(self)Data 1, rank 4, I2P.
write_dataarray1_rank4_I1Ppass(self)Data 1, rank 4, I1P.
write_dataarray3_rank1_R8Ppass(self)Data 3, rank 1, R8P.
write_dataarray3_rank1_R4Ppass(self)Data 3, rank 1, R4P.
write_dataarray3_rank1_I8Ppass(self)Data 3, rank 1, I8P.
write_dataarray3_rank1_I4Ppass(self)Data 3, rank 1, I4P.
write_dataarray3_rank1_I2Ppass(self)Data 3, rank 1, I2P.
write_dataarray3_rank1_I1Ppass(self)Data 3, rank 1, I1P.
write_dataarray3_rank3_R8Ppass(self)Data 3, rank 3, R8P.
write_dataarray3_rank3_R4Ppass(self)Data 3, rank 3, R4P.
write_dataarray3_rank3_I8Ppass(self)Data 3, rank 3, I8P.
write_dataarray3_rank3_I4Ppass(self)Data 3, rank 3, I4P.
write_dataarray3_rank3_I2Ppass(self)Data 3, rank 3, I2P.
write_dataarray3_rank3_I1Ppass(self)Data 3, rank 3, I1P.
write_dataarray6_rank1_R8Ppass(self)Data 3, rank 1, R8P.
write_dataarray6_rank1_R4Ppass(self)Data 3, rank 1, R4P.
write_dataarray6_rank1_I8Ppass(self)Data 3, rank 1, I8P.
write_dataarray6_rank1_I4Ppass(self)Data 3, rank 1, I4P.
write_dataarray6_rank1_I2Ppass(self)Data 3, rank 1, I2P.
write_dataarray6_rank1_I1Ppass(self)Data 3, rank 1, I1P.
write_dataarray6_rank3_R8Ppass(self)Data 3, rank 3, R8P.
write_dataarray6_rank3_R4Ppass(self)Data 3, rank 3, R4P.
write_dataarray6_rank3_I8Ppass(self)Data 3, rank 3, I8P.
write_dataarray6_rank3_I4Ppass(self)Data 3, rank 3, I4P.
write_dataarray6_rank3_I2Ppass(self)Data 3, rank 3, I2P.
write_dataarray6_rank3_I1Ppass(self)Data 3, rank 3, I1P.
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).
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_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 ​

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

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 and tcoords arguments designate the active array of each role, written as the Scalars, Vectors, Normals, Tensors and TCoords attributes of the tag: readers (e.g. ParaView) use it as the default array of that role. 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) 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.

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

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.

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_parallel_open_block ​

Write a block (open) container.

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) result(error)

Arguments

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

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.

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