grad_triangle_2d#
- iskra.fem.grad_triangle_2d(vertices: Tensor, faces: Tensor) tuple[Tensor, Tensor][SOURCE]#
Finite element gradient matrix for 2d triangles.
Given a triangle mesh in 2d, 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, 2) interpreted as face index list of a triangle mesh
Returns: torch.Tensor: two (m, n) sparse coo tensor of the finite element gradient matrix
Notes: Taken from sgsellan/gpytoolbox