discretize.TreeMesh.face_divergence#
- TreeMesh.face_divergence#
Face divergence operator (faces to cell-centres).
This property constructs the 2nd order numerical divergence operator that maps from faces to cell centers. The operator is a sparse matrix
that can be applied as a matrix-vector product to a discrete vector that lives on mesh faces; i.e.:div_u = Df @ u
Once constructed, the operator is stored permanently as a property of the mesh. See notes for additional details.
- Returns:
- (
n_cells
,n_faces
)scipy.sparse.csr_matrix
The numerical divergence operator from faces to cell centers
- (
Notes
In continuous space, the divergence operator is defined as:
Where
is the discrete representation of the continuous variable on cell faces and is the discrete representation of at cell centers, face_divergence constructs a discrete linear operator such that:For each cell, the computation of the face divergence can be expressed according to the integral form below. For cell
whose corresponding faces are indexed as a subset from the set of all mesh faces:where
is the volume of cell , is the surface area of face k, is the value of on face k, and represents the outward normal vector of face k for cell i.