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 toassemble_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\) ifsigned=Falseand is equal to the orientation of the subface \(j\) as seen from face \(i\) (seeget_faces()) ifsigned=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.
See also
iskra.topology.assemble_incidence_matrix(),iskra.topology.get_subfaces(). Also used iniskra.dec.d_01(),iskra.dec.d_12(), 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=-1asks for (k-1)-dimensional simplices.signed (bool) – Whether the matrix should be signed or not.
- Returns:
(
SparseTensor[Float, [F, S]]) – Incidence matrix.