pystran.geometry module#
Simple geometry utilities.
- pystran.geometry.delt(ci, cj)[source]#
Compute oriented vector from the first to the second location.
- Parameters:
ci – Coordinates of the first point.
cj – Coordinates of the second point.
- Return type:
array
- pystran.geometry.herm_basis(xi)[source]#
Compute the cubic Hermite basis functions for an interval \(-1\le\xi\le+1\).
- Parameters:
xi – Parametric coordinate (from -1 to +1) from the first joint to the second.
- Returns:
An array of basis function values is returned (i.e. \([N_1(\xi), ..., N_4(\xi)]\)).
- Return type:
array
- pystran.geometry.herm_basis_xi(xi)[source]#
Compute the first derivative wrt \(\xi\) of the Hermite basis functions.
- Parameters:
xi – Parametric coordinate (from -1 to +1) from the first joint to the second.
- Returns:
An array of first derivatives of shape functions is returned (i.e. \([dN_1(\xi)/d\xi, ..., dN_4(\xi)/d\xi]\)).
- Return type:
array
See also
- pystran.geometry.herm_basis_xi2(xi)[source]#
Compute the second derivative wrt \(\xi\) of the Hermite basis functions.
- Parameters:
xi – Parametric coordinate (from -1 to +1) from the first joint to the second.
- Returns:
An array of second derivatives of shape functions is returned (i.e. \([d^2N_1(\xi)/d\xi^2, ..., d^2N_4(\xi)/d\xi^2]\)).
- Return type:
array
See also
- pystran.geometry.herm_basis_xi3(xi)[source]#
Compute the third derivative wrt \(\xi\) of the Hermite basis functions.
- Parameters:
xi – Parametric coordinate (from -1 to +1) from the first joint to the second.
- Returns:
An array of third derivatives of shape functions is returned (i.e. \([d^3N_1(\xi)/d\xi^3, ..., d^3N_4(\xi)/d\xi^3]\)).
- Return type:
array
See also
- pystran.geometry.interpolate(xi, q1, q2)[source]#
Interpolate linearly between two quantities.
- Parameters:
xi – Parametric coordinate (from -1 to +1) from the first joint to the second.
q1 – The quantity at \(\xi=-1\).
q2 – The quantity at \(\xi=+1\).
- pystran.geometry.lin_basis(xi)[source]#
Compute linear basis functions for an interval \(-1\le\xi\le+1\).
- Parameters:
xi – Parametric coordinate (from -1 to +1) from the first joint to the second.
- Returns:
The matrix of basis functions (i.e. \([N_1(\xi), N_2(\xi)]\)).
- Return type:
array
- pystran.geometry.member_2d_geometry(i, j)[source]#
Compute 2d member geometry.
A local coordinate system is attached to the member such that the \(x\) axis is along the member axis. The deformation of the member is considered in the \(x-z\) plane.
- Parameters:
i – Dictionary holding data for first joint.
j – Dictionary holding data for second joint.
- Returns:
Vector \(e_x\) is the direction vector along the axis of the member. \(e_z\) is the direction vector perpendicular to the axis of the member. These two vectors form a left-handed coordinate system (consistent with the sign convention in the book): The deflection \(w\) is measured positive downwards, while the \(x\) coordinate is measured left to right. So in two dimensions \(e_x\) and \(e_z\) form a left-handed coordinate system. In reality, the complete coordinate system is right-handed, as the not-used basis vector is \(e_y\), which points out of the plane of the screen (page).
- Return type:
tuple of e_x, e_z, h
- pystran.geometry.member_3d_geometry(i, j, xz_vector)[source]#
Compute 3d member geometry.
A local coordinate system is attached to the member such that the \(x\) axis is along the member axis. The deformation of the member is considered in the three dimensional space.
The plane \(x-z\) is defined by the vector
xz_vector
and the member axis (i.e. \(e_x\)), in other words \(e_x\) is given by the axis of the member, and the vector \(e_y\) is the normalized cross product of thexz_vector
and \(e_x\). Therefore, the vectorxz_vector
must not be parallel to the member axis.The third vector, \(e_z\), completes the Cartesian basis.
- Parameters:
i – Dictionary holding data for first joint.
j – Dictionary holding data for second joint.
xz_vector – The vector that defines the \(x-z\) plane of the member-local coordinate system. It does not need to be of unit length, but it must not be parallel to the member axis. This vector is not defined for a truss member, and will be passed in as empty. Heuristics will be then used to orient the planes.
- Returns:
Vector \(e_x\) is the direction vector along the axis of the member, and \(e_y\) and \(e_z\) are the direction vectors perpendicular to the axis of the member. These three vectors form a right-handed Cartesian coordinate system. \(h\) is the length of the member.
- Return type:
tuple of e_x, e_y, e_z, h