# GTMesh: A Highly Efficient C++ Template Library for Numerical Schemes on General Topology Meshes
## 1 Introduction  
Numerical algorithms for the solution of problems for partial differential equations often rely on meshes covering the computational domain. The prominent representatives of mesh-based methods are the finite element method (FEM) [1; 2; 3; 4] and the finite volume method (FVM) [5; 6; 7]. In order to tackle domains with nontrivial geometries, efficient tools for unstructured mesh representation and manipulation are needed. In particular, using general polygonal or polyhedral meshes comprising a relatively small number of highly complex cells can be beneficial in several situations. Using FVM to solve problems involving, e.g., reacting multiphase flows [8; 9], the number of necessary evaluations of computationally costly terms in the governing equations can be reduced by using polyhedral meshes. In the CFD domain, the properties of polyhedral meshes and their possible advantages, in terms of convergence rate and computational costs, have recently started to be investigated systematically [10; 11; 12; 13], and their support is available in popular packages, such as ANSYS Fluent, OpenFOAM [14] or AVL FIRE. Efficient finite volume schemes, specifically tailored to polyhedral meshes, are in active development [15; 16]. FEM traditionally uses tetrahedral or hexahedral meshes (in 3D). However, FEM has recently been successfully generalized to meshes of convex polyhedrons, which has brought about significant advantages [17; 18; 19; 20]. Their applications also extend to computer graphics [21]. For developers of numerical codes, several open-source projects offer mesh handling support, but none of them can provide the complete set of features required by high-performance parallel FVM and FEM codes. Notable examples are outlined below:OpenMesh [22] is aimed at applications in computer graphics, and provides tools for mesh modification. However, it only supports polygonal meshes for the representation of surfaces in 3D. * PUMI (Parallel Unstructured Mesh Infrastructure) [23] is a complex library supporting distributed mesh storage and processing via MPI [24]. By default, the mesh representation by means of the MDS (Mesh Data Structure) submodule only accepts a limited set of topological types known a priori at compile time, in order to achieve high performance. * ViennaGrid [25] is a modern library leveraging the concepts of template metaprogramming and iterators available in C++. It provides data structures for arbitrary-dimensional meshes and also a number of specialized data types and mesh algorithms that are often limited to certain dimensions or mesh types. * MOAB (Mesh-Oriented datABase) [26] is an extensive library that allows general topology meshes and supports mesh refinement, decomposition, parallel I/O and other features. Despite being written in C++, it does not take advantage of templates, and its performance has been shown to be relatively poor when processing polyhedral meshes [27]. MOAB always represents mesh geometry in a 3D coordinate system. * DUNE (Distributed and Unified Numerics Environment) [28] is a framework for numerical computations primarily (but not exclusively) aimed at FEM. It is a mature and very complex project with incomplete documentation, which also supports general topology meshes. * TNL (Template Numerical Library) [29] is a dynamically evolving framework for implementing efficient numerical algorithms in C++, taking advantage of State-of-the-Art C++ programming paradigms and exposing both CPU and GPU programming through a unified interface. Recently, support for general topology polytopal meshes [27] has been added. With all the above in mind, we introduce GTMesh, a library created to facilitate rapid development of numerical schemes and data postprocessing algorithms on general polytopal meshes in an arbitrary dimension. GTMesh is implemented as a modern C++ header-only library (compliant with the C++14 standard [30]).