FEDEM Solver
R8.0
Source code of the dynamics solver
|
Module with subroutines for manipulation of finite rotations. More...
Data Types | |
interface | eccexpand |
Takes into account possible eccentricity. More... | |
interface | ffa_eulerzyx |
Computes the EulerZYX angles for a relative rotation. More... | |
interface | ffa_glbeulerzyx |
Computes the EulerZYX angles for a global rotation. More... | |
Functions/Subroutines | |
real(dp) function, dimension(3) | mattoeulerxyz (R, eulerIn, err) |
Converts a rotation matrix (tensor) to EulerXYZ angles. More... | |
real(dp) function, dimension(3, 3) | eulertomat (euler) |
Converts a set of EulerXYZ angles into a rotation matrix. More... | |
subroutine | vec_to_mat (rvec, rten, lpu) |
Computes the rotation tensor from a rotation vector. More... | |
subroutine | mat_to_vec (rten, rvec) |
Computes the rotation vector from a rotation tensor. More... | |
subroutine | vec_to_quat (rvec, q, lpu) |
Computes the quaternion representation from a rotation vector. More... | |
subroutine | mat_to_quat (rten, q) |
Computes the quaternion representation from a rotation tensor. More... | |
subroutine | quat_to_mat (q, rten) |
Computes the rotation tensor from a quaternion representation. More... | |
subroutine | quat_to_vec (q, rvec) |
Computes the rotation vector from a quaternion representation. More... | |
real(dp) function, dimension(3) | deltarot (T1, T2) |
Computes the incremental rotation vector rotating tensor T1 to T2. More... | |
subroutine | orthonorm3 (rten) |
Makes a rotation tensor orthonormal through use of quaternions. More... | |
subroutine | spin (vec, mat) |
Computes the spin (skew-symmetric) tensor from the rotation vector. More... | |
subroutine | dtheta_domega (thetaVec, jacobiMat, lpu) |
Computes the variation of a rotation pseudo vector. More... | |
subroutine | domega_dtheta (thetaVec, jacobiMat, lpu) |
Computes the inverse of the variation of a rotation pseudo vector. More... | |
subroutine, private | eccexpandvec (e, v, vFull) |
Takes into account possible eccentricity. More... | |
subroutine, private | eccexpandmat (e, M, Mfull) |
Takes into account possible eccentricity. More... | |
subroutine, private | eccexpanddiagmat (e, D, Mfull) |
Takes into account possible eccentricity, for a diagonal matrix D. More... | |
Variables | |
real(dp), parameter, private | epsth2_p = 0.0005_dp |
Angles zero-tolerance. More... | |
Module with subroutines for manipulation of finite rotations.
This module contains various utility subroutines (and functions) for manipulation of finite rotations in the nonlinear solver, like convertion of rotation tensors to angles, and vice versa.
Bjorn Haugen
real(dp) function, dimension(3) rotationmodule::deltarot | ( | real(dp), dimension(3,3), intent(in) | T1, |
real(dp), dimension(3,3), intent(in) | T2 | ||
) |
Computes the incremental rotation vector rotating tensor T1 to T2.
subroutine rotationmodule::domega_dtheta | ( | real(dp), dimension(3), intent(in) | thetaVec, |
real(dp), dimension(3,3), intent(out) | jacobiMat, | ||
integer, intent(in), optional | lpu | ||
) |
Computes the inverse of the variation of a rotation pseudo vector.
[in] | thetaVec | Initial rotation vector |
[out] | jacobiMat | The inverse matrix of pseudo-vector variations |
[in] | lpu | Optional file unit number for error messages |
subroutine rotationmodule::dtheta_domega | ( | real(dp), dimension(3), intent(in) | thetaVec, |
real(dp), dimension(3,3), intent(out) | jacobiMat, | ||
integer, intent(in), optional | lpu | ||
) |
Computes the variation of a rotation pseudo vector.
[in] | thetaVec | Initial rotation vector |
[out] | jacobiMat | Matrix of pseudo-vector variations with respect to w = (eps, 0, 0) , w = (0, eps, 0) and w = (0, 0, eps) |
[in] | lpu | Optional file unit number for error messages |
The variation of the rotation vector r
is computed with respect to the incremental rotation w
, where the rotations obey the rule
R(r+w) = R(w)∗R(r)
The variation is given as
V = I - 0.5∗Spin(θ) + η∗Spin(θ)∗Spin(θ)
where η = (sin(0.5∗θ) - 0.5∗θ∗cos(0.5∗θ)) ⁄ (θ2∗sin(0.5∗θ))
|
private |
Takes into account possible eccentricity, for a diagonal matrix D.
| Mfull | = | I : 0 || D : 0 || I : Spin(e)' | | | | Spin(e) : I || 0 : 0 || 0 : I |
|
private |
Takes into account possible eccentricity.
| Mfull | = | I : 0 || M : 0 || I : Spin(e)' | | | | Spin(e) : I || 0 : 0 || 0 : I |
|
private |
Takes into account possible eccentricity.
| vFull | = | I : 0 || v | | | | Spin(e) : I || 0 |
real(dp) function, dimension(3,3) rotationmodule::eulertomat | ( | real(dp), dimension(3), intent(in) | euler | ) |
Converts a set of EulerXYZ angles into a rotation matrix.
subroutine rotationmodule::mat_to_quat | ( | real(dp), dimension(3,3), intent(in) | rten, |
real(dp), dimension(4), intent(out) | q | ||
) |
Computes the quaternion representation from a rotation tensor.
[in] | rten | The rotation tensor |
[out] | q | The rotation quaternions (Euler parameters) |
The computation is performed by means of equations from Richard A. Spurrier comments on "Singularity free Extraction of a Quaternion from a Direction-Cosine Matrix" in Journal of Rockets and Spacecraft, 1978.
subroutine rotationmodule::mat_to_vec | ( | real(dp), dimension(3,3), intent(in) | rten, |
real(dp), dimension(3), intent(out) | rvec | ||
) |
Computes the rotation vector from a rotation tensor.
[in] | rten | The rotation tensor |
[out] | rvec | The rotation vector |
real(dp) function, dimension(3) rotationmodule::mattoeulerxyz | ( | real(dp), dimension(3,3), intent(in) | R, |
real(dp), dimension(3), intent(in) | eulerIn, | ||
integer, intent(out) | err | ||
) |
Converts a rotation matrix (tensor) to EulerXYZ angles.
[in] | R | The rotation matrix to convert |
[in] | eulerIn | Euler angle set to use as a hint |
[out] | err | Error flag (=1: singularity encountered, infinite solutions for Z and X rotation. = -1: Failed to find a valid solution, try orthonormalizing the coordinate system) |
This function tries to find the Euler angle set that is closest to the set given as input.
subroutine rotationmodule::orthonorm3 | ( | real(dp), dimension(3,3), intent(inout) | rten | ) |
Makes a rotation tensor orthonormal through use of quaternions.
subroutine rotationmodule::quat_to_mat | ( | real(dp), dimension(4), intent(inout) | q, |
real(dp), dimension(3,3), intent(out) | rten | ||
) |
Computes the rotation tensor from a quaternion representation.
[in] | q | The quaternion representation of the rotation |
[out] | rten | The rotation tensor |
subroutine rotationmodule::quat_to_vec | ( | real(dp), dimension(4), intent(inout) | q, |
real(dp), dimension(3), intent(out) | rvec | ||
) |
Computes the rotation vector from a quaternion representation.
[in] | q | The quaternion representation of the rotation |
[out] | rvec | The rotation vector |
subroutine rotationmodule::spin | ( | real(dp), dimension(:), intent(in) | vec, |
real(dp), dimension(3,3), intent(out) | mat | ||
) |
Computes the spin (skew-symmetric) tensor from the rotation vector.
subroutine rotationmodule::vec_to_mat | ( | real(dp), dimension(3), intent(in) | rvec, |
real(dp), dimension(3,3), intent(out) | rten, | ||
integer, intent(in), optional | lpu | ||
) |
Computes the rotation tensor from a rotation vector.
[in] | rvec | The rotation vector |
[out] | rten | The rotation tensor |
[in] | lpu | Optional file unit number for error messages |
subroutine rotationmodule::vec_to_quat | ( | real(dp), dimension(3), intent(in) | rvec, |
real(dp), dimension(4), intent(out) | q, | ||
integer, intent(in), optional | lpu | ||
) |
Computes the quaternion representation from a rotation vector.
[in] | rvec | The rotation vector |
[out] | q | The quaternion representation of the rotation |
[in] | lpu | Optional file unit number for error messages |
|
private |
Angles zero-tolerance.