discretize.TreeMesh.stencil_cell_gradient_z#

TreeMesh.stencil_cell_gradient_z#

Differencing operator along z-direction to total (including hanging) z faces.

This property constructs a differencing operator along the z-axis that acts on cell centered quantities; i.e. the stencil for the z-component of the cell gradient. The operator computes the differences between the values at adjacent cell centers along the z-direction, and places the result on the z-faces. The operator is a sparse matrix \(\mathbf{G_z}\) that can be applied as a matrix-vector product to a cell centered quantity \(\boldsymbol{\phi}\), i.e.:

diff_phi_z = Gz @ phi

By default, the operator assumes zero-Neumann boundary conditions on the scalar quantity.

Returns:
(n_total_faces_z, n_cells) scipy.sparse.csr_matrix

The stencil for the z-component of the cell gradient