SZL Read Functions#

tec_file_reader_open

Open an SZL file for reading.

tec_file_reader_close

Close an SZL file reader handle and release its resources.

tec_file_get_type

Get the file type for an opened SZL file.

tec_data_set_get_title

Read the dataset title string.

tec_data_set_get_num_vars

Query the number of variables in the dataset.

tec_data_set_get_num_zones

Query the number of zones in the dataset.

tec_zone_get_ijk

Get zone dimensions (ORDERED) or node/element counts (FE).

tec_zone_get_title

Read the title for a zone.

tec_zone_get_type

Query the zone type.

tec_zone_is_enabled

Check whether a zone is enabled.

tec_zone_get_solution_time

Read the solution time for a zone.

tec_zone_get_strand_id

Get the strand ID for a zone.

is_64bit

Check whether a zone's node-map uses 64-bit indices.

tec_zone_node_map_get_64

Read a 64-bit node map for an FE zone.

tec_zone_node_map_get

Read a 32-bit node map for an FE zone.

tec_var_get_name

Get a variable name by index.

tec_var_is_enabled

Check whether a variable is enabled.

tec_zone_var_get_type

Get the data type for a variable in a zone.

tec_zone_var_get_value_location

Get the value location for a zone variable.

tec_zone_var_is_passive

Check whether a zone variable is passive.

tec_zone_var_get_shared_zone

Get the shared zone index for a variable.

tec_zone_var_get_num_values

Query the number of values for a zone variable.

tec_zone_var_get_float_values

Read float32 values for a zone variable.

tec_zone_var_get_double_values

Read float64 values for a zone variable.

tec_zone_var_get_int32_values

Read int32 values for a zone variable.

tec_zone_var_get_int16_values

Read int16 values for a zone variable.

tec_zone_var_get_uint8_values

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 .szplt file.

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:

FileType enum (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:

ZoneType enum 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:

DataType enum 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:

ValueLocation enum (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.

tecio.libtecio.tec_zone_var_get_shared_zone(handle, zone_index, var_index)[source]#

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#

tec_data_set_aux_data_get_num_items

Get the number of dataset-level auxiliary data items.

tec_data_set_aux_data_get_item

Read a dataset-level auxiliary data item.

tec_var_aux_data_get_num_items

Get the number of auxiliary data items for a variable.

tec_var_aux_data_get_item

Read a variable-level auxiliary data item.

tec_zone_aux_data_get_num_items

Get the number of auxiliary data items for a zone.

tec_zone_aux_data_get_item

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.