tecio.cli.tecfix

tecio.cli.tecfix#

Rewrite a Tecplot data file with invalid variable arrays set to passive.

Numerical solvers occasionally produce output containing NaN or Inf values, whether due to localised solver divergence, incomplete initialisation, or variables that are formally undefined in certain zones. These invalid values propagate silently through post-processing pipelines and can cause unexpected behaviour in Tecplot and downstream tools. tecfix addresses this by scanning every variable array in a file and rewriting any array containing invalid values as passive, recording the affected variable names in zone-level auxiliary data for traceability. A dry-run mode is available to produce a diagnostic report without writing any output, making the tool useful as a validation step before committing to a fix.

Usage:

tecfix [-h] [-o PATH] [-f] [--dry-run] PATH
Positional Arguments:
filename

Path to the input Tecplot binary file (.plt or .szplt) to inspect and fix.

Options:
-o PATH, --output PATH

Output file path. Defaults to <stem>_fixed<ext> in the same directory as the input file.

-f, --force

Overwrite the output file if it already exists. Without this flag the command exits with an error rather than silently clobbering an existing file.

--dry-run

Scan all variable arrays for invalid values and print a report without writing any output file. Useful for diagnosing whether a file requires fixing before modifying it.

Returns:

A new Tecplot file written to the output path with all invalid variable arrays set to passive. Affected variables are recorded in zone-level auxiliary data. If --dry-run is set, output is written to standard output only and no file is produced. Exit code is 0 on success and non-zero if the input file cannot be read or the output file already exists and --force is not set.

Examples

Fix a file with the default output naming:

$ tecfix flow.szplt

Write the fixed file to an explicit path:

$ tecfix flow.szplt --output clean.szplt

Overwrite an existing fixed file:

$ tecfix --force flow.szplt

Report bad variables without writing any output:

$ tecfix --dry-run flow.szplt

Call directly from a Python session:

import tecio.cli.tecfix.main as tecfix

tecfix(["flow.szplt", "--output", "clean.szplt"])

See also

  • tecio.cli.tecdump: Inspect file contents and metadata to identify zones or variables that may require fixing.

  • tecio.cli.tecstats: Compute per-zone min, max, and mean statistics without printing raw values.

Note

Only floating-point variables (FLOAT and DOUBLE) are inspected; integer variables cannot represent NaN / Inf and are always copied as-is.

Note

Variables that are already passive or shared in the source file are forwarded unchanged (they remain passive / shared).

Note

If a zone has no bad variables its aux data is not modified beyond what was already present in the source file.

Note

The output format matches the input format (extension is preserved).

Functions

main([argv])

Inspect and fix a Tecplot file.