tecplot Package¶
tecplot
Module¶
-
class
pyNastran.converters.tecplot.tecplot.
Tecplot
(log=None, debug=False)[source]¶ Bases:
object
Parses a hexa binary/ASCII Tecplot 360 file. Writes an ASCII Tecplot 10 file (no transient support).
-
nelements
¶ gets the number of elements in the model
-
nnodes
¶ gets the number of nodes in the model
-
read_header_lines
(self, tecplot_file, line)[source]¶ reads a tecplot header
Examples
Example 1
TITLE = “tecplot geometry and solution file” VARIABLES = “x” “y” “z” “rho” “u” “v” “w” “p” ZONE T=”“processor 1”” n=522437, e=1000503, ZONETYPE=FEBrick DATAPACKING=BLOCK
Example 2
title=”Force and Momment Data for forces” variables=”Iteration” “C_L”,”C_D”,”C_M_x”,”C_M_y”,”C_M_z”“C_x”,”C_y”,”C_z”,”C_Lp”,”C_Dp”, “C_Lv”, “C_Dv”“C_M_xp” “C_M_yp”,”C_M_zp”,”C_M_xv”,”C_M_yv”“C_M_zv”,”C_xp”,”C_yp”,”C_zp”,”C_xv”,”C_yv”“C_zv “Mass flow”,”<greek>r</greek>”,”u” “p/p<sub>0</sub>”,”T”,”p<sub>t</sub>/p<sub>0</sub>” “T<sub>t</sub>”,”Mach” “Simulation Time” zone,t=”forces”
-
read_table
(self, tecplot_file, unused_iblock, headers_dict, line)[source]¶ reads a space-separated tabular data block
-
read_tecplot
(self, tecplot_filename)[source]¶ Reads an ASCII/binary Tecplot file.
The binary file reader must have ONLY CHEXAs and be Tecplot 360 with rho, u, v, w, and p. The ASCII file reader has only been tested with Tecplot 10, but will probably work on Tecplot360. It should work with any set of variables.
-
read_tecplot_ascii
(self, tecplot_filename, nnodes=None, nelements=None)[source]¶ Reads a Tecplot ASCII file.
- Supports:
- CTRIA3
- CQUAD4
- CTETRA
- CHEXA
Note
assumes single typed results
Warning
BLOCK option doesn’t work if line length isn’t the same…
-
read_tecplot_binary
(self, tecplot_filename, nnodes=None, nelements=None)[source]¶ The binary file reader must have ONLY CHEXAs and be Tecplot 360 with: rho, u, v, w, and p.
-
result_names
¶ gets the variables
-
show_data
(self, data, types='ifs', endian=None)[source]¶ Shows a data block as various types
Parameters: - data : bytes
the binary string bytes
- types : str; default=’ifs’
i - int f - float s - string d - double (float64; 8 bytes) q - long long (int64; 8 bytes)
l - long (int; 4 bytes) I - unsigned int (int; 4 bytes) L - unsigned long (int; 4 bytes) Q - unsigned long long (int; 8 bytes)
- endian : str; default=None -> auto determined somewhere else in the code
the big/little endian {>, <}
- .. warning:: ‘s’ is apparently not Python 3 friendly
-
slice_xyz
(self, xslice, yslice, zslice)[source]¶ TODO: doesn’t remove unused nodes/renumber elements
-
write_tecplot
(self, tecplot_filename, res_types=None, is_points=True, adjust_nids=True)[source]¶ Only handles single type writing
Parameters: - tecplot_filename : str
the path to the output file
- res_types : str; List[str, str, …]; default=None -> all
the results that will be written (must be consistent with self.variables)
- is_points : bool; default=True
write in POINT format vs. BLOCK format
- adjust_nids : bool; default=True
element_ids are 0-based in binary and must be switched to 1-based in ASCII
-
tecplot_to_cart3d
Module¶
- Defines:
- tecplot_to_cart3d_filename(tecplot_filename, cart3d_filename, debug=True)
- tecplot_to_cart3d(tecplot_filename, cart3d_filename=None, debug=True)
tecplot_to_nastran
Module¶
- Defines:
- tecplot_to_nastran(tecplot_filename, bdf_filename, debug=True)
- tecplot_to_nastran(tecplot_filename, bdf_filename, debug=True)