Read and Write TEC Files

**TEC_IO**
is a MATLAB library which
can read or write
a TEC graphics file containing a finite element model.

There are several kinds of TEC files; the routines given here can only
handle the case where a single **ZONE** record is used to define finite
element data, using a **DATAPACKING** value of "POINT" (not "BLOCK"),
and a ZONETYPE of

- FETRIANGLE
- FEQUADRILATERAL
- FETETRAHEDRON
- FEBRICK

The data to be written or read is assumed to have a logical organization into three groups:

- Node coordinate data;
- Element definitions, that is, the sequence of node indices that define each element;
- Node data, such as finite element coefficients for pressure, velocity, and so on.

The TECPLOT home page contains a description of the
**TECPLOT** program.

The computer code and data files described and made available on this web page are distributed under the GNU LGPL license.

**TEC_IO** is available in
a FORTRAN90 version and
a MATLAB version.

FEM_50, a MATLAB program which implements a finite element solver in just 50 lines of code.

FEM_50_HEAT, a MATLAB program which is a modified version of FEM_50 suitable for solving the heat equation.

FEM_IO, a MATLAB library which reads or writes an FEM model.

FEM_TO_TEC, a MATLAB program which reads the three files defining an FEM model and writes an equivalent TEC file.

FEM2D, a data directory which contains examples of 2D FEM files, text files that describe a 2D finite element geometry and associated nodal values;

FEM2D_PACK, a MATLAB library which is useful for finite element calculations.

FEM2D_POISSON, a MATLAB program which solves Poisson's equation on a square, using the finite element method.

HOT_PIPE, a MATLAB library which can be run with FEM_50_HEAT.

HOT_POINT,
a MATLAB library which
can be run with **FEM_50_HEAT**.

TEC,
a data directory which
contains a description and examples
of the **TEC** graphics files used by **TECPLOT**

TEC_TO_FEM, a MATLAB program which reads a TEC file and writes a set of three files defining the equivalent FEM model.

- ch_cap.m capitalizes a character.
- ch_eqi.m is TRUE if two characters are equal, ignoring case.
- ch_is_alpha.m is TRUE if a character is alphabetic.
- file_name_inc.m "increments" a file name.
- i4mat_transpose_print_some.m prints an I4MAT, transposed.
- i4mat_transpose_print_some.m prints some of an I4MAT, transposed.
- r8mat_transpose_print.m prints an R8MAT, transposed.
- r8mat_transpose_print_some.m prints some of an R8MAT, transposed.
- s_adjustl.m shifts a string to the left, removing initial blanks.
- s_alpha_last.m finds the last alphabetic character in a string.
- s_begin.m is TRUE if two strings match up to the end of the shorter one, ignoring spaces and capitalization.
- s_behead_substring.m beheads a substring from the beginning of a string, if it occurs there.
- s_eqi.m returns "TRUE" if two strings are equal, ignoring case.
- s_inc.m "increments" a string.
- s_len_trim.m returns the length of a string to the last nonblank.
- s_replace_ch.m replaces all occurrences of one character by another character.
- s_to_i4.m converts a string to an I4.
- s_word_count.m counts the number of words in a string.
- s_word_extract.m extracts the first word from a string.
- tec_read.m reads the information from a TEC file.
- tec_variable_line_parse.m parses the "variables" line of a TEC file.
- tec_write.m writes information to a TEC file.
- tec_zone_line_parse.m parses the "zone" line of a TEC file.
- timestamp.m prints the current YMDHMS date as a timestamp.

- tec_io_test.m runs the tests.
- tec_io_test01.m tests TEC_READ by reading "ell.dat";
- tec_io_test02.m tests TEC_WRITE by writing "tiny.dat";
- tec_io_test_output.txt printed output from the tests.
- ell.dat, a TECPLOT ASCII file read by the test program;
- tiny.dat, a TECPLOT ASCII file created by the test program;

You can go up one level to the MATLAB source codes.