MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
Rot.hh
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/libraries/libmbmath/Rot.hh,v 1.23 2017/01/12 14:43:53 masarati Exp $ */
2 /*
3  * HmFe (C) is a FEM analysis code.
4  *
5  * Copyright (C) 1996-2017
6  *
7  * Marco Morandini <morandini@aero.polimi.it>
8  * Teodoro Merlini <merlini@aero.polimi.it>
9  *
10  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
11  * via La Masa, 34 - 20156 Milano, Italy
12  * http://www.aero.polimi.it
13  *
14  * Changing this copyright notice is forbidden.
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18  *
19  */
20 /*
21  * MBDyn (C) is a multibody analysis code.
22  * http://www.mbdyn.org
23  *
24  * Copyright (C) 1996-2017
25  *
26  * This code is a partial merge of HmFe and MBDyn.
27  *
28  * Pierangelo Masarati <masarati@aero.polimi.it>
29  * Paolo Mantegazza <mantegazza@aero.polimi.it>
30  *
31  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
32  * via La Masa, 34 - 20156 Milano, Italy
33  * http://www.aero.polimi.it
34  *
35  * Changing this copyright notice is forbidden.
36  *
37  * This program is free software; you can redistribute it and/or modify
38  * it under the terms of the GNU General Public License as published by
39  * the Free Software Foundation (version 2 of the License).
40  *
41  *
42  * This program is distributed in the hope that it will be useful,
43  * but WITHOUT ANY WARRANTY; without even the implied warranty of
44  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
45  * GNU General Public License for more details.
46  *
47  * You should have received a copy of the GNU General Public License
48  * along with this program; if not, write to the Free Software
49  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
50  */
51 
52 
53 #ifndef Rot_hh
54 #define Rot_hh
55 
56 #include "matvecexp.h"
57 
58 namespace RotManip {
59 
63 Mat3x3 Rot(const Vec3 & phi);
64 
69  Mat3x3 DRot(const Vec3 & phi);
70 
75 void RotAndDRot(const Vec3 & phi, Mat3x3 & Phi, Mat3x3 & Ga);
76 
80 Mat3x3 DRot_IT(const Vec3 & phi);
81 
85 Mat3x3 DRot_I(const Vec3 & phi);
86 
91 void RotAndDRot_IT(const Vec3 & phi, Mat3x3 & PhiIT, Mat3x3 & GaIT);
92 
96 Vec3 VecRot(const Mat3x3 & Phi);
97 
102 Mat3x3 Elle(const Vec3 & phi, const Vec3 & a);
103 
104 } //end of namespace RotManip
105 
106 
107 /*
108  * Euler-Rodrigues rotation manipulation namespace
109  */
110 namespace ER_Rot {
111 
112 class Param_Manip : public Vec3_Manip {
113 public:
114  inline Vec3 operator << (const Mat3x3& m) const {
115  return RotManip::VecRot(m);
116  };
117 
118  inline void Manipulate(Vec3& v, const Mat3x3& m) const {
119  v = RotManip::VecRot(m);
120  };
121 };
122 
123 class MatR_Manip : public Mat3x3_Manip {
124 public:
125  inline Mat3x3 operator << (const Vec3& v) const {
126  return RotManip::Rot(v);
127  };
128 
129  inline void Manipulate(Mat3x3& m, const Vec3& v) const {
130  m = RotManip::Rot(v);
131  };
132 };
133 
134 class MatG_Manip : public Mat3x3_Manip {
135 public:
136  inline Mat3x3 operator << (const Vec3& v) const {
137  return RotManip::DRot(v);
138  };
139 
140  inline void Manipulate(Mat3x3& m, const Vec3& v) const {
141  m = RotManip::DRot(v);
142  };
143 };
144 
145 class MatGm1_Manip : public Mat3x3_Manip {
146 public:
147  inline Mat3x3 operator << (const Vec3& v) const {
148  return RotManip::DRot_I(v);
149  };
150 
151  inline void Manipulate(Mat3x3& m, const Vec3& v) const {
152  m = RotManip::DRot_I(v);
153  };
154 };
155 
156 extern Param_Manip Param;
157 extern MatR_Manip MatR;
158 extern MatG_Manip MatG;
159 extern MatGm1_Manip MatGm1;
160 
161 } // end of namespace ER_Rot
162 
163 
164 
165 namespace RoTrManip {
166 
167 MatExp Elle(const VecExp & phi, const VecExp & a);
168 
169 MatExp RoTr(const VecExp & eta);
170 
171 MatExp DRoTr(const VecExp & eta);
172 
173 void RoTrAndDRoTr(const VecExp & eta, MatExp & H, MatExp & Th);
174 
175 MatExp DRoTr_It (const VecExp & eta);
176 
177 MatExp DRoTr_I (const VecExp & eta);
178 
179 void RoTrAndDRoTr_It(const VecExp & eta, MatExp & HIt, MatExp & ThIt);
180 
181 VecExp Helix (const MatExp & H);
182 
183 } //end of namespace RoTrManip
184 #endif // Rot_hh
185 
Mat3x3 DRot_IT(const Vec3 &phi)
Definition: Rot.cc:100
Definition: matvec3.h:98
MatR_Manip MatR
Definition: Rot.cc:292
MatExp DRoTr_It(const VecExp &eta)
Definition: Rot.cc:244
void Manipulate(Mat3x3 &m, const Vec3 &v) const
Definition: Rot.hh:129
MatExp DRoTr_I(const VecExp &eta)
Definition: Rot.cc:255
Mat3x3 DRot(const Vec3 &phi)
Definition: Rot.cc:74
Param_Manip Param
Definition: Rot.cc:291
void Manipulate(Vec3 &v, const Mat3x3 &m) const
Definition: Rot.hh:118
void Manipulate(Mat3x3 &m, const Vec3 &v) const
Definition: Rot.hh:140
Mat3x3 operator<<(const Vec3 &v) const
Definition: Rot.hh:136
Vec3 operator<<(const Mat3x3 &m) const
Definition: Rot.hh:114
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
void RoTrAndDRoTr_It(const VecExp &eta, MatExp &HIt, MatExp &ThIt)
Definition: Rot.cc:266
VecExp Helix(const MatExp &H)
Definition: Rot.cc:282
MatExp RoTr(const VecExp &eta)
Definition: Rot.cc:208
MatExp DRoTr(const VecExp &eta)
Definition: Rot.cc:219
Mat3x3 Rot(const Vec3 &phi)
Definition: Rot.cc:62
MatG_Manip MatG
Definition: Rot.cc:293
Mat3x3 Elle(const Vec3 &phi, const Vec3 &a)
Definition: Rot.cc:179
void RotAndDRot(const Vec3 &phi, Mat3x3 &Phi, Mat3x3 &Ga)
Definition: Rot.cc:86
void Manipulate(Mat3x3 &m, const Vec3 &v) const
Definition: Rot.hh:151
Mat3x3 operator<<(const Vec3 &v) const
Definition: Rot.hh:125
static const doublereal a
Definition: hfluid_.h:289
void RotAndDRot_IT(const Vec3 &phi, Mat3x3 &PhiIT, Mat3x3 &GaIT)
Definition: Rot.cc:122
Mat3x3 operator<<(const Vec3 &v) const
Definition: Rot.hh:147
MatGm1_Manip MatGm1
Definition: Rot.cc:294
void RoTrAndDRoTr(const VecExp &eta, MatExp &H, MatExp &Th)
Definition: Rot.cc:230
Mat3x3 DRot_I(const Vec3 &phi)
Definition: Rot.cc:111
MatExp Elle(const VecExp &phi, const VecExp &a)
Definition: Rot.cc:194