Usage Reference for pyvisfile.xdmf
¶
This implementation targets XDMF3 and takes available fields directly from the code in the xdmf library. Additional documentation can be found online, but (at the time of this writing, December 2020) does not appear to be kept up to date.
Xdmf Tags¶
DataItem¶
-
class
pyvisfile.xdmf.
DataItemType
(value)¶ Bases:
enum.Enum
Data layout of an item.
-
Function
= 3¶
-
HyperSlab
= 2¶
-
Uniform
= 1¶
-
-
class
pyvisfile.xdmf.
DataItemNumberType
(value)¶ Bases:
enum.Enum
Basic number types for an item.
-
Char
= 1¶
-
Float
= 5¶
-
Int
= 3¶
-
UChar
= 2¶
-
UInt
= 4¶
-
-
class
pyvisfile.xdmf.
DataItemFormat
(value)¶ Bases:
enum.Enum
Format in which the item is stored.
-
Binary
= 3¶
-
HDF
= 2¶
-
TIFF
= 4¶
-
XML
= 1¶
-
-
class
pyvisfile.xdmf.
DataItemEndian
(value)¶ Bases:
enum.Enum
Endianess of the data stored in the item.
-
Big
= 50¶
-
Little
= 51¶
-
Native
= 52¶
-
-
class
pyvisfile.xdmf.
DataItem
(*, dimensions=None, name=None, itype=<DataItemType.Uniform: 1>, ntype=<DataItemNumberType.Float: 5>, precision=4, reference=None, function=None, endian=<DataItemEndian.Native: 52>, dformat=<DataItemFormat.XML: 1>, parent=None, data=None)¶ A
DataItem
describes the storage of actual values in an XDMF file. This can be inline ASCII data, the path to a binary file or a reference to anotherDataItem
.-
dimensions
¶ Analogous to
numpy.ndarray.shape
.
-
__init__
(*, dimensions=None, name=None, itype=<DataItemType.Uniform: 1>, ntype=<DataItemNumberType.Float: 5>, precision=4, reference=None, function=None, endian=<DataItemEndian.Native: 52>, dformat=<DataItemFormat.XML: 1>, parent=None, data=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
reference (Optional[str]) – path to another
DataItem
. Useas_reference()
to populate.data (Optional[str]) – data contained inside the
DataItem
. This is usually a path to a binary file.dimensions (Optional[Tuple[int, ..]]) –
name (Optional[str]) –
itype (Optional[pyvisfile.xdmf.DataItemType]) –
ntype (Optional[pyvisfile.xdmf.DataItemNumberType]) –
precision (Optional[int]) –
function (Optional[str]) –
endian (Optional[pyvisfile.xdmf.DataItemEndian]) –
dformat (Optional[pyvisfile.xdmf.DataItemFormat]) –
-
classmethod
as_reference
(reference_name, *, parent=None)¶ - Parameters
reference_name (str) – a name or an absolute reference to another
DataItem
. The name is just theName
attribute of the item, which is assumed to be in the topDomain
. If anotherDataItem
needs to be references, or there are multiple domains, use an absolute reference path, as defined in the XDMF docs.reference_name –
parent (Optional[xml.etree.ElementTree.Element]) –
- Return type
-
Domain¶
-
class
pyvisfile.xdmf.
Domain
(*, name=None, parent=None)¶ -
__init__
(*, name=None, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
name (Optional[str]) –
-
Grid¶
-
class
pyvisfile.xdmf.
GridType
(value)¶ Bases:
enum.Enum
General structure of the connectivity.
-
Collection
= 2¶
-
SubSet
= 4¶
-
Tree
= 3¶
-
Uniform
= 1¶
-
-
class
pyvisfile.xdmf.
CollectionType
(value)¶ Bases:
enum.Enum
An enumeration.
-
Spatial
= 1¶
-
Temporal
= 2¶
-
-
class
pyvisfile.xdmf.
Grid
(*, name=None, gtype=<GridType.Uniform: 1>, ctype=None, parent=None)¶ -
__init__
(*, name=None, gtype=<GridType.Uniform: 1>, ctype=None, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
name (Optional[str]) –
gtype (pyvisfile.xdmf.GridType) –
ctype (Optional[pyvisfile.xdmf.CollectionType]) –
-
Topology¶
-
class
pyvisfile.xdmf.
TopologyType
(value)¶ Bases:
enum.IntEnum
Element and mesh layouts.
-
CoRectMesh2D
= 4354¶
-
CoRectMesh3D
= 4354¶
-
Edge_3
= 34¶
-
Hexahedron
= 9¶
-
Hexahedron_1000
= 57¶
-
Hexahedron_125
= 52¶
-
Hexahedron_1331
= 64¶
-
Hexahedron_20
= 48¶
-
Hexahedron_216
= 53¶
-
Hexahedron_24
= 49¶
-
Hexahedron_27
= 50¶
-
Hexahedron_343
= 54¶
-
Hexahedron_512
= 55¶
-
Hexahedron_64
= 51¶
-
Hexahedron_729
= 56¶
-
Hexahedron_Spectral_1000
= 71¶
-
Hexahedron_Spectral_125
= 66¶
-
Hexahedron_Spectral_1331
= 72¶
-
Hexahedron_Spectral_216
= 67¶
-
Hexahedron_Spectral_343
= 68¶
-
Hexahedron_Spectral_512
= 69¶
-
Hexahedron_Spectral_64
= 65¶
-
Hexahedron_Spectral_729
= 70¶
-
Mixed
= 112¶
-
NoTopology
= 0¶
-
Polygon
= 3¶
-
Polyhedron
= 16¶
-
Polyline
= 2¶
-
Polyvertex
= 1¶
-
Pyramid
= 7¶
-
Pyramid_13
= 39¶
-
Quadrilateral
= 5¶
-
Quadrilateral_8
= 37¶
-
RectMesh2D
= 4353¶
-
RectMesh3D
= 4353¶
-
SMesh2D
= 4368¶
-
SMesh3D
= 4368¶
-
Tetrahedron
= 6¶
-
Tetrahedron_10
= 38¶
-
Triangle
= 4¶
-
Triangle_6
= 36¶
-
Wedge
= 8¶
-
Wedge_15
= 40¶
-
Wedge_18
= 41¶
-
-
class
pyvisfile.xdmf.
Topology
(*, ttype, nodes_per_element=None, number_of_elements=None, dimensions=None, parent=None)¶ -
__init__
(*, ttype, nodes_per_element=None, number_of_elements=None, dimensions=None, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
ttype (pyvisfile.xdmf.TopologyType) –
nodes_per_element (Optional[int]) –
number_of_elements (Optional[int]) –
dimensions (Optional[Tuple[int, ..]]) –
-
Geometry¶
-
class
pyvisfile.xdmf.
GeometryType
(value)¶ Bases:
enum.Enum
Data layout of the node coordinates.
-
ORIGIN_DXDY
= 5¶
-
ORIGIN_DXDYDZ
= 6¶
-
VXVY
= 3¶
-
VXVYVZ
= 4¶
-
XY
= 1¶
-
XYZ
= 2¶
-
-
class
pyvisfile.xdmf.
Geometry
(*, name=None, gtype=<GeometryType.XYZ: 2>, parent=None)¶ -
__init__
(*, name=None, gtype=<GeometryType.XYZ: 2>, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
name (Optional[str]) –
gtype (pyvisfile.xdmf.GeometryType) –
-
Attribute¶
-
class
pyvisfile.xdmf.
AttributeType
(value)¶ Bases:
enum.Enum
Rank of the attribute stored on the mesh.
-
GlobalId
= 205¶
-
Matrix
= 203¶
-
Scalar
= 200¶
-
Tensor
= 202¶
-
Tensor6
= 204¶
-
Vector
= 201¶
-
-
class
pyvisfile.xdmf.
AttributeCenter
(value)¶ Bases:
enum.Enum
Center of the attribute stored on the mesh.
-
Cell
= 101¶
-
Edge
= 103¶
-
Face
= 102¶
-
Grid
= 100¶
-
Node
= 104¶
-
Other
= 105¶
-
-
class
pyvisfile.xdmf.
Attribute
(*, name=None, atype=<AttributeType.Scalar: 200>, acenter=<AttributeCenter.Node: 104>, parent=None)¶ -
__init__
(*, name=None, atype=<AttributeType.Scalar: 200>, acenter=<AttributeCenter.Node: 104>, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
name (Optional[str]) –
atype (pyvisfile.xdmf.AttributeType) –
acenter (pyvisfile.xdmf.AttributeCenter) –
-
Time¶
-
class
pyvisfile.xdmf.
TimeType
(value)¶ Bases:
enum.Enum
Temporal information of the current grid.
-
HyperSlab
= 2¶
-
List
= 3¶
-
Range
= 4¶
-
Single
= 1¶
-
-
class
pyvisfile.xdmf.
Time
(*, value, parent=None)¶ -
__init__
(*, value, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
value (str) –
-
Information¶
-
class
pyvisfile.xdmf.
Information
(*, name, value, parent=None)¶ -
__init__
(*, name, value, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
name (str) –
value (str) –
-
XInclude¶
-
class
pyvisfile.xdmf.
XInclude
(*, href, xpointer=None, parent=None)¶ -
__init__
(*, href, xpointer=None, parent=None)¶ - Parameters
parent (Optional[xml.etree.ElementTree.Element]) – if provided, self is appended to the element.
xpointer (Optional[str]) – path inside the file represented by href.
href (Optional[str]) –
-
Writing¶
-
class
pyvisfile.xdmf.
DataArray
(components, *, name=None, acenter=None, atype=None)¶ An array represented as a list of
DataItem
s.-
__init__
(components, *, name=None, acenter=None, atype=None)¶ - Parameters
components (Tuple[pyvisfile.xdmf.DataItem, ..]) – a description of each component of an array.
name (Optional[str]) – name of the array. This name will be used if the array is added as an attribute, otherwise the names of the components are used.
acenter (Optional[pyvisfile.xdmf.AttributeCenter]) –
atype (Optional[pyvisfile.xdmf.AttributeType]) –
-
as_data_item
(*, parent=None)¶ Finalize the
DataArray
and constructDataItem
s to be written to a file.- Parameters
parent (Optional[xml.etree.ElementTree.Element]) –
- Return type
Tuple[pyvisfile.xdmf.DataItem, ..]
-
-
class
pyvisfile.xdmf.
NumpyDataArray
(ary, *, acenter=None, name=None)¶ -
__init__
(ary, *, acenter=None, name=None)¶ - Parameters
ary (numpy.ndarray) – if this is an
object
array, each entry is considered a different component and will consist of a separateDataItem
.ary –
acenter (Optional[pyvisfile.xdmf.AttributeCenter]) –
name (Optional[str]) –
-
-
class
pyvisfile.xdmf.
XdmfUnstructuredGrid
(points, connectivity, *, topology_type, name=None, geometry_type=None)¶