xx GlobalDerivative

GlobalDerivative

Christian Reisswig <reisswig@aei.mpg.de>

May 17, 2024

Abstract

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 and global coordinates by . The first derivatives in global coordinates are then defined by i.e.

Similarly, second derivatives are calculated by

If local and global coordinate system are identical then the global derivatives reduce to the local derivatives.

2 Numerical Implementation

Similar to the SummationByParts thorn, there are subroutines that can be called to apply a global derivative to an entire grid variable. However, in most cases, one cannot effort to store the result of the derivative as an extra grid variable. Hence, the thorn provides a number of pointwise inline functions that can be used by including the GlobalDerivative header file.

3 Parameters

11epsdisxforxlevel 10Scope: restrictedx01 REAL

11Description: Epsdis for a specific refinement level

11 Range 10 x01 Default: -1.0
11:  10Negative indicates use default

11

11fdxorderxonxnonxcartxmaps 10Scope: restrictedx01  INT

11Description: Order of accuracy of spatial derivatives on non-Cartesian patches.

11 Range 10 x01 Default: -1
11-1  10use same FD order everywhere
112:*  10use different FD order on non-Cartesian patches

11

11forcexdissxorder  10Scope: restrictedx01  INT

11Description: Force this order of accuracy for dissipation operator

11 Range 10 x01 Default: -1
11-1  10Use default as specified in SBP::order
112:8  102nd, 4th, 6th and 8th order

11orderxforxlevel  10Scope: restrictedx01  INT

11Description: Order of accuracy for a specific refinement level

11 Range 10 x01 Default: -1
11-1  10Use default as specified in SBP::order
112:8  102nd, 4th, 6th and 8th order

11

11usexdissipation  10Scope: restrictedx01  BOOLEAN

11Description: Use global dissipation

11                   10  x01  Default: no

11

11dissxfraction  10Scope: shared from SUMMATIONBYPARTSx01REAL

11

11dissipationxtype  10Scope: shared from SUMMATIONBYPARTSx01KEYWORD

11

11epsdis  10Scope: shared from SUMMATIONBYPARTSx01REAL

11

11hxscaling  10Scope: shared from SUMMATIONBYPARTSx01REAL

11

11normxtype  10Scope: shared from SUMMATIONBYPARTSx01KEYWORD

11

11order  10Scope: shared from SUMMATIONBYPARTSx01INT

11

11poisonxdissipation 10Scope: shared from SUMMATIONBYPARTSx01BOOLEAN

11

11usexvariablexdeltas 10Scope: shared from SUMMATIONBYPARTSx01BOOLEAN

11

11vars  10Scope: shared from SUMMATIONBYPARTSx01STRING

11

4 Interfaces General Implements: globalderivative

Inherits: grid summationbyparts coordinates

Adds header: GlobalDerivative.h AllDerivative.h AllDerivativex8th.h Jacobian.h

Provides: globalDiffxgv to globalDiff2xgv to

5 Schedule This section lists all the variables which are assigned storage by thorn Llama/GlobalDerivative. Storage can either last for the duration of the run (Always means that if this thorn is activated storage will be assigned, Conditional means that if this thorn is activated storage will be assigned for the duration of the run if some condition is met), or can be turned on for the duration of a schedule function.

Storage NONE

Scheduled Functions

CCTKxPARAMCHECK x globalderivxparamcheck x check parameters x

11x11Language:11c
11 x 11Options: 11global
11 x 11Type: 11function

MoLxPostRHS (conditional) x globalderivxdissipation x apply global dissipation to registered variables x

11x11Language:11c
11 x 11Options: 11local
11 x 11Type: 11function