pencil.math.derivatives.der_nonequi

Functions

der_6th(f, dx_1, axis)

der_6th(f, dx_1, axis)

der2_6th(f, dx_1, dx_tilde, axis)

der2_6th(f, dx_1, dx_tilde, axis)

der6_2nd(f, dx_1, axis)

der6_2nd(f, dx_1, axis)

xder_6th(f[, dx, dx_1])

xder_6th(f, dx=None, dx_1=None)

yder_6th(f[, dy, dy_1])

Same as xder_6th, but for y axis

zder_6th(f[, dz, dz_1])

Same as xder_6th, but for z axis

xder2_6th(f[, dx, dx_1, dx_tilde])

xder2_6th(f, dx=None, dx_1=None)

yder2_6th(f[, dy, dy_1, dy_tilde])

Same as xder2_6th, but for y axis

zder2_6th(f[, dz, dz_1, dz_tilde])

Same as xder2_6th, but for z axis

xder6_2nd(f[, dx, dx_1])

xder6_2nd(f, dx=None, dx_1=None)

yder6_2nd(f[, dy, dy_1])

Same as xder6_2nd, but for y axis

zder6_2nd(f[, dz, dz_1])

Same as xder6_2nd, but for z axis

Module Contents

pencil.math.derivatives.der_nonequi.der_6th(f, dx_1, axis)

der_6th(f, dx_1, axis)

Compute the 1st order derivative, 6th order accurate in x. Adapted from der2_main in deriv.f90. This supports nonequidistant grids.

Parameters:
  • f (ndarray) – Array for which to compute the derivative.

  • dx_1 (1D array) – grid.dx_1 (or dy_1 or dz_1), where grid is a Pencil grid object, and the array passed should correspond to the variable that is differentiated. In the case of equidistant grids, all elements are just 1/grid_spacing.

  • axis (int) – Axis of f along which the derivative should be taken.

pencil.math.derivatives.der_nonequi.der2_6th(f, dx_1, dx_tilde, axis)

der2_6th(f, dx_1, dx_tilde, axis)

Compute the 2nd order derivative, 6th order accurate in x. Adapted from der2_main in deriv.f90. This supports nonequidistant grids.

Parameters:
  • f (ndarray) – Array for which to compute the derivative.

  • dx_1 (1D array) – grid.dx_1 (or dy_1 or dz_1), where grid is a Pencil grid object, and the array passed should correspond to the variable that is differentiated. In the case of equidistant grids, all elements are just 1/grid_spacing.

  • dx_tilde (1D array) – grid.dx_tilde (or dy_tilde or dz_tilde). Is just zero for equidistant grids.

  • axis (int) – Axis of f along which the derivative should be taken.

pencil.math.derivatives.der_nonequi.der6_2nd(f, dx_1, axis)

der6_2nd(f, dx_1, axis)

Compute the 6th order derivative, with 2nd order error in x. Adapted from der6_main in deriv.f90. This supports nonequidistant grids.

Parameters:
  • f (ndarray) – Array for which to compute the derivative.

  • dx_1 (1D array) – grid.dx_1 (or dy_1 or dz_1), where grid is a Pencil grid object, and the array passed should correspond to the variable that is differentiated. In the case of equidistant grids, all elements are just 1/grid_spacing.

  • axis (int) – Axis of f along which the derivative should be taken.

pencil.math.derivatives.der_nonequi.xder_6th(f, dx=None, dx_1=None)

xder_6th(f, dx=None, dx_1=None)

Compute the 1st order derivative, 6th order accurate in x.

Parameters:
  • f (ndarray) – Array for which to compute the derivative.

  • dx (float) – Grid-spacing in x. For nonequidistant grids, leave this as None and specify dx_1 (=grid.dx_1) instead. If this is specified, the dx_1 argument is ignored.

  • dx_1 (ndarray) – Inverse grid spacing. Specify this and leave dx=None if your grid is nonequidistant

pencil.math.derivatives.der_nonequi.yder_6th(f, dy=None, dy_1=None)

Same as xder_6th, but for y axis

pencil.math.derivatives.der_nonequi.zder_6th(f, dz=None, dz_1=None)

Same as xder_6th, but for z axis

pencil.math.derivatives.der_nonequi.xder2_6th(f, dx=None, dx_1=None, dx_tilde=None)

xder2_6th(f, dx=None, dx_1=None)

Compute the 2nd order derivative, 6th order accurate in x.

Parameters:
  • f (ndarray) – Array for which to compute the derivative.

  • dx (float) – Grid-spacing in x. For nonequidistant grids, leave this as None and specify dx_1 (=grid.dx_1) instead. If this is specified, the dx_1 and dx_tilde arguments are ignored.

  • dx_1 (ndarray) – Inverse grid spacing. Specify this and leave dx=None if your grid is nonequidistant

  • dx_tilde (1D array) – grid.dx_tilde (or dy_tilde or dz_tilde). Is just zero for equidistant grids.

pencil.math.derivatives.der_nonequi.yder2_6th(f, dy=None, dy_1=None, dy_tilde=None)

Same as xder2_6th, but for y axis

pencil.math.derivatives.der_nonequi.zder2_6th(f, dz=None, dz_1=None, dz_tilde=None)

Same as xder2_6th, but for z axis

pencil.math.derivatives.der_nonequi.xder6_2nd(f, dx=None, dx_1=None)

xder6_2nd(f, dx=None, dx_1=None)

Compute the 6th order derivative, with 2nd order error in x

Parameters:
  • f (ndarray) – Array for which to compute the derivative.

  • dx (float) – Grid-spacing in x. For nonequidistant grids, leave this as None and specify dx_1 (=grid.dx_1) instead. If this is specified, the dx_1 argument is ignored.

  • dx_1 (ndarray) – Inverse grid spacing. Specify this and leave dx=None if your grid is nonequidistant

pencil.math.derivatives.der_nonequi.yder6_2nd(f, dy=None, dy_1=None)

Same as xder6_2nd, but for y axis

pencil.math.derivatives.der_nonequi.zder6_2nd(f, dz=None, dz_1=None)

Same as xder6_2nd, but for z axis