discretize.TreeMesh.average_cell_to_face#
- TreeMesh.average_cell_to_face#
Averaging operator from cell centers to faces (scalar quantities).
This property constructs an averaging operator that maps scalar quantities from cell centers to face. This averaging operator is used when a discrete scalar quantity defined cell centers must be projected to faces. Once constructed, the operator is stored permanently as a property of the mesh. See notes.
- Returns:
- (
n_faces
,n_cells
)scipy.sparse.csr_matrix
The scalar averaging operator from cell centers to faces
- (
Notes
Let
be a discrete scalar quantity that lives at cell centers. average_cell_to_face constructs a discrete linear operator that projects to faces, i.e.:where
approximates the value of the scalar quantity at the faces. For each face, we are performing a weighted average between the values at adjacent cell centers. In 1D, where adjacent cells and have widths and , on face is approximated by:On boundary faces, nearest neighbour is used to extrapolate the value from the nearest cell center. Once the operator is construct, the averaging is implemented as a matrix vector product, i.e.:
phi_f = Acf @ phi_c