Skip to content

Repository files navigation

TecIO C++17

Important

This is an unofficial derivative of TecIO. It is not an official Tecplot product and is not affiliated with or endorsed by Tecplot, Inc.

TecIO C++17 is a source-available C++17 library for writing Tecplot data files and reading SZL data. It provides the established C and Fortran APIs, serial and MPI library targets, CMake and xmake builds, and a serial Tecplot ASCII .dat writer.

The project is derived from the TecIO source vendored by SU2. Unlike the separately downloadable obfuscated TecIO source described by Tecplot, this repository keeps readable production sources and descriptive internal identifiers. It also removes the Boost runtime/build dependency in favor of genuine C++17 standard-library features and focused project-local utilities.

Highlights

  • C++17 production code with no Boost dependency.
  • Readable internal names; no numeric obfuscation placeholders in production sources.
  • CMake 3.16+ and xmake build entry points.
  • Static or shared serial library (tecio).
  • Optional MPI library (tecio_mpi) for partitioned SZL workflows.
  • C and Fortran public interfaces.
  • Binary PLT and SZL output, SZL input, and serial ASCII .dat output.
  • Optional OpenMP acceleration for selected serial compute kernels.
  • Examples and focused compatibility, ownership, platform, and format tests.

Format scope

Format Main support
SZL (.szplt) Modern serial/MPI writer surface and SZL reader API.
Classic PLT (.plt) Serial output through the retained legacy-compatible API.
ASCII (.dat) Serial modern writer; full files, ordered and conventional FE zones, nodal block data.

ASCII currently supports ORDERED, FELINESEG, FETRIANGLE, FEQUADRILATERAL, FETETRAHEDRON, and FEBRICK zones with float, double, Int32, Int16, or byte variables. It does not currently support the MPI target, the legacy TECINI142 route, polygon/polyhedron zones, cell-centered data, annotations, metadata, partitions, or writer flushes. Unsupported ASCII combinations fail explicitly.

Requirements

  • A C++17 compiler. The maintained baseline is Visual Studio 2019 or newer on Windows and a recent GCC, Clang, or Apple Clang on Unix-like systems.
  • CMake 3.16+ or xmake.
  • Optional: an MPI C++ development environment, OpenMP, and a Fortran compiler.

The normal serial build has no third-party library dependency.

Quick start with CMake

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

The default build creates the static tecio library, C++ examples, and szcombine. For Visual Studio and other multi-configuration generators, add --config Release to the build command.

Useful configurations:

# Shared serial library
cmake -S . -B build/shared -DBUILD_SHARED_LIBS=ON
cmake --build build/shared --config Release --target tecio --parallel

# MPI library
cmake -S . -B build/mpi -DTECIO_BUILD_MPI=ON
cmake --build build/mpi --config Release --target tecio_mpi --parallel

# Tests and ASCII example smoke tests
cmake -S . -B build/test -DTECIO_BUILD_TESTS=ON
cmake --build build/test --config Release --parallel
ctest --test-dir build/test -C Release --output-on-failure

Other options include TECIO_BUILD_EXAMPLES, TECIO_BUILD_FORTRAN_EXAMPLES, TECIO_BUILD_TOOLS, TECIO_ENABLE_OPENMP, TECIO_ENABLE_ASSERTS, TECIO_ENABLE_WARNINGS, TECIO_WARNINGS_AS_ERRORS, and TECIO_ENABLE_CLANG_TIDY.

Quick start with xmake

xmake f -m release -k static
xmake build tecio

Optional builds:

xmake f -m release -k shared
xmake build tecio

xmake f -m release -k static --mpi=y --cc=mpicc --cxx=mpicxx
xmake build tecio_mpi

xmake f -m release -k static --tests=y
xmake build ascii_writer_behavior
xmake run ascii_writer_behavior

On Windows, the xmake MPI configuration expects Intel MPI and a configured I_MPI_ROOT. Use xmake show -l targets to inspect enabled targets.

Output and downstream use

Building either library stages reusable files under dist/:

dist/
├── LICENSE
├── NOTICE.md
├── tecio_license_agreement.txt
├── include/                  Public C and Fortran headers
└── lib/                      Static/shared libraries
    └── cmake/Tecio/          CMake package files from a CMake build

Use the staged CMake package from another project:

find_package(Tecio 1.0 CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE Tecio::tecio)

Configure the consumer with -DCMAKE_PREFIX_PATH=/path/to/tecio/dist. For MPI, request component tecio_mpi and link Tecio::tecio_mpi.

For writer code, include TECIO.h, open a handle, create a zone, write each variable (and FE connectivity when applicable), then close the handle. Modern functions return zero on success and nonzero on failure. See the runnable examples in examples/ascii_ijk, examples/ascii_tet, and examples/ijkpartitioned.

The self-contained user guide includes complete ordered and finite-element writers, an SZL reader, a Fortran sample, MPI rules, Do/Don't checklists, and troubleshooting.

Repository layout

  • include/ — stable public headers plus non-distributed internal headers.
  • src/core/ — implementation shared by serial and MPI libraries.
  • src/serial/ — serial adapters, classic PLT, and ASCII output.
  • src/mpi/ — MPI communication, file I/O, and MPI adapters.
  • src/internal/ — narrow Windows/POSIX platform adapters.
  • examples/ — C++ and Fortran examples.
  • tests/ — focused behavior and compatibility verification.
  • doc/ — the end-user guide.

Only files staged in dist/include are supported downstream headers. Code in include/internal and src is an implementation detail.

Provenance, changes, and license

Original contributions owned by Ming NI are available under the scoped MIT License in LICENSE. That MIT grant applies only to original material for which Ming NI owns the copyright; it does not relicense inherited or derivative TecIO material.

TecIO-derived code and documentation remain governed by Tecplot's custom TecIO license agreement. The required copyright notice, upstream provenance, brief change summary, and publication checklist are in NOTICE.md. Read and retain all three files when distributing the combined work.

If you publish this derivative, Tecplot's agreement requires you to retain that agreement and copyright notice, provide end users with a brief summary of changes, and send Tecplot a copy of the modified source within 30 days after publication. Review both license files; this README is not a substitute for them or for legal advice.

Copyright © 1988-2016 Tecplot, Inc. All rights reserved worldwide.

About

An unofficial TecIO library fork and implement based on C++17

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages