TNL aims to be STL for HPC

Numerical libraries are often designed in pure C or Fortran, languages which are limited in offering flexible and user friendly interface. TNL is based on template programming  resulting in flexible code design.

Many numerical libraries do not support modern hardware architectures like multicore CPUs, GPUs and distributed systems. TNL supports modern hardware architectures in number of data structures and algorithms with unified interface.

A lot of numerical libraries implement only a couple of specific numerical methods. Combining different libraries with the aim of solving a single problem can be tedious . TNL aims to be a general collection of data structures  (like sparse matrices and unstructured meshes) and solvers to make the development of numerical solvers easier.

We have done:

  • BLAS-like functions enclosed to templated vectors and expression templates for simple and efficient vector operations
  • Flexible parallel reduction for GPUs and multicore CPUs
  • Matrix formats - dense, diagonal, tridiagonal, multidiagonal, COO (CPU only), CSR, Ellpack, Sliced Ellpack
  • SolversCG, BiCGStab,GMRES, parallel CWYGMRES, TFQMR, Jacobi, SOR (CPU only)
  • PreconditionersJacobi, ILU0 (CPU only), ILUT( CPU only)
  • Runge-Kutta solvers - Euler (first order), Runge-Kutta-Merson (fourth order adaptive)
  • Orthogonal numerical grids and unstructured numerical meshes
  • Image formats - DICOM (via DCMTK), JPEG (via libjpeg), PNG (via libpng), PGM
  • Framework for rapid development of PDE solvers
  • Finite Difference Method

    • Heat equation
    • Transport equation -  Lax-Friedrichs, first order, upwind
    • Euler and Navier-Stokes problems - Lax-Friedrichs, Stegger-Warming, van Leer
    • Hamilton-Jacobi equations - Fast sweeping method, Fast iterative method

We're currently working on:

  • Documentation
  • Lattice-Boltzmann method
  • Adaptive orthogonal numerical grids
  • Computations on clusters (including GPU clusters)
  • Additional matrix formats
  • Expression templates
  • Higher-precision arithmetic
  • API for Python

We plan to do ...

TNL is not a library of one or a few numerical methods. We are interested in implementing new methods and data structures which may profit from templated design and support of modern hardware. If you feel it the same way you are very welcome to ...

Join us


To try out the latest stable version of TNL, just copy-paste the following lines to your Unix terminal:

tar xvf tnl-0.1.tar.bz2
cd tnl-0.1

Or  download the very latest version with the newest features on:

TNL Gitlab

Get in touch

For TNL users and developers, there is a forum.

TNL users forum

If you have questions or would like to join our team please do not hesitate to get in touch.


This project was supported by


Large structures in boundary layers over complex surfaces under high Reynolds numbers, project no. 18-09539S of the Czech Science Foundation, 2017-2019.

Quantitative Mapping of Myocard and of Flow Dynamics by Means of MR Imaging for Patients with Nonischemic Cardiomyopathy - Development of Methodology, project No. 15-27178A of Ministry of Health of the Czech Republic, 2015-2018.