SZL Write Functions#
Open a writer handle for creating SZL files. |
|
Close a writer handle and finalise the output 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. |
- tecio.libtecio.tec_file_writer_open(filename, variables, title='Untitled', file_type=FileType.FULL, use_szl=1, grid_file_handle=None)[source]#
Open a writer handle for creating SZL files.
- Parameters:
filename (str) – Output file path.
variables (Sequence[str]) – Variable name list.
title (str) – Dataset title.
file_type (FileType) – File type enum.
use_szl (int) – SZL flag (1 to use SZL format).
grid_file_handle (ctypes.c_void_p | None) – Optional handle to an existing grid file for solution-only output.
- Returns:
Opaque writer handle for subsequent write calls.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_file_writer_close(handle)[source]#
Close a writer handle and finalise the output file.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_create_ijk(handle, zone_title, imax, jmax, kmax, var_types, var_sharing=None, value_locations=None, pas_vars=None, face_nbr_sharing=0, num_face_cons=0, face_nbr_mode=FaceNeighborMode.LOCAL_ONE_TO_ONE)[source]#
Create an ordered IJK zone for writing.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone_title (str) – Zone title.
imax (int) – I dimension.
jmax (int) – J dimension.
kmax (int) – K dimension.
var_types (Sequence[DataType | int]) – Per-variable data types.
var_sharing (Sequence[int] | None) – Optional per-variable sharing source zones. Must be same length as var_types if provided. None/null means all no variable sharing.
value_locations (Sequence[int | ValueLocation] | None) – Optional per-variable data locations.
pas_vars (Sequence[bool | int] | None) – Optional per-variable passive flags or 1/True if passive else 0/False. Must be same length as var_types if provided. None/null means all variables are active.
face_nbr_sharing (int) – Optional face-neighbor sharing source zone.
num_face_cons (int) – Optional number of face connections.
face_nbr_mode (FaceNeighborMode | int) – Optional face-neighbor mode.
- Returns:
1-based zone index of the created zone.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_create_fe(handle, zone_title, zone_type, num_nodes, num_cells, var_types, var_sharing=None, value_locations=None, pas_vars=None, con_sharing=0, num_face_cons=0, face_nbr_mode=FaceNeighborMode.LOCAL_ONE_TO_ONE)[source]#
Create a finite-element zone for writing.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone_title (str) – Zone title.
zone_type (int | ZoneType) – FE zone type.
num_nodes (int) – Number of nodes.
num_cells (int) – Number of cells/elements.
var_types (Sequence[DataType | int]) – Optional per-variable data types.
var_sharing (Sequence[int] | None) – Optional per-variable sharing source zones. Must be same length as var_types if provided. None/null means all no variable sharing.
value_locations (Sequence[int | ValueLocation] | None) – Optional per-variable data locations.
pas_vars (Sequence[bool | int] | None) – Optional per-variable passive flags or 1/True if passive else 0/False. Must be same length as var_types if provided. None/null means all variables are active.
con_sharing (int) – Optional connectivity sharing source zone (0 = none). Connectivity and/or face neighbors cannot be shared when the face neighbor mode is set to Global. Connectivity cannot be shared between cell-based and face-based finite element zones.
num_face_cons (int) – Optional number of face connections.
face_nbr_mode (FaceNeighborMode | int) – Optional face-neighbor mode.
- Returns:
1-based zone index of the created zone.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_set_unsteady_options(handle, zone, strand=0, solution_time=0.0)[source]#
Set time/strand metadata for a zone.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
strand (int) – Strand ID.
solution_time (float) – Solution time.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_write_double_values(handle, zone, var, values)[source]#
Write float64 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
var (int) – 1-based variable index.
values (npt.ArrayLike) – Array of float64 values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_write_float_values(handle, zone, var, values)[source]#
Write float32 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
var (int) – 1-based variable index.
values (npt.ArrayLike) – Array of float32 values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_write_int32_values(handle, zone, var, values)[source]#
Write int32 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
var (int) – 1-based variable index.
values (npt.ArrayLike) – Array of int32 values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_write_int16_values(handle, zone, var, values)[source]#
Write int16 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
var (int) – 1-based variable index.
values (npt.ArrayLike) – Array of int16 values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_var_write_uint8_values(handle, zone, var, values)[source]#
Write uint8 values for a zone variable.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
var (int) – 1-based variable index.
values (npt.ArrayLike) – Array of uint8 values.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_node_map_write32(handle, zone, nodes, partition=0, is_one_based=True)[source]#
Write 32-bit node map entries for an FE zone.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
nodes (npt.ArrayLike) – Array of int32 node indices.
partition (int) – Partition index (0 for non-partitioned).
is_one_based (bool | int) – Whether indices are 1-based.
- Raises:
TecioError – On C library error.
Note
Use for zones with fewer than ~2 billion node map entries.
Note
Can be called multiple times per zone; total entries must match zone definition.
Note
Node indices are 1-based by convention in Tecplot.
- tecio.libtecio.tec_zone_node_map_write64(handle, zone, nodes, partition=0, is_one_based=True)[source]#
Write 64-bit node map entries for an FE zone.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
nodes (npt.ArrayLike) – Array of int64 node indices.
partition (int) – Partition index (0 for non-partitioned).
is_one_based (bool | int) – Whether indices are 1-based.
- Raises:
TecioError – On C library error.
Note
Use for zones with fewer than ~2 billion node map entries.
Note
Can be called multiple times per zone; total entries must match zone definition.
Note
Node indices are 1-based by convention in Tecplot.
- tecio.libtecio.tec_zone_face_nbr_write_connections32(handle, zone, face_neighbors)[source]#
Write 32-bit face-neighbor connections for an FE zone.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
face_neighbors (npt.ArrayLike) – Array of int32 face-neighbor indices.
- Raises:
TecioError – On C library error.
Note
num_face_consandface_nbr_modemust be set when creating the zone viatec_zone_create_ijk()ortec_zone_create_fe().Note
Use for zones with fewer than ~2 billion face neighbor entries.
Note
Can be called multiple times. Total entries must match num_face_cons declared at zone creation.
Note
Face neighbors have expensive performance implications. Use face neighbors only to manually specify connections that are not defined via the connectivity list.
- tecio.libtecio.tec_zone_face_nbr_write_connections64(handle, zone, face_neighbors)[source]#
Write 64-bit face-neighbor connections for an FE zone.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone (int) – 1-based zone index.
face_neighbors (npt.ArrayLike) – Array of int64 face-neighbor indices.
- Raises:
TecioError – On C library error.
Note
num_face_consandface_nbr_modemust be set when creating the zone viatec_zone_create_ijk()ortec_zone_create_fe().Note
Use for zones with more than ~2 billion face neighbor entries.
Note
Can be called multiple times. Total entries must match num_face_cons declared at zone creation.
Note
Face neighbors have expensive performance implications. Use face neighbors only to manually specify connections that are not defined via the connectivity list.
Auxiliary Data#
Add a dataset-level auxiliary data record. |
|
Add a variable-level auxiliary data record. |
|
Add a zone-level auxiliary data record. |
- tecio.libtecio.tec_data_set_add_aux_data(handle, name, value)[source]#
Add a dataset-level auxiliary data record.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
name (str) – Auxiliary data name.
value (str) – Auxiliary data value.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_var_add_aux_data(handle, var_index, name, value)[source]#
Add a variable-level auxiliary data record.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
var_index (int) – 1-based variable index.
name (str) – Auxiliary data name.
value (str) – Auxiliary data value.
- Raises:
TecioError – On C library error.
- tecio.libtecio.tec_zone_add_aux_data(handle, zone_index, name, value)[source]#
Add a zone-level auxiliary data record.
- Parameters:
handle (ctypes.c_void_p) – Writer handle.
zone_index (int) – 1-based zone index.
name (str) – Auxiliary data name.
value (str) – Auxiliary data value.
- Raises:
TecioError – On C library error.