tecio.TecplotWriter#

class tecio.TecplotWriter(path, title, variables, file_type)#

Bases: ABC

Shared interface and lifecycle for all Tecplot file writers.

Concrete subclasses (TecplotSzlWriter, …) differ in how a file is actually opened, closed, and written to, but share the same aux-data buffering, variable-list handling, and context-manager lifecycle, so application code can be written against this base without caring which format is being produced.

Parameters:
  • path – Output file path.

  • title – Dataset title.

  • variables – Variable name list. None defers file creation until the first zone-writing call (lazy open).

  • file_type – File type enum (FULL, GRID, or SOLUTION).

path#

Output file path.

title#

Dataset title string.

variables#

Variable name list, or None if the file has not been opened yet.

file_type#

File type (FULL, GRID, or SOLUTION).

current_zone#

0-based index of the most recently written zone. -1 before any zone has been written; updated only after a zone-writing method successfully completes.

auxdataset#

Buffered dataset-level auxiliary data, flushed before the first zone.

auxvar#

Buffered variable-level auxiliary data, flushed before the first zone.

Attributes

meta

Read-only record of everything written to this file so far.

Methods

add_auxdataset_dict(auxdict)

Buffer dataset-level auxiliary data from a dictionary.

add_auxvar_dict(auxdict)

Buffer variable-level auxiliary data from a dictionary.

close()

Finalize and close the file.

flush_aux()

Write buffered dataset- and variable-level aux data to the file.

write_fe_zone(data, zone_type, *[, ...])

Write a complete finite-element zone.

write_femixed_zone(data[, cell_shapes, ...])

Write a complete FEMIXED zone.

write_ordered_zone(data, *[, title, ...])

Write a complete structured zone.

write_poly_zone(data, zone_type, *[, ...])

Write a complete FEPOLYGON or FEPOLYHEDRON zone.

add_auxdataset_dict(auxdict)[source]#

Buffer dataset-level auxiliary data from a dictionary.

add_auxvar_dict(auxdict)[source]#

Buffer variable-level auxiliary data from a dictionary.

abstractmethod close()[source]#

Finalize and close the file. Safe to call more than once.

flush_aux()[source]#

Write buffered dataset- and variable-level aux data to the file.

Called automatically before the first zone is written. Only needed directly if you want to flush explicitly, e.g. before checking meta.

property meta#

Read-only record of everything written to this file so far.

abstractmethod write_fe_zone(data, zone_type, *, node_map=None, title=None, variables=None, value_locations=None, passive_vars=None, var_sharing=None, con_sharing=None, face_neighbors=None, face_neighbor_mode=None, solution_time=0.0, strand_id=0, aux=None)[source]#

Write a complete finite-element zone.

abstractmethod write_femixed_zone(data, cell_shapes=None, node_maps=None, *, title=None, variables=None, value_locations=None, passive_vars=None, var_sharing=None, con_sharing=None, solution_time=0.0, strand_id=0, aux=None, datapacking=DataPacking.BLOCK)[source]#

Write a complete FEMIXED zone.

abstractmethod write_ordered_zone(data, *, title=None, variables=None, value_locations=None, passive_vars=None, var_sharing=None, solution_time=0.0, strand_id=0, aux=None, datapacking=DataPacking.BLOCK)[source]#

Write a complete structured zone.

abstractmethod write_poly_zone(data, zone_type, *, face_nodes=None, face_node_counts=None, face_left_elements=None, face_right_elements=None, boundary_connection_counts=None, boundary_connection_elements=None, boundary_connection_zones=None, title=None, variables=None, value_locations=None, passive_vars=None, var_sharing=None, con_sharing=None, solution_time=0.0, strand_id=0, aux=None, datapacking=DataPacking.BLOCK)[source]#

Write a complete FEPOLYGON or FEPOLYHEDRON zone.