Defined as:
sdynpy.core.sdynpy_geometry.NodeArrayModule:
sdynpy.core.sdynpy_geometrySource: GitHub
Parent:
sdynpy.SdynpyArrayParent:
numpy.ndarray
Signature¶
class sdynpy.NodeArray(shape, buffer=None, offset=0, strides=None, order=None)Node information array
Use the node_array helper function to create the array.
Attributes¶
| Name | Summary |
|---|---|
data_dtype | Built-in mutable sequence. |
data_dtype¶
Methods¶
| Name | Summary |
|---|---|
by_grid | Selects nodes in a grid |
by_position | Select node by closest position |
from_unv | Load NodeArrays from universal file data from read_unv |
global_coordinate | Get the global coordinate of each node |
project_to_minimum_plane | Projects coordinates to a single best-fit plane |
reduce | Keep only nodes that are contained in node_list |
triangulate | Creates elements for a node set using Delaunay Triangulation |
by_grid¶
Source: GitHub
def sdynpy.NodeArray.by_grid(self, grid_spacing, x_min=None, y_min=None, z_min=None, x_max=None, y_max=None, z_max=None)Selects nodes in a grid
Parameters¶
grid_spacing : float Approximate grid spacing between selected nodes
x_min : float, optional Minimum X-value of the grid. The default is the minimum node x-coordinate.
y_min : float, optional Minimun Y-value of the grid. The default is the minimum node y-coordinate.
z_min : float, optional Minimum Z-value of the grid. The default is the minimum node z-coordinate.
x_max : float, optional Maximum X-value of the grid. The default is the maximum node x-coordinate.
y_max : float, optional Maximum Y-value of the grid. The default is the maximum node y-coordinate.
z_max : float, optional Maximum Z-value of the grid. The default is the maximum node z-coordinate.
Returns¶
NodeArray
NodeArray containing the closest nodes to the grid points
by_position¶
Source: GitHub
def sdynpy.NodeArray.by_position(self, position_array)Select node by closest position
Parameters¶
position_array : np.ndarray A (...,3) shape array containing positions of nodes to keep
Returns¶
NodeArray
NodArray containing nodes that were closest to the positions in
position_array.
from_unv¶
Source: GitHub
def sdynpy.NodeArray.from_unv(unv_data_dict, combine=True)Load NodeArrays from universal file data from read_unv
Parameters¶
unv_data_dict : dict Dictionary containing data from read_unv
combine : bool, optional If True, return as a single NodeArray
Returns¶
output_arrays : NodeArray Nodes read from unv
global_coordinate¶
Source: GitHub
def sdynpy.NodeArray.global_coordinate(self, cs_array)Get the global coordinate of each node
Parameters¶
cs_array : CoordinateSystemArray CoordinateSystemArray consisting of the local coordinate systems for each node
Returns¶
points : np.ndarray Coordinates of the nodes in the global coordinate system.
project_to_minimum_plane¶
Source: GitHub
def sdynpy.NodeArray.project_to_minimum_plane(coordinates, return_3D=True)Projects coordinates to a single best-fit plane
Parameters¶
coordinates : np.ndarray A (...,3) coordinate array.
return_3D : bool, optional If True, return the 3D coordinates of the projected points. Otherwise return the projected 2D coordinate. The default is True.
Returns¶
np.ndarray
Points projected to a best-fit plane.
reduce¶
Source: GitHub
def sdynpy.NodeArray.reduce(self, node_list)Keep only nodes that are contained in node_list
Parameters¶
node_list : iterable Iterable containing nodes to keep.
Returns¶
NodeArray
NodeArray containing only nodes in node_list.
triangulate¶
Source: GitHub
def sdynpy.NodeArray.triangulate(self, cs_array, projection_function=None, return_element_array=True, element_color=1, condition_threshold=None)Creates elements for a node set using Delaunay Triangulation
Parameters¶
cs_array : CoordinateSystemArray CoordinateSystemArray containing coordinate systems for each node.
projection_function : function, optional Function to use to project 3D coordinates to 2D coordinates for triangulation. The default is None.
return_element_array : bool, optional Returns an ElementArray if True, otherwise it simply returns the triangle simplices. The default is True.
element_color : np.ndarray or int, optional Integers representing colors applied to the elements. The default is 1.
condition_threshold : float, optional Condition number threshold used to remove triangles that are poorly shaped. The default is None.
Returns¶
ElementArray or np.ndarray
ElementArray containing elements or np.ndarray containing triangle
simplices.