assemble_incidence_matrix#

iskra.topology.assemble_incidence_matrix(n_faces: int, n_subfaces: int, face_to_subface: Tensor, subface_sign: Tensor, signed: bool = False) SparseTensor[SOURCE]#

Assembles face-subface relationships into a 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. The inputs needed for this function usually come from get_subfaces(), or you can use the high-level wrapper incidence_matrix().

Parameters:
  • n_faces (int) – Number of faces (F).

  • n_subfaces (int) – Number of subfaces (S).

  • face_to_subface (Tensor[Int64, [F, FS]]) – Face-subface matrix.

  • subface_sign (Tensor[Float, [F, FS]]) – Subface orientation matrix.

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

Returns:

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