grad_triangle_3d#

iskra.fem.grad_triangle_3d(vertices: Tensor, faces: Tensor) tuple[Tensor, ...][SOURCE]#

Finite element gradient matrix for 3d triangles.

Given a triangle mesh in 3d, computes the finite element gradient matrix assuming piecewise linear hat function basis.

Args: vertices (torch.Tensor):(n,d) tensor vertex list a triangle mesh faces (torch.Tensor): tensor of ints of shape (m, 3) interpreted as face index list of a triangle mesh

Returns: torch.Tensor: three (m, n) sparse coo tensor of the finite element gradient matrix