MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
drvhinge.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/drvhinge.cc,v 1.50 2017/01/12 14:46:43 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  * Paolo Mantegazza <mantegazza@aero.polimi.it>
10  *
11  * Dipartimento di Ingegneria Aerospaziale - Politecnico di Milano
12  * via La Masa, 34 - 20156 Milano, Italy
13  * http://www.aero.polimi.it
14  *
15  * Changing this copyright notice is forbidden.
16  *
17  * This program is free software; you can redistribute it and/or modify
18  * it under the terms of the GNU General Public License as published by
19  * the Free Software Foundation (version 2 of the License).
20  *
21  *
22  * This program is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25  * GNU General Public License for more details.
26  *
27  * You should have received a copy of the GNU General Public License
28  * along with this program; if not, write to the Free Software
29  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
30  */
31 
32 /* Cerniera pilotata */
33 
34 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
35 
36 #include "dataman.h"
37 #include "drvhinge.h"
38 #include "Rot.hh"
39 #include "hint_impl.h"
40 
41 /* DriveHingeJoint - begin */
42 
43 /* Costruttore non banale */
45  const DofOwner* pDO,
46  const TplDriveCaller<Vec3>* pDC,
47  const StructNode* pN1,
48  const StructNode* pN2,
49  const Mat3x3& R1,
50  const Mat3x3& R2,
51  flag fOut)
52 : Elem(uL, fOut),
53 Joint(uL, pDO, fOut),
54 TplDriveOwner<Vec3>(pDC),
55 pNode1(pN1), pNode2(pN2), R1h(R1), R2h(R2),
56 R1Ref(Eye3),
57 RRef(Eye3),
58 ThetaRef(Zero3),
59 ThetaCurr(Zero3),
60 M(Zero3),
61 bFirstRes(false)
62 {
63  ASSERT(pNode1 != NULL);
64  ASSERT(pNode2 != NULL);
67 }
68 
69 
70 /* Distruttore */
72 {
73  NO_OP;
74 }
75 
76 
77 /* Contributo al file di restart */
78 std::ostream&
79 DriveHingeJoint::Restart(std::ostream& out) const
80 {
81  Joint::Restart(out) << ", drive hinge, "
82  << pNode1->GetLabel() << ", reference, node, 1, ",
83  (R1h.GetVec(1)).Write(out, ", ")
84  << ", 2, ", (R1h.GetVec(2)).Write(out, ", ") << ", "
85  << pNode2->GetLabel() << ", reference, node, 1, ",
86  (R2h.GetVec(1)).Write(out, ", ")
87  << ", 2, ", (R2h.GetVec(2)).Write(out, ", ") << ", ",
88  pGetDriveCaller()->Restart(out) << ';' << std::endl;
89  return out;
90 }
91 
92 
93 void
95 {
96  if (bToBeOutput()) {
97  Mat3x3 R1(pNode1->GetRCurr()*R1h);
98  Vec3 d(MatR2EulerAngles(R1.Transpose()*(pNode2->GetRCurr()*R2h)));
99  Joint::Output(OH.Joints(), "DriveHinge", GetLabel(),
100  Zero3, M, Zero3, R1*M)
101  << " " << d*dRaDegr
102  << " " << ThetaCurr << std::endl;
103  }
104 }
105 
106 void
110 {
111  if (ph) {
112  for (unsigned i = 0; i < ph->size(); i++) {
113  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
114 
115  if (pjh) {
116  if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
118 
119  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
121 
122  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
123  /* TODO */
124  }
125  continue;
126  }
127 
128  TplDriveHint<Vec3> *pdh = dynamic_cast<TplDriveHint<Vec3> *>((*ph)[i]);
129 
130  if (pdh) {
131  pedantic_cout("DriveHingeJoint(" << uLabel << "): "
132  "creating drive from hint[" << i << "]..." << std::endl);
133 
134  TplDriveCaller<Vec3> *pDC = pdh->pCreateDrive(pDM);
135  if (pDC == 0) {
136  silent_cerr("DriveHingeJoint(" << uLabel << "): "
137  "unable to create drive "
138  "after hint #" << i << std::endl);
140  }
141 
143  continue;
144  }
145  }
146  }
147 }
148 
149 Hint *
150 DriveHingeJoint::ParseHint(DataManager *pDM, const char *s) const
151 {
152  if (strncasecmp(s, "hinge{" /*}*/ , STRLENOF("hinge{" /*}*/ )) == 0)
153  {
154  s += STRLENOF("hinge{" /*}*/ );
155 
156  if (strcmp(&s[1], /*{*/ "}") != 0) {
157  return 0;
158  }
159 
160  switch (s[0]) {
161  case '1':
162  return new Joint::HingeHint<1>;
163 
164  case '2':
165  return new Joint::HingeHint<2>;
166  }
167  }
168 
169  /* take care of "drive" hint... */
170  return SimulationEntity::ParseHint(pDM, s);
171 }
172 
173 std::ostream&
175  const char *prefix, bool bInitial) const
176 {
177  integer iIndex = iGetFirstIndex();
178 
179  out
180  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
181  "reaction couples [mx,my,mz]" << std::endl;
182 
183  if (bInitial) {
184  iIndex += 3;
185  out
186  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
187  "reaction couple derivatives [mPx,mPy,mPz]" << std::endl;
188  }
189 
190  return out;
191 }
192 
193 static const char xyz[] = "xyz";
194 static const char *dof[] = { "reaction couple m", "reaction couple derivative mP" };
195 static const char *eq[] = { "orientation constraint g", "orientation constraint derivative w" };
196 
197 void
198 DriveHingeJoint::DescribeDof(std::vector<std::string>& desc,
199  bool bInitial, int i) const
200 {
201  int iend = 1;
202  if (i == -1) {
203  if (bInitial) {
204  iend = 6;
205 
206  } else {
207  iend = 3;
208  }
209  }
210  desc.resize(iend);
211 
212  std::ostringstream os;
213  os << "DriveHingeJoint(" << GetLabel() << ")";
214 
215  if (i == -1) {
216  std::string name = os.str();
217  for (i = 0; i < iend; i++) {
218  os.str(name);
219  os.seekp(0, std::ios_base::end);
220  os << ": " << dof[i/3] << xyz[i%3];
221 
222  desc[i] = os.str();
223  }
224 
225  } else {
226  os << ": " << dof[i/3] << xyz[i%3];
227  desc[0] = os.str();
228  }
229 }
230 
231 std::ostream&
232 DriveHingeJoint::DescribeEq(std::ostream& out,
233  const char *prefix, bool bInitial) const
234 {
235  integer iIndex = iGetFirstIndex();
236 
237  out
238  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
239  "orientation constraints [gx1=gx2,gy1=gy2,gz1=gz2]" << std::endl;
240 
241  if (bInitial) {
242  iIndex += 3;
243  out
244  << prefix << iIndex + 1 << "->" << iIndex + 3 << ": "
245  "angular velocity constraints [wx1=wx2,wy1=wy2,wz1=wz2]" << std::endl;
246  }
247 
248  return out;
249 
250 }
251 
252 void
253 DriveHingeJoint::DescribeEq(std::vector<std::string>& desc,
254  bool bInitial, int i) const
255 {
256  int iend = 1;
257  if (i == -1) {
258  if (bInitial) {
259  iend = 6;
260 
261  } else {
262  iend = 3;
263  }
264  }
265  desc.resize(iend);
266 
267  std::ostringstream os;
268  os << "DriveHingeJoint(" << GetLabel() << ")";
269 
270  if (i == -1) {
271  std::string name = os.str();
272  for (i = 0; i < iend; i++) {
273  os.str(name);
274  os.seekp(0, std::ios_base::end);
275  os << ": " << eq[i/3] << xyz[i%3];
276 
277  desc[i] = os.str();
278  }
279 
280  } else {
281  os << ": " << eq[i/3] << xyz[i%3];
282  desc[0] = os.str();
283  }
284 }
285 
286 /* Dati privati (aggiungere magari le reazioni vincolari) */
287 unsigned int
289 {
290  return 6;
291 };
292 
293 unsigned int
295 {
296  ASSERT(s != NULL);
297  ASSERT(s[0] != '\0');
298 
299  unsigned int idx = 0;
300 
301  switch (s[0]) {
302  case 'M':
303  idx += 3;
304  /* fallthru */
305  case 'r':
306  break;
307 
308  default:
309  return 0;
310  }
311 
312  if (s[1] == '\0' || s[2] != '\0') {
313  return 0;
314  }
315 
316  switch (s[1]) {
317  case 'x':
318  return idx + 1;
319  case 'y':
320  return idx + 2;
321  case 'z':
322  return idx + 3;
323  }
324 
325  return 0;
326 }
327 
329 DriveHingeJoint::dGetPrivData(unsigned int i) const
330 {
331  ASSERT(i >= 1 && i <= 6);
332 
333  switch (i) {
334  case 1:
335  case 2:
336  case 3:
337  return Get().dGet(i);
338 
339  case 4:
340  case 5:
341  case 6:
342  return M(i - 3);
343 
344  default:
345  ASSERT(0);
347  }
348 }
349 
350 /* assemblaggio jacobiano */
353  doublereal dCoef,
354  const VectorHandler& /* XCurr */ ,
355  const VectorHandler& /* XPrimeCurr */ )
356 {
357  DEBUGCOUT("Entering DriveHingeJoint::AssJac()" << std::endl);
358 
359  FullSubMatrixHandler& WM = WorkMat.SetFull();
360 
361  /* Dimensiona e resetta la matrice di lavoro */
362  integer iNumRows = 0;
363  integer iNumCols = 0;
364  WorkSpaceDim(&iNumRows, &iNumCols);
365  WM.ResizeReset(iNumRows, iNumCols);
366 
367  /* Recupera gli indici */
368  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
369  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
370  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
371  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
372  integer iFirstReactionIndex = iGetFirstIndex();
373 
374  /* Setta gli indici della matrice */
375  for (int iCnt = 1; iCnt <= 3; iCnt++) {
376  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
377  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
378  WM.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
379  WM.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
380  WM.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
381  WM.PutColIndex(6 + iCnt, iFirstReactionIndex + iCnt);
382  }
383 
384  AssMat(WM, dCoef);
385 
386  return WorkMat;
387 }
388 
389 
390 void
392  VectorHandler& /* XP */ )
393 {
394  /* Recupera i dati */
395  R1Ref = pNode1->GetRRef()*R1h;
396  Mat3x3 R1T = R1Ref.Transpose();
397  Mat3x3 RD(R1T*pNode2->GetRRef()*R2h);
398 
399  /* Calcola la deformazione corrente nel sistema locale (nodo a) */
401 
402  /* Calcola l'inversa di Gamma di ThetaRef */
403  Mat3x3 GammaRefm1 = RotManip::DRot_I(ThetaRef);
404 
405  /* Contributo alla linearizzazione ... */
406  RRef = GammaRefm1*R1T;
407 
408  /* Flag di aggiornamento dopo la predizione */
409  bFirstRes = true;
410 }
411 
412 
413 void
415 {
416  Mat3x3 MCross(MatCross, R1Ref*(M*dCoef));
417 
418  WM.Add(1, 1, MCross);
419  WM.Sub(4, 1, MCross);
420 
421  WM.Sub(1, 7, R1Ref);
422  WM.Add(4, 7, R1Ref);
423 
424  WM.Sub(7, 1, RRef);
425  WM.Add(7, 4, RRef);
426 }
427 
428 
429 /* assemblaggio residuo */
432  doublereal dCoef,
433  const VectorHandler& XCurr,
434  const VectorHandler& /* XPrimeCurr */ )
435 {
436  DEBUGCOUT("Entering DriveHingeJoint::AssRes()" << std::endl);
437 
438  /* Dimensiona e resetta la matrice di lavoro */
439  integer iNumRows = 0;
440  integer iNumCols = 0;
441  WorkSpaceDim(&iNumRows, &iNumCols);
442  WorkVec.ResizeReset(iNumRows);
443 
444  /* Recupera gli indici */
445  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
446  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
447  integer iFirstReactionIndex = iGetFirstIndex();
448 
449  /* Setta gli indici della matrice */
450  for (int iCnt = 1; iCnt <= 3; iCnt++) {
451  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
452  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
453  WorkVec.PutRowIndex(6 + iCnt, iFirstReactionIndex + iCnt);
454  }
455 
456  M = Vec3(XCurr, iFirstReactionIndex+1);
457 
458  AssVec(WorkVec, dCoef);
459 
460  return WorkVec;
461 }
462 
463 
464 void
466 {
467  Mat3x3 R1(pNode1->GetRCurr()*R1h);
468 
469  if (bFirstRes) {
470  /* La rotazione e' gia' stata aggiornata da AfterPredict */
471  bFirstRes = false;
472 
473  } else {
474  Mat3x3 R2(pNode2->GetRCurr()*R2h);
475  ThetaCurr = RotManip::VecRot(R1.Transpose()*R2);
476  }
477 
478  Vec3 MTmp(R1*M);
479 
480  WorkVec.Add(1, MTmp);
481  WorkVec.Sub(3 + 1, MTmp);
482 
483  ASSERT(dCoef != 0.);
484  WorkVec.Add(6 + 1, (Get() - ThetaCurr)/dCoef);
485 }
486 
487 
488 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
491  const VectorHandler& XCurr)
492 {
493  DEBUGCOUT("Entering DriveHingeJoint::InitialAssJac()" << std::endl);
494 
495  FullSubMatrixHandler& WM = WorkMat.SetFull();
496 
497  /* Dimensiona e resetta la matrice di lavoro */
498  integer iNumRows = 0;
499  integer iNumCols = 0;
500  InitialWorkSpaceDim(&iNumRows, &iNumCols);
501  WM.ResizeReset(iNumRows, iNumCols);
502 
503  /* Recupera gli indici */
504  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
505  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
506  integer iFirstReactionIndex = iGetFirstIndex();
507  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
508  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
509  integer iReactionPrimeIndex = iFirstReactionIndex + 3;
510 
511  /* Setta gli indici della matrice */
512  for (int iCnt = 1; iCnt <= 3; iCnt++) {
513  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
514  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
515  WM.PutRowIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
516  WM.PutColIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
517  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
518  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
519  WM.PutRowIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
520  WM.PutColIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
521  WM.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
522  WM.PutColIndex(12 + iCnt, iFirstReactionIndex + iCnt);
523  WM.PutRowIndex(15 + iCnt, iReactionPrimeIndex + iCnt);
524  WM.PutColIndex(15 + iCnt, iReactionPrimeIndex + iCnt);
525  }
526 
527  Mat3x3 Ra(pNode1->GetRRef()*R1h);
528  Mat3x3 RaT(Ra.Transpose());
529  Vec3 Wa(pNode1->GetWRef());
530  Vec3 Wb(pNode2->GetWRef());
531 
532  Mat3x3 MTmp(MatCross, M);
533  Mat3x3 MPrimeTmp(MatCross, Ra*Vec3(XCurr, iReactionPrimeIndex + 1));
534 
535  WM.Add(1, 1, MTmp);
536  WM.Add(3 + 1, 3 + 1, MTmp);
537  WM.Sub(6 + 1, 1, MTmp);
538  WM.Sub(9 + 1, 3 + 1, MTmp);
539 
540  MTmp = Wa.Cross(MTmp) + MPrimeTmp;
541  WM.Add(3 + 1, 1, MTmp);
542  WM.Sub(9 + 1, 1, MTmp);
543 
544  WM.Add(6 + 1, 12 + 1, Ra);
545  WM.Add(9 + 1, 15 + 1, Ra);
546  WM.Sub(1, 12 + 1, Ra);
547  WM.Sub(3 + 1, 15 + 1, Ra);
548 
549  MTmp = Wa.Cross(Ra);
550  WM.Add(9 + 1, 12 + 1, MTmp);
551  WM.Sub(3 + 1, 12 + 1, MTmp);
552 
553  WM.Add(12 + 1, 6 + 1, RaT);
554  WM.Sub(12 + 1, 1, RaT);
555  WM.Sub(15 + 1, 3 + 1, RaT);
556  WM.Add(15 + 1, 9 + 1, RaT);
557  WM.Add(15 + 1, 1, RaT*Mat3x3(MatCross, Wb - Wa));
558 
559  return WorkMat;
560 }
561 
562 
563 /* Contributo al residuo durante l'assemblaggio iniziale */
566  const VectorHandler& XCurr)
567 {
568  DEBUGCOUT("Entering DriveHingeJoint::InitialAssRes()" << std::endl);
569 
570  /* Dimensiona e resetta la matrice di lavoro */
571  integer iNumRows = 0;
572  integer iNumCols = 0;
573  InitialWorkSpaceDim(&iNumRows, &iNumCols);
574  WorkVec.ResizeReset(iNumRows);
575 
576  /* Recupera gli indici */
577  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
578  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
579  integer iFirstReactionIndex = iGetFirstIndex();
580  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
581  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
582  integer iReactionPrimeIndex = iFirstReactionIndex + 3;
583 
584  /* Setta gli indici del vettore */
585  for (int iCnt = 1; iCnt <= 3; iCnt++) {
586  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
587  WorkVec.PutRowIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
588  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
589  WorkVec.PutRowIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
590  WorkVec.PutRowIndex(12 + iCnt, iFirstReactionIndex + iCnt);
591  WorkVec.PutRowIndex(15 + iCnt, iReactionPrimeIndex + iCnt);
592  }
593 
594  Mat3x3 R1(pNode1->GetRCurr()*R1h);
595  Mat3x3 R1T(R1.Transpose());
596  Vec3 Wa(pNode1->GetWCurr());
597  Vec3 Wb(pNode2->GetWCurr());
598 
599  M = Vec3(XCurr, iFirstReactionIndex+1);
600  Vec3 MPrime = Vec3(XCurr, iReactionPrimeIndex+1);
601 
602  Vec3 MTmp(R1*M);
603  Vec3 MPrimeTmp(Wa.Cross(MTmp) + R1*MPrime);
604 
605  Mat3x3 R2(pNode2->GetRCurr()*R2h);
606  ThetaCurr = RotManip::VecRot(R1T*R2);
607 
608  Vec3 ThetaPrime = R1T*(Wb-Wa);
609 
610  WorkVec.Add(1, MTmp);
611  WorkVec.Add(3 + 1, MPrimeTmp);
612  WorkVec.Sub(6 + 1, MTmp);
613  WorkVec.Sub(9 + 1, MPrimeTmp);
614  WorkVec.Add(12 + 1, Get() - ThetaCurr);
615  if (bIsDifferentiable()) {
616  ThetaPrime -= GetP();
617  }
618  WorkVec.Sub(15 + 1, ThetaPrime);
619 
620  return WorkVec;
621 }
622 
623 /* DriveHingeJoint - end */
Definition: hint.h:38
virtual ~DriveHingeJoint(void)
Definition: drvhinge.cc:71
virtual std::ostream & Restart(std::ostream &out) const
Definition: drvhinge.cc:79
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
const Vec3 Zero3(0., 0., 0.)
long int flag
Definition: mbdyn.h:43
static const char * eq[]
Definition: drvhinge.cc:195
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
virtual bool bToBeOutput(void) const
Definition: output.cc:890
DriveHingeJoint(unsigned int uL, const DofOwner *pDO, const TplDriveCaller< Vec3 > *pDC, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &R1, const Mat3x3 &R2, flag fOut)
Definition: drvhinge.cc:44
virtual bool bIsDifferentiable(void) const
Definition: tpldrive.h:118
#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
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: drvhinge.cc:391
FullSubMatrixHandler & SetFull(void)
Definition: submat.h:1168
virtual const Mat3x3 & GetRCurr(void) const
Definition: strnode.h:1012
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: simentity.cc:76
std::ostream & Write(std::ostream &out, const FullMatrixHandler &m, const char *s, const char *s2)
Definition: fullmh.cc:376
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: drvhinge.cc:150
virtual void Output(OutputHandler &OH) const
Definition: drvhinge.cc:94
virtual doublereal dGetPrivData(unsigned int i=0) const
Definition: drvhinge.cc:329
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvhinge.cc:431
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
#define NO_OP
Definition: myassert.h:74
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: drvhinge.cc:107
std::vector< Hint * > Hints
Definition: simentity.h:89
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
const Mat3x3 R1h
Definition: drvhinge.h:51
void Set(const TplDriveCaller< T > *pDC)
Definition: tpldrive.h:97
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:127
virtual Vec3 GetP(void) const
Definition: tpldrive.h:121
static const char * dof[]
Definition: drvhinge.cc:194
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual unsigned int iGetNumPrivData(void) const
Definition: drvhinge.cc:288
virtual std::ostream & DescribeDof(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: drvhinge.cc:174
TplDriveCaller< Vec3 > * pGetDriveCaller(void) const
Definition: tpldrive.h:105
Definition: mbdyn.h:76
unsigned int iGetPrivDataIdx(const char *s) const
Definition: drvhinge.cc:294
const doublereal & dGet(unsigned short int iRow) const
Definition: matvec3.h:285
Mat3x3 RRef
Definition: drvhinge.h:55
#define DEBUGCOUT(msg)
Definition: myassert.h:232
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: drvhinge.h:154
const StructNode * pNode2
Definition: drvhinge.h:50
virtual integer iGetFirstMomentumIndex(void) const =0
virtual integer iGetFirstPositionIndex(void) const
Definition: strnode.h:452
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: drvhinge.cc:352
virtual const Vec3 & GetWCurr(void) const
Definition: strnode.h:1030
const doublereal dRaDegr
Definition: matvec3.cc:884
unsigned int uLabel
Definition: withlab.h:44
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
std::ostream & Joints(void) const
Definition: output.h:443
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: drvhinge.cc:490
virtual std::ostream & Restart(std::ostream &out) const =0
TplDriveCaller< T > * pCreateDrive(DataManager *pDM) const
Definition: hint_impl.h:124
#define ASSERT(expression)
Definition: colamd.c:977
Vec3 MatR2EulerAngles(const Mat3x3 &R)
Definition: matvec3.cc:887
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
Mat3x3 R1Ref
Definition: drvhinge.h:54
const StructNode * pNode1
Definition: drvhinge.h:49
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
Vec3 ThetaCurr
Definition: drvhinge.h:58
#define STRLENOF(s)
Definition: mbdyn.h:166
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: drvhinge.cc:565
Definition: elem.h:75
void AssMat(FullSubMatrixHandler &WM, doublereal dCoef)
Definition: drvhinge.cc:414
void AssVec(SubVectorHandler &WorkVec, doublereal dCoef)
Definition: drvhinge.cc:465
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
virtual std::ostream & DescribeEq(std::ostream &out, const char *prefix="", bool bInitial=false) const
Definition: drvhinge.cc:232
const Mat3x3 R2h
Definition: drvhinge.h:52
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
Definition: joint.h:50
virtual integer iGetFirstIndex(void) const
Definition: dofown.h:127
double doublereal
Definition: colamd.c:52
bool bFirstRes
Definition: drvhinge.h:62
std::ostream & Output(std::ostream &out, const char *sJointName, unsigned int uLabel, const Vec3 &FLocal, const Vec3 &MLocal, const Vec3 &FGlobal, const Vec3 &MGlobal) const
Definition: joint.cc:138
long int integer
Definition: colamd.c:51
unsigned int GetLabel(void) const
Definition: withlab.cc:62
static const char xyz[]
Definition: drvhinge.cc:193
Vec3 Get(void) const
Definition: tpldrive.h:113
Mat3x3 DRot_I(const Vec3 &phi)
Definition: Rot.cc:111