IntegrationPoints structures#
- class IntegrationPoints(natural_coordinates, element_indices, weights=None, n_topological_dimensions=None, properties=None)[source]#
Base class to store integration points for numerical integration over elements and localisation of points into
pysdic.Meshobjects.Integration points are defined in the reference element using natural coordinates (\(\xi, \eta, \zeta, ...\)), element indices, and weights.
The number of natural coordinates depends on the topological dimension of the element \(K\) noted
n_topological_dimensions:Note
The coordinates and the properties of the points are stored as copy-on-write (cow) NumPy arrays of type
numpy.float64. Accesing these arrays directly will return unwritable views to prevent accidental modifications. The element indices are stored as copy-on-write (cow) NumPy arrays of typenumpy.int64.Note
If the weights are not provided, equal weights are assumed for all integration points. By default the weights are set to 1 for all integration points (and not \(1/N_p\)).
If a specific specific point is not include in any element, it can be identified by setting its element ID to -1 and its natural coordinates to NaN.
- Parameters:
natural_coordinates (ArrayLike) – The natural coordinates of the integration points as a numpy ndarray with shape (\(N_p\), \(K\)), where \(N_p\) is the number of integration points and \(K\) is the topological dimension of the element.
element_indices (ArrayLike) – The element indices of the integration points as a numpy ndarray with shape (\(N_p\),), where \(N_p\) is the number of integration points.
weights (Optional[ArrayLike], optional) – The weights of the integration points as a numpy ndarray with shape (\(N_p\),), where \(N_p\) is the number of integration points, by default None means equal weights of 1 for all points.
n_topological_dimensions (Optional[Integral], optional) – The topological dimension of the element, by default None means it will be inferred from the shape of the natural_coordinates. Otherwise, an error will be raised if the provided dimension does not match the shape of the natural_coordinates.
properties (Optional[Dict[
str, ArrayLike]], optional) – A dictionary of additional properties to associate with the integrated points. Keys are property names, and values are NumPy arrays of property data of shape \((N_{p}, A)\) where \(A\) is the number of attributes per point for the given property. Default isNone, meaning no additional properties are set.
I/O IntegrationPoints objects#
The IntegrationPoints class can be instantiated using the following constructor:
|
Create a |
The IntegrationPoints can be exported to a .npz file using the following method:
|
Save the integration points to a NumPy NPZ file. |
Accessing IntegrationPoints attributes#
[Get or Set] The element indices of the integration points as a numpy ndarray with shape (\(N_p\),), where \(N_p\) is the number of integration points. |
|
[Get] The number of integration points. |
|
[Get] The topological dimension of the element. |
|
[Get] The number of valid integration points (points included in an element). |
|
[Get or Set] The natural coordinates of the integration points as a numpy ndarray with shape (\(N_p\), \(K\)), where \(N_p\) is the number of integration points and \(K\) is the topological dimension of the element. |
|
[Get] The shape of the integration points data. |
|
[Get or Set] The weights of the integration points as a numpy ndarray with shape (\(N_p\),), where \(N_p\) is the number of integration points. |
Add and manage IntegrationPoints points properties#
The properties of the points in a IntegrationPoints object can be managed using the following methods:
Note
Point properties are stored as named NumPy arrays of shape \((N_p, A)\) where \(N_p\) is the number of points and \(A\) is the number of property components (e.g., 3 for RGB color).
All the point properties must have the same number of points as the IntegrationPoints object and are stored as numpy.float64 arrays.
|
Set a property for the integration points as a NumPy array of shape \((N_p, A)\) where \(A\) is the number of attributes per point for the given property. |
Get a property of the integration points by its key/name. |
|
Check if the integration points have a property with the given key/name. |
|
Delete a property of the integration points by its key/name. |
|
List all property keys/names associated with the integration points. |
|
Return a copy of all properties of the integration points. |
|
Remove all properties from the integration points. |
Precomputed quantities of the integration points#
To perform geometric computations and property interpolations on the mesh, some quantities can be precomputed and stored in the integration points for later use. The precomputed quantities of the integration points are stored in a dictionary, and they can be accessed and managed using the following methods:
Warning
If any modification is made to the points of the integration points, the precomputed properties may become invalid and should be cleared using IntegrationPoints.clear_precomputed() to avoid using outdated properties in subsequent computations.
It is the responsibility of the user to ensure that the precomputed properties are consistent with the current state of the integration points, especially after any modifications to the points.
Get the value of a precomputed property stored in the mesh by its key. |
|
List all the keys of the precomputed properties that are currently stored in the mesh. |
|
Clear all the precomputed properties stored in the mesh, removing all key-value pairs from the precomputed properties dictionary. |
The method with precompute argument allows to compute a quantity and store it in the precomputed properties of the integration points for later use (or into IntegrationPoints).
Set to True to store the computed quantity in the precomputed properties of the integration points, and set to False to compute the quantity without storing it in the precomputed properties of the integration points.
The precomputed quantities available are (and are precomputed when using the corresponding methods in Mesh):
integration_points_neighborhoodshape_functionsshape_function_derivatives
Manipulating IntegrationPoints objects#
|
Concatenate two |
|
Create a copy of the current |
|
Disable specific integration points by their indices without removing them. |
|
Remove all invalid integration points (points not included in any element). |
|
Remove specific integration points by their indices. |
Validate the consistency of the |