SZL Read Functions#
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. |
|
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. |
- tecio.libtecio.tec_file_reader_open(file_name)[source]#
Open an SZL file for reading.
- Parameters:
file_name (str) – Path to the
.szpltfile.- Returns:
Opaque file handle for subsequent TecIO calls.
- Raises:
TecioError – If the file cannot be opened.
- tecio.libtecio.tec_file_reader_close(handle)[source]#
Close an SZL file reader handle and release its resources.
- Parameters:
handle – File handle from
tec_file_reader_open().- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_file_get_type(handle)[source]#
Get the file type for an opened SZL file.
- Parameters:
handle (ctypes.c_void_p) – File handle from
tec_file_reader_open().- Returns:
FileTypeenum (FULL, GRID, or SOLUTION).- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_data_set_get_title(handle)[source]#
Read the dataset title string.
- Parameters:
handle (ctypes.c_void_p) – File handle.
- Returns:
UTF-8 decoded dataset title.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_data_set_get_num_vars(handle)[source]#
Query the number of variables in the dataset.
- Parameters:
handle (ctypes.c_void_p) – File handle.
- Returns:
Number of variables.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_data_set_get_num_zones(handle)[source]#
Query the number of zones in the dataset.
- Parameters:
handle (ctypes.c_void_p) – File handle.
- Returns:
Number of zones.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_get_ijk(handle, zone_index)[source]#
Get zone dimensions (ORDERED) or node/element counts (FE).
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
(I, J, K)for ORDERED zones, or(num_nodes, num_elements, 0)for FE zones.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_get_title(handle, zone_index)[source]#
Read the title for a zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
Zone title string.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_get_type(handle, zone_index)[source]#
Query the zone type.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
ZoneTypeenum value.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_is_enabled(handle, zone_index)[source]#
Check whether a zone is enabled.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
True if the zone is enabled.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_get_solution_time(handle, zone_index)[source]#
Read the solution time for a zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
Solution time (double precision).
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_get_strand_id(handle, zone_index)[source]#
Get the strand ID for a zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
Strand ID integer.
- Raises:
TecioError – On C library error.
- tecio.libtecio.is_64bit(handle, zone_index)[source]#
Check whether a zone’s node-map uses 64-bit indices.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
True if 64-bit, False if 32-bit.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_node_map_get_64(handle, zone_index, num_elements, nodes_per_cell)[source]#
Read a 64-bit node map for an FE zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
num_elements (int) – Number of elements to read.
nodes_per_cell (int) – Nodes per element.
- Returns:
Array of shape
(num_elements, nodes_per_cell)with dtype int64.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_node_map_get(handle, zone_index, num_elements, nodes_per_cell)[source]#
Read a 32-bit node map for an FE zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
num_elements (int) – Number of elements to read.
nodes_per_cell (int) – Nodes per element.
- Returns:
Array of shape
(num_elements, nodes_per_cell)with dtype int32.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_var_get_name(handle, var_index)[source]#
Get a variable name by index.
- Parameters:
handle (ctypes.c_void_p) – File handle.
var_index (int) – 1-based variable index.
- Returns:
Variable name string.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_var_is_enabled(handle, var_index)[source]#
Check whether a variable is enabled.
- Parameters:
handle (ctypes.c_void_p) – File handle.
var_index (int) – 1-based variable index.
- Returns:
True if the variable is enabled.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_type(handle, zone_index, var_index)[source]#
Get the data type for a variable in a zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
- Returns:
DataTypeenum value.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_value_location(handle, zone_index, var_index)[source]#
Get the value location for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
- Returns:
ValueLocationenum (NODAL or CELL_CENTERED).- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_is_passive(handle, zone_index, var_index)[source]#
Check whether a zone variable is passive.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
- Returns:
True if the variable is passive in this zone.
- Raises:
TecioError – On C library error.
Get the shared zone index for a variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
- Returns:
Shared zone index, or None if not shared.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_num_values(handle, zone_index, var_index)[source]#
Query the number of values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
- Returns:
Number of values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_float_values(handle, zone_index, var_index, start_index, num_values)[source]#
Read float32 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
start_index (int) – 1-based start position.
num_values (int) – Number of values to read.
- Returns:
NumPy float32 array of length num_values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_double_values(handle, zone_index, var_index, start_index, num_values)[source]#
Read float64 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
start_index (int) – 1-based start position.
num_values (int) – Number of values to read.
- Returns:
NumPy float64 array of length num_values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_int32_values(handle, zone_index, var_index, start_index, num_values)[source]#
Read int32 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
start_index (int) – 1-based start position.
num_values (int) – Number of values to read.
- Returns:
NumPy int32 array of length num_values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_int16_values(handle, zone_index, var_index, start_index, num_values)[source]#
Read int16 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
start_index (int) – 1-based start position.
num_values (int) – Number of values to read.
- Returns:
NumPy int16 array of length num_values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_get_uint8_values(handle, zone_index, var_index, start_index, num_values)[source]#
Read uint8 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
var_index (int) – 1-based variable index.
start_index (int) – 1-based start position.
num_values (int) – Number of values to read.
- Returns:
NumPy uint8 array of length num_values.
- Raises:
TecioError – On C library error.
Auxiliary Data#
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. |
- tecio.libtecio.tec_data_set_aux_data_get_num_items(handle)[source]#
Get the number of dataset-level auxiliary data items.
- Parameters:
handle (ctypes.c_void_p) – File handle.
- Returns:
Number of auxiliary data items.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_data_set_aux_data_get_item(handle, item_index)[source]#
Read a dataset-level auxiliary data item.
- Parameters:
handle (ctypes.c_void_p) – File handle.
item_index (int) – 1-based item index.
- Returns:
(name, value)string tuple.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_var_aux_data_get_num_items(handle, var_index)[source]#
Get the number of auxiliary data items for a variable.
- Parameters:
handle (ctypes.c_void_p) – File handle.
var_index (int) – 1-based variable index.
- Returns:
Number of auxiliary data items.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_var_aux_data_get_item(handle, var_index, item_index)[source]#
Read a variable-level auxiliary data item.
- Parameters:
handle (ctypes.c_void_p) – File handle.
var_index (int) – 1-based variable index.
item_index (int) – 1-based item index.
- Returns:
(name, value)string tuple.- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_aux_data_get_num_items(handle, zone_index)[source]#
Get the number of auxiliary data items for a zone.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
- Returns:
Number of auxiliary data items.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_aux_data_get_item(handle, zone_index, item_index)[source]#
Read a zone-level auxiliary data item.
- Parameters:
handle (ctypes.c_void_p) – File handle.
zone_index (int) – 1-based zone index.
item_index (int) – 1-based item index.
- Returns:
(name, value)string tuple.- Raises:
TecioError – On C library error.