tecio.cli.tecelretyp#
Retype finite-element zones whose cells are all stored as a larger cell type.
Most unstructured mesh multi-physics solvers support volume cells with degenerate edges
such that multiple cell types can be stored in the same block with square connectivity
arrays. However, if all cells are upcast when they are written to disk as FEBRICK
for all classical volume cells and FEQUADRILATERAL for surface cells, node indices
of upcast cells are repeated describe the smaller cells and incurring more
memory. Therefore, zones where all cells are upcast can be rewritten with the zone type
with the least required memory allocation and a compact node map. For example a solution
file containing tetrahedra volume cells and triangle surface cells can be written with
hexahedral and quadralateral cells respectively. tecelretyp finds such zones and
downcasts them as:
FEBRICKzones whose cells are all tetrahedra becomeFETETRAHEDRON.FEQUADRILATERALzones whose cells are all triangles becomeFETRIANGLE.
Detection does not assume a repeat convention (see tecio.classify_cells()), and
the handedness of each cell is kept. Node indices are not renumbered, so every variable,
nodal or cell-centered, is copied unchanged. Zones that share connectivity are retyped
together.
A zone that holds several cell shapes, such as tetrahedra with pyramids and prisms, has
no classic zone type to collapse to. With --femixed it is written as a FEMIXED
zone instead, with one section per shape (see tecio.split_cells_by_shape()). The
cells are then grouped by shape, so cell-centered variables are reordered to match.
FEMIXED zones need .szplt output. Every other zone is copied unchanged.
--dry-run lists what would change and ends with the estimated size of the
connectivity (the node maps, which are the part retyping changes) under each option,
including as polyhedral or polygonal zones, and with the commands that give each saving.
Poly output cannot be written by this tool and is only an estimate.
- Usage:
tecelretyp [-h] [-z LIST] [--femixed] [--dry-run] [--check]
[--drop-face-neighbors] [-o PATH] [-f] PATH
- Positional Arguments:
PATHPath to the input Tecplot file (
.szplt,.pltor.dat).
- Options:
-z LIST,--zones LISTComma-separated list of 0-based zone indices to consider (e.g.
-z 0,2). Other zones are copied unchanged. A group of zones sharing connectivity is only retyped if every zone in it is listed. If omitted, all zones are considered.--femixedWrite zones that hold several cell shapes as
FEMIXEDzones. Needs.szpltoutput, which is then the default for the output name. Face-neighbor data is discarded, as for any.szpltoutput.--dry-runPrint what would change, the estimated sizes and suggested commands, and write nothing.
--checkLike
--dry-run, and exit with status1if any zone could be retyped (and0if none could), for use in scripts. Errors exit with status2.--drop-face-neighborsRetype zones that have face-neighbor data, discarding that data. Face numbers depend on the cell type, so the data cannot be carried over, and without this flag such zones are left as they are. Ignored for
.szpltoutput, which does not store face-neighbor data.-o PATH,--output PATHOutput file path. The extension controls the output format:
.szplt,.pltor.dat. Defaults to<stem>_retyped<ext>in the same directory as the input file.-f,--forceOverwrite the output file if it already exists.
- Returns:
A new Tecplot file with the retypable zones rewritten, all other zones unchanged. If no zone can be retyped, no file is written. Exit code
0on success and1if the input cannot be read, a zone index is out of range, the output exists without--force,--femixedis given with.pltor.datoutput, or writing fails (2for errors under--check).
Examples
See what could be retyped, and how much it would save, without writing anything:
$ tecelretyp --dry-run flow.plt
Retype and write to a new file:
$ tecelretyp flow.plt -o flow_compact.plt
Retype and convert to SZL in one step:
$ tecelretyp flow.plt -o flow_compact.szplt
Also write zones of mixed cell shapes as FEMIXED:
$ tecelretyp --femixed flow.plt -o flow_compact.szplt
Fail a pipeline if a file still holds upcast cells:
$ tecelretyp --check flow.plt
Call directly from a Python session:
from tecio.cli.tecelretyp import main as tecelretyp
tecelretyp(["flow.plt", "-o", "flow_compact.plt"])
See also
tecio.collapse_cells(), tecio.split_cells_by_shape() and
tecio.classify_cells() - The node map functions this tool is built on.
tecio.cli.teconvert - Convert between Tecplot file formats.
Functions
|
Retype finite-element zones that hold only smaller cells. |