pysdic.Mesh.compute_property_interpolation#
- Mesh.compute_property_interpolation(property, integration_points, *, skip_m1=True, default=nan)[source]#
Compute the interpolation of a property at given natural coordinates for specified elements in the mesh (convenient method for
pysdic.compute_property_interpolation()). Theelement_typemust be specified in the mesh connectivity to compute the shape functions for the elements of the mesh, which are used to perform the interpolation of the property.In a space of dimension \(E\), we consider a \(K\)-dimensional element (with \(K \leq E\)) defined by \(N_{vpe}\) nodes/vertices.
For an \(K\)-dimensional element defined by \(N_{vpe}\) nodes, points inside the element are represented in a local coordinate system \((\xi, \eta, \zeta, ...)\) also named
natural coordinates. Shape functions are defined in this local coordinate system in order to interpolate values at any point within the element based on the values at the nodes.\[P(\xi, \eta, \zeta, ...) = \sum_{i=1}^{N_{vpe}} N_i(\xi, \eta, \zeta, ...) P_i\]where \(P\) is the interpolated value at the point, \(N_i\) are the shape functions, and \(P_i\) are the nodal values.
Method to compute the interpolation of a property at given natural coordinates for specified elements in the mesh.
Note
The function is a convenience wrapper around the
pysdic.compute_property_interpolation()function.Important
If
shape_functionsare precomputed inIntegrationPoints, they will be used, otherwise they will be computed on the fly using theMesh.compute_shape_functions()method.
Hint
To interpolate the position of the vertices use
property=mesh.vertices.points.Warning
No test are performed to check if the provided integration points are consistent with the mesh (i.e., existing element indices). Only shape check is performed. The behavior of the function is undefined if the provided integration points are not consistent with the mesh.
- Parameters:
property (Union[
str, ArrayLike]) – The property to interpolate. If a string is provided, it should correspond to a property name in the mesh (either a vertex property or an element property). If a numpy array is provided, it should have shape (\(N_v\), \(P\)) for vertex properties or shape (\(N_e\), \(P\)) for element properties, where \(N_v\) is the number of vertices, \(N_e\) is the number of elements, and \(P\) is the number of property channels.integration_points (
pysdic.objects.IntegrationPoints) – The integration points at which to compute the property interpolation.skip_m1 (
bool, optional) – If set toTrue, any element index of -1 inelement_indiceswill result in the corresponding interpolated property being set todefault. Default isTrue.default (Union[Real, ArrayLike], optional) – The default value to assign to interpolated properties for integration points associated with an element index of -1 when
skip_m1isTrue. Default isnumpy.nan. The input can also be anumpy.ndarrayof shape (P,) to assign different default values for each property component.
- Returns:
interpolated_properties – An array of shape \((N_{p}, P)\) containing the interpolated property values at each of the \(N_{p}\) integration points.
- Return type:
See also
pysdic.compute_shape_functions()For more information on shape functions and their role in property interpolation.
pysdic.compute_property_interpolation()For more information on the algorithm used to compute the property interpolation and an example of how to use it.