interp_volume_average#
- 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 settingmethod='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
.- Parameters:
- nodes_{x;y;z}ndarray
The nodes in x-, y-, and z-directions for the original grid,
grid.nodes_{x;y;z}
, from aemg3d.meshes.TensorMesh
instance.- valuesndarray
Values corresponding to original grid (of shape
grid.shape_cells
).- new_nodes_{x;y;z}ndarray
The nodes in x-, y-, and z-directions for the new grids,
new_grid.nodes_{x;y;z}
, from aemg3d.meshes.TensorMesh
instance.- new_valuesndarray
Array where values corresponding to the new grid will be added (of shape
new_grid.shape_cells
).- new_volndarray
The cell volumes of the new grid (
new_grid.cell_volumes
).