TNL is a collection of building blocks that facilitate the development of efficient numerical solvers. It is implemented in C++ using modern programming paradigms in order to provide flexible and user friendly interface. TNL provides native support for modern hardware architectures such as multicore CPUs, GPUs, and distributed systems, which can be managed via a unified interface.
Similarly to the STL, features provided by the TNL can be grouped into several modules:
- Core concepts. The main concepts used in TNL are the memory space, which represents the part of memory where given data is allocated, and the execution model, which represents the way how given (typically parallel) algorithm is executed. For example, data can be allocated in the main system memory, in the GPU memory, or using the CUDA Unified Memory which can be accessed from the host as well as from the GPU. On the other hand, algorithms can be executed using either the host CPU or an accelerator (GPU), and for each there are many ways to manage parallel execution. The usage of memory spaces is abstracted with allocators and the execution model is represented by devices. See the Core concepts page for details.
- Containers. TNL provides generic containers such as array, multidimensional array or array views, which abstract data management and execution of common operations on different hardware architectures.
- Linear algebra.
TNL provides generic data structures and algorithms for linear algebra, such
as vectors, sparse matrices,
Krylov solvers and preconditioners.
- Sparse matrix formats: CSR, Ellpack, Sliced Ellpack, Chunked Ellpack, Bisection Ellpack,
- tridiagonal, multidiagonal
- Lambda matrices (matrix elements are defined by C++ lambda functions)
- Stationary solvers: Jacobi, SOR
- Krylov solvers: CG, BiCGStab, BICGStab(l), GMRES, CWYGMRES, TFQMR
- Preconditioners: Jacobi, ILU(0) (CPU only), ILUT (CPU only)
- Meshes. TNL provides data structures for the representation of structured or unstructured numerical meshes.
- Solvers for differential equations. TNL provides a framework for the development of ODE or PDE solvers.
- Image processing. TNL provides structures for the representation of image data. Imports and exports from several file formats such as DICOM, PNG, and JPEG are provided using external libraries (see below).
See also Comparison with other libraries.
TNL also provides several optional components:
- TNL header files in the src/TNL directory.
- Various pre-processing and post-processing tools in the src/Tools directory.
- Python bindings and scripts in the src/Python directory.
- Examples of various numerical solvers in the src/Examples directory.
- Benchmarks in the src/Benchmarks directory.
These components can be individually enabled or disabled and installed by a
convenient install
script. See the Installation section in
the documentation for details.
See the full documentation for information about:
and other documented topics.
The TNL project welcomes and encourages participation by everyone. While most of the work for TNL involves programming in principle, we value and encourage contributions even from people proficient in other, non-technical areas.
This section provides several ideas how both new and experienced TNL users can contribute to the project. Note that this is not an exhaustive list.
- Join the code development. Our GitLab issues tracker contains many ideas for new features, or you may bring your own. The contributing guidelines describe the standards for code contributions.
- Help with testing and reporting problems. Testing is an integral part of agile software development which refines the code development. Constructive critique is always welcome.
- Improve and extend the documentation. Even small changes such as improving grammar or fixing typos are very appreciated.
- Share your experience with TNL. Have you used TNL in your own project? Please be open and share your experience to help others in similar fields to get familiar with TNL. If you could not utilize TNL as smoothly as possible, feel free to submit a feature request.
Before contributing, please get accustomed with the code of conduct.
If you use TNL in your scientific projects, please cite the following paper in your publications:
- T. Oberhuber, J. Klinkovský, R. Fučík, TNL: Numerical library for modern parallel architectures, Acta Polytechnica 61.SI (2021), 122-134.
See the list of team members on our website. The overview of contributions can be viewed on GitLab.
Template Numerical Library is provided under the terms of the MIT License.