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: bool = False)[source]

Bases: object

Parses a hexa binary/ASCII Tecplot 360 file. Writes an ASCII Tecplot 10 file.

Supports:
  • title

  • single zone only?

  • unstructured: - nodal results - single element type; ZONETYPE = [FETRIANGLE, FEQUADRILATERAL, FETETRAHEDRON, FEBRICK] - DATAPACKING = [POINT, ELEMENT] writing - 2D/3D - full support for writing

  • structured: - nodal results - F=POINT - 2d/3d (POINT, I/J/K) - full support for writing - no reshaping of xyz to make slicing easier!

Doesn’t support:
  • text

  • geometry

  • transient writing

  • centroidal results

  • non-sequential node ids

  • data lists (100*0.0)

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

doesn’t work…

property headers_dict
property hexa_elements
property nzones

gets the number of zones

property quad_elements
read_table(tecplot_file, unused_iblock, headers_dict, line)[source]

reads a space-separated tabular data block

read_tecplot(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(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(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.

show(n, types='ifs', endian=None)[source]
show_data(data, types='ifs', endian=None)[source]

Shows a data block as various types

Parameters
databytes

the binary string bytes

typesstr; 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)

endianstr; default=None -> auto determined somewhere else in the code

the big/little endian {>, <}

.. warning:: ‘s’ is apparently not Python 3 friendly
show_ndata(n, types='ifs')[source]
slice_x(xslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

slice_xyz(xslice, yslice, zslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

slice_y(yslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

slice_z(zslice)[source]

TODO: doesn’t remove unused nodes/renumber elements

property tet_elements
property tri_elements
write_tecplot(tecplot_filename, res_types=None, adjust_nids=True)[source]

Only handles single type writing

Parameters
tecplot_filenamestr

the path to the output file

res_typesstr; List[str, str, …]; default=None -> all

the results that will be written (must be consistent with self.variables)

adjust_nidsbool; default=True

element_ids are 0-based in binary and must be switched to 1-based in ASCII

property xy
property xyz
pyNastran.converters.tecplot.tecplot.get_next_line(lines, iline)[source]

Read the next line from the file. Handles comments.

pyNastran.converters.tecplot.tecplot.get_next_nsline(lines, iline, sline, nvars)[source]
pyNastran.converters.tecplot.tecplot.get_next_sline(lines, iline)[source]

Read the next split line from the file. Handles comments.

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

tests slicing

pyNastran.converters.tecplot.tecplot.read_block(lines, iline, xyz, results, zone_type, line, sline, nnodes, nvars, log)[source]

BLOCK format is similar to PLOT3D in that you read all the X values before the Ys, Zs, and results. The alternative format is POINT, which reads them on a per node basis.

pyNastran.converters.tecplot.tecplot.read_point(lines, iline, xyz, results, zone_type, line, sline, nnodes, nvars, log)[source]

a POINT grid is a structured grid

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

loads a tecplot file

pyNastran.converters.tecplot.tecplot.read_unstructured_elements(lines, iline, sline, elements, nelements)[source]
pyNastran.converters.tecplot.tecplot.read_zone_block(lines, iline, xyz, results, nresults, zone_type, sline, nnodes, log)[source]

a zone can be structured or unstructred

pyNastran.converters.tecplot.tecplot.split_headers(header_in)[source]
pyNastran.converters.tecplot.tecplot.split_line(line)[source]

splits a comma or space separated line

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.get_zone_tris_xyz(zone)[source]

gets the tris and associated xyz points

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, remove_degenerate_tris=True, log=None, debug=True)[source]

Converts a Tecplot file to Cart3d.

Parameters
remove_degenerate_trisbool; default=False

removes degenerate triangles (triangles with an area of 0.0)

pyNastran.converters.tecplot.tecplot_to_cart3d.tecplot_to_cart3d_filename(tecplot_filename, cart3d_filename, remove_degenerate_tris=True, log=None, 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.nastran_table_to_tecplot(bdf_model: pyNastran.bdf.bdf.BDF, case, variables: List[str]) → pyNastran.converters.tecplot.tecplot.Tecplot[source]

assumes only triangles

pyNastran.converters.tecplot.tecplot_to_nastran.nastran_tables_to_tecplot_filenames(tecplot_filename_base: str, bdf_model: pyNastran.bdf.bdf.BDF, case, variables: Optional[List[str]] = None, ivars: Optional[List[int]] = None) → None[source]
pyNastran.converters.tecplot.tecplot_to_nastran.tecplot_to_nastran(tecplot_filename: Union[str, Tecplot], bdf_filename: str, log: Optional[SimpleLogger] = None, debug: bool = True) → None[source]

Converts a Tecplot file to Nastran.

pyNastran.converters.tecplot.tecplot_to_nastran.tecplot_to_nastran_filename(tecplot_filename: Union[str, Tecplot], bdf_filename: str, log: Optional[SimpleLogger] = None, debug: bool = True) → BDF[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