I present in this work the GHOST (Geoscientific Hollow Sphere Tessellation) software which allows for the fast generation of computational meshes in hollow sphere geometries counting up to 100 million cells. Each mesh is composed of concentric spherical shells which are built out of quadrilaterals or triangles. I focus here on three commonly used meshes used in geodynamics/geophysics and demonstrate the accuracy of shell surfaces and mesh volume measurements as a function of resolution. I further benchmark the built-in gravity and gravitational potential procedures in the simple case of a constant density geometry and finally show how the produced meshes can be used to visualise the S40RTS mantle tomography model. The code is open source and is available on the GitHub sharing platform.

In the last 40 years, numerical mantle convection studies have improved our understanding
of mantle dynamics as a whole

To a first approximation, the Earth is a sphere: the Earth's polar diameter is about 43 km shorter
than its equatorial diameter, a negligible difference of about 0.3 %. As a consequence, modelling physical processes
which take place in the planet require the discretisation of a sphere.
Furthermore, because core dynamics occur on vastly difference timescales than mantle dynamics, mantle
modelling usually leaves the core out, thereby requiring simulations to be run on a hollow sphere mesh
(with the noticeable exception of

Although so-called latitude–longitude grids would seem appealing, they suffer from the convergence of meridians at the poles
(resulting in oversampling at poles)
and the juxtaposition of triangles near the poles and quadrilaterals elsewhere.
As a consequence, more regular, but more complex, grids have been designed over the years which tessellate the surface of the
sphere into triangles or quadrilaterals (sometimes overlapping).
There is the “cubed sphere”

How such meshes are built is often not discussed in the literature. It is a tedious exercise of three-dimensional geometry and it can be time-consuming, especially the connectivity array generation. In this paper, I present an open-source mesh generator for three hollow sphere meshes: the “cubed sphere” mesh, the CitcomS mesh and the icosahedral mesh.

Reference square and triangle meshes at level 5 .

From left to right: HS06, HS12 and HS20 shells coloured by block number.

I first present the basic workflow which has been implemented to arrive at such meshes; then, I showcase its efficiency and how accurate surfaces and volumes are represented. Finally, I provide a simple example of gravity and gravity potential calculations on such meshes and compare the obtained values with the analytical solution derived in the Appendix.

Number of nodes (

The open-source code library

The cubed sphere (HS06) is composed of six blocks which
are themselves subdivided into

The CitcomS mesh (HS12) is composed of 12 blocks also subdivided
into

The icosahedral mesh (HS20) is composed of 20 triangular blocks

Measured times to build and assemble the mesh as a function of its number of nodes (

Relative shell area error as a function of its number of nodes (

Given the regularity and symmetry of these meshes, determining the location of the mesh nodes in space is a relatively straightforward task. Building the mesh connectivity in an efficient manner is where the difficulty lies.

The approach to building all three meshes is identical:

A reference square or triangle is populated with cells, as shown in
Fig.

This reference square or triangle is then replicated

All block meshes are then merged together to generate a shell mesh. This task is rather
complex as duplicate nodes must be removed and all connectivity arrays of the blocks must then
be mended accordingly. This task is carried out in the

Shell meshes are replicated

Elemental area for the

More information on these steps is available in the manual of the code.
In Table

It is also worth mentioning that the aspect ratio of the cells usually
influences the accuracy of the computed solution. As such, the user should strive to
generate a mesh where cells' aspect ratios are (on average) close to unity by making

The total time to generate the coordinates and the connectivity of the final
hollow sphere mesh was timed for all three mesh types and is shown in
Fig.

The area of the shell of unit radius can be calculated by
summing the areas of each cell. In the case of triangles, Heron's formula is used, which
states that the area of a triangle whose sides have lengths

In the case of quadrilaterals, the four points composing each of them are not necessarily coplanar and the definition of the surface is ill-posed. Each quadrilateral is therefore decomposed into four triangles sharing a vertex in the middle given by the barycentre of the four points. The area of each quadrilateral is then approximated by the sum of the areas of all four inscribed triangles.

The relative error on the shell outer area,

Figure

Although the volume of the hexahedra could have been computed directly with
the formula of

The measured hollow sphere mesh volume and its relative error

The gravity potential

The gravity vector and potential at location

In what follows, I set the inner radius to

Norm of the gravity vector

Gravity potential

HS06 grid with 64 layers and level

The S40RTS model is one of the most widely used tomographic models of the mantle

I have adapted the Fortran interface provided with the dataset and for each node of the grid
the shear-velocity variation

The three types of hollow sphere meshes presented in this work are currently in use in the
ELEFANT code (

Following the example of CitcomS, each block of the final mesh could actually be built and used
by a different Message Passing Interface (MPI) thread in the context of parallel calculations

Other tomography models than S40RTS

Finally, this library is aimed at students and researchers alike. It provides the essential building block for many geophysical applications: a non-overlapping tessellation of the mantle. It also provides the starting point for any finite-element or finite-volume method-based geodynamical code. Which of the three mesh types is best may be problem-specific, and potential users are encouraged to explore various combinations of resolutions and mesh types. However, under the assumption that the quality of the numerical solution correlates with the uniformity of the mesh cells' volume, it appears that an equiangular projection should always be preferred to an equidistant one.

The code is written in Fortran90, and the development version is freely downloadable at

The gravity potential can be computed by means of the Poisson equation
(

For

The author declares that he has no conflict of interest.

The author wishes to thank Alexis Plunder and Sébastien Boulay for stimulating discussions in the early stages of this work and
Henri Brett for careful reading of the manuscript. Perceptually uniform colour maps were used in this study to prevent visual
distortion of the data (