incidence_matrix#

iskra.topology.incidence_matrix(faces: Tensor, subface_dim: int = -1, signed: bool = False) SparseTensor[SOURCE]#

Constructs the face-subface incidence matrix.

This function is a high-level wrapper that calls get_subfaces() and passes the outputs to assemble_incidence_matrix(). Returns a sparse [F, S] matrix where a non-zero entry at \((i, j)\) indicates that face \(i\) contains subface \(j\). The entry is \(1\) if signed=False and is equal to the orientation of the subface \(j\) as seen from face \(i\) (see get_faces()) if signed=True.

Caution

The dimension of a face is one less than the number of vertices in the face, e.g., edges are 1-faces, triangles 2-faces, etc.

Parameters:
  • faces (Tensor[Int64, [F, 3]]) – Face index.

  • subface_dim (int) – The dimension of the requested subfaces. Passing a negative value makes the subface dimension relative to the face dimension: on a k-dimensional mesh, passing subface_dim=-1 asks for (k-1)-dimensional simplices.

  • signed (bool) – Whether the matrix should be signed or not.

Returns:

(SparseTensor[Float, [F, S]]) – Incidence matrix.