GlobalDerivative

Christian Reisswig <reisswig@aei.mpg.de>

April 20, 2017

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 (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)

i.e.

̂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

̂îj = xk x̂ik xl x̂j l + xk x̂i xl x̂jkl (5)

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




epsdis_for_level
Scope: restricted  REAL



Description: Epsdis for a specific refinement level



Range   Default: -1.0
:
Negative indicates use default






fd_order_on_non_cart_maps
Scope: restricted  INT



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



Range   Default: -1
-1
use same FD order everywhere
2:*
use different FD order on non-Cartesian patches






force_diss_order
Scope: restricted  INT



Description: Force this order of accuracy for dissipation operator



Range   Default: -1
-1
Use default as specified in SBP::order
2:8
2nd, 4th, 6th and 8th order






order_for_level
Scope: restricted  INT



Description: Order of accuracy for a specific refinement level



Range   Default: -1
-1
Use default as specified in SBP::order
2:8
2nd, 4th, 6th and 8th order






use_dissipation
Scope: restricted  BOOLEAN



Description: Use global dissipation



  Default: no






diss_fraction
Scope: shared from SUMMATIONBYPARTS REAL






dissipation_type
Scope: shared from SUMMATIONBYPARTS KEYWORD






epsdis
Scope: shared from SUMMATIONBYPARTS REAL






h_scaling
Scope: shared from SUMMATIONBYPARTS REAL






norm_type
Scope: shared from SUMMATIONBYPARTS KEYWORD






order
Scope: shared from SUMMATIONBYPARTS INT






poison_dissipation
Scope: shared from SUMMATIONBYPARTS BOOLEAN






use_variable_deltas
Scope: shared from SUMMATIONBYPARTS BOOLEAN






vars
Scope: shared from SUMMATIONBYPARTS STRING



4 Interfaces

General

Implements:

globalderivative

Inherits:

grid

summationbyparts

coordinates

Adds header:

GlobalDerivative.h

AllDerivative.h

AllDerivative_8th.h

Jacobian.h

Provides:

globalDiff_gv to

globalDiff2_gv 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

CCTK_PARAMCHECK

  globalderiv_paramcheck

  check parameters

 

 Language:c
 Options: global
 Type: function

MoL_PostRHS (conditional)

  globalderiv_dissipation

  apply global dissipation to registered variables

 

 Language:c
 Options: local
 Type: function