Christian Reisswig <>

March 31, 2019


This thorn is ment to provide “global” first and second derivatives by taking summation by parts (SBP) derivatives in the local grid coordinate system and transforming them to the global coordinate system. For this, the Jacobian and its derivatives must be provided as functional arguments. If no Jacobian is given, i.e. the grid variable pointers are NULL, the global derivatives reduce to the local derivatives.

1 Introduction

Some thorns, e.g. those that use the Llama multipatch system, use a local grid coordinate system but the (tensor) quantities are represented in a global coordinate system. Since (SBP) finite differences are calculated in the local grid-coordinate system, the derivative operators have to be transformed to the global coordinate system in order to be correctly represented in the global coordinate basis.

By using this thorn as a provider for finite-difference derivative operators, one can implement a thorn by assuming one global coordinate system. By providing Jacobians from local to global coordinates one then ends up with a code that is valid on all “patches” that are eventually defined by different local coordinates.

We label local grid coordinates by (xi) = (a,b,c) and global coordinates by (x̂i) = (x,y,z). The first derivatives in global coordinates are then defined by

̂i = xj x̂i xj, (1)


̂x = a(x) x a + b(x) x b + c(x) x c, (2) ̂y = a(y) y a + b(y) y b + c(y) y c, (3) ̂z = a(z) z a + b(z) z b + c(z) z c. (4)

Similarly, second derivatives are calculated by