astronomix._spatial_operators._interpolate#

High-order interpolation between cell centres and cell faces.

Provides the 4th-order centre-to-face and 6th-order face-to-centre interpolations, plus the point-value to cell-average correction used to retain high-order accuracy in dimensionally split settings.

Module Contents#

Functions#

interp_center_to_face

Interpolate to x-interfaces using 4th order

f_{i+1/2} = (-f_{i-1} + 9f_{i} + 9f_{i+1} - f_{i+2}) / 16

interp_face_to_center

6th order interpolation from face to center.

point_values_to_averages

For point values q, we can approximate the cell-averaged values Q based on interpolation as

point_values_to_averages_single_axis

Single axis version of point_values_to_averages.

API#

astronomix._spatial_operators._interpolate.interp_center_to_face(arr, axis)[source]#
Interpolate to x-interfaces using 4th order

f_{i+1/2} = (-f_{i-1} + 9f_{i} + 9f_{i+1} - f_{i+2}) / 16

The i-th array index in the output corresponds to the i+1/2 interface.

astronomix._spatial_operators._interpolate.interp_face_to_center(f_int, axis)[source]#

6th order interpolation from face to center.

astronomix._spatial_operators._interpolate.point_values_to_averages(q, axisA, axisB)[source]#

For point values q, we can approximate the cell-averaged values Q based on interpolation as

Q_i = q_i + Δx^2/24 q’’(x_i) - …

For point values, the second derivative can be approximated

q’’(x_i) = (q_{i+1} - 2 q_i + q_{i-1}) / Δx^2

Here we apply this in two dimensions. Compare Buchmüller and Helzel 2014, Eq. 12, 13.

Such smoothing can be used to retain high-order accuracy in dimensionally split settings.

astronomix._spatial_operators._interpolate.point_values_to_averages_single_axis(q, axisA)[source]#

Single axis version of point_values_to_averages.