MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
vehj4.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/vehj4.cc,v 1.14 2017/01/12 14:46:44 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 deformabile */
33 
34 #include "mbconfig.h" /* This goes first in every *.c,*.cc file */
35 
36 #include "dataman.h"
37 #include "vehj4.h"
38 
39 #include "matvecexp.h"
40 #include "Rot.hh"
41 
42 /* DeformableAxialJoint - begin */
43 
44 /* assemblaggio jacobiano */
45 /* Used by all "attached" hinges */
46 void
48  doublereal dCoef)
49 {
50  /* M was updated by AssRes */
51  Mat3x3 MTmp(MatCross, M*dCoef);
52 
53  WMA.Add(1, 1, MTmp);
54  WMA.Sub(4, 1, MTmp);
55 }
56 
57 /* Used by all hinges */
58 void
60  doublereal dCoef)
61 {
62  Mat3x3 MTmp(MDE*dCoef);
63 
64  WMA.Add(1, 1, MTmp);
65  WMA.Sub(1, 4, MTmp);
66  WMA.Sub(4, 1, MTmp);
67  WMA.Add(4, 4, MTmp);
68 }
69 
70 /* Used by all "attached" hinges */
71 void
73  FullSubMatrixHandler& WMB, doublereal dCoef)
74 {
75  WMB.Add(1, 1, MDEPrime);
76  WMB.Sub(1, 4, MDEPrime);
77  WMB.Sub(4, 1, MDEPrime);
78  WMB.Add(4, 4, MDEPrime);
79 
80  Mat3x3 MTmp(MDEPrime*Mat3x3(MatCross, pNode2->GetWCurr()*dCoef));
81  WMA.Sub(1, 1, MTmp);
82  WMA.Add(1, 4, MTmp);
83  WMA.Add(4, 1, MTmp);
84  WMA.Sub(4, 4, MTmp);
85 }
86 
87 /* Costruttore non banale */
89  const DofOwner* pDO,
90  const ConstitutiveLaw1D* pCL,
91  const StructNode* pN1,
92  const StructNode* pN2,
93  const Mat3x3& tilde_R1h,
94  const Mat3x3& tilde_R2h,
95  flag fOut)
96 : Elem(uL, fOut),
97 Joint(uL, pDO, fOut),
99 pNode1(pN1),
100 pNode2(pN2),
101 tilde_R1h(tilde_R1h),
102 tilde_R2h(tilde_R2h),
103 bFirstRes(false),
104 dTol(0.)
105 {
106  ASSERT(pNode1 != NULL);
107  ASSERT(pNode2 != NULL);
110 }
111 
112 /* Distruttore */
114 {
115  NO_OP;
116 }
117 
118 /* Contributo al file di restart */
119 std::ostream&
120 DeformableAxialJoint::Restart(std::ostream& out) const
121 {
122  /* FIXME: does not work for invariant hinge */
123  Joint::Restart(out) << ", deformable hinge, "
124  << pNode1->GetLabel() << ", hinge, reference, node, 1, ",
125  (tilde_R1h.GetVec(1)).Write(out, ", ")
126  << ", 2, ", (tilde_R1h.GetVec(2)).Write(out, ", ") << ", "
127  << pNode2->GetLabel() << ", hinge, reference, node, 1, ",
128  (tilde_R2h.GetVec(1)).Write(out, ", ")
129  << ", 2, ", (tilde_R2h.GetVec(2)).Write(out, ", ") << ", ";
130  return pGetConstLaw()->Restart(out) << ';' << std::endl;
131 }
132 
133 void
135 {
136  if (bToBeOutput()) {
139  Mat3x3 R(R1h.MulTM(R2h));
140 
141  Vec3 v(0., 0., GetF());
142  Joint::Output(OH.Joints(), "DeformableHinge", GetLabel(),
143  Zero3, v, Zero3, R1h*v) << " " << RotManip::VecRot(R)(3);
144 
146  OH.Joints() << " " << R1h.GetVec(3).Dot(pNode2->GetWCurr() - pNode1->GetWCurr());
147  }
148 
149  OH.Joints() << std::endl;
150  }
151 }
152 
153 void
155  VectorHandler& /* XP */ )
156 {
157  bFirstRes = true;
158 
159  AfterPredict();
160 }
161 
162 void
166 {
167  if (ph) {
168  for (unsigned i = 0; i < ph->size(); i++) {
169  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
170 
171  if (pjh) {
172  if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
174 
175  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
177 
178  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
179  /* TODO */
180  }
181 
182  continue;
183  }
184 
185  /* else, pass to constitutive law */
186  ConstitutiveLaw1DOwner::SetValue(pDM, X, XP, ph);
187  }
188  }
189 }
190 
191 void
193 {
194  AfterPredict();
195 }
196 
197 /* inverse dynamics capable element */
198 bool
200 {
201  return true;
202 }
203 
204 Hint *
206 {
207  if (strncasecmp(s, "hinge{" /*}*/, STRLENOF("hinge{" /*}*/)) == 0) {
208  s += STRLENOF("hinge{" /*}*/);
209 
210  if (strcmp(&s[1], /*{*/ "}") != 0) {
211  return 0;
212  }
213 
214  switch (s[0]) {
215  case '1':
216  return new Joint::HingeHint<1>;
217 
218  case '2':
219  return new Joint::HingeHint<2>;
220  }
221  }
222 
223  return ConstitutiveLaw1DOwner::ParseHint(pDM, s);
224 }
225 
226 unsigned int
228 {
230 }
231 
232 unsigned int
234 {
235  ASSERT(s != NULL);
236 
237  if (s[1] == 'z' && s[2] == '\0') {
238  switch (s[0]) {
239  case 'r':
240  return 1;
241 
242  case 'w':
243  return 2;
244 
245  case 'M':
246  return 3;
247  }
248  }
249 
250  const size_t l = STRLENOF("constitutiveLaw.");
251  if (strncmp(s, "constitutiveLaw.", l) == 0) {
252  unsigned idx = ConstitutiveLaw1DOwner::iGetPrivDataIdx(&s[l]);
253  if (idx > 0) {
254  return 3 + idx;
255  }
256  }
257 
258  return 0;
259 }
260 
263 {
264  ASSERT(i > 0);
265 
266  ASSERT(i <= iGetNumPrivData());
267 
268  switch (i) {
269  case 1:
270  {
271  /* NOTE: this is correct also in the invariant case */
274 
275  Vec3 v(RotManip::VecRot(R1h.MulTM(R2h)));
276 
277  return v(3);
278  }
279 
280  case 2:
281  {
283  Vec3 w(R1h.MulTV(pNode2->GetWCurr() - pNode1->GetWCurr()));
284 
285  return w(3);
286  }
287 
288  case 3:
289  return GetF();
290 
291  default:
293  }
294 }
295 
296 /* DeformableAxialJoint - end */
297 
298 
299 /* ElasticAxialJoint - begin */
300 
302  const DofOwner* pDO,
303  const ConstitutiveLaw1D* pCL,
304  const StructNode* pN1,
305  const StructNode* pN2,
306  const Mat3x3& tilde_R1h,
307  const Mat3x3& tilde_R2h,
308  flag fOut)
309 : Elem(uL, fOut),
310 DeformableAxialJoint(uL, pDO, pCL, pN1, pN2, tilde_R1h, tilde_R2h, fOut),
311 dThetaRef(0.)
312 {
313  // force update of MDE/MDEPrime as needed
314  AfterPredict();
315 }
316 
318 {
319  NO_OP;
320 }
321 
322 void
324  const VectorHandler& XP)
325 {
327 }
328 
329 /* assemblaggio jacobiano */
332  doublereal dCoef,
333  const VectorHandler& /* XCurr */ ,
334  const VectorHandler& /* XPrimeCurr */ )
335 {
336  DEBUGCOUT("Entering ElasticAxialJoint::AssJac()" << std::endl);
337 
338  FullSubMatrixHandler& WM = WorkMat.SetFull();
339 
340  /* Dimensiona e resetta la matrice di lavoro */
341  integer iNumRows = 0;
342  integer iNumCols = 0;
343  WorkSpaceDim(&iNumRows, &iNumCols);
344  WM.ResizeReset(iNumRows, iNumCols);
345 
346  /* Recupera gli indici */
347  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
348  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
349  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
350  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
351 
352  /* Setta gli indici della matrice */
353  for (int iCnt = 1; iCnt <= 3; iCnt++) {
354  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
355  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
356  WM.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
357  WM.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
358  }
359 
360  AssMat(WM, dCoef);
361 
362  return WorkMat;
363 }
364 
365 /* assemblaggio jacobiano */
366 void
368  VariableSubMatrixHandler& WorkMatB,
369  const VectorHandler& /* XCurr */ ,
370  const VectorHandler& /* XPrimeCurr */ )
371 {
372  DEBUGCOUT("Entering ElasticAxialJoint::AssJac()" << std::endl);
373 
374  FullSubMatrixHandler& WMA = WorkMatA.SetFull();
375  WorkMatB.SetNullMatrix();
376 
377  /* Dimensiona e resetta la matrice di lavoro */
378  integer iNumRows = 0;
379  integer iNumCols = 0;
380  WorkSpaceDim(&iNumRows, &iNumCols);
381  WMA.ResizeReset(iNumRows, iNumCols);
382 
383  /* Recupera gli indici */
384  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
385  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
386  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
387  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
388 
389  /* Setta gli indici della matrice */
390  for (int iCnt = 1; iCnt <= 3; iCnt++) {
391  WMA.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
392  WMA.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
393  WMA.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
394  WMA.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
395  }
396 
397  AssMat(WMA, 1.);
398 }
399 
400 void
402 {
403  /* Calcola le deformazioni, aggiorna il legame costitutivo
404  * e crea la MDE */
405 
406  /* Recupera i dati */
407  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
408  Mat3x3 R2h(pNode2->GetRRef()*tilde_R2h);
409 
410  /* Calcola la deformazione corrente nel sistema locale (nodo a) */
411  dThetaCurr = dThetaRef = RotManip::VecRot(R1h.MulTM(R2h))(3);
412 
413  /* Aggiorna il legame costitutivo */
415 
416  /* Chiede la matrice tangente di riferimento e la porta
417  * nel sistema globale */
418  Vec3 e1z(R1h.GetVec(3));
420 }
421 
422 void
424 {
425 #if 0
426  // Calcola l'inversa di Gamma di ThetaRef
427  Mat3x3 GammaCurrm1 = RotManip::DRot_I(ThetaCurr);
428 
429  // Chiede la matrice tangente di riferimento e la porta
430  // nel sistema globale
431  MDE = R1h*ConstitutiveLaw1DOwner::GetFDE()*GammaCurrm1.MulMT(R1h);
432 #endif
433 
434  AssMatM(WMA, dCoef);
435  AssMatMDE(WMA, dCoef);
436 }
437 
438 /* Inverse Dynamics Jacobian matrix assembly */
441  const VectorHandler& XCurr)
442 {
443  ASSERT(bIsErgonomy());
444 
445  // HACK? Need to call AfterPredict() here to update MDE and so
446  AfterPredict();
447 
448  return AssJac(WorkMat, 1., XCurr, XCurr);
449 }
450 
451 /* assemblaggio residuo */
454  doublereal /* dCoef */ ,
455  const VectorHandler& /* XCurr */ ,
456  const VectorHandler& /* XPrimeCurr */ )
457 {
458  DEBUGCOUT("Entering ElasticAxialJoint::AssRes()" << std::endl);
459 
460  /* Dimensiona e resetta la matrice di lavoro */
461  integer iNumRows = 0;
462  integer iNumCols = 0;
463  WorkSpaceDim(&iNumRows, &iNumCols);
464  WorkVec.ResizeReset(iNumRows);
465 
466  /* Recupera gli indici */
467  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
468  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
469 
470  /* Setta gli indici della matrice */
471  for (int iCnt = 1; iCnt <= 3; iCnt++) {
472  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
473  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
474  }
475 
476  AssVec(WorkVec);
477 
478  return WorkVec;
479 }
480 
481 /* Inverse Dynamics Residual Assembly */
484  const VectorHandler& /* XCurr */,
485  const VectorHandler& /* XPrimeCurr */,
486  const VectorHandler& /* XPrimePrimeCurr */,
487  InverseDynamics::Order iOrder)
488 {
489  DEBUGCOUT("Entering ElasticAxialJoint::AssRes()" << std::endl);
490 
492  || (iOrder == InverseDynamics::POSITION && bIsErgonomy()));
493 
494  /* There is no need to call AfterPredict, everything is done in AssVec*/
495  bFirstRes = false;
496 
497  /* Dimensiona e resetta la matrice di lavoro */
498  integer iNumRows = 0;
499  integer iNumCols = 0;
500  WorkSpaceDim(&iNumRows, &iNumCols);
501  WorkVec.ResizeReset(iNumRows);
502 
503  /* Recupera gli indici */
504  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex() + 3;
505  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex() + 3;
506 
507  /* Setta gli indici della matrice */
508  for (int iCnt = 1; iCnt <= 3; iCnt++) {
509  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
510  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
511  }
512 
513  AssVec(WorkVec);
514 
515  return WorkVec;
516 }
517 
518 /* Inverse Dynamics update */
519 void
521 {
522  NO_OP;
523 }
524 
525 /* Inverse Dynamics after convergence */
526 void
528  const VectorHandler& XP, const VectorHandler& XPP)
529 {
531 }
532 
533 
534 void
536 {
538 
539  if (bFirstRes) {
540  bFirstRes = false;
541 
542  } else {
544  Vec3 ThetaCurr(RotManip::VecRot(R1h.MulTM(R2h)));
545  dThetaCurr = ThetaCurr(3);
547 
548  // sanity check
549  if (dTol > 0.) {
550  ThetaCurr(3) = 0.;
551  doublereal dErr = ThetaCurr.Norm();
552  if (dErr > dTol) {
553  silent_cerr("ElasticAxialJoint(" << GetLabel() << "): axes non-colinear (err=" << dErr << ")" << std::endl);
554  }
555  }
556  }
557 
558  /* Couple attached to node 1 */
559  M = R1h.GetVec(3)*GetF();
560 
561  WorkVec.Add(1, M);
562  WorkVec.Sub(4, M);
563 }
564 
565 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
568  const VectorHandler& /* XCurr */ )
569 {
570  DEBUGCOUT("Entering ElasticAxialJoint::InitialAssJac()" << std::endl);
571 
572  FullSubMatrixHandler& WM = WorkMat.SetFull();
573 
574  /* Dimensiona e resetta la matrice di lavoro */
575  integer iNumRows = 0;
576  integer iNumCols = 0;
577  InitialWorkSpaceDim(&iNumRows, &iNumCols);
578  WM.ResizeReset(iNumRows, iNumCols);
579 
580  /* Recupera gli indici */
581  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
582  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
583 
584  /* Setta gli indici della matrice */
585  for (int iCnt = 1; iCnt <= 3; iCnt++) {
586  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
587  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
588  WM.PutRowIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
589  WM.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
590  }
591 
592  AssMat(WM, 1.);
593 
594  return WorkMat;
595 }
596 
597 /* Contributo al residuo durante l'assemblaggio iniziale */
600  const VectorHandler& /* XCurr */ )
601 {
602  /* Dimensiona e resetta la matrice di lavoro */
603  integer iNumRows = 0;
604  integer iNumCols = 0;
605  InitialWorkSpaceDim(&iNumRows, &iNumCols);
606  WorkVec.ResizeReset(iNumRows);
607 
608  /* Recupera gli indici */
609  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
610  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
611 
612  /* Setta gli indici della matrice */
613  for (int iCnt = 1; iCnt <= 3; iCnt++) {
614  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
615  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
616  }
617 
618  AssVec(WorkVec);
619 
620  return WorkVec;
621 }
622 
623 /* ElasticAxialJoint - end */
624 
625 
626 /* ViscousAxialJoint - begin */
627 
629  const DofOwner* pDO,
630  const ConstitutiveLaw1D* pCL,
631  const StructNode* pN1,
632  const StructNode* pN2,
633  const Mat3x3& tilde_R1h,
634  const Mat3x3& tilde_R2h,
635  flag fOut)
636 : Elem(uL, fOut),
637 DeformableAxialJoint(uL, pDO, pCL, pN1, pN2, tilde_R1h, tilde_R2h, fOut)
638 {
639  // force update of MDE/MDEPrime as needed
640  AfterPredict();
641 }
642 
644 {
645  NO_OP;
646 }
647 
648 void
650  const VectorHandler& XP)
651 {
653 }
654 
655 void
657 {
658  /* Calcola le deformazioni, aggiorna il legame costitutivo
659  * e crea la MDE */
660 
661  /* Aggiorna il legame costitutivo */
662  Vec3 e1z(pNode1->GetRRef()*tilde_R1h.GetVec(3));
663  dOmega = e1z.Dot(pNode2->GetWRef() - pNode1->GetWRef());
664  ConstitutiveLaw1DOwner::Update(0., dOmega);
665 
666  /* Chiede la matrice tangente di riferimento e la porta
667  * nel sistema globale */
668  MDEPrime = e1z.Tens(e1z*GetFDEPrime());
669 }
670 
671 /* assemblaggio jacobiano */
674  doublereal dCoef,
675  const VectorHandler& /* XCurr */ ,
676  const VectorHandler& /* XPrimeCurr */ )
677 {
678  FullSubMatrixHandler& WM = WorkMat.SetFull();
679 
680  /* Dimensiona e resetta la matrice di lavoro */
681  integer iNumRows = 0;
682  integer iNumCols = 0;
683  WorkSpaceDim(&iNumRows, &iNumCols);
684  WM.ResizeReset(iNumRows, iNumCols);
685 
686  /* Recupera gli indici */
687  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
688  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
689  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
690  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
691 
692  /* Setta gli indici della matrice */
693  for (int iCnt = 1; iCnt <= 3; iCnt++) {
694  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
695  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
696  WM.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
697  WM.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
698  }
699 
700  AssMats(WM, WM, dCoef);
701 
702  return WorkMat;
703 }
704 
705 /* assemblaggio jacobiano */
706 void
708  VariableSubMatrixHandler& WorkMatB,
709  const VectorHandler& /* XCurr */ ,
710  const VectorHandler& /* XPrimeCurr */ )
711 {
712  FullSubMatrixHandler& WMA = WorkMatA.SetFull();
713  FullSubMatrixHandler& WMB = WorkMatB.SetFull();
714 
715  /* Dimensiona e resetta la matrice di lavoro */
716  integer iNumRows = 0;
717  integer iNumCols = 0;
718  WorkSpaceDim(&iNumRows, &iNumCols);
719  WMA.ResizeReset(iNumRows, iNumCols);
720  WMB.ResizeReset(iNumRows, iNumCols);
721 
722  /* Recupera gli indici */
723  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
724  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
725  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
726  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
727 
728  /* Setta gli indici della matrice */
729  for (int iCnt = 1; iCnt <= 3; iCnt++) {
730  WMA.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
731  WMA.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
732  WMA.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
733  WMA.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
734 
735  WMB.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
736  WMB.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
737  WMB.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
738  WMB.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
739  }
740 
741  AssMats(WMA, WMA, 1.);
742 }
743 
744 /* assemblaggio jacobiano */
745 void
748  doublereal dCoef)
749 {
750  AssMatM(WMA, dCoef);
751  AssMatMDEPrime(WMA, WMB, dCoef);
752 }
753 
754 /* assemblaggio residuo */
757  doublereal /* dCoef */ ,
758  const VectorHandler& /* XCurr */ ,
759  const VectorHandler& /* XPrimeCurr */ )
760 {
761  /* Dimensiona e resetta la matrice di lavoro */
762  integer iNumRows = 0;
763  integer iNumCols = 0;
764  WorkSpaceDim(&iNumRows, &iNumCols);
765  WorkVec.ResizeReset(iNumRows);
766 
767  /* Recupera gli indici */
768  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
769  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
770 
771  /* Setta gli indici della matrice */
772  for (int iCnt = 1; iCnt <= 3; iCnt++) {
773  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
774  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
775  }
776 
777  AssVec(WorkVec);
778 
779  return WorkVec;
780 }
781 
782 /* Inverse Dynamics Residual Assembly */
785  const VectorHandler& /* XCurr */,
786  const VectorHandler& /* XPrimeCurr */,
787  const VectorHandler& /* XPrimePrimeCurr */,
788  InverseDynamics::Order iOrder)
789 {
791 
792  bFirstRes = false;
793 
794  /* Dimensiona e resetta la matrice di lavoro */
795  integer iNumRows = 0;
796  integer iNumCols = 0;
797  WorkSpaceDim(&iNumRows, &iNumCols);
798  WorkVec.ResizeReset(iNumRows);
799 
800  /* Recupera gli indici */
801  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex() + 3;
802  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex() + 3;
803 
804  /* Setta gli indici della matrice */
805  for (int iCnt = 1; iCnt <= 3; iCnt++) {
806  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
807  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
808  }
809 
810  AssVec(WorkVec);
811 
812  return WorkVec;
813 }
814 
815 /* assemblaggio residuo */
816 void
818 {
819  Vec3 e1z(pNode1->GetRCurr()*tilde_R1h.GetVec(3));
820 
821  if (bFirstRes) {
822  bFirstRes = false;
823 
824  } else {
825  dOmega = e1z.Dot(pNode2->GetWCurr() - pNode1->GetWCurr());
826 
828  }
829 
831 
832  WorkVec.Add(1, M);
833  WorkVec.Sub(4, M);
834 }
835 
836 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
839  const VectorHandler& /* XCurr */ )
840 {
841  FullSubMatrixHandler& WM = WorkMat.SetFull();
842 
843  /* Dimensiona e resetta la matrice di lavoro */
844  integer iNumRows = 0;
845  integer iNumCols = 0;
846  InitialWorkSpaceDim(&iNumRows, &iNumCols);
847  WM.ResizeReset(iNumRows, iNumCols);
848 
849  /* Recupera gli indici */
850  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
851  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
852  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
853  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
854 
855  /* Setta gli indici della matrice */
856  for (int iCnt = 1; iCnt <= 3; iCnt++) {
857  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
858  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
859  WM.PutColIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
860 
861  WM.PutRowIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
862  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
863  WM.PutColIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
864  }
865 
866  Vec3 e1z(pNode1->GetRCurr()*tilde_R1h.GetVec(3));
867 
868  const Vec3& W2(pNode2->GetWCurr());
869 
871 
872  Mat3x3 Tmp(MDEPrime*Mat3x3(MatCross, W2));
873  WM.Add(4, 7, Tmp);
874  WM.Sub(1, 7, Tmp);
875 
877  WM.Add(1, 1, Tmp);
878  WM.Sub(4, 1, Tmp);
879 
880  WM.Add(1, 4, MDEPrime);
881  WM.Add(4, 10, MDEPrime);
882 
883  WM.Sub(1, 10, MDEPrime);
884  WM.Sub(4, 4, MDEPrime);
885 
886  return WorkMat;
887 }
888 
889 /* Contributo al residuo durante l'assemblaggio iniziale */
892  const VectorHandler& /* XCurr */ )
893 {
894  /* Dimensiona e resetta la matrice di lavoro */
895  integer iNumRows = 0;
896  integer iNumCols = 0;
897  InitialWorkSpaceDim(&iNumRows, &iNumCols);
898  WorkVec.ResizeReset(iNumRows);
899 
900  /* Recupera gli indici */
901  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
902  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
903 
904  /* Setta gli indici della matrice */
905  for (int iCnt = 1; iCnt <= 3; iCnt++) {
906  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
907  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
908  }
909 
910  Vec3 e1z(pNode1->GetRCurr()*tilde_R1h.GetVec(3));
911 
912  if (bFirstRes) {
913  bFirstRes = false;
914 
915  } else {
916  dOmega = e1z.Dot(pNode2->GetWCurr() - pNode1->GetWCurr());
917 
919  }
920 
922 
923  WorkVec.Add(1, M);
924  WorkVec.Sub(4, M);
925 
926  return WorkVec;
927 }
928 
929 /* ViscousAxialJoint - end */
930 
931 
932 /* ViscoElasticAxialJoint - begin */
933 
935  const DofOwner* pDO,
936  const ConstitutiveLaw1D* pCL,
937  const StructNode* pN1,
938  const StructNode* pN2,
939  const Mat3x3& tilde_R1h,
940  const Mat3x3& tilde_R2h,
941  flag fOut)
942 : Elem(uL, fOut),
943 DeformableAxialJoint(uL, pDO, pCL, pN1, pN2, tilde_R1h, tilde_R2h, fOut),
944 dThetaRef(0.)
945 {
946  // force update of MDE/MDEPrime as needed
947  AfterPredict();
948 }
949 
951 {
952  NO_OP;
953 }
954 
955 void
957  const VectorHandler& XP)
958 {
960 }
961 
962 void
964 {
965  /* Computes strains, updates constitutive law and generates
966  * MDE and MDEPrime */
967 
968  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
969  Mat3x3 R2h(pNode2->GetRRef()*tilde_R2h);
970 
971  /* Current strain in material reference frame (node 1) */
972  dThetaCurr = dThetaRef = RotManip::VecRot(R1h.MulTM(R2h))(3);
973 
974  /* Relative angular velocity */
975  Vec3 e1z(R1h.GetVec(3));
976  dOmega = e1z.Dot(pNode2->GetWRef() - pNode1->GetWRef());
977 
978  /* Updates constitutive law */
980 
981  /* don't repeat the above operations during AssRes */
982  bFirstRes = true;
983 
984  /* Tangent matrices are updated and projected in the global
985  * reference frame; they won't change during the solution
986  * of the current time step, according to the updated-updated
987  * approach */
989  MDEPrime = e1z.Tens(e1z*GetFDEPrime());
990 }
991 
992 /* assemblaggio jacobiano */
995  doublereal dCoef,
996  const VectorHandler& /* XCurr */ ,
997  const VectorHandler& /* XPrimeCurr */ )
998 {
999  FullSubMatrixHandler& WM = WorkMat.SetFull();
1000 
1001  /* Dimensiona e resetta la matrice di lavoro */
1002  integer iNumRows = 0;
1003  integer iNumCols = 0;
1004  WorkSpaceDim(&iNumRows, &iNumCols);
1005  WM.ResizeReset(iNumRows, iNumCols);
1006 
1007  /* Recupera gli indici */
1008  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
1009  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
1010  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
1011  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
1012 
1013  /* Setta gli indici della matrice */
1014  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1015  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1016  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1017  WM.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
1018  WM.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
1019  }
1020 
1021  AssMats(WM, WM, dCoef);
1022 
1023  return WorkMat;
1024 }
1025 
1026 /* assemblaggio jacobiano */
1027 void
1029  VariableSubMatrixHandler& WorkMatB,
1030  const VectorHandler& /* XCurr */ ,
1031  const VectorHandler& /* XPrimeCurr */ )
1032 {
1033  FullSubMatrixHandler& WMA = WorkMatA.SetFull();
1034  FullSubMatrixHandler& WMB = WorkMatB.SetFull();
1035 
1036  /* Dimensiona e resetta la matrice di lavoro */
1037  integer iNumRows = 0;
1038  integer iNumCols = 0;
1039  WorkSpaceDim(&iNumRows, &iNumCols);
1040  WMA.ResizeReset(iNumRows, iNumCols);
1041  WMB.ResizeReset(iNumRows, iNumCols);
1042 
1043  /* Recupera gli indici */
1044  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
1045  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
1046  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
1047  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
1048 
1049  /* Setta gli indici della matrice */
1050  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1051  WMA.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1052  WMA.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1053  WMA.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
1054  WMA.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
1055 
1056  WMB.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1057  WMB.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1058  WMB.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
1059  WMB.PutColIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
1060  }
1061 
1062  AssMats(WMA, WMB, 1.);
1063 }
1064 
1065 /* assemblaggio jacobiano */
1066 void
1068  FullSubMatrixHandler& WMB,
1069  doublereal dCoef)
1070 {
1071  AssMatM(WMA, dCoef);
1072  AssMatMDE(WMA, dCoef);
1073  AssMatMDEPrime(WMA, WMB, dCoef);
1074 }
1075 
1076 /* assemblaggio residuo */
1079  doublereal /* dCoef */ ,
1080  const VectorHandler& /* XCurr */ ,
1081  const VectorHandler& /* XPrimeCurr */ )
1082 {
1083  /* Dimensiona e resetta la matrice di lavoro */
1084  integer iNumRows = 0;
1085  integer iNumCols = 0;
1086  WorkSpaceDim(&iNumRows, &iNumCols);
1087  WorkVec.ResizeReset(iNumRows);
1088 
1089  /* Recupera gli indici */
1090  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex() + 3;
1091  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex() + 3;
1092 
1093  /* Setta gli indici della matrice */
1094  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1095  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1096  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
1097  }
1098 
1099  AssVec(WorkVec);
1100 
1101  return WorkVec;
1102 }
1103 
1104 /* Inverse Dynamics Residual Assembly */
1107  const VectorHandler& /* XCurr */,
1108  const VectorHandler& /* XPrimeCurr */,
1109  const VectorHandler& /* XPrimePrimeCurr */,
1110  InverseDynamics::Order iOrder)
1111 {
1113 
1114  bFirstRes = false;
1115 
1116  /* Dimensiona e resetta la matrice di lavoro */
1117  integer iNumRows = 0;
1118  integer iNumCols = 0;
1119  WorkSpaceDim(&iNumRows, &iNumCols);
1120  WorkVec.ResizeReset(iNumRows);
1121 
1122  /* Recupera gli indici */
1123  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex() + 3;
1124  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex() + 3;
1125 
1126  /* Setta gli indici della matrice */
1127  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1128  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1129  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstMomIndex + iCnt);
1130  }
1131 
1132  AssVec(WorkVec);
1133 
1134  return WorkVec;
1135 }
1136 
1137 /* assemblaggio residuo */
1138 void
1140 {
1141  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1142  Vec3 e1z(R1h.GetVec(3));
1143 
1144  if (bFirstRes) {
1145  bFirstRes = false;
1146 
1147  } else {
1148  Mat3x3 R2h(pNode2->GetRCurr()*tilde_R2h);
1149 
1150  /* orientazione intermedia */
1151  dThetaCurr = RotManip::VecRot(R1h.MulTM(R2h))(3);
1152 
1153  /* velocita' relativa nel riferimento intermedio */
1154  dOmega = e1z.Dot(pNode2->GetWCurr() - pNode1->GetWCurr());
1155 
1156  /* aggiorna il legame costitutivo */
1158  }
1159 
1161 
1162  WorkVec.Add(1, M);
1163  WorkVec.Sub(4, M);
1164 }
1165 
1166 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
1169  const VectorHandler& /* XCurr */ )
1170 {
1171  FullSubMatrixHandler& WM = WorkMat.SetFull();
1172 
1173  /* Dimensiona e resetta la matrice di lavoro */
1174  integer iNumRows = 0;
1175  integer iNumCols = 0;
1176  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1177  WM.ResizeReset(iNumRows, iNumCols);
1178 
1179  /* Recupera gli indici */
1180  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
1181  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
1182  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
1183  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
1184 
1185  /* Setta gli indici della matrice */
1186  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1187  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1188  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1189  WM.PutColIndex(3 + iCnt, iNode1FirstVelIndex + iCnt);
1190 
1191  WM.PutRowIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
1192  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1193  WM.PutColIndex(9 + iCnt, iNode2FirstVelIndex + iCnt);
1194  }
1195 
1196  Vec3 e1z(pNode1->GetRCurr()*tilde_R1h.GetVec(3));
1197  const Vec3& W2(pNode2->GetWCurr());
1198 
1201 
1202  Mat3x3 Tmp(MDE + MDEPrime*Mat3x3(MatCross, W2));
1203  WM.Add(4, 7, Tmp);
1204  WM.Sub(1, 7, Tmp);
1205 
1207  WM.Add(1, 1, Tmp);
1208  WM.Sub(4, 1, Tmp);
1209 
1210  WM.Add(1, 4, MDEPrime);
1211  WM.Add(4, 10, MDEPrime);
1212 
1213  WM.Sub(1, 10, MDEPrime);
1214  WM.Sub(4, 4, MDEPrime);
1215 
1216  return WorkMat;
1217 }
1218 
1219 /* Contributo al residuo durante l'assemblaggio iniziale */
1222  const VectorHandler& /* XCurr */ )
1223 {
1224  /* Dimensiona e resetta la matrice di lavoro */
1225  integer iNumRows = 0;
1226  integer iNumCols = 0;
1227  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1228  WorkVec.ResizeReset(iNumRows);
1229 
1230  /* Recupera gli indici */
1231  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex() + 3;
1232  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex() + 3;
1233 
1234  /* Setta gli indici della matrice */
1235  for (int iCnt = 1; iCnt <= 3; iCnt++) {
1236  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1237  WorkVec.PutRowIndex(3 + iCnt, iNode2FirstPosIndex + iCnt);
1238  }
1239 
1240  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1241  Vec3 e1z(R1h.GetVec(3));
1242 
1243  if (bFirstRes) {
1244  bFirstRes = false;
1245 
1246  } else {
1247  Mat3x3 R2h(pNode2->GetRCurr()*tilde_R2h);
1248 
1249  dThetaCurr = RotManip::VecRot(R1h.MulTM(R2h))(3);
1250  dOmega = e1z.Dot(pNode2->GetWCurr() - pNode1->GetWCurr());
1251 
1253  }
1254 
1256 
1257  WorkVec.Add(1, M);
1258  WorkVec.Sub(4, M);
1259 
1260  return WorkVec;
1261 }
1262 
1263 /* ViscoElasticAxialJoint - end */
1264 
1265 /* InvAngularCLR - end */
Definition: hint.h:38
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:453
virtual ~DeformableAxialJoint(void)
Definition: vehj4.cc:113
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: vehj4.cc:233
virtual void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vehj4.cc:746
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
const Vec3 Zero3(0., 0., 0.)
virtual void AfterPredict(void)
Definition: vehj4.cc:656
virtual bool bInverseDynamics(void) const
Definition: vehj4.cc:199
ViscoElasticAxialJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &tilde_R1h, const Mat3x3 &tilde_R2h, flag fOut)
Definition: vehj4.cc:934
long int flag
Definition: mbdyn.h:43
virtual const Mat3x3 & GetRRef(void) const
Definition: strnode.h:1006
virtual bool bToBeOutput(void) const
Definition: output.cc:890
virtual ConstLawType::Type GetConstLawType(void) const =0
void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
Definition: vehj4.cc:520
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
Definition: constltp.h:278
Definition: matvec3.h:98
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj4.cc:1168
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:994
virtual void AfterPredict(void)=0
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
virtual Node::Type GetNodeType(void) const
Definition: strnode.cc:145
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj4.cc:956
bool bIsErgonomy(void) const
Definition: elem.cc:83
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual void AssVec(SubVectorHandler &WorkVec)
Definition: vehj4.cc:817
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: constltp.h:361
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj4.cc:838
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
doublereal dTol
Definition: vehj4.h:55
virtual std::ostream & Restart(std::ostream &out) const
Definition: vehj4.cc:120
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
~ViscoElasticAxialJoint(void)
Definition: vehj4.cc:950
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj4.cc:323
virtual void AssMatMDEPrime(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vehj4.cc:72
const Tder & GetFDE(void) const
Definition: constltp.h:298
virtual void AssVec(SubVectorHandler &WorkVec)
Definition: vehj4.cc:1139
virtual unsigned int iGetNumPrivData(void) const
Definition: constltp.h:352
virtual void AssVec(SubVectorHandler &WorkVec)
Definition: vehj4.cc:535
const StructNode * pNode1
Definition: vehj4.h:48
doublereal dThetaRef
Definition: vehj4.h:391
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj4.cc:599
const Mat3x3 & Tens(const Vec3 &a, const Vec3 &b)
Definition: matvec3.h:799
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
#define NO_OP
Definition: myassert.h:74
virtual void Output(OutputHandler &OH) const
Definition: vehj4.cc:134
std::vector< Hint * > Hints
Definition: simentity.h:89
virtual ~ElasticAxialJoint(void)
Definition: vehj4.cc:317
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj4.cc:649
Mat3x3 tilde_R2h
Definition: vehj4.h:51
virtual void AfterPredict(void)
Definition: vehj4.cc:401
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:756
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj4.h:466
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual unsigned int iGetNumPrivData(void) const
Definition: vehj4.cc:227
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj4.h:244
virtual void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vehj4.cc:1067
virtual void AssMats(VariableSubMatrixHandler &WorkMatA, VariableSubMatrixHandler &WorkMatB, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:367
const StructNode * pNode2
Definition: vehj4.h:49
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:331
ElasticAxialJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &tilde_R1h, const Mat3x3 &tilde_R2h, flag fOut)
Definition: vehj4.cc:301
doublereal dThetaRef
Definition: vehj4.h:161
void SetNullMatrix(void)
Definition: submat.h:1159
Definition: mbdyn.h:76
#define DEBUGCOUT(msg)
Definition: myassert.h:232
ViscousAxialJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &tilde_R1h, const Mat3x3 &tilde_R2h, flag fOut)
Definition: vehj4.cc:628
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:673
doublereal dThetaCurr
Definition: vehj4.h:162
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
doublereal dOmega
Definition: vehj4.h:281
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: vehj4.cc:567
void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
Definition: constltp.h:288
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: vehj4.cc:205
#define ASSERT(expression)
Definition: colamd.c:977
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: vehj4.cc:163
Mat3x3 tilde_R1h
Definition: vehj4.h:50
virtual void AssMatM(FullSubMatrixHandler &WMA, doublereal dCoef)
Definition: vehj4.cc:47
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
doublereal dOmega
Definition: vehj4.h:394
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj4.cc:1078
virtual doublereal dGetPrivData(unsigned int i) const
Definition: constltp.h:369
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
Mat3x3 MDEPrime
Definition: vehj4.h:67
#define STRLENOF(s)
Definition: mbdyn.h:166
Definition: elem.h:75
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
const T & GetF(void) const
Definition: constltp.h:293
doublereal dThetaCurr
Definition: vehj4.h:392
virtual ~ViscousAxialJoint(void)
Definition: vehj4.cc:643
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
DeformableAxialJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw1D *pCL, const StructNode *pN1, const StructNode *pN2, const Mat3x3 &tilde_R1h, const Mat3x3 &tilde_R2h, flag fOut)
Definition: vehj4.cc:88
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj4.cc:891
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
void AssMatMDE(FullSubMatrixHandler &WMA, doublereal dCoef)
Definition: vehj4.cc:59
Definition: joint.h:50
Mat3x3 MulMT(const Mat3x3 &m) const
Definition: matvec3.cc:444
virtual void AssMat(FullSubMatrixHandler &WM, doublereal dCoef)
Definition: vehj4.cc:423
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
Definition: simentity.cc:63
double doublereal
Definition: colamd.c:52
const Tder & GetFDEPrime(void) const
Definition: constltp.h:303
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
void Update(const T &Eps, const T &EpsPrime=mb_zero< T >())
Definition: constltp.h:283
virtual void SetInitialValue(VectorHandler &)
Definition: vehj4.cc:192
unsigned int GetLabel(void) const
Definition: withlab.cc:62
virtual doublereal dGetPrivData(unsigned int i) const
Definition: vehj4.cc:262
Mat3x3 DRot_I(const Vec3 &phi)
Definition: Rot.cc:111
Mat3x3 R
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj4.cc:1221
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj4.h:353
virtual void AfterPredict(void)
Definition: vehj4.cc:963