pysdic.Mesh.compute_shape_functions#
- Mesh.compute_shape_functions(integration_points, *, return_derivatives=False, default=0.0, tolerance=0.0)[source]#
Compute the shape functions of the elements of the mesh at integration points.
Shortcut for
pysdic.fem.compute_shape_functions()with the element type of the mesh and the natural coordinates ofintegration_points(see this function for the conventions ondefaultandtolerance).- Parameters:
integration_points (
pysdic.IntegrationPoints) – The integration points, consistent with the mesh (seevalidate_integration_points()).return_derivatives (bool, optional (default:
False)) – If True, the derivatives of the shape functions with respect to the natural coordinates are also returned.default (Optional[Real], optional (default:
0.0)) – The value of the shape functions at the points outside the reference element.tolerance (Real, optional (default:
0.0)) – The tolerance to decide if a point is inside the reference element.
- Returns:
shape_functions (numpy.ndarray) – An array of shape \((N_p, N_{vpe})\).
shape_function_derivatives (numpy.ndarray) – Only returned if
return_derivativesis True. An array of shape \((N_p, N_{vpe}, K)\).
- Return type:
Examples
1from pysdic import Mesh, IntegrationPoints 2 3mesh = Mesh([[0, 0, 0], [1, 0, 0], [0, 1, 0]], [[0, 1, 2]], element_type="triangle_3") 4integration_points = IntegrationPoints.from_gauss_points("triangle_3", mesh.n_elements) 5 6print(mesh.compute_shape_functions(integration_points)) # [[0.33333333 0.33333333 0.33333333]]