tecplot Package

tecplot Module

Inheritance diagram of pyNastran.converters.tecplot.tecplot
models from:
http://people.sc.fsu.edu/~jburkardt/data/tec/tec.html
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).

extract_y_slice(self, y0, tol=0.01, slice_filename=None)[source]

doesn’t work…

get_free_faces(self)[source]

get the free faces for hexa elements

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(self, n, types='ifs', endian=None)[source]
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
show_ndata(self, n, types='ifs')[source]
skin_elements(self)[source]
slice_x(self, xslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

slice_xyz(self, xslice, yslice, zslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

slice_y(self, yslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

slice_z(self, 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

pyNastran.converters.tecplot.tecplot.main()[source]
pyNastran.converters.tecplot.tecplot.main2()[source]

tests slicing

pyNastran.converters.tecplot.tecplot.read_tecplot(tecplot_filename, use_cols=None, dtype=None, log=None, debug=False)[source]

loads a tecplot file

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)
pyNastran.converters.tecplot.tecplot_to_cart3d.main()[source]

runs the test problem

pyNastran.converters.tecplot.tecplot_to_cart3d.tecplot_to_cart3d(tecplot_filename, cart3d_filename=None, debug=True)[source]

Converts a Tecplot file to Cart3d.

It’s assumed that quads are actually degenerate triangles

pyNastran.converters.tecplot.tecplot_to_cart3d.tecplot_to_cart3d_filename(tecplot_filename, cart3d_filename, debug=True)[source]

Converts a Tecplot file to Cart3d.

tecplot_to_nastran Module

Defines:
  • tecplot_to_nastran(tecplot_filename, bdf_filename, debug=True)
  • tecplot_to_nastran(tecplot_filename, bdf_filename, debug=True)
pyNastran.converters.tecplot.tecplot_to_nastran.tecplot_to_nastran(tecplot_filename, bdf_filename, log=None, debug=True)[source]

Converts a Tecplot file to Nastran.

pyNastran.converters.tecplot.tecplot_to_nastran.tecplot_to_nastran_filename(tecplot_filename, bdf_filename, log=None, debug=True)[source]

Converts a Tecplot file to Nastran.

utils Module

pyNastran.converters.tecplot.utils.merge_tecplot_files(tecplot_filenames, tecplot_filename_out=None, log=None)[source]

merges one or more tecplot files

utils Module

pyNastran.converters.tecplot.utils.merge_tecplot_files(tecplot_filenames, tecplot_filename_out=None, log=None)[source]

merges one or more tecplot files