C Function Wrappers#
Python bindings for the TecIO C library.
Ctypes bindings for both the new SZL API (tec_*) and the classic PLT API
(tec*142), and a Python wrapper function for each C entry point. The TecIO library
often uses integers with special meanings (zone types, data types, data locations). The
same values are used both for writing and for SZL reading and writing. Enum classes with
descriptive names are defined in tecio._constants and imported here.
Notes
The ctypes bindings are defined conditionall if the symbol exists in the loaded TecIO shared object binary such that older versions not containing newer (often niche) functions such as
tecznefemixed142()do not cause the entire tecio Python package to fail to load.Only loading the available symbols also allows for the tecio Python package to be used without any TecIO shared object binary available as it is only needed for SZL read/write and PLT write. DAT read/write and PLT read have pure Python implementations and do not have external dependencies other than NumPy.
The load/bind/guard mechanism is defined in
tecio._utilsAfter binding, a one-line summary is emitted via
warnings(categoryTecioAvailabilityWarning) if anything is disabled and is available as data viaLIBRARY_LOAD_ERRORandUNAVAILABLE_FUNCTIONS.
tecio.libtecio provides the direct interface with the TecIO C
library functions. Each is wrapped in an equivalent Python function that
also handles conversion between Python data objects and C-compatible ones,
and back again for the read functions.
These are the basis of the tecio Python package; each reader and
writer class provides a higher-level interface built on top of them.
However, the Python wrapper functions here are kept in the public API to
allow calling the TecIO library directly, if desired.
Exceptions#
Exception for TecIO C library errors. |
|
Raised when calling a function whose C symbol is unavailable. |
|
Emitted once at import time if any C function could not be bound. |
- class tecio.libtecio.TecioError[source]#
Bases:
RuntimeErrorException for TecIO C library errors.
Bases:
TecioErrorRaised when calling a function whose C symbol is unavailable.
Either because no TecIO shared library could be located at all, or because the library that was found doesn’t export this particular symbol (typically an older Tecplot version, predating that entry point).
- class tecio.libtecio.TecioAvailabilityWarning[source]#
Bases:
UserWarningEmitted once at import time if any C function could not be bound.
SZL Read Functions#
See SZL Read Functions for full documentation.
Open an SZL file for reading. |
|
Close an SZL file reader handle and release its resources. |
|
Get the file type for an opened SZL file. |
|
Read the dataset title string. |
|
Query the number of variables in the dataset. |
|
Query the number of zones in the dataset. |
|
Get zone dimensions (ORDERED) or node/element counts (FE). |
|
Read the title for a zone. |
|
Query the zone type. |
|
Check whether a zone is enabled. |
|
Read the solution time for a zone. |
|
Get the strand ID for a zone. |
|
Check whether a zone's node-map uses 64-bit indices. |
|
Read a 64-bit node map for an FE zone. |
|
Read a 32-bit node map for an FE zone. |
|
Read a whole FE zone node map as one flat array. |
|
Get a variable name by index. |
|
Check whether a variable is enabled. |
|
Get the data type for a variable in a zone. |
|
Get the value location for a zone variable. |
|
Check whether a zone variable is passive. |
|
Get the shared zone index for a variable. |
|
Query the number of values for a zone variable. |
|
Read float32 values for a zone variable. |
|
Read float64 values for a zone variable. |
|
Read int32 values for a zone variable. |
|
Read int16 values for a zone variable. |
|
Read uint8 values for a zone variable. |
|
Get the number of dataset-level auxiliary data items. |
|
Read a dataset-level auxiliary data item. |
|
Get the number of auxiliary data items for a variable. |
|
Read a variable-level auxiliary data item. |
|
Get the number of auxiliary data items for a zone. |
|
Read a zone-level auxiliary data item. |
SZL Write Functions#
See SZL Write Functions for full documentation.
Open a writer handle for creating SZL files. |
|
Close a writer handle and finalise the output file. |
|
Flush written zone data to a temporary intermediate file. |
|
Create an ordered IJK zone for writing. |
|
Create a finite-element zone for writing. |
|
Set time/strand metadata for a zone. |
|
Write float64 values for a zone variable. |
|
Write float32 values for a zone variable. |
|
Write int32 values for a zone variable. |
|
Write int16 values for a zone variable. |
|
Write uint8 values for a zone variable. |
|
Write 32-bit node map entries for an FE zone. |
|
Write 64-bit node map entries for an FE zone. |
|
Write 32-bit face-neighbor connections for an FE zone. |
|
Write 64-bit face-neighbor connections for an FE zone. |
|
Add a dataset-level auxiliary data record. |
|
Add a variable-level auxiliary data record. |
|
Add a zone-level auxiliary data record. |
Classic API Functions#
See Classic API Functions for full documentation.
Initialise a Tecplot data file (classic API). |
|
Finalise and close the active Tecplot data file. |
|
Flush data to disk, optionally retaining zones in memory (SZL only). |
|
Get the file handle for the current output file. |
|
Set foreign byte order for output. |
|
Create a new zone in the active file (classic API). |
|
Create a polygonal or polyhedral zone (classic API). |
|
Create a FEMIXED zone (classic API). |
|
Write field data to the current zone (classic API). |
|
Write node connectivity for an FE zone (classic API). |
|
Write face-neighbor connections (classic API). |
|
Write face data for polygonal/polyhedral zones (classic API). |
|
Write boundary connections for poly zones (classic API). |
|
Add dataset-level auxiliary data (classic API). |
|
Add variable-level auxiliary data (classic API). |
|
Add zone-level auxiliary data (classic API). |
|
Write a user-defined data record (classic API). |