MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
module-imu.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/modules/module-imu/module-imu.cc,v 1.6 2017/01/12 14:52:55 masarati Exp $ */
2 /*
3  * MBDyn (C) is a multibody analysis code.
4  * http://www.mbdyn.org
5  *
6  * Copyright (C) 1996-2017
7  *
8  * Pierangelo Masarati <masarati@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  *
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation (version 2 of the License).
19  *
20  *
21  * This program is distributed in the hope that it will be useful,
22  * but WITHOUT ANY WARRANTY; without even the implied warranty of
23  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24  * GNU General Public License for more details.
25  *
26  * You should have received a copy of the GNU General Public License
27  * along with this program; if not, write to the Free Software
28  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29  */
30 
31 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
32 
33 #include <iostream>
34 #include <cfloat>
35 
36 #include "dataman.h"
37 #include "userelem.h"
38 
39 // ModuleIMU: begin
40 
41 class ModuleIMU
42 : virtual public Elem, public UserDefinedElem {
43 private:
44  // add private data
48 
50 
53 
54 public:
55  ModuleIMU(unsigned uLabel, const DofOwner *pDO,
56  DataManager* pDM, MBDynParser& HP);
57  virtual ~ModuleIMU(void);
58 
59  virtual void Output(OutputHandler& OH) const;
60  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
63  doublereal dCoef,
64  const VectorHandler& XCurr,
65  const VectorHandler& XPrimeCurr);
67  AssRes(SubVectorHandler& WorkVec,
68  doublereal dCoef,
69  const VectorHandler& XCurr,
70  const VectorHandler& XPrimeCurr);
71  unsigned int iGetNumPrivData(void) const;
72  unsigned int iGetPrivDataIdx(const char *s) const;
73  doublereal dGetPrivData(unsigned int i) const;
74  int iGetNumConnectedNodes(void) const;
75  void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
78  std::ostream& Restart(std::ostream& out) const;
79  virtual unsigned int iGetInitialNumDof(void) const;
80  virtual void
81  InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
84  const VectorHandler& XCurr);
86  InitialAssRes(SubVectorHandler& WorkVec, const VectorHandler& XCurr);
87 };
88 
90  unsigned uLabel, const DofOwner *pDO,
91  DataManager* pDM, MBDynParser& HP)
92 : Elem(uLabel, flag(0)),
93 UserDefinedElem(uLabel, pDO),
94 m_pNode(0),
95 m_tilde_f(::Zero3),
96 m_tilde_Rh(::Eye3),
97 m_overline_f(::Zero3),
98 m_overline_Omega(::Zero3),
99 m_overline_Acceleration(::Zero3)
100 {
101  // help
102  if (HP.IsKeyWord("help")) {
103  silent_cout(
104 " \n"
105 "Module: imu \n"
106 "Author: Pierangelo Masarati <masarati@aero.polimi.it> \n"
107 "Organization: Dipartimento di Ingegneria Aerospaziale \n"
108 " Politecnico di Milano \n"
109 " http://www.aero.polimi.it/ \n"
110 " \n"
111 "All rights reserved \n"
112 " \n"
113 "Syntax: \n"
114 " user defined : <label> , imu , \n"
115 " <node_label> \n"
116 " [ , position , (Vec3)<offset> ] \n"
117 " [ , orientation , (OrientationMatrix)<orientation> ] \n"
118  << std::endl);
119 
120  if (!HP.IsArg()) {
121  /*
122  * Exit quietly if nothing else is provided
123  */
124  throw NoErr(MBDYN_EXCEPT_ARGS);
125  }
126  }
127 
128  m_pNode = pDM->ReadNode<const StructNode, Node::STRUCTURAL>(HP);
129  if (!m_pNode->bComputeAccelerations()) {
130  const_cast<StructNode *>(m_pNode)->ComputeAccelerations(true);
131  }
132 
134  if (HP.IsKeyWord("position")) {
135  m_tilde_f = HP.GetPosRel(RF);
136  }
137 
138  if (HP.IsKeyWord("orientation")) {
139  m_tilde_Rh = HP.GetRotRel(RF);
140  }
141 
143 
145 }
146 
148 {
149  NO_OP;
150 }
151 
152 void
154 {
155  if (bToBeOutput()) {
156  std::ostream& out = OH.Loadable();
157 
158  out << std::setw(8) << GetLabel()
159  << " " << m_overline_Omega
160  << " " << m_overline_Acceleration
161  << std::endl;
162  }
163 }
164 
165 void
166 ModuleIMU::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
167 {
168  *piNumRows = 0;
169  *piNumCols = 0;
170 }
171 
174  doublereal dCoef,
175  const VectorHandler& XCurr,
176  const VectorHandler& XPrimeCurr)
177 {
178  WorkMat.SetNullMatrix();
179 
180  return WorkMat;
181 }
182 
185  doublereal dCoef,
186  const VectorHandler& XCurr,
187  const VectorHandler& XPrimeCurr)
188 {
189  WorkVec.ResizeReset(0);
190 
193 
195  if (!m_overline_f.IsNull()) {
196  Vec3 OmegaP(R.MulTV(m_pNode->GetWPCurr()));
198  m_overline_Acceleration += m_overline_Omega.Cross(m_overline_Omega.Cross(m_overline_f));
199  }
200 
201  return WorkVec;
202 }
203 
204 unsigned int
206 {
207  return 3 + 3;
208 }
209 
210 unsigned int
211 ModuleIMU::iGetPrivDataIdx(const char *s) const
212 {
213  unsigned idx = 0;
214 
215  switch (s[0]) {
216  case 'w':
217  break;
218 
219  case 'a':
220  idx += 3;
221  break;
222 
223  default:
224  return 0;
225  }
226 
227  switch (s[1]) {
228  case 'x':
229  idx += 1;
230  break;
231 
232  case 'y':
233  idx += 2;
234  break;
235 
236  case 'z':
237  idx += 3;
238  break;
239 
240  default:
241  return 0;
242  }
243 
244  return idx;
245 }
246 
248 ModuleIMU::dGetPrivData(unsigned int i) const
249 {
250  ASSERT(i > 1 && i <= iGetNumPrivData());
251 
252  switch (i) {
253  case 1:
254  case 2:
255  case 3:
256  return m_overline_Omega(i);
257 
258  case 4:
259  case 5:
260  case 6:
261  return m_overline_Acceleration(i - 3);
262  }
263 
264  return 0.;
265 }
266 
267 int
269 {
270  return 1;
271 }
272 
273 void
274 ModuleIMU::GetConnectedNodes(std::vector<const Node *>& connectedNodes) const
275 {
276  connectedNodes.resize(1);
277  connectedNodes[0] = m_pNode;
278 }
279 
280 void
284 {
285  NO_OP;
286 }
287 
288 std::ostream&
289 ModuleIMU::Restart(std::ostream& out) const
290 {
291  return out << "# ModuleIMU: not implemented" << std::endl;
292 }
293 
294 unsigned int
296 {
297  return 0;
298 }
299 
300 void
302  integer* piNumRows,
303  integer* piNumCols) const
304 {
305  *piNumRows = 0;
306  *piNumCols = 0;
307 }
308 
311  VariableSubMatrixHandler& WorkMat,
312  const VectorHandler& XCurr)
313 {
314  // should not be called, since initial workspace is empty
315  ASSERT(0);
316 
317  WorkMat.SetNullMatrix();
318 
319  return WorkMat;
320 }
321 
324  SubVectorHandler& WorkVec,
325  const VectorHandler& XCurr)
326 {
327  // should not be called, since initial workspace is empty
328  ASSERT(0);
329 
330  WorkVec.ResizeReset(0);
331 
332  return WorkVec;
333 }
334 
335 // ModuleIMU: end
336 
337 // ModuleIMUConstraint: begin
338 
340 : virtual public Elem, public UserDefinedElem {
341 private:
342  // add private data
346 
348 
351 
356 
357 public:
358  ModuleIMUConstraint(unsigned uLabel, const DofOwner *pDO,
359  DataManager* pDM, MBDynParser& HP);
360  virtual ~ModuleIMUConstraint(void);
361 
362  unsigned int iGetNumDof(void) const;
363  DofOrder::Order GetDofType(unsigned int i) const;
364 
365 #if 0
366  virtual std::ostream&
367  DescribeDof(std::ostream& out,
368  const char *prefix = "",
369  bool bInitial = false) const;
370 
371  virtual void
372  DescribeDof(std::vector<std::string>& desc,
373  bool bInitial = false,
374  int i = -1) const;
375 
376  virtual std::ostream&
377  DescribeEq(std::ostream& out,
378  const char *prefix = "",
379  bool bInitial = false) const;
380 
381  virtual void
382  DescribeEq(std::vector<std::string>& desc,
383  bool bInitial = false,
384  int i = -1) const;
385 #endif
386 
387  virtual void Output(OutputHandler& OH) const;
388  virtual void WorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
391  doublereal dCoef,
392  const VectorHandler& XCurr,
393  const VectorHandler& XPrimeCurr);
395  AssRes(SubVectorHandler& WorkVec,
396  doublereal dCoef,
397  const VectorHandler& XCurr,
398  const VectorHandler& XPrimeCurr);
399  unsigned int iGetNumPrivData(void) const;
400  unsigned int iGetPrivDataIdx(const char *s) const;
401  doublereal dGetPrivData(unsigned int i) const;
402  int iGetNumConnectedNodes(void) const;
403  void GetConnectedNodes(std::vector<const Node *>& connectedNodes) const;
404  void SetValue(DataManager *pDM, VectorHandler& X, VectorHandler& XP,
406  std::ostream& Restart(std::ostream& out) const;
407  virtual unsigned int iGetInitialNumDof(void) const;
408  virtual void
409  InitialWorkSpaceDim(integer* piNumRows, integer* piNumCols) const;
412  const VectorHandler& XCurr);
414  InitialAssRes(SubVectorHandler& WorkVec, const VectorHandler& XCurr);
415 };
416 
418  unsigned uLabel, const DofOwner *pDO,
419  DataManager* pDM, MBDynParser& HP)
420 : Elem(uLabel, flag(0)),
421 UserDefinedElem(uLabel, pDO),
422 m_pNode(0),
423 m_tilde_f(::Zero3),
424 m_tilde_Rh(::Eye3),
425 m_overline_f(::Zero3),
426 m_LambdaOmega(::Zero3),
427 m_LambdaAcceleration(::Zero3),
428 m_v(::Zero3),
429 m_vP(::Zero3)
430 {
431  // help
432  if (HP.IsKeyWord("help")) {
433  silent_cout(
434 " \n"
435 "Module: imu \n"
436 "Author: Pierangelo Masarati <masarati@aero.polimi.it> \n"
437 "Organization: Dipartimento di Ingegneria Aerospaziale \n"
438 " Politecnico di Milano \n"
439 " http://www.aero.polimi.it/ \n"
440 " \n"
441 "All rights reserved \n"
442 " \n"
443 "Syntax: \n"
444 " user defined : <label> , imu constraint, \n"
445 " <node_label> , \n"
446 " [ position , (Vec3)<offset> , ] \n"
447 " [ orientation , (OrientationMatrix)<orientation> , ] \n"
448 " (TplDriveCaller<Vec3>) <omega> , \n"
449 " (TplDriveCaller<Vec3>) <acceleration> \n"
450  << std::endl);
451 
452  if (!HP.IsArg()) {
453  /*
454  * Exit quietly if nothing else is provided
455  */
456  throw NoErr(MBDYN_EXCEPT_ARGS);
457  }
458  }
459 
460  m_pNode = pDM->ReadNode<const StructNode, Node::STRUCTURAL>(HP);
461  flag fOut = m_pNode->fToBeOutput();
462  if (!(fOut & StructNode::OUTPUT_ACCELERATIONS)) {
463  const_cast<StructNode *>(m_pNode)->SetOutputFlag(fOut | StructNode::OUTPUT_ACCELERATIONS);
464  }
465 
467  if (HP.IsKeyWord("position")) {
468  m_tilde_f = HP.GetPosRel(RF);
469  }
470 
471  if (HP.IsKeyWord("orientation")) {
472  m_tilde_Rh = HP.GetRotRel(RF);
473  }
474 
475  ReferenceFrame RFh(0, ::Zero3,
477  ::Zero3, ::Zero3,
479 
480  TplDriveCaller<Vec3> *pOmegaDC = ReadDCVecRel(pDM, HP, RFh);
481  m_OmegaDrv.Set(pOmegaDC);
482 
483  TplDriveCaller<Vec3> *pAccelerationDC = ReadDCVecRel(pDM, HP, RFh);
484  m_AccelerationDrv.Set(pAccelerationDC);
485 
487 
489 }
490 
492 {
493  NO_OP;
494 }
495 
496 unsigned int
498 {
499  return 9;
500 }
501 
503 ModuleIMUConstraint::GetDofType(unsigned int i) const
504 {
505  if (i >= 0 && i < 6) {
506  return DofOrder::ALGEBRAIC;
507  }
508 
509  if (i >= 6 && i < 9) {
510  return DofOrder::DIFFERENTIAL;
511  }
512 
513  ASSERT(0);
515 }
516 
517 void
519 {
520  if (bToBeOutput()) {
521  std::ostream& out = OH.Loadable();
522 
523  out << std::setw(8) << GetLabel()
524  << " " << m_LambdaOmega
525  << " " << m_LambdaAcceleration
526  << " " << m_v
527  << " " << m_vP
528  << std::endl;
529  }
530 }
531 
532 void
533 ModuleIMUConstraint::WorkSpaceDim(integer* piNumRows, integer* piNumCols) const
534 {
535  *piNumRows = 6 + 9;
536  *piNumCols = 6 + 9;
537 }
538 
541  doublereal dCoef,
542  const VectorHandler& XCurr,
543  const VectorHandler& XPrimeCurr)
544 {
545  FullSubMatrixHandler& WM = WorkMat.SetFull();
546 
547  WM.ResizeReset(15, 15);
548 
549  integer iFirstPositionIndex = m_pNode->iGetFirstPositionIndex();
550  integer iFirstMomentumIndex = m_pNode->iGetFirstMomentumIndex();
551  integer iFirstIndex = iGetFirstIndex();
552 
553  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
554  WM.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
555  WM.PutColIndex(iCnt, iFirstPositionIndex + iCnt);
556  }
557 
558  for (integer iCnt = 1; iCnt <= 9; iCnt++) {
559  WM.PutRowIndex(6 + iCnt, iFirstIndex + iCnt);
560  WM.PutColIndex(6 + iCnt, iFirstIndex + iCnt);
561  }
562 
565 
566  Vec3 F(R*(m_LambdaAcceleration*dCoef));
567  Vec3 M(R*(m_LambdaOmega*dCoef) + f.Cross(F));
568 
569  WM.Sub(1, 4, Mat3x3(MatCross, F));
570  WM.Sub(4, 4, Mat3x3(MatCross, M));
571 
572  WM.Add(1, 7, R);
573  WM.Add(4, 10, R);
574 
575  WM.AddT(7, 1, R);
576  WM.AddT(10, 4, R);
577 
578  Mat3x3 Tmp(f.Cross(R));
579  WM.Add(4, 7, Tmp);
580  Tmp -= (m_pNode->GetVCurr()*dCoef).Cross(R);
581  WM.AddT(7, 4, Tmp);
582 
583  for (integer iCnt = 1; iCnt <= 3; iCnt++) {
584  WM.PutCoef(6 + iCnt, 12 + iCnt, -dCoef);
585  WM.PutCoef(12 + iCnt, 12 + iCnt, 1.);
586  }
587 
588  return WorkMat;
589 }
590 
593  doublereal dCoef,
594  const VectorHandler& XCurr,
595  const VectorHandler& XPrimeCurr)
596 {
597  WorkVec.ResizeReset(15);
598 
599  integer iFirstMomentumIndex = m_pNode->iGetFirstMomentumIndex();
600  integer iFirstIndex = iGetFirstIndex();
601 
602  for (integer iCnt = 1; iCnt <= 6; iCnt++) {
603  WorkVec.PutRowIndex(iCnt, iFirstMomentumIndex + iCnt);
604  }
605 
606  for (integer iCnt = 1; iCnt <= 9; iCnt++) {
607  WorkVec.PutRowIndex(6 + iCnt, iFirstIndex + iCnt);
608  }
609 
610  m_LambdaAcceleration = Vec3(XCurr, iFirstIndex + 1);
611  m_LambdaOmega = Vec3(XCurr, iFirstIndex + 4);
612  m_v = Vec3(XCurr, iFirstIndex + 7);
613  m_vP = Vec3(XPrimeCurr, iFirstIndex + 7);
614 
617 
619  Vec3 M(R*m_LambdaOmega + f.Cross(F));
620 
621  Vec3 Omega(R.MulTV(m_pNode->GetWCurr()));
622 
623  WorkVec.Sub(1, F);
624  WorkVec.Sub(4, M);
625  WorkVec.Add(7, m_v - R.MulTV(m_pNode->GetVCurr()) - Omega.Cross(m_overline_f));
626  WorkVec.Add(10, m_OmegaDrv.Get() - Omega);
627  WorkVec.Add(13, m_AccelerationDrv.Get() - m_vP);
628 
629  return WorkVec;
630 }
631 
632 unsigned int
634 {
635  return 0;
636 }
637 
638 unsigned int
640 {
641  return 0;
642 }
643 
646 {
647  return 0.;
648 }
649 
650 int
652 {
653  return 1;
654 }
655 
656 void
657 ModuleIMUConstraint::GetConnectedNodes(std::vector<const Node *>& connectedNodes) const
658 {
659  connectedNodes.resize(1);
660  connectedNodes[0] = m_pNode;
661 }
662 
663 void
667 {
670 
672  X.Put(iGetFirstIndex() + 7, m_v);
673 }
674 
675 std::ostream&
676 ModuleIMUConstraint::Restart(std::ostream& out) const
677 {
678  return out << "# ModuleIMUConstraint: not implemented" << std::endl;
679 }
680 
681 unsigned int
683 {
684  return 0;
685 }
686 
687 void
689  integer* piNumRows,
690  integer* piNumCols) const
691 {
692  *piNumRows = 0;
693  *piNumCols = 0;
694 }
695 
698  VariableSubMatrixHandler& WorkMat,
699  const VectorHandler& XCurr)
700 {
701  // should not be called, since initial workspace is empty
702  ASSERT(0);
703 
704  WorkMat.SetNullMatrix();
705 
706  return WorkMat;
707 }
708 
711  SubVectorHandler& WorkVec,
712  const VectorHandler& XCurr)
713 {
714  // should not be called, since initial workspace is empty
715  ASSERT(0);
716 
717  WorkVec.ResizeReset(0);
718 
719  return WorkVec;
720 }
721 
722 // ModuleIMUConstraint: end
723 
724 extern "C" int
725 module_init(const char *module_name, void *pdm, void *php)
726 {
728 
729  if (!SetUDE("imu", rf1)) {
730  delete rf1;
731 
732  silent_cerr("ModuleIMU: "
733  "module_init(" << module_name << ") "
734  "failed" << std::endl);
735 
736  return -1;
737  }
738 
740 
741  if (!SetUDE("imu" "constraint", rf2)) {
742  delete rf2;
743 
744  silent_cerr("ModuleIMUConstraint: "
745  "module_init(" << module_name << ") "
746  "failed" << std::endl);
747 
748  return -1;
749  }
750 
751  return 0;
752 }
753 
flag fReadOutput(MBDynParser &HP, const T &t) const
Definition: dataman.h:1064
ModuleIMU(unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
Definition: module-imu.cc:89
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: module-imu.cc:540
Mat3x3 GetRotRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1795
unsigned int iGetNumPrivData(void) const
Definition: module-imu.cc:205
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: module-imu.cc:657
long int flag
Definition: mbdyn.h:43
virtual bool bToBeOutput(void) const
Definition: output.cc:890
Vec3 m_overline_Acceleration
Definition: module-imu.cc:52
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
const MatCross_Manip MatCross
Definition: matvec3.cc:639
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
int module_init(const char *module_name, void *pdm, void *php)
This function registers our user defined element for the math parser.
Definition: module-imu.cc:725
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual unsigned int iGetInitialNumDof(void) const
Definition: module-imu.cc:682
unsigned int iGetPrivDataIdx(const char *s) const
Definition: module-imu.cc:639
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
void PutCoef(integer iRow, integer iCol, const doublereal &dCoef)
Definition: submat.h:672
virtual ~ModuleIMU(void)
Definition: module-imu.cc:147
#define NO_OP
Definition: myassert.h:74
Vec3 m_tilde_f
Definition: module-imu.cc:46
std::vector< Hint * > Hints
Definition: simentity.h:89
doublereal dGetPrivData(unsigned int i) const
Definition: module-imu.cc:248
Vec3 m_overline_f
Definition: module-imu.cc:49
void Set(const TplDriveCaller< T > *pDC)
Definition: tpldrive.h:97
void AddT(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:227
doublereal dGetPrivData(unsigned int i) const
Definition: module-imu.cc:645
std::ostream & Restart(std::ostream &out) const
Definition: module-imu.cc:289
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: module-imu.cc:301
Mat3x3 m_tilde_Rh
Definition: module-imu.cc:47
DofOrder::Order GetDofType(unsigned int i) const
Definition: module-imu.cc:503
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: module-imu.cc:688
void GetConnectedNodes(std::vector< const Node * > &connectedNodes) const
Definition: module-imu.cc:274
bool IsNull(void) const
Definition: matvec3.h:472
const StructNode * m_pNode
Definition: module-imu.cc:45
Vec3 GetPosRel(const ReferenceFrame &rf)
Definition: mbpar.cc:1331
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: module-imu.cc:533
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: module-imu.cc:173
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
Definition: module-imu.cc:664
void SetNullMatrix(void)
Definition: submat.h:1159
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: module-imu.cc:710
const StructNode * m_pNode
Definition: module-imu.cc:343
std::ostream & Loadable(void) const
Definition: output.h:506
T Get(const doublereal &dVar) const
Definition: tpldrive.h:109
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: module-imu.cc:592
unsigned int iGetNumPrivData(void) const
Definition: module-imu.cc:633
virtual unsigned int iGetInitialNumDof(void) const
Definition: module-imu.cc:295
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: module-imu.cc:166
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: elem.cc:137
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
virtual void Output(OutputHandler &OH) const
Definition: module-imu.cc:153
unsigned int uLabel
Definition: withlab.h:44
virtual const Vec3 & GetWPCurr(void) const
Definition: strnode.h:1042
ModuleIMUConstraint(unsigned uLabel, const DofOwner *pDO, DataManager *pDM, MBDynParser &HP)
Definition: module-imu.cc:417
#define ASSERT(expression)
Definition: colamd.c:977
unsigned int iGetNumDof(void) const
Definition: module-imu.cc:497
Vec3 m_overline_Omega
Definition: module-imu.cc:51
OrientationDescription GetOrientationDescription(void) const
Definition: dataman.cc:857
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
Definition: matvec.h:3248
virtual ~ModuleIMUConstraint(void)
Definition: module-imu.cc:491
SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: module-imu.cc:323
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
Definition: except.h:79
int iGetNumConnectedNodes(void) const
Definition: module-imu.cc:268
unsigned int iGetPrivDataIdx(const char *s) const
Definition: module-imu.cc:211
virtual void Put(integer iRow, const Vec3 &v)
Definition: vh.cc:93
virtual bool IsArg(void)
Definition: parser.cc:807
Definition: elem.h:75
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: module-imu.cc:310
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: module-imu.cc:697
bool SetUDE(const std::string &s, UserDefinedElemRead *rude)
Definition: userelem.cc:97
std::ostream & Restart(std::ostream &out) const
Definition: module-imu.cc:676
virtual flag fToBeOutput(void) const
Definition: output.cc:884
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph)
Definition: module-imu.cc:281
TplDriveOwner< Vec3 > m_OmegaDrv
Definition: module-imu.cc:349
SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: module-imu.cc:184
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual const Vec3 & GetXPPCurr(void) const
Definition: strnode.h:334
int iGetNumConnectedNodes(void) const
Definition: module-imu.cc:651
virtual void SetOutputFlag(flag f=flag(1))
Definition: output.cc:896
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
Node * ReadNode(MBDynParser &HP, Node::Type type) const
Definition: dataman3.cc:2309
virtual void Output(OutputHandler &OH) const
Definition: module-imu.cc:518
virtual bool bComputeAccelerations(void) const
Definition: strnode.h:433
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: elem.cc:124
Mat3x3 R
TplDriveCaller< Vec3 > * ReadDCVecRel(const DataManager *pDM, MBDynParser &HP, const ReferenceFrame &rf)
TplDriveOwner< Vec3 > m_AccelerationDrv
Definition: module-imu.cc:350