pysdic.IntegrationPoints.get_precomputed#
- IntegrationPoints.get_precomputed(key)[source]#
Get the value of a precomputed property stored in the mesh by its key.
- Parameters:
key (
str) – The key of the precomputed property to retrieve.- Returns:
The value of the precomputed property associated with the specified key, or
Noneif the key does not exist in the precomputed properties of the mesh.- Return type:
Any
Examples
Create a simple
Meshinstance.1import numpy as np 2from pysdic import Mesh, PointCloud 3 4points = np.array([[0, 0, 0], [1, 0, 0], [0, 1, 0], [0, 0, 1], [1, 1, 1]]) 5connectivity = np.array([[0, 1, 2], [0, 1, 3], [0, 2, 3], [1, 2, 3], [1, 2, 4]]) 6mesh3d = Mesh(points, connectivity)
Precompute the vertices path distance matrix from the connectivity and store it in the precomputed properties of the mesh with the key ‘vertices_adjacency_matrix’.
1distance_matrix = mesh3d.precompute_vertices_adjacency_matrix()
Get the value of the precomputed vertices adjacency matrix using its key.
1retrieved_distance_matrix = mesh3d.get_precomputed('vertices_adjacency_matrix') 2print(retrieved_distance_matrix)