topoptlab.rotation_matrices module

topoptlab.rotation_matrices.R_2d(theta: ndarray) ndarray[source]

2D rotation matrix

Parameters:

theta (np.ndarray, shape (n)) – angle in radian.

Returns:

R – rotation matrices.

Return type:

np.ndarray shape (n,2,2)

topoptlab.rotation_matrices.R_3d(theta: ndarray, phi: ndarray) ndarray[source]

3D rotation matrix.

Parameters:
  • theta (np.ndarray, shape (n,)) – angle in radian for rotation around z axis.

  • phi (np.ndarray, shape (n,)) – angle in radian for rotation around y axis.

Returns:

R – Rotation matrices for each (theta, phi) pair.

Return type:

np.ndarray, shape (n, 3, 3)

topoptlab.rotation_matrices.Rv_2d(theta: ndarray, eng_conv: bool = False) ndarray[source]

2D rotation matrix in Voigt notation.

Parameters:
  • theta (np.ndarray, shape (n,)) – angle in radians

  • eng_conv (bool) – False -> standard Voigt [xx, yy, xy] True -> engineering Voigt [xx, yy, gamma_xy]

Returns:

Rv

Return type:

np.ndarray, shape (n,3,3)

topoptlab.rotation_matrices.Rv_3d(theta: ndarray, phi: ndarray, eng_conv: bool = False) ndarray[source]

3D rotation matrix in Voigt notation.

Voigt order:

[xx, yy, zz, yz, xz, xy]

Parameters:
  • theta (np.ndarray, shape (n,)) – angle in radians

  • phi (np.ndarray, shape (n,)) – angle in radians

  • eng_conv (bool) – False -> standard Voigt [xx, yy, zz, yz, xz, xy] True -> engineering Voigt [xx, yy, zz, gamma_yz, gamma_xz, gamma_xy]

Returns:

Rv

Return type:

np.ndarray, shape (n,6,6)

topoptlab.rotation_matrices.dR2_dtheta(theta: ndarray) ndarray[source]

Derivative of R_2d w.r.t. theta

Parameters:

theta (np.ndarray, shape (n)) – angle in radian.

Returns:

dR – derivatives of rotation matrices.

Return type:

np.ndarray, shape (n,2,2)

topoptlab.rotation_matrices.dR3_dphi(theta: ndarray, phi: ndarray) ndarray[source]

Derivative of R_3d w.r.t. phi

topoptlab.rotation_matrices.dR3_dtheta(theta: ndarray, phi: ndarray) ndarray[source]

Derivative of R_3d w.r.t. theta

topoptlab.rotation_matrices.dRvdphi_3d(theta: ndarray, phi: ndarray, eng_conv: bool = False) ndarray[source]

Derivative of Rv_3d with respect to phi.

topoptlab.rotation_matrices.dRvdtheta_2d(theta: ndarray, eng_conv: bool = False) ndarray[source]

Derivative of the 2D Voigt rotation matrix with respect to theta.

Parameters:
  • theta (np.ndarray, shape (n,)) – angle in radians

  • eng_conv (bool) – False -> standard Voigt [xx, yy, xy] True -> engineering Voigt [xx, yy, gamma_xy]

Returns:

dRv

Return type:

np.ndarray, shape (n,3,3)

topoptlab.rotation_matrices.dRvdtheta_3d(theta: ndarray, phi: ndarray, eng_conv: bool = False) ndarray[source]

Derivative of Rv_3d with respect to theta.