Applied Sciences (Jul 2023)

GTMesh: A Highly Efficient C++ Template Library for Numerical Schemes on General Topology Meshes

  • Tomáš Jakubec,
  • Pavel Strachota

DOI
https://doi.org/10.3390/app13158748
Journal volume & issue
Vol. 13, no. 15
p. 8748

Abstract

Read online

This article introduces GTMesh, an open-source C++ library providing data structures and algorithms that facilitate the development of numerical schemes on general polytopal meshes. After discussing the features and limitations of the existing open-source alternatives, we focus on the theoretical description of geometry and the topology of conforming polytopal meshes in an arbitrary-dimensional space, using elements from graph theory. The data structure for mesh representation is explained. The main part of the article focuses on the implementation of data structures and algorithms (computation of measures, centers, normals, cell coloring) by using State-of-the-Art template metaprogramming techniques for maximum performance. The geometrical algorithms are designed to be valid regardless of the dimension of the underlying space. As an integral part of the library, a template implementation of class reflection in C++ has been created, which is sufficiently versatile and suitable for the development of numerical and data I/O algorithms working with generic data types. Finally, the use of GTMesh is demonstrated on a simple example of solving the heat equation by the finite volume method.

Keywords