Template Numerical Library
TNL is a collection of building blocks that facilitate the development of efficient numerical solvers and HPC algorithms. It is implemented in C++ using modern programming paradigms in order to provide a flexible and user-friendly interface such as the STL library, for example. TNL provides native support for modern hardware architectures such as multicore CPUs, GPUs, and distributed systems, which can be managed via a unified interface.
- Unified memory management for CPUs and GPUs with extended smart pointers.
- BLAS-like functions enclosed to templated vectors and expression templates for simple and efficient vector operations.
- Various types of parallel for loops for 1D, 2D and 3D ranges.
- Flexible parallel reduction and parallel scan for GPUs and multicore CPUs.
- Parallel sorting including inplace sorting with user defined swapping.
- Various types of matrices like dense, tridiagonal, multidiagonal and general sparse matrices based on number of different formats.
- Lambda matrices with matrix elements defined by C++ lambda functions.
- Segments – data abstraction of sparse matrix formats like CSR, Adaptive CSR, Ellpack, Sliced Ellpack, Chunked Ellpack, Bisection Ellpack.
- Linear solvers – CG, BiCGStab,GMRES, parallel CWYGMRES, TFQMR, Jacobi, SOR.
- Preconditioners of linear solvers – Jacobi, ILU0 (CPU only), ILUT (CPU only).
- ODE solvers – Euler (first order), Runge-Kutta-Merson (fourth order adaptive).
- Orthogonal numerical grids for efficient computation on structured orthogonal numerical grids, including staggered grids.
- Unstructured numerical meshes (including distributed) with import from FPMA, Netgen, VTU, VTK, XMLVTK, PVTU and PVTK.
- Image formats – DICOM (via DCMTK), JPEG (via libjpeg), PNG (via libpng), PGM.
Template Numerical Library is provided under the terms of the MIT License. To get the latest version of TNL, run the following command in your terminal:
git clone https://gitlab.com/tnl-project/tnl
Users of Arch Linux may install TNL from Arch Linux User Repository.
TNL is an open-source project and everyone using the library is encouraged to contribute their ideas and enhancements to the whole community. The TNL project has a broad scope and some areas are covered better than others. If you have a specific suggestion or a general question, please let us know in some of the following communication channels.
If you use TNL in your scientific projects, please cite the following papers in your publications:
- T. Oberhuber, J. Klinkovský, R. Fučík, TNL: Numerical library for modern parallel architectures, Acta Polytechnica 61.SI (2021), 122-134.
- J. Klinkovský, T. Oberhuber, R. Fučík, V. Žabka, Configurable open-source data structure for distributed conforming unstructured homogeneous meshes with GPU support, ACM Transactions on Mathematical Software, 2022, 48(3), 1-33.
Partners and sponsors
This project was supported by…
- Analysis of flow character and prediction of evolution in endovascular treated arteries by magnetic resonance imaging coupled with mathematical modeling, project no. NV19-08-00071 of Ministry of Health of the Czech Republic, 2019-2022.
- Research Center for Informatics, OPVVV project no. CZ.02.1.01/0.0/0.0/16_019/0000765 of Ministry of Education, Youth and Sports of the Czech Republic, 2018-2022.
- 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.
Code of Conduct
The TNL project welcomes and encourages participation by everyone. Therefore, we have adopted a code of conduct in order to create an open and welcoming environment for everyone, regardless of age, body size, disability, ethnicity, gender, level of experience, education, nationality, race, religion, or sexual identity and orientation. No matter how you identify yourself or how others perceive you, you are welcome in our community. For more details see…