emg3d.maps.interp_volume_average(nodes_x, nodes_y, nodes_z, values, new_nodes_x, new_nodes_y, new_nodes_z, new_values, new_vol)[source]

Interpolate properties from grid to new_grid using volume averages.

This functionality is best accessed through emg3d.maps.interpolate by setting method='volume'.

Interpolation using the volume averaging technique. The original implementation (see emg3d v0.7.1) followed [PlDM07]. Joseph Capriotti took that algorithm and made it much faster for implementation in discretize. The current implementation is a translation of that from Cython to Numba, heavily simplified for the 3D use case in emg3d.

The result is added to new_values.


The nodes in x-, y-, and z-directions for the original grid, grid.nodes_{x;y;z}, from a emg3d.meshes.TensorMesh instance.


Values corresponding to original grid (of shape grid.shape_cells).


The nodes in x-, y-, and z-directions for the new grids, new_grid.nodes_{x;y;z}, from a emg3d.meshes.TensorMesh instance.


Array where values corresponding to the new grid will be added (of shape new_grid.shape_cells).


The cell volumes of the new grid (new_grid.cell_volumes).