FEDEM Solver  R8.0
Source code of the dynamics solver
Data Types | Functions/Subroutines | Variables
rotationmodule Module Reference

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...
 

Detailed Description

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

Date
February 1999

Function/Subroutine Documentation

◆ deltarot()

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.

◆ domega_dtheta()

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.

Parameters
[in]thetaVecInitial rotation vector
[out]jacobiMatThe inverse matrix of pseudo-vector variations
[in]lpuOptional file unit number for error messages

◆ dtheta_domega()

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.

Parameters
[in]thetaVecInitial rotation vector
[out]jacobiMatMatrix of pseudo-vector variations with respect to w = (eps, 0, 0), w = (0, eps, 0) and w = (0, 0, eps)
[in]lpuOptional 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∗θ))

◆ eccexpanddiagmat()

subroutine, private rotationmodule::eccexpanddiagmat ( real(dp), dimension(3), intent(in)  e,
real(dp), dimension(3), intent(in)  D,
real(dp), dimension(6,6), intent(out)  Mfull 
)
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      |
Author
Knut Morten Okstad
Date
21 Jan 2004

◆ eccexpandmat()

subroutine, private rotationmodule::eccexpandmat ( real(dp), dimension(3), intent(in)  e,
real(dp), dimension(3,3), intent(in)  M,
real(dp), dimension(6,6), intent(out)  Mfull 
)
private

Takes into account possible eccentricity.

   | Mfull | = |    I    :  0 || M : 0 || I : Spin(e)' |
   |       |   | Spin(e) :  I || 0 : 0 || 0 :   I      |
Author
Bjorn Haugen
Date
Feb 2002

◆ eccexpandvec()

subroutine, private rotationmodule::eccexpandvec ( real(dp), dimension(3), intent(in)  e,
real(dp), dimension(3), intent(in)  v,
real(dp), dimension(6), intent(out)  vFull 
)
private

Takes into account possible eccentricity.

    | vFull | = |    I    :  0 || v |
    |       |   | Spin(e) :  I || 0 |
Author
Bjorn Haugen
Date
Feb 2002

◆ eulertomat()

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.

◆ mat_to_quat()

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.

Parameters
[in]rtenThe rotation tensor
[out]qThe 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.

◆ mat_to_vec()

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.

Parameters
[in]rtenThe rotation tensor
[out]rvecThe rotation vector

◆ mattoeulerxyz()

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.

Parameters
[in]RThe rotation matrix to convert
[in]eulerInEuler angle set to use as a hint
[out]errError flag (=1: singularity encountered, infinite solutions for Z and X rotation. = -1: Failed to find a valid solution, try orthonormalizing the coordinate system)
Returns
The EulerXYZ rotation angles

This function tries to find the Euler angle set that is closest to the set given as input.

Note
This function is no longer in use, consider remove?

◆ orthonorm3()

subroutine rotationmodule::orthonorm3 ( real(dp), dimension(3,3), intent(inout)  rten)

Makes a rotation tensor orthonormal through use of quaternions.

◆ quat_to_mat()

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.

Parameters
[in]qThe quaternion representation of the rotation
[out]rtenThe rotation tensor

◆ quat_to_vec()

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.

Parameters
[in]qThe quaternion representation of the rotation
[out]rvecThe rotation vector

◆ spin()

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.

◆ vec_to_mat()

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.

Parameters
[in]rvecThe rotation vector
[out]rtenThe rotation tensor
[in]lpuOptional file unit number for error messages

◆ vec_to_quat()

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.

Parameters
[in]rvecThe rotation vector
[out]qThe quaternion representation of the rotation
[in]lpuOptional file unit number for error messages

Variable Documentation

◆ epsth2_p

real(dp), parameter, private rotationmodule::epsth2_p = 0.0005_dp
private

Angles zero-tolerance.