pysdic.Mesh.compute_vertices_neighborhood#

Mesh.compute_vertices_neighborhood(*, max_distance=1, self_neighborhood=True)[source]#

Compute the neighborhood of each vertex of the mesh, i.e. the vertices within a given distance (two vertices are at distance 1 if they belong to the same element).

Shortcut for pysdic.fem.compute_vertices_neighborhood() with the connectivity and the number of vertices of the mesh (the vertices used by no element have an empty neighborhood, or only themselves).

Parameters:
  • max_distance (Integral, optional (default: 1)) – The maximum distance of the vertices in the neighborhood.

  • self_neighborhood (bool, optional (default: True)) – If True, the neighborhood of each vertex includes the vertex itself.

Returns:

A symmetric boolean sparse matrix of shape \((N_v, N_v)\), where the neighborhood of vertex \(i\) is neighborhood[i].indices (sorted).

Return type:

scipy.sparse.csr_matrix