MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
RotManip Namespace Reference

Functions

Mat3x3 Rot (const Vec3 &phi)
 
Mat3x3 DRot (const Vec3 &phi)
 
void RotAndDRot (const Vec3 &phi, Mat3x3 &Phi, Mat3x3 &Ga)
 
Mat3x3 DRot_IT (const Vec3 &phi)
 
Mat3x3 DRot_I (const Vec3 &phi)
 
void RotAndDRot_IT (const Vec3 &phi, Mat3x3 &PhiIT, Mat3x3 &GaIT)
 
Vec3 VecRot (const Mat3x3 &Phi)
 
Mat3x3 Elle (const Vec3 &phi, const Vec3 &a)
 

Function Documentation

Mat3x3 RotManip::DRot ( const Vec3 phi)

Compute G matrix given Euler Rogriguez's parameters Phi G defined in such a way that dPhi * PhiT = G * dphi

Definition at line 74 of file Rot.cc.

References RotCoeff::COEFF_C, RotCoeff::CoeffC(), and MatCrossCross.

Referenced by Shell4EAS::AssJac(), Shell4EAS::ComputeIPCurvature(), Shell4EASANS::ComputeIPCurvature(), ER_Rot::MatG_Manip::Manipulate(), ER_Rot::MatG_Manip::operator<<(), and InvAngularConstitutiveLaw::Update().

74  {
75  doublereal coeff[COEFF_C];
76 
77  CoeffC(phi,phi,coeff);
78 
79  Mat3x3 Ga(1., phi*coeff[1]); /* I + c[0] * phi x */
80  Ga += Mat3x3(MatCrossCross, phi, phi*coeff[2]); /* += c[1] * phi x phi x */
81 
82  return Ga;
83 }
void CoeffC(const T1 &phi, const Vec3 &p, T2 *const coeff)
const Int COEFF_C
Definition: RotCoeff.hh:64
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

Mat3x3 RotManip::DRot_I ( const Vec3 phi)

Compute the inverse of G matrix given Euler Rogriguez's parameters Phi

Definition at line 111 of file Rot.cc.

References RotCoeff::COEFF_C_STAR, RotCoeff::COEFF_D, RotCoeff::CoeffCStar(), and MatCrossCross.

Referenced by DriveHingeJoint::AfterPredict(), ElasticHingeJoint::AfterPredict(), ElasticJoint::AfterPredict(), ElasticHingeJointInv::AfterPredict(), ElasticJointInv::AfterPredict(), ViscoElasticJoint::AfterPredict(), ViscoElasticHingeJoint::AfterPredict(), ViscoElasticHingeJointInv::AfterPredict(), LoadIncNorm::AssJac(), ElasticAxialJoint::AssMat(), ElasticHingeJoint::AssMat(), Shell4EAS::ComputeIPCurvature(), Shell4EASANS::ComputeIPCurvature(), Shell4EAS::InterpolateOrientation(), Shell4EASANS::InterpolateOrientation(), main(), ER_Rot::MatGm1_Manip::Manipulate(), and ER_Rot::MatGm1_Manip::operator<<().

111  {
112  doublereal coeff[COEFF_D], coeffs[COEFF_C_STAR];
113 
114  CoeffCStar(phi,phi,coeff,coeffs);
115 
116  Mat3x3 GaI(1., phi*(-.5));
117  GaI += Mat3x3(MatCrossCross, phi, phi*coeffs[0]);
118 
119  return GaI;
120 }
const Int COEFF_D
Definition: RotCoeff.hh:65
void CoeffCStar(const T1 &phi, const Vec3 &p, T2 *const coeff, T2 *const coeffs)
const Int COEFF_C_STAR
Definition: RotCoeff.hh:69
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

Mat3x3 RotManip::DRot_IT ( const Vec3 phi)

Compute the inverse transpose of G matrix given Euler Rogriguez's parameters Phi

Definition at line 100 of file Rot.cc.

References RotCoeff::COEFF_C_STAR, RotCoeff::COEFF_D, RotCoeff::CoeffCStar(), and MatCrossCross.

Referenced by Shell4EAS::AssJac(), and RoTrManip::Helix().

100  {
101  doublereal coeff[COEFF_D], coeffs[COEFF_C_STAR];
102 
103  CoeffCStar(phi,phi,coeff,coeffs);
104 
105  Mat3x3 GaIT(1., phi*.5);
106  GaIT += Mat3x3(MatCrossCross, phi, phi*coeffs[0]);
107 
108  return GaIT;
109 }
const Int COEFF_D
Definition: RotCoeff.hh:65
void CoeffCStar(const T1 &phi, const Vec3 &p, T2 *const coeff, T2 *const coeffs)
const Int COEFF_C_STAR
Definition: RotCoeff.hh:69
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

Mat3x3 RotManip::Elle ( const Vec3 phi,
const Vec3 a 
)

Compute, given Euler Rogriguez's parameters phi, L matrix such that dG * a = L(phi, a) * dphi

Definition at line 179 of file Rot.cc.

References a, RotCoeff::COEFF_E, RotCoeff::CoeffE(), Vec3::Cross(), MatCross, and MatCrossCross.

Referenced by Shell4EAS::AssJac(), Shell4EAS::ComputeIPCurvature(), and Shell4EASANS::ComputeIPCurvature().

180  {
181  doublereal coeff[COEFF_E];
182  CoeffE(phi,phi,coeff);
183 
184  Mat3x3 L(MatCross, a*(-coeff[1]));
185  L -= Mat3x3(MatCrossCross, phi, a*coeff[2]);
186  L -= Mat3x3(MatCross, phi.Cross(a*coeff[2]));
187  L += (phi.Cross(a)).Tens(phi*coeff[3]);
188  L += (Mat3x3(MatCrossCross, phi, phi)*a).Tens(phi*coeff[4]);
189 
190  return L;
191 }
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
const MatCross_Manip MatCross
Definition: matvec3.cc:639
const Int COEFF_E
Definition: RotCoeff.hh:66
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
static const doublereal a
Definition: hfluid_.h:289
void CoeffE(const T1 &phi, const Vec3 &p, T2 *const coeff)

Here is the call graph for this function:

Mat3x3 RotManip::Rot ( const Vec3 phi)

Compute the rotation matrix Phi given Euler Rogriguez's parameters phi

Definition at line 62 of file Rot.cc.

References RotCoeff::COEFF_B, RotCoeff::CoeffB(), and MatCrossCross.

Referenced by ElasticHingeJointInv::AfterPredict(), ElasticDispJointInv::AfterPredict(), ElasticJointInv::AfterPredict(), ViscousHingeJointInv::AfterPredict(), ViscoElasticHingeJointInv::AfterPredict(), TotalEquation::AssRes(), TotalJoint::AssRes(), TotalPinJoint::AssRes(), GimbalRotationJoint::AssVec(), ElasticDispJointInv::AssVec(), ElasticHingeJointInv::AssVec(), ElasticJointInv::AssVec(), ViscousHingeJointInv::AssVec(), ViscoElasticHingeJointInv::AssVec(), DeformableHingeJoint::dGetPrivDataInv(), MBDynParser::GetMatR2vec(), TotalEquation::InitialAssRes(), TotalJoint::InitialAssRes(), TotalPinJoint::InitialAssRes(), Shell4EAS::InterpolateOrientation(), Shell4EASANS::InterpolateOrientation(), main(), ER_Rot::MatR_Manip::Manipulate(), ER_Rot::MatR_Manip::operator<<(), DeformableHingeJoint::OutputInv(), MBDynParser::Reference_int(), TotalPinJoint::SetValue(), DriveRigidBodyKinematics::Update(), InvAngularConstitutiveLaw::Update(), Shell4EAS::UpdateNodalAndAveragePosAndOrientation(), and Shell4EASANS::UpdateNodalAndAveragePosAndOrientation().

62  {
63  doublereal coeff[COEFF_B];
64 
65  CoeffB(phi,phi,coeff);
66 
67  Mat3x3 Phi(1., phi*coeff[0]); /* I + c[0] * phi x */
68  Phi += Mat3x3(MatCrossCross, phi, phi*coeff[1]); /* += c[1] * phi x phi x */
69 
70  return Phi;
71 }
void CoeffB(const T1 &phi, const Vec3 &p, T2 *const coeff)
const Int COEFF_B
Definition: RotCoeff.hh:63
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

void RotManip::RotAndDRot ( const Vec3 phi,
Mat3x3 Phi,
Mat3x3 Ga 
)

Compute rotation matrix Phi and Ga matrix given Euler Rogriguez's parameters Phi

Definition at line 86 of file Rot.cc.

References RotCoeff::COEFF_C, RotCoeff::CoeffC(), and MatCrossCross.

Referenced by Shell4EAS::InterpolateOrientation(), and Shell4EASANS::InterpolateOrientation().

86  {
87  doublereal coeff[COEFF_C];
88 
89  CoeffC(phi,phi,coeff);
90 
91  Phi = Mat3x3(1., phi*coeff[0]);
92  Phi += Mat3x3(MatCrossCross, phi, phi*coeff[1]);
93 
94  Ga = Mat3x3(1., phi*coeff[1]);
95  Ga += Mat3x3(MatCrossCross, phi, phi*coeff[2]);
96 
97  return;
98 }
void CoeffC(const T1 &phi, const Vec3 &p, T2 *const coeff)
const Int COEFF_C
Definition: RotCoeff.hh:64
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

void RotManip::RotAndDRot_IT ( const Vec3 phi,
Mat3x3 PhiIT,
Mat3x3 GaIT 
)

Compute inverse transpose ot rotation matrix Phi and Ga matrix given Euler Rogriguez's parameters Phi

Definition at line 122 of file Rot.cc.

References RotCoeff::COEFF_C_STAR, RotCoeff::COEFF_D, RotCoeff::CoeffCStar(), and MatCrossCross.

122  {
123  doublereal coeff[COEFF_D], coeffs[COEFF_C_STAR];
124 
125  CoeffCStar(phi,phi,coeff,coeffs);
126 
127  PhiIT = Mat3x3(1., phi*coeff[0]);
128  PhiIT += Mat3x3(MatCrossCross, phi, phi*coeff[1]);
129 
130  GaIT = Mat3x3(1., phi*.5);
131  GaIT += Mat3x3(MatCrossCross, phi, phi*coeffs[0]);
132 
133  return;
134 }
const Int COEFF_D
Definition: RotCoeff.hh:65
void CoeffCStar(const T1 &phi, const Vec3 &p, T2 *const coeff, T2 *const coeffs)
const Int COEFF_C_STAR
Definition: RotCoeff.hh:69
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640

Here is the call graph for this function:

Vec3 RotManip::VecRot ( const Mat3x3 Phi)

Compute Euler Rogriguez's parameters phi given rotation matrix Phi

Definition at line 136 of file Rot.cc.

References a, grad::atan2(), Mat3x3::Ax(), RotCoeff::CoeffA(), Vec3::Cross(), Vec3::Norm(), grad::sqrt(), Mat3x3::Symm(), and Mat3x3::Trace().

Referenced by AeroDynModule::AeroDynModule(), PlaneHingeJoint::AfterConvergence(), TotalJoint::AfterConvergence(), PlaneRotationJoint::AfterConvergence(), TotalPinJoint::AfterConvergence(), AxialRotationJoint::AfterConvergence(), PlanePinJoint::AfterConvergence(), DriveHingeJoint::AfterPredict(), ElasticAxialJoint::AfterPredict(), ElasticHingeJoint::AfterPredict(), ElasticJoint::AfterPredict(), ElasticHingeJointInv::AfterPredict(), ElasticDispJointInv::AfterPredict(), ElasticJointInv::AfterPredict(), ViscoElasticAxialJoint::AfterPredict(), ViscousHingeJointInv::AfterPredict(), ViscoElasticJoint::AfterPredict(), ViscoElasticHingeJoint::AfterPredict(), ViscoElasticHingeJointInv::AfterPredict(), angle(), anglerel(), DataManager::AssConstrRes(), LoadIncNorm::AssRes(), AerodynamicModal::AssRes(), TotalEquation::AssRes(), TotalJoint::AssRes(), Modal::AssRes(), ClampJoint::AssRes(), TotalPinJoint::AssRes(), GimbalRotationJoint::AssVec(), DriveHingeJoint::AssVec(), ElasticAxialJoint::AssVec(), ElasticHingeJoint::AssVec(), ElasticJoint::AssVec(), ElasticDispJointInv::AssVec(), ElasticHingeJointInv::AssVec(), ElasticJointInv::AssVec(), ViscoElasticAxialJoint::AssVec(), ViscousHingeJointInv::AssVec(), ViscoElasticJoint::AssVec(), ViscoElasticHingeJoint::AssVec(), ViscoElasticHingeJointInv::AssVec(), ViscousBody::dGetPrivData(), DeformableAxialJoint::dGetPrivData(), DeformableJoint::dGetPrivData(), DeformableHingeJoint::dGetPrivData(), PlaneHingeJoint::dGetPrivData(), TotalJoint::dGetPrivData(), PlaneRotationJoint::dGetPrivData(), Beam2::dGetPrivData(), Beam::dGetPrivData(), TotalPinJoint::dGetPrivData(), AxialRotationJoint::dGetPrivData(), PlanePinJoint::dGetPrivData(), StructNode::dGetPrivData(), DeformableHingeJoint::dGetPrivDataInv(), Eu2PhiWrap::Get(), getbladeparams(), getelemparams(), RoTrManip::Helix(), DriveHingeJoint::InitialAssRes(), TotalEquation::InitialAssRes(), TotalJoint::InitialAssRes(), TotalPinJoint::InitialAssRes(), ViscoElasticAxialJoint::InitialAssRes(), ViscoElasticHingeJoint::InitialAssRes(), main(), ER_Rot::Param_Manip::Manipulate(), MatManip_test(), ER_Rot::Param_Manip::operator<<(), ReferenceFrame::Output(), GimbalRotationJoint::Output(), SphericalHingeJoint::Output(), DeformableAxialJoint::Output(), DeformableHingeJoint::Output(), DeformableJoint::Output(), Inertia::Output(), StructExtForce::Output(), PlaneHingeJoint::Output(), UniversalRotationJoint::Output(), TotalEquation::Output(), TotalJoint::Output(), Beam2::Output(), PlaneRotationJoint::Output(), Beam::Output(), TotalReaction::Output(), TotalPinJoint::Output(), AxialRotationJoint::Output(), StructNode::Output(), Inertia::Output_int(), Aerodynamic2DElem< iNN >::Output_int(), DataManager::OutputEigGeometry(), DeformableHingeJoint::OutputInv(), ReadStructExtForce(), ReadStructNode(), StructExtForce::SendToFileDes(), StructMappingExtForce::SendToFileDes(), StructMembraneMappingExtForce::SendToFileDes(), StructExtForce::SendToStream(), StructMappingExtForce::SendToStream(), StructMembraneMappingExtForce::SendToStream(), PlaneHingeJoint::SetValue(), PlaneRotationJoint::SetValue(), PlanePinJoint::SetValue(), TotalJoint::TotalJoint(), TotalPinJoint::TotalPinJoint(), Shell4EAS::UpdateNodalAndAveragePosAndOrientation(), and Shell4EASANS::UpdateNodalAndAveragePosAndOrientation().

136  {
137  doublereal a, cosphi, sinphi;
138  Vec3 unit;
139 
140  // Modified from Appendix 2.4 of
141  //
142  // author = {Marco Borri and Lorenzo Trainelli and Carlo L. Bottasso},
143  // title = {On Representations and Parameterizations of Motion},
144  // journal = {Multibody System Dynamics},
145  // volume = {4},
146  // pages = {129--193},
147  // year = {2000}
148 
149  cosphi = (Phi.Trace() - 1.)/2.;
150  if (cosphi > 0.) {
151  unit = Phi.Ax();
152  sinphi = unit.Norm();
153  doublereal phi = atan2(sinphi, cosphi);
154  CoeffA(phi, Vec3(phi, 0., 0.), &a);
155  unit /= a;
156  } else {
157  // -1 <= cosphi <= 0
158  Mat3x3 eet(Phi.Symm());
159  eet(1, 1) -= cosphi;
160  eet(2, 2) -= cosphi;
161  eet(3, 3) -= cosphi;
162  // largest (abs) component of unit vector phi/|phi|
163  Int maxcol = 1;
164  if (eet(2, 2) > eet(1, 1)) {
165  maxcol = 2;
166  }
167  if (eet(3, 3) > eet(maxcol, maxcol)) {
168  maxcol = 3;
169  }
170  unit = (eet.GetVec(maxcol)/sqrt(eet(maxcol, maxcol)*(1. - cosphi)));
171  // sinphi = -(Mat3x3(unit)*Phi).Trace()/2.;
172  sinphi = -(unit.Cross(Phi)).Trace()/2.;
173  unit *= atan2(sinphi, cosphi);
174  }
175  return unit;
176 }
Vec3 Ax(void) const
Definition: matvec3.h:827
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Definition: matvec3.h:98
doublereal Norm(void) const
Definition: matvec3.h:263
doublereal Trace(void) const
Definition: matvec3.h:836
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Definition: gradient.h:2974
void CoeffA(const T1 &phi, const Vec3 &p, T2 *const coeff)
Mat3x3 Symm(void) const
Definition: matvec3.h:840
static const doublereal a
Definition: hfluid_.h:289
GradientExpression< BinaryExpr< FuncAtan2, LhsExpr, RhsExpr > > atan2(const GradientExpression< LhsExpr > &u, const GradientExpression< RhsExpr > &v)
Definition: gradient.h:2962

Here is the call graph for this function: