Defined as:
sdynpy.core.sdynpy_coordinate.CoordinateArrayModule:
sdynpy.core.sdynpy_coordinateSource: GitHub
Parent:
sdynpy.SdynpyArrayParent:
numpy.ndarray
Signature¶
class sdynpy.CoordinateArray(shape, buffer=None, offset=0, strides=None, order=None)Coordinate information specifying Degrees of Freedom (e.g. 101X+).
Use the coordinate_array helper function to create the array.
Attributes¶
| Name | Summary |
|---|---|
data_dtype | Built-in mutable sequence. |
data_dtype¶
Methods¶
| Name | Summary |
|---|---|
abs | Returns a coordinate array with direction signs flipped positive |
direction_string_array | Returns a string array representation of the direction |
find_indices | Finds the indices and signs of the specified coordinates |
from_matlab_cellstr | Creates a CoordinateArray from a matlab cellstring object loaded from scipy.io.loadmat |
from_nodelist | Returns a coordinate array with a set of nodes with a set of directions |
local_direction | Returns a local direction array |
offset_node_ids | Returns a copy of the CoordinateArray with the node IDs offset |
sign | Returns the sign on the directions of the CoordinateArray |
string_array | Returns a string array representation of the coordinate array |
abs¶
Source: GitHub
def sdynpy.CoordinateArray.abs(self)Returns a coordinate array with direction signs flipped positive
direction_string_array¶
Source: GitHub
def sdynpy.CoordinateArray.direction_string_array(self)Returns a string array representation of the direction
Returns¶
np.ndarray
ndarray of direction strings representing the CoordinateArray
find_indices¶
Source: GitHub
def sdynpy.CoordinateArray.find_indices(self, coordinate)Finds the indices and signs of the specified coordinates
Parameters¶
coordinate : CoordinateArray A CoordinateArray containing the coordinates to find.
Returns¶
indices : tuple of ndarray An tuple of arrays of indices into this CoordinateArray for each entry in
coordinate, which can be used directly to index this CoordinateArray.signs : ndarray An array of sign flips between this CoordinateArray at the indices in
indicesfor each entry incoordinate
Raises¶
ValueError
If more than one coordinate matches, or no coordinate matches.
from_matlab_cellstr¶
Source: GitHub
def sdynpy.CoordinateArray.from_matlab_cellstr(cls, cellstr_data)Creates a CoordinateArray from a matlab cellstring object loaded from scipy.io.loadmat
Parameters¶
cellstr_data : np.ndarray Dictionary entry corresponding to a cell string variable in a mat file loaded from scipy.io.loadmat
Returns¶
CoordinateArray
CoordinateArray built from the provided cell string array
from_nodelist¶
Source: GitHub
def sdynpy.CoordinateArray.from_nodelist(cls, nodes, directions=[1, 2, 3], flatten=True)Returns a coordinate array with a set of nodes with a set of directions
Parameters¶
nodes : iterable A list of nodes to create degrees of freedom at
directions : iterable, optional A list of directions to create for each node. The default is [1,2,3], which provides the three positive translations (X+, Y+, Z+).
flatten : bool, optional Specifies that the array should be flattened prior to output. The default is True. If False, the output will have a dimension one larger than the input node list due to the added direction dimension.
Returns¶
coordinate_array : CoordinateArray Array of coordinates with each specified direction defined at each node. If flatten is false, this array will have shape nodes.shape + directions.shape. Otherwise, this array will have shape (nodes.size*directions.size,)
local_direction¶
Source: GitHub
def sdynpy.CoordinateArray.local_direction(self)Returns a local direction array
Returns¶
local_direction_array : np.ndarray Returns a (...,3) array where ... is the dimension of the CoordinateArray. The (...,0), (...,1), and (...,2) indices represent the x,y,z direction of the local coordinate direction. For example, a CoordinateArray with direction X- would return [-1,0,0].
offset_node_ids¶
Source: GitHub
def sdynpy.CoordinateArray.offset_node_ids(self, offset_value)Returns a copy of the CoordinateArray with the node IDs offset
Parameters¶
offset_value : int The value to offset the node IDs by.
Returns¶
CoordinateArray
sign¶
Source: GitHub
def sdynpy.CoordinateArray.sign(self)Returns the sign on the directions of the CoordinateArray
string_array¶
Source: GitHub
def sdynpy.CoordinateArray.string_array(self)Returns a string array representation of the coordinate array
Returns¶
np.ndarray
ndarray of strings representing the CoordinateArray