darsia.cell_to_face_average#

cell_to_face_average(grid, cell_qty, mode)[source]#

Project scalar cell quantity to scalar face quantity via averaging.

Allow for arithmetic or harmonic averaging of the cell quantity to the faces. In the harmonic case, the averaging is regularized to avoid division by zero. Matrix-free implementation.

Parameters:
griddarsia.Grid

Grid.

cell_qtynp.ndarray

Scalar-valued cell-based quantity.

modestr

Mode of projection, either “arithmetic” or “harmonic” (averaging).

Returns:
np.ndarray

Face-based quantity.