MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
vehj2.cc
Go to the documentation of this file.
1 /* $Header: /var/cvs/mbdyn/mbdyn/mbdyn-1.0/mbdyn/struct/vehj2.cc,v 1.70 2017/07/23 15:09:35 zanoni 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 "vehj2.h"
38 #include "Rot.hh"
39 
40 /* DeformableDispJoint - begin */
41 
42 /* Costruttore non banale */
44  const DofOwner* pDO,
45  const ConstitutiveLaw3D* pCL,
46  const StructNode* pN1,
47  const StructNode* pN2,
48  const Vec3& tilde_f1,
49  const Vec3& tilde_f2,
50  const Mat3x3& tilde_R1h,
51  const Mat3x3& tilde_R2h,
52  flag fOut)
53 : Elem(uL, fOut),
54 Joint(uL, pDO, fOut),
56 pNode1(pN1), pNode2(pN2),
57 tilde_f1(tilde_f1), tilde_f2(tilde_f2),
58 tilde_R1h(tilde_R1h), tilde_R2h(tilde_R2h),
59 tilde_R1hT_tilde_f1(tilde_R1h.Transpose()*tilde_f1),
60 tilde_d(Zero3), tilde_dPrime(Zero3),
61 # ifdef USE_NETCDF
62 Var_tilde_d(0),
63 Var_tilde_dPrime(0),
64 Var_d(0),
65 Var_dPrime(0),
66 #endif // USE_NETCDF
67 bFirstRes(false), F(Zero3)
68 {
69  ASSERT(pNode1 != NULL);
70  ASSERT(pNode2 != NULL);
73 }
74 
75 /* Distruttore */
77 {
78  NO_OP;
79 }
80 
81 /* assemblaggio jacobiano - F */
82 void
84  const Vec3& d1, const Vec3& d2, doublereal dCoef)
85 {
86  /* force */
87  Vec3 FTmp(F*dCoef);
88 
89  /* - [ F x ] * dCoef */
90  Mat3x3 MTmp(MatCross, FTmp);
91  WMA.Add(1, 4, MTmp);
92  WMA.Sub(6 + 1, 4, MTmp);
93  WMA.Sub(4, 1, MTmp);
94  WMA.Add(4, 6 + 1, MTmp);
95 
96  /* [ di x ] [ F x ] * dCoef */
97  WMA.Add(4, 4, Mat3x3(MatCrossCross, d1, FTmp));
98  WMA.Sub(6 + 4, 4, Mat3x3(MatCrossCross, d2, FTmp));
99 
100  /* [ F x ] [ d2 x ] * dCoef */
101  MTmp = Mat3x3(MatCrossCross, FTmp, d2);
102  WMA.Sub(4, 6 + 4, MTmp);
103  WMA.Add(6 + 4, 6 + 4, MTmp);
104 }
105 
106 /* assemblaggio jacobiano - FDE */
107 void
109  const Vec3& d1, const Vec3& d2, doublereal dCoef)
110 {
111  /* F/d */
112  Mat3x3 DTmp(FDE*dCoef);
113 
114  /* Force equations */
115 
116  /* delta x1 */
117  WMA.Add(1, 1, DTmp);
118  WMA.Sub(6 + 1, 1, DTmp);
119 
120  /* delta x2 */
121  WMA.Sub(1, 6 + 1, DTmp);
122  WMA.Add(6 + 1, 6 + 1, DTmp);
123 
124  /* delta g1 */
125  Mat3x3 MTmp(DTmp*Mat3x3(MatCross, d1));
126  WMA.Sub(1, 4, MTmp);
127  WMA.Add(6 + 1, 4, MTmp);
128 
129  /* delta g2 */
130  MTmp = DTmp*Mat3x3(MatCross, d2);
131  WMA.Add(1, 6 + 4, MTmp);
132  WMA.Sub(6 + 1, 6 + 4, MTmp);
133 
134  /* Moment equation on node 1 */
135  /* d1 x F/d */
136  MTmp = d1.Cross(DTmp);
137 
138  /* delta x1 */
139  WMA.Add(4, 1, MTmp);
140 
141  /* delta x2 */
142  WMA.Sub(4, 6 + 1, MTmp);
143 
144  /* delta g1 */
145  WMA.Sub(4, 4, MTmp*Mat3x3(MatCross, d1));
146 
147  /* delta g2 */
148  WMA.Add(4, 6 + 4, MTmp*Mat3x3(MatCross, d2));
149 
150  /* Moment equation on node 2 */
151  MTmp = d2.Cross(DTmp);
152 
153  /* delta x1 */
154  WMA.Sub(6 + 4, 1, MTmp);
155 
156  /* delta x2 */
157  WMA.Add(6 + 4, 6 + 1, MTmp);
158 
159  /* delta g1 */
160  WMA.Add(6 + 4, 4, MTmp*Mat3x3(MatCross, d1));
161 
162  /* delta g2 */
163  WMA.Sub(6 + 4, 6 + 4, MTmp*Mat3x3(MatCross, d2));
164 }
165 
166 /* assemblaggio jacobiano - FDEPrime */
167 void
170  const Vec3& d1, const Vec3& d2, doublereal dCoef)
171 {
172  /* F/dot{d} */
173  WMB.Add(1, 1, FDEPrime);
174  WMB.Sub(6 + 1, 1, FDEPrime);
175  WMB.Sub(1, 6 + 1, FDEPrime);
176  WMB.Add(6 + 1, 6 + 1, FDEPrime);
177 
178  Mat3x3 MTmp(d1.Cross(FDEPrime));
179 
180  WMB.Add(4, 1, MTmp);
181  WMB.Sub(4, 6 + 1, MTmp);
182 
183  MTmp = d2.Cross(FDEPrime);
184 
185  WMB.Sub(6 + 4, 1, MTmp);
186  WMB.Add(6 + 4, 6 + 1, MTmp);
187 
188  /* F/dot{d} * [ d2 x ] */
189  MTmp = FDEPrime*Mat3x3(MatCross, d2);
190 
191  WMB.Add(1, 6 + 4, MTmp);
192  WMB.Sub(6 + 1, 6 + 4, MTmp);
193 
194  WMB.Add(4, 6 + 4, d1.Cross(MTmp));
195  WMB.Sub(6 + 4, 6 + 4, d2.Cross(MTmp));
196 
197  /* F/dot{d} * [ d1 x ] */
198  MTmp = FDEPrime*Mat3x3(MatCross, d1);
199 
200  WMB.Sub(1, 4, MTmp);
201  WMB.Add(6 + 1, 4, MTmp);
202 
203  WMB.Sub(4, 4, d1.Cross(MTmp));
204  WMB.Add(6 + 4, 4, d2.Cross(MTmp));
205 
206  /* F/dot{d} * [ ( w1 * dCoef ) x ] */
207  Mat3x3 CTmp = FDEPrime*Mat3x3(MatCross, pNode1->GetWCurr()*dCoef);
208 
209  WMA.Sub(1, 1, CTmp);
210  WMA.Add(6 + 1, 1, CTmp);
211  WMA.Add(1, 6 + 1, CTmp);
212  WMA.Sub(6 + 1, 6 + 1, CTmp);
213 
214  MTmp = d1.Cross(CTmp);
215 
216  WMA.Sub(4, 1, MTmp);
217  WMA.Add(4, 6 + 1, MTmp);
218 
219  MTmp = d2.Cross(CTmp);
220 
221  WMA.Add(6 + 4, 1, MTmp);
222  WMA.Sub(6 + 4, 6 + 1, MTmp);
223 
224  /* F/dot{d} * ( [ d1Prime x ] - [ w1 x ] [ d1 x ] ) * dCoef */
225  Vec3 d1Prime(pNode2->GetVCurr()
226  + pNode2->GetWCurr().Cross(d2)
227  - pNode1->GetVCurr());
228  MTmp = FDEPrime*(Mat3x3(MatCross, d1Prime*dCoef) - Mat3x3(MatCrossCross, pNode1->GetWCurr(), d1*dCoef));
229  WMA.Sub(1, 4, MTmp);
230  WMA.Add(6 + 1, 4, MTmp);
231 
232  WMA.Sub(4, 4, d1.Cross(MTmp));
233  WMA.Add(6 + 4, 4, d2.Cross(MTmp));
234 
235  /* F/dot{d} * ( [ ( w2 x d2 ) x ] - [ w1 x ] [ d2 x ] ) * dCoef */
236  Vec3 d2Prime(pNode2->GetWCurr().Cross(d2));
237  MTmp = FDEPrime*(Mat3x3(MatCross, d2Prime*dCoef)
238  - Mat3x3(MatCrossCross, pNode1->GetWCurr(), d2*dCoef));
239  WMA.Add(1, 6 + 4, MTmp);
240  WMA.Sub(6 + 1, 6 + 4, MTmp);
241 
242  WMA.Add(4, 6 + 4, d1.Cross(MTmp));
243  WMA.Sub(6 + 4, 6 + 4, d2.Cross(MTmp));
244 }
245 
246 /* assemblaggio jacobiano */
249  doublereal dCoef,
250  const VectorHandler& /* XCurr */ ,
251  const VectorHandler& /* XPrimeCurr */ )
252 {
253  FullSubMatrixHandler& WM = WorkMat.SetFull();
254 
255  /* Dimensiona e resetta la matrice di lavoro */
256  integer iNumRows = 0;
257  integer iNumCols = 0;
258  WorkSpaceDim(&iNumRows, &iNumCols);
259  WM.ResizeReset(iNumRows, iNumCols);
260 
261  /* Recupera gli indici */
262  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
263  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
264  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
265  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
266 
267  /* Setta gli indici della matrice */
268  for (int iCnt = 1; iCnt <= 6; iCnt++) {
269  WM.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
270  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
271  WM.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
272  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
273  }
274 
275  AssMats(WM, WM, dCoef);
276 
277  return WorkMat;
278 }
279 
280 /* Jacobian matrix assembly - all but the purely elastic */
281 void
283  VariableSubMatrixHandler& WorkMatB,
284  const VectorHandler& /* XCurr */ ,
285  const VectorHandler& /* XPrimeCurr */ )
286 {
287  FullSubMatrixHandler& WMA = WorkMatA.SetFull();
288  FullSubMatrixHandler& WMB = WorkMatB.SetFull();
289 
290  /* Dimensiona e resetta la matrice di lavoro */
291  integer iNumRows = 0;
292  integer iNumCols = 0;
293  WorkSpaceDim(&iNumRows, &iNumCols);
294  WMA.ResizeReset(iNumRows, iNumCols);
295  WMB.ResizeReset(iNumRows, iNumCols);
296 
297  /* Recupera gli indici */
298  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
299  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
300  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
301  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
302 
303  /* Setta gli indici della matrice */
304  for (int iCnt = 1; iCnt <= 6; iCnt++) {
305  WMA.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
306  WMA.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
307  WMA.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
308  WMA.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
309 
310  WMB.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
311  WMB.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
312  WMB.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
313  WMB.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
314  }
315 
316  AssMats(WMA, WMB, 1.);
317 }
318 
319 /* Contributo al file di restart */
320 std::ostream&
321 DeformableDispJoint::Restart(std::ostream& out) const
322 {
323  Joint::Restart(out) << ", deformable displacement joint, "
324  << pNode1->GetLabel() << ", reference, node, ",
325  tilde_f1.Write(out, ", ") << ", hinge, reference, node, 1, ",
326  (tilde_R1h.GetVec(1)).Write(out, ", ")
327  << ", 2, ", (tilde_R1h.GetVec(2)).Write(out, ", ") << ", "
328  << pNode2->GetLabel() << ", reference, node, ",
329  tilde_f2.Write(out, ", ") << ", hinge, reference, node, 1, ",
330  (tilde_R2h.GetVec(1)).Write(out, ", ")
331  << ", 2, ", (tilde_R2h.GetVec(2)).Write(out, ", ") << ", ";
332 
333  return pGetConstLaw()->Restart(out) << ';' << std::endl;
334 }
335 
336 void
338 {
339  if (bToBeOutput()) {
340 #ifdef USE_NETCDF
342  std::string name;
343  OutputPrepare_int("deformable displacement", OH, name);
344 
345  Var_tilde_d = OH.CreateVar<Vec3>(name + "d", "m",
346  "relative position in local frame (x, y, z)");
347  Var_tilde_dPrime = OH.CreateVar<Vec3>(name + "dPrime", "m/s",
348  "relative linear velocity in local frame (x, y, z)");
349  Var_d = OH.CreateVar<Vec3>(name + "D", "m",
350  "relative position in global frame (x, y, z)");
351  Var_dPrime = OH.CreateVar<Vec3>(name + "DPrime", "m/s",
352  "relative linear velocity in global frame (x, y, z)");
353  }
354 #endif // USE_NETCDF
355  }
356 }
357 
358 void
360 {
361  if (bToBeOutput()) {
362 #ifdef USE_NETCDF
364  Var_F_local->put_rec(GetF().pGetVec(), OH.GetCurrentStep());
365  Var_M_local->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
366  Var_F_global->put_rec((pNode1->GetRCurr()*(tilde_R1h*GetF())).pGetVec(),
367  OH.GetCurrentStep());
368  Var_M_global->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
369  Var_tilde_d->put_rec(tilde_d.pGetVec(), OH.GetCurrentStep());
370  Var_d->put_rec((pNode1->GetRCurr()*(tilde_R1h*tilde_d)).pGetVec(),
371  OH.GetCurrentStep());
373  Var_tilde_dPrime->put_rec(tilde_dPrime.pGetVec(),
374  OH.GetCurrentStep());
375  Var_dPrime->put_rec((pNode1->GetRCurr()*(tilde_R1h*tilde_dPrime)).pGetVec(),
376  OH.GetCurrentStep());
377  } else {
378  Var_tilde_dPrime->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
379  Var_dPrime->put_rec(Zero3.pGetVec(), OH.GetCurrentStep());
380  }
381  }
382 #endif // USE_NETCDF
383 
384  if (OH.UseText(OutputHandler::JOINTS)) {
385  Joint::Output(OH.Joints(), "DeformableDispJoint", GetLabel(),
386  GetF(), Zero3,
388  << " " << tilde_d;
390  OH.Joints() << " " << tilde_dPrime;
391  }
392  OH.Joints() << std::endl;
393  }
394  }
395 }
396 
397 void
401 {
402  if (ph) {
403  for (unsigned i = 0; i < ph->size(); i++) {
404  Joint::JointHint *pjh = dynamic_cast<Joint::JointHint *>((*ph)[i]);
405 
406  if (pjh) {
407  if (dynamic_cast<Joint::OffsetHint<1> *>(pjh)) {
408  Mat3x3 R1T(pNode1->GetRCurr().Transpose());
409  Vec3 f2(pNode2->GetRCurr()*tilde_f2);
410 
411  tilde_f1 = R1T*(pNode2->GetXCurr() + f2 - pNode1->GetXCurr());
412 
413  } else if (dynamic_cast<Joint::OffsetHint<2> *>(pjh)) {
414  Mat3x3 R2T(pNode2->GetRCurr().Transpose());
415  Vec3 f1(pNode1->GetRCurr()*tilde_f1);
416 
417  tilde_f2 = R2T*(pNode1->GetXCurr() + f1 - pNode2->GetXCurr());
418 
419  } else if (dynamic_cast<Joint::HingeHint<1> *>(pjh)) {
421 
422  } else if (dynamic_cast<Joint::HingeHint<2> *>(pjh)) {
424 
425  } else if (dynamic_cast<Joint::ReactionsHint *>(pjh)) {
426  /* TODO */
427  }
428 
429  continue;
430  }
431 
432  /* else, pass to constitutive law */
433  ConstitutiveLaw3DOwner::SetValue(pDM, X, XP, ph);
434  }
435  }
436 }
437 
438 Hint *
439 DeformableDispJoint::ParseHint(DataManager *pDM, const char *s) const
440 {
441  if (strncasecmp(s, "offset{" /*}*/ , STRLENOF("offset{" /*}*/ )) == 0)
442  {
443  s += STRLENOF("offset{" /*}*/ );
444 
445  if (strcmp(&s[1], /*{*/ "}") != 0) {
446  return 0;
447  }
448 
449  switch (s[0]) {
450  case '1':
451  return new Joint::OffsetHint<1>;
452 
453  case '2':
454  return new Joint::OffsetHint<2>;
455  }
456 
457  } else if (strncasecmp(s, "hinge{" /*}*/, STRLENOF("hinge{" /*}*/)) == 0) {
458  s += STRLENOF("hinge{" /*}*/);
459 
460  if (strcmp(&s[1], /* { */ "}") != 0) {
461  return 0;
462  }
463 
464  switch (s[0]) {
465  case '1':
466  return new Joint::HingeHint<1>;
467 
468  case '2':
469  return new Joint::HingeHint<2>;
470  }
471  }
472 
473  return ConstitutiveLaw3DOwner::ParseHint(pDM, s);
474 }
475 
476 /* inverse dynamics capable element */
477 bool
479 {
480  return true;
481 }
482 
483 unsigned int
485 {
487 }
488 
489 unsigned int
491 {
492  ASSERT(s != NULL);
493 
494  unsigned idx = 0;
495 
496  switch (s[0]) {
497  case 'd':
498  break;
499 
500  case 'v':
501  idx += 3;
502  break;
503 
504  case 'F':
505  idx += 6;
506  break;
507 
508  default:
509  {
510  size_t l = STRLENOF("constitutiveLaw.");
511  if (strncmp(s, "constitutiveLaw.", l) == 0) {
513  if (idx > 0) {
514  return 9 + idx;
515  }
516  }
517  return 0;
518  }
519  }
520 
521  switch (s[1]) {
522  case 'x':
523  idx += 1;
524  break;
525  case 'y':
526  idx += 2;
527  break;
528  case 'z':
529  idx += 3;
530  break;
531  default:
532  return 0;
533  }
534 
535  if (s[2] != '\0') {
536  return 0;
537  }
538 
539  return idx;
540 }
541 
544 {
545  ASSERT(i > 0);
546 
547  ASSERT(i <= iGetNumPrivData());
548 
549  switch (i) {
550  case 1:
551  case 2:
552  case 3:
553  {
554  /* FIXME: allows simplifications by using only the column
555  * and the components of tilde_R1h that is actually required */
556  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
558  Vec3 tilde_d(R1h.MulTV(pNode2->GetXCurr() + d2 - pNode1->GetXCurr()) - tilde_R1hT_tilde_f1);
559  return tilde_d(i);
560  }
561 
562  case 4:
563  case 5:
564  case 6:
565  {
566  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
567  Mat3x3 R1h(pNode1->GetRCurr());
568  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
569  Vec3 d1Prime(pNode2->GetVCurr() + pNode2->GetWCurr().Cross(d2) - pNode1->GetVCurr());
570  Vec3 tilde_dPrime(R1h.MulTV(d1Prime - pNode1->GetWCurr().Cross(d1)));
571 
572  return tilde_dPrime(i - 3);
573  }
574 
575  case 7:
576  case 8:
577  case 9:
578  return GetF()(i - 6);
579 
580  default:
582  }
583 }
584 
585 /* DeformableDispJoint - end */
586 
587 
588 /* ElasticDispJoint - begin */
589 
591  const DofOwner* pDO,
592  const ConstitutiveLaw3D* pCL,
593  const StructNode* pN1,
594  const StructNode* pN2,
595  const Vec3& tilde_f1,
596  const Vec3& tilde_f2,
597  const Mat3x3& tilde_R1h,
598  const Mat3x3& tilde_R2h,
599  flag fOut)
600 : Elem(uL, fOut),
601 DeformableDispJoint(uL, pDO, pCL, pN1, pN2, tilde_f1, tilde_f2, tilde_R1h, tilde_R2h, fOut)
602 {
603  /*
604  * Chiede la matrice tangente di riferimento
605  * e la porta nel sistema globale
606  */
607  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
608  FDE = R1h*GetFDE().MulMT(R1h);
609 }
610 
612 {
613  NO_OP;
614 }
615 
616 void
618  const VectorHandler& XP)
619 {
621 }
622 
623 /* assemblaggio jacobiano */
624 void
626  VariableSubMatrixHandler& WorkMatB,
627  const VectorHandler& /* XCurr */ ,
628  const VectorHandler& /* XPrimeCurr */ )
629 {
630  FullSubMatrixHandler& WMA = WorkMatA.SetFull();
631  WorkMatB.SetNullMatrix();
632 
633  /* Dimensiona e resetta la matrice di lavoro */
634  integer iNumRows = 0;
635  integer iNumCols = 0;
636  WorkSpaceDim(&iNumRows, &iNumCols);
637  WMA.ResizeReset(iNumRows, iNumCols);
638 
639  /* Recupera gli indici */
640  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
641  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
642  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
643  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
644 
645  /* Setta gli indici della matrice */
646  for (int iCnt = 1; iCnt <= 6; iCnt++) {
647  WMA.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
648  WMA.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
649  WMA.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
650  WMA.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
651  }
652 
653  // NOTE: the second instance of WMA is ignored (see below)
654  AssMats(WMA, WMA, 1.);
655 }
656 
657 void
659  FullSubMatrixHandler& /* WMB */ ,
660  doublereal dCoef)
661 {
662  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
663  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
664 
665  AssMatF(WMA, d1, d2, dCoef);
666  AssMatFDE(WMA, d1, d2, dCoef);
667 }
668 
669 /* assemblaggio residuo */
672  doublereal /* dCoef */ ,
673  const VectorHandler& /* XCurr */ ,
674  const VectorHandler& /* XPrimeCurr */ )
675 {
676  /* Dimensiona e resetta la matrice di lavoro */
677  integer iNumRows = 0;
678  integer iNumCols = 0;
679  WorkSpaceDim(&iNumRows, &iNumCols);
680  WorkVec.ResizeReset(iNumRows);
681 
682  /* Recupera gli indici */
683  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
684  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
685 
686  /* Setta gli indici della matrice */
687  for (int iCnt = 1; iCnt <= 6; iCnt++) {
688  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
689  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
690  }
691 
692  AssVec(WorkVec);
693 
694  return WorkVec;
695 }
696 
697 /* Inverse Dynamics Jacobian matrix assembly */
700  const VectorHandler& XCurr)
701 {
702  ASSERT(bIsErgonomy());
703 
704  // HACK? Need to call AfterPredict() here to update MDE and so
705  // const_cast because AfterPredict() does not modify X, XP
706  AfterPredict(const_cast<VectorHandler&>(XCurr), const_cast<VectorHandler&>(XCurr));
707 
708  return DeformableDispJoint::AssJac(WorkMat, 1., XCurr, XCurr);
709 }
710 
711 /* Inverse Dynamics Residual Assembly */
714  const VectorHandler& /* XCurr */,
715  const VectorHandler& /* XPrimeCurr */,
716  const VectorHandler& /* XPrimePrimeCurr */,
717  InverseDynamics::Order iOrder)
718 {
720  || (iOrder == InverseDynamics::POSITION && bIsErgonomy()));
721 
722  bFirstRes = false;
723 
724  /* Dimensiona e resetta la matrice di lavoro */
725  integer iNumRows = 0;
726  integer iNumCols = 0;
727  WorkSpaceDim(&iNumRows, &iNumCols);
728  WorkVec.ResizeReset(iNumRows);
729 
730  /* Recupera gli indici */
731  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex();
732  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex();
733 
734  /* Setta gli indici della matrice */
735  for (int iCnt = 1; iCnt <= 6; iCnt++) {
736  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
737  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
738  }
739 
740  AssVec(WorkVec);
741 
742  return WorkVec;
743 }
744 
745 /* Inverse Dynamics update */
746 void
748 {
749  NO_OP;
750 }
751 
752 /* Inverse Dynamics after convergence */
753 void
755  const VectorHandler& XP, const VectorHandler& XPP)
756 {
758 }
759 
760 void
762 {
764  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
765  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
766 
767  if (bFirstRes) {
768  bFirstRes = false;
769 
770  } else {
771  tilde_d = R1h.MulTV(d1) - tilde_R1hT_tilde_f1;
772 
774  }
775 
776  F = R1h*GetF();
777 
778  WorkVec.Add(1, F);
779  WorkVec.Add(4, d1.Cross(F));
780  WorkVec.Sub(6 + 1, F);
781  WorkVec.Sub(6 + 4, d2.Cross(F));
782 }
783 
784 void
786 {
788  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
789 
790  tilde_d = R1h.MulTV(pNode2->GetXCurr() + d2 - pNode1->GetXCurr())
792 
794 
795  /* FIXME: we need to be able to regenerate FDE
796  * if the constitutive law throws ChangedEquationStructure */
797  FDE = R1h*GetFDE().MulMT(R1h);
798 
799  bFirstRes = true;
800 }
801 
802 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
805  const VectorHandler& /* XCurr */ )
806 {
807  FullSubMatrixHandler& WM = WorkMat.SetFull();
808 
809  /* Dimensiona e resetta la matrice di lavoro */
810  integer iNumRows = 0;
811  integer iNumCols = 0;
812  InitialWorkSpaceDim(&iNumRows, &iNumCols);
813  WM.ResizeReset(iNumRows, iNumCols);
814 
815  /* Recupera gli indici */
816  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
817  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
818 
819  /* Setta gli indici della matrice */
820  for (int iCnt = 1; iCnt <= 6; iCnt++) {
821  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
822  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
823  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
824  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
825  }
826 
827  AssMats(WM, WM, 1.);
828 
829  return WorkMat;
830 }
831 
832 /* Contributo al residuo durante l'assemblaggio iniziale */
835  const VectorHandler& /* XCurr */ )
836 {
837  /* Dimensiona e resetta la matrice di lavoro */
838  integer iNumRows = 0;
839  integer iNumCols = 0;
840  InitialWorkSpaceDim(&iNumRows, &iNumCols);
841  WorkVec.ResizeReset(iNumRows);
842 
843  /* Recupera gli indici */
844  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
845  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
846 
847  /* Setta gli indici della matrice */
848  for (int iCnt = 1; iCnt <= 6; iCnt++) {
849  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
850  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
851  }
852 
853  AssVec(WorkVec);
854 
855  return WorkVec;
856 }
857 
858 /* ElasticDispJoint - end */
859 
860 
861 /* ElasticDispJointInv - begin */
862 
864  const DofOwner* pDO,
865  const ConstitutiveLaw3D* pCL,
866  const StructNode* pN1,
867  const StructNode* pN2,
868  const Vec3& tilde_f1,
869  const Vec3& tilde_f2,
870  const Mat3x3& tilde_R1h,
871  const Mat3x3& tilde_R2h,
872  flag fOut)
873 : Elem(uL, fOut),
874 DeformableDispJoint(uL, pDO, pCL, pN1, pN2, tilde_f1, tilde_f2, tilde_R1h, tilde_R2h, fOut)
875 {
876  /*
877  * Chiede la matrice tangente di riferimento
878  * e la porta nel sistema globale
879  */
880  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
881  FDE = R1h*GetFDE().MulMT(R1h);
882 }
883 
885 {
886  NO_OP;
887 }
888 
889 void
891  const VectorHandler& XP)
892 {
894 }
895 
896 /* assemblaggio jacobiano */
897 void
899  VariableSubMatrixHandler& WorkMatB,
900  const VectorHandler& /* XCurr */ ,
901  const VectorHandler& /* XPrimeCurr */ )
902 {
903  FullSubMatrixHandler& WMA = WorkMatA.SetFull();
904  WorkMatB.SetNullMatrix();
905 
906  /* Dimensiona e resetta la matrice di lavoro */
907  integer iNumRows = 0;
908  integer iNumCols = 0;
909  WorkSpaceDim(&iNumRows, &iNumCols);
910  WMA.ResizeReset(iNumRows, iNumCols);
911 
912  /* Recupera gli indici */
913  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
914  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
915  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
916  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
917 
918  /* Setta gli indici della matrice */
919  for (int iCnt = 1; iCnt <= 6; iCnt++) {
920  WMA.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
921  WMA.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
922  WMA.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
923  WMA.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
924  }
925 
926  // NOTE: the second instance of WMA is ignored (see below)
927  AssMats(WMA, WMA, 1.);
928 }
929 
930 void
932  FullSubMatrixHandler& /* WMB */ ,
933  doublereal dCoef)
934 {
935  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
936  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
937 
938  AssMatF(WMA, d1, d2, dCoef);
939  AssMatFDE(WMA, d1, d2, dCoef);
940 }
941 
942 /* assemblaggio residuo */
945  doublereal /* dCoef */ ,
946  const VectorHandler& /* XCurr */ ,
947  const VectorHandler& /* XPrimeCurr */ )
948 {
949  /* Dimensiona e resetta la matrice di lavoro */
950  integer iNumRows = 0;
951  integer iNumCols = 0;
952  WorkSpaceDim(&iNumRows, &iNumCols);
953  WorkVec.ResizeReset(iNumRows);
954 
955  /* Recupera gli indici */
956  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
957  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
958 
959  /* Setta gli indici della matrice */
960  for (int iCnt = 1; iCnt <= 6; iCnt++) {
961  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
962  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
963  }
964 
965  AssVec(WorkVec);
966 
967  return WorkVec;
968 }
969 
970 /* Inverse Dynamics Residual Assembly */
973  const VectorHandler& /* XCurr */,
974  const VectorHandler& /* XPrimeCurr */,
975  const VectorHandler& /* XPrimePrimeCurr */,
976  InverseDynamics::Order iOrder)
977 {
979 
980  bFirstRes = false;
981 
982  /* Dimensiona e resetta la matrice di lavoro */
983  integer iNumRows = 0;
984  integer iNumCols = 0;
985  WorkSpaceDim(&iNumRows, &iNumCols);
986  WorkVec.ResizeReset(iNumRows);
987 
988  /* Recupera gli indici */
989  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex();
990  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex();
991 
992  /* Setta gli indici della matrice */
993  for (int iCnt = 1; iCnt <= 6; iCnt++) {
994  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
995  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
996  }
997 
998  AssVec(WorkVec);
999 
1000  return WorkVec;
1001 }
1002 
1003 void
1005 {
1006  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
1007  Mat3x3 R2h(pNode2->GetRRef()*tilde_R2h);
1008  Vec3 ThetaCurr = RotManip::VecRot(R1h.MulTM(R2h));
1009  Mat3x3 tilde_R = RotManip::Rot(ThetaCurr/2.);
1010  Mat3x3 hat_R(R1h*tilde_R);
1011 
1012  Mat3x3 hat_I = hat_R*((Eye3 + tilde_R).Inv()).MulMT(hat_R);
1013 
1014  Vec3 f1(pNode1->GetRCurr()*tilde_f1);
1015  Vec3 f2(pNode2->GetRCurr()*tilde_f2);
1016  Vec3 d(pNode2->GetXCurr() + f2 - pNode1->GetXCurr() - f1);
1017 
1018  if (bFirstRes) {
1019  bFirstRes = false;
1020 
1021  } else {
1022  tilde_d = hat_R.MulTV(d);
1023 
1025  }
1026 
1027  F = hat_R*GetF();
1028 
1029  Vec3 dCrossF(d.Cross(F));
1030  WorkVec.Add(1, F);
1031  WorkVec.Add(4, f1.Cross(F) + hat_I*dCrossF);
1032  WorkVec.Sub(6 + 1, F);
1033  WorkVec.Sub(6 + 4, f2.Cross(F) - hat_I.MulTV(dCrossF));
1034 }
1035 
1036 void
1038 {
1039  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
1040  Mat3x3 R2h(pNode2->GetRRef()*tilde_R2h);
1041  Vec3 ThetaCurr = RotManip::VecRot(R1h.MulTM(R2h));
1042  Mat3x3 hat_R(R1h*RotManip::Rot(ThetaCurr/2.));
1043 
1044  Vec3 f1(pNode1->GetRCurr()*tilde_f1);
1045  Vec3 f2(pNode2->GetRCurr()*tilde_f2);
1046  tilde_d = hat_R.MulTV(pNode2->GetXCurr() + f2 - pNode1->GetXCurr() - f1);
1047 
1049 
1050  /* FIXME: we need to be able to regenerate FDE
1051  * if the constitutive law throws ChangedEquationStructure */
1052  FDE = hat_R*GetFDE().MulMT(hat_R);
1053 
1054  bFirstRes = true;
1055 }
1056 
1057 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
1060  const VectorHandler& /* XCurr */ )
1061 {
1062  FullSubMatrixHandler& WM = WorkMat.SetFull();
1063 
1064  /* Dimensiona e resetta la matrice di lavoro */
1065  integer iNumRows = 0;
1066  integer iNumCols = 0;
1067  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1068  WM.ResizeReset(iNumRows, iNumCols);
1069 
1070  /* Recupera gli indici */
1071  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1072  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1073 
1074  /* Setta gli indici della matrice */
1075  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1076  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1077  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1078  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1079  WM.PutColIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1080  }
1081 
1082  AssMats(WM, WM, 1.);
1083 
1084  return WorkMat;
1085 }
1086 
1087 /* Contributo al residuo durante l'assemblaggio iniziale */
1090  const VectorHandler& /* XCurr */ )
1091 {
1092  /* Dimensiona e resetta la matrice di lavoro */
1093  integer iNumRows = 0;
1094  integer iNumCols = 0;
1095  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1096  WorkVec.ResizeReset(iNumRows);
1097 
1098  /* Recupera gli indici */
1099  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1100  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1101 
1102  /* Setta gli indici della matrice */
1103  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1104  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1105  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1106  }
1107 
1108  AssVec(WorkVec);
1109 
1110  return WorkVec;
1111 }
1112 
1113 /* ElasticDispJointInv - end */
1114 
1115 
1116 /* ViscousDispJoint - begin */
1117 
1119  const DofOwner* pDO,
1120  const ConstitutiveLaw3D* pCL,
1121  const StructNode* pN1,
1122  const StructNode* pN2,
1123  const Vec3& tilde_f1,
1124  const Vec3& tilde_f2,
1125  const Mat3x3& tilde_R1h,
1126  const Mat3x3& tilde_R2h,
1127  flag fOut)
1128 : Elem(uL, fOut),
1129 DeformableDispJoint(uL, pDO, pCL, pN1, pN2, tilde_f1, tilde_f2, tilde_R1h, tilde_R2h, fOut)
1130 {
1131  /*
1132  * Chiede la matrice tangente di riferimento
1133  * e la porta nel sistema globale
1134  */
1135  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
1136  FDEPrime = R1h*GetFDEPrime()*R1h.Transpose();
1137 }
1138 
1140 {
1141  NO_OP;
1142 }
1143 
1144 void
1146  const VectorHandler& XP)
1147 {
1149 }
1150 
1151 void
1153  FullSubMatrixHandler& WMB,
1154  doublereal dCoef)
1155 {
1156  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1157  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1158 
1159  AssMatF(WMA, d1, d2, dCoef);
1160  AssMatFDEPrime(WMA, WMB, d1, d2, dCoef);
1161 }
1162 
1163 /* assemblaggio residuo */
1166  doublereal /* dCoef */ ,
1167  const VectorHandler& /* XCurr */ ,
1168  const VectorHandler& /* XPrimeCurr */ )
1169 {
1170  /* Dimensiona e resetta la matrice di lavoro */
1171  integer iNumRows = 0;
1172  integer iNumCols = 0;
1173  WorkSpaceDim(&iNumRows, &iNumCols);
1174  WorkVec.ResizeReset(iNumRows);
1175 
1176  /* Recupera gli indici */
1177  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
1178  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
1179 
1180  /* Setta gli indici della matrice */
1181  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1182  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1183  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
1184  }
1185 
1186  AssVec(WorkVec);
1187 
1188  return WorkVec;
1189 }
1190 
1191 /* Inverse Dynamics Residual Assembly */
1194  const VectorHandler& /* XCurr */,
1195  const VectorHandler& /* XPrimeCurr */,
1196  const VectorHandler& /* XPrimePrimeCurr */,
1197  InverseDynamics::Order iOrder)
1198 {
1200 
1201  bFirstRes = false;
1202 
1203  /* Dimensiona e resetta la matrice di lavoro */
1204  integer iNumRows = 0;
1205  integer iNumCols = 0;
1206  WorkSpaceDim(&iNumRows, &iNumCols);
1207  WorkVec.ResizeReset(iNumRows);
1208 
1209  /* Recupera gli indici */
1210  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex();
1211  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex();
1212 
1213  /* Setta gli indici della matrice */
1214  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1215  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1216  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
1217  }
1218 
1219  AssVec(WorkVec);
1220 
1221  return WorkVec;
1222 }
1223 
1224 /* Inverse Dynamics update */
1225 void
1227 {
1228  if (iOrder != InverseDynamics::INVERSE_DYNAMICS) {
1229  // issue "default" warning message
1230  Joint::Update(XCurr, iOrder);
1231  }
1232 }
1233 
1234 /* Inverse Dynamics after convergence */
1235 void
1237  const VectorHandler& XP, const VectorHandler& XPP)
1238 {
1240 }
1241 
1242 void
1244 {
1245  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1246  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1247  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1248 
1249  if (bFirstRes) {
1250  bFirstRes = false;
1251 
1252  } else {
1253  Vec3 d1Prime(pNode2->GetVCurr()
1254  + pNode2->GetWCurr().Cross(d2)
1255  - pNode1->GetVCurr());
1256 
1257  tilde_dPrime = R1h.Transpose()*(d1Prime
1258  - pNode1->GetWCurr().Cross(d1));
1259 
1260  ConstitutiveLaw3DOwner::Update(Zero3, tilde_dPrime);
1261  }
1262 
1263  Vec3 F(R1h*GetF());
1264 
1265  WorkVec.Add(1, F);
1266  WorkVec.Add(4, d1.Cross(F));
1267  WorkVec.Sub(6 + 1, F);
1268  WorkVec.Sub(6 + 4, d2.Cross(F));
1269 }
1270 
1271 void
1273 {
1274  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1275  Mat3x3 R1hT(R1h.Transpose());
1276  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1277  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1278  Vec3 d1Prime(pNode2->GetVCurr()
1279  + pNode2->GetWCurr().Cross(d2)
1280  - pNode1->GetVCurr());
1281 
1282  tilde_dPrime = R1h.Transpose()*(d1Prime
1283  - pNode1->GetWCurr().Cross(d1));
1284 
1285  ConstitutiveLaw3DOwner::Update(Zero3, tilde_dPrime);
1286 
1287  /* FIXME: we need to be able to regenerate FDE
1288  * if the constitutive law throws ChangedEquationStructure */
1289  FDEPrime = R1h*GetFDEPrime()*R1hT;
1290 
1291  bFirstRes = true;
1292 }
1293 
1294 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
1297  const VectorHandler& /* XCurr */ )
1298 {
1299  FullSubMatrixHandler& WM = WorkMat.SetFull();
1300 
1301  /* Dimensiona e resetta la matrice di lavoro */
1302  integer iNumRows = 0;
1303  integer iNumCols = 0;
1304  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1305  WM.ResizeReset(iNumRows, iNumCols);
1306 
1307  /* Recupera gli indici */
1308  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1309  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
1310  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1311  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
1312 
1313  /* Setta gli indici della matrice */
1314  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1315  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1316  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1317  WM.PutColIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
1318 
1319  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1320  WM.PutColIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
1321  WM.PutColIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
1322  }
1323 
1324  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
1325  Vec3 Omega1(pNode1->GetWRef());
1326  Vec3 Omega2(pNode2->GetWRef());
1327 
1328  Vec3 F(R1h*GetF());
1329  Mat3x3 FDEPrime(R1h*GetFDEPrime()*R1h.Transpose());
1330  Mat3x3 Tmp(Mat3x3(MatCross, F) - FDEPrime*Mat3x3(MatCross, Omega2 - Omega1));
1331 
1332  WM.Add(1, 1, Tmp);
1333  WM.Sub(4, 1, Tmp);
1334 
1335  WM.Add(1, 4, FDEPrime);
1336  WM.Add(4, 6 + 4, FDEPrime);
1337 
1338  WM.Sub(1, 6 + 4, FDEPrime);
1339  WM.Sub(4, 4, FDEPrime);
1340 
1341  return WorkMat;
1342 }
1343 
1344 /* Contributo al residuo durante l'assemblaggio iniziale */
1347  const VectorHandler& /* XCurr */ )
1348 {
1349  /* Dimensiona e resetta la matrice di lavoro */
1350  integer iNumRows = 0;
1351  integer iNumCols = 0;
1352  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1353  WorkVec.ResizeReset(iNumRows);
1354 
1355  /* Recupera gli indici */
1356  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1357  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1358 
1359  /* Setta gli indici della matrice */
1360  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1361  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1362  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1363  }
1364 
1365  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1366  Vec3 Omega1(pNode1->GetWCurr());
1367  Vec3 Omega2(pNode2->GetWCurr());
1368 
1369  Vec3 g1(pNode1->GetgCurr());
1370  Vec3 g2(pNode2->GetgCurr());
1371 
1372  /* Aggiornamento: tilde_d += R1h^T(G(g2)*g2-G(g1)*g1) */
1373  tilde_d = R1h.Transpose()*(g2*(4./(4. + g2.Dot()))
1374  - g1*(4./(4. + g1.Dot())));
1375  tilde_dPrime = R1h.Transpose()*(Omega2 - Omega1);
1377 
1378  Vec3 F(R1h*GetF());
1379 
1380  WorkVec.Add(1, F);
1381  WorkVec.Sub(4, F);
1382 
1383  return WorkVec;
1384 }
1385 
1386 /* ViscousDispJoint - end */
1387 
1388 
1389 /* ViscoElasticDispJoint - begin */
1390 
1392  const DofOwner* pDO,
1393  const ConstitutiveLaw3D* pCL,
1394  const StructNode* pN1,
1395  const StructNode* pN2,
1396  const Vec3& tilde_f1,
1397  const Vec3& tilde_f2,
1398  const Mat3x3& tilde_R1h,
1399  const Mat3x3& tilde_R2h,
1400  flag fOut)
1401 : Elem(uL, fOut),
1402 DeformableDispJoint(uL, pDO, pCL, pN1, pN2, tilde_f1, tilde_f2, tilde_R1h, tilde_R2h, fOut)
1403 {
1404  /*
1405  * Chiede la matrice tangente di riferimento
1406  * e la porta nel sistema globale
1407  */
1408  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
1409  Mat3x3 R1hT(R1h.Transpose());
1410  FDE = R1h*GetFDE()*R1hT;
1411  FDEPrime = R1h*GetFDEPrime()*R1hT;
1412 }
1413 
1415 {
1416  NO_OP;
1417 }
1418 
1419 void
1421  const VectorHandler& XP)
1422 {
1424 }
1425 
1426 /* assemblaggio jacobiano */
1427 void
1429  FullSubMatrixHandler& WMB,
1430  doublereal dCoef)
1431 {
1432  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1433  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1434 
1435  AssMatF(WMA, d1, d2, dCoef);
1436  AssMatFDE(WMA, d1, d2, dCoef);
1437  AssMatFDEPrime(WMA, WMB, d1, d2, dCoef);
1438 }
1439 
1440 /* assemblaggio residuo */
1443  doublereal /* dCoef */ ,
1444  const VectorHandler& /* XCurr */ ,
1445  const VectorHandler& /* XPrimeCurr */ )
1446 {
1447  /* Dimensiona e resetta la matrice di lavoro */
1448  integer iNumRows = 0;
1449  integer iNumCols = 0;
1450  WorkSpaceDim(&iNumRows, &iNumCols);
1451  WorkVec.ResizeReset(iNumRows);
1452 
1453  /* Recupera gli indici */
1454  integer iNode1FirstMomIndex = pNode1->iGetFirstMomentumIndex();
1455  integer iNode2FirstMomIndex = pNode2->iGetFirstMomentumIndex();
1456 
1457  /* Setta gli indici della matrice */
1458  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1459  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1460  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
1461  }
1462 
1463  AssVec(WorkVec);
1464 
1465  return WorkVec;
1466 }
1467 
1468 /* Inverse Dynamics Residual Assembly */
1471  const VectorHandler& /* XCurr */,
1472  const VectorHandler& /* XPrimeCurr */,
1473  const VectorHandler& /* XPrimePrimeCurr */,
1474  InverseDynamics::Order iOrder)
1475 {
1477 
1478  bFirstRes = false;
1479 
1480  /* Dimensiona e resetta la matrice di lavoro */
1481  integer iNumRows = 0;
1482  integer iNumCols = 0;
1483  WorkSpaceDim(&iNumRows, &iNumCols);
1484  WorkVec.ResizeReset(iNumRows);
1485 
1486  /* Recupera gli indici */
1487  integer iNode1FirstMomIndex = pNode1->iGetFirstPositionIndex();
1488  integer iNode2FirstMomIndex = pNode2->iGetFirstPositionIndex();
1489 
1490  /* Setta gli indici della matrice */
1491  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1492  WorkVec.PutRowIndex(iCnt, iNode1FirstMomIndex + iCnt);
1493  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstMomIndex + iCnt);
1494  }
1495 
1496  AssVec(WorkVec);
1497 
1498  return WorkVec;
1499 }
1500 
1501 /* Inverse Dynamics update */
1502 void
1504 {
1505  if (iOrder != InverseDynamics::INVERSE_DYNAMICS) {
1506  // issue "default" warning message
1507  Joint::Update(XCurr, iOrder);
1508  }
1509 }
1510 
1511 /* Inverse Dynamics after convergence */
1512 void
1514  const VectorHandler& XP, const VectorHandler& XPP)
1515 {
1517 }
1518 
1519 void
1521 {
1522  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1523  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1524  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1525 
1526  if (bFirstRes) {
1527  bFirstRes = false;
1528 
1529  } else {
1530  Mat3x3 R1hT(R1h.Transpose());
1531  Vec3 d1Prime(pNode2->GetVCurr()
1532  + pNode2->GetWCurr().Cross(d2)
1533  - pNode1->GetVCurr());
1534 
1535  tilde_d = R1hT*d1 - tilde_R1hT_tilde_f1;
1536  tilde_dPrime = R1hT*(d1Prime - pNode1->GetWCurr().Cross(d1));
1537 
1539  }
1540 
1541  Vec3 F(R1h*GetF());
1542 
1543  WorkVec.Add(1, F);
1544  WorkVec.Add(4, d1.Cross(F));
1545  WorkVec.Sub(6 + 1, F);
1546  WorkVec.Sub(6 + 4, d2.Cross(F));
1547 }
1548 
1549 void
1551 {
1552  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1553  Mat3x3 R1hT(R1h.Transpose());
1554  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1555  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1556  Vec3 d1Prime(pNode2->GetVCurr()
1557  + pNode2->GetWCurr().Cross(d2)
1558  - pNode1->GetVCurr());
1559 
1560  tilde_d = R1hT*d1 - tilde_R1hT_tilde_f1;
1561  tilde_dPrime = R1hT*(d1Prime - pNode1->GetWCurr().Cross(d1));
1562 
1564 
1565  /* FIXME: we need to be able to regenerate FDE and FDEPrime
1566  * if the constitutive law throws ChangedEquationStructure */
1567  FDE = R1h*GetFDE()*R1hT;
1568  FDEPrime = R1h*GetFDEPrime()*R1hT;
1569 
1570  bFirstRes = true;
1571 }
1572 
1573 /* Contributo allo jacobiano durante l'assemblaggio iniziale */
1576  const VectorHandler& /* XCurr */ )
1577 {
1578  FullSubMatrixHandler& WM = WorkMat.SetFull();
1579 
1580  /* Dimensiona e resetta la matrice di lavoro */
1581  integer iNumRows = 0;
1582  integer iNumCols = 0;
1583  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1584  WM.ResizeReset(iNumRows, iNumCols);
1585 
1586  /* Recupera gli indici */
1587  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1588  integer iNode1FirstVelIndex = iNode1FirstPosIndex + 6;
1589  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1590  integer iNode2FirstVelIndex = iNode2FirstPosIndex + 6;
1591 
1592  /* Setta gli indici della matrice */
1593  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1594  WM.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1595  WM.PutColIndex(iCnt, iNode1FirstPosIndex + iCnt);
1596  WM.PutColIndex(6 + iCnt, iNode1FirstVelIndex + iCnt);
1597 
1598  WM.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1599  WM.PutColIndex(12 + iCnt, iNode2FirstPosIndex + iCnt);
1600  WM.PutColIndex(18 + iCnt, iNode2FirstVelIndex + iCnt);
1601  }
1602 
1603  Mat3x3 R1h(pNode1->GetRRef()*tilde_R1h);
1604  Vec3 Omega1(pNode1->GetWRef());
1605  Vec3 Omega2(pNode2->GetWRef());
1606 
1607  Vec3 F(R1h*GetF());
1608  Mat3x3 FDE(R1h*GetFDE().MulMT(R1h));
1609  Mat3x3 FDEPrime(R1h*GetFDEPrime().MulMT(R1h));
1610 
1611  Mat3x3 Tmp(Mat3x3(MatCross, F) - FDEPrime*Mat3x3(MatCross, Omega2 - Omega1) + FDE);
1612 
1613  // FIXME: check and rewrite
1614 
1615  WM.Add(1, 1, Tmp);
1616  WM.Sub(4, 1, Tmp);
1617 
1618  WM.Add(4, 6 + 1, FDE);
1619  WM.Sub(1, 6 + 1, FDE);
1620 
1621  WM.Add(1, 4, FDEPrime);
1622  WM.Add(4, 6 + 4, FDEPrime);
1623 
1624  WM.Sub(1, 6 + 4, FDEPrime);
1625  WM.Sub(4, 4, FDEPrime);
1626 
1627  return WorkMat;
1628 }
1629 
1630 /* Contributo al residuo durante l'assemblaggio iniziale */
1633  const VectorHandler& /* XCurr */ )
1634 {
1635  /* Dimensiona e resetta la matrice di lavoro */
1636  integer iNumRows = 0;
1637  integer iNumCols = 0;
1638  InitialWorkSpaceDim(&iNumRows, &iNumCols);
1639  WorkVec.ResizeReset(iNumRows);
1640 
1641  /* Recupera gli indici */
1642  integer iNode1FirstPosIndex = pNode1->iGetFirstPositionIndex();
1643  integer iNode2FirstPosIndex = pNode2->iGetFirstPositionIndex();
1644 
1645  /* Setta gli indici della matrice */
1646  for (int iCnt = 1; iCnt <= 6; iCnt++) {
1647  WorkVec.PutRowIndex(iCnt, iNode1FirstPosIndex + iCnt);
1648  WorkVec.PutRowIndex(6 + iCnt, iNode2FirstPosIndex + iCnt);
1649  }
1650 
1651  Mat3x3 R1h(pNode1->GetRCurr()*tilde_R1h);
1652  Vec3 d2(pNode2->GetRCurr()*tilde_f2);
1653  Vec3 d1(pNode2->GetXCurr() + d2 - pNode1->GetXCurr());
1654 
1655  Mat3x3 R1hT(R1h.Transpose());
1656  Vec3 d1Prime(pNode2->GetVCurr()
1657  + pNode2->GetWCurr().Cross(d2)
1658  - pNode1->GetVCurr());
1659 
1660  tilde_d = R1hT*d1 - tilde_R1hT_tilde_f1;
1661  tilde_dPrime = R1hT*(d1Prime - pNode1->GetWCurr().Cross(d1));
1662 
1664 
1665  Vec3 F(R1h*GetF());
1666 
1667  WorkVec.Add(1, F);
1668  WorkVec.Add(4, d1.Cross(F));
1669  WorkVec.Sub(6 + 1, F);
1670  WorkVec.Sub(6 + 4, d2.Cross(F));
1671 
1672  return WorkVec;
1673 }
1674 
1675 /* ViscoElasticDispJoint - end */
Definition: hint.h:38
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj2.h:132
Mat3x3 FDEPrime
Definition: vehj2.h:62
void PutColIndex(integer iSubCol, integer iCol)
Definition: submat.h:325
virtual Hint * ParseHint(DataManager *pDM, const char *s) const
Definition: vehj2.cc:439
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
Definition: matvec3.h:218
Vec3 tilde_dPrime
Definition: vehj2.h:55
void AssMatFDEPrime(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, const Vec3 &d1, const Vec3 &d2, doublereal dCoef)
Definition: vehj2.cc:168
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
Definition: matvec3.cc:738
~ElasticDispJointInv(void)
Definition: vehj2.cc:884
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
MatrixExpression< TransposedMatrix< MatrixDirectExpr< Matrix< T, N_rows, N_cols > > >, N_cols, N_rows > Transpose(const Matrix< T, N_rows, N_cols > &A)
Definition: matvec.h:2206
ElasticDispJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw3D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &tilde_f1, const Vec3 &tilde_f2, const Mat3x3 &tilde_R1, const Mat3x3 &tilde_R2, flag fOut)
Definition: vehj2.cc:590
ConstitutiveLaw< T, Tder > * pGetConstLaw(void) const
Definition: constltp.h:278
Definition: matvec3.h:98
virtual void ResizeReset(integer)
Definition: vh.cc:55
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj2.cc:1346
const MatCross_Manip MatCross
Definition: matvec3.cc:639
bool UseNetCDF(int out) const
Definition: output.cc:491
virtual const Vec3 & GetgCurr(void) const
Definition: strnode.h:982
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 AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: vehj2.cc:785
bool bIsErgonomy(void) const
Definition: elem.cc:83
void Add(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:209
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: constltp.h:361
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
void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
Definition: vehj2.cc:1226
~ViscousDispJoint(void)
Definition: vehj2.cc:1139
virtual void Sub(integer iRow, const Vec3 &v)
Definition: vh.cc:78
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj2.cc:1145
const Tder & GetFDE(void) const
Definition: constltp.h:298
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
const StructNode * pNode1
Definition: vehj2.h:46
Mat3x3 tilde_R2h
Definition: vehj2.h:51
virtual unsigned int iGetPrivDataIdx(const char *s) const
Definition: vehj2.cc:490
virtual unsigned int iGetNumPrivData(void) const
Definition: constltp.h:352
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj2.cc:1059
virtual const Vec3 & GetWRef(void) const
Definition: strnode.h:1024
void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
Definition: vehj2.cc:1503
#define NO_OP
Definition: myassert.h:74
std::vector< Hint * > Hints
Definition: simentity.h:89
void AssMatF(FullSubMatrixHandler &WMA, const Vec3 &d1, const Vec3 &d2, doublereal dCoef)
Definition: vehj2.cc:83
Vec3 GetVec(unsigned short int i) const
Definition: matvec3.h:893
Vec3 tilde_R1hT_tilde_f1
Definition: vehj2.h:52
Vec3 VecRot(const Mat3x3 &Phi)
Definition: Rot.cc:136
virtual void Output(OutputHandler &OH) const
Definition: vehj2.cc:359
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj2.cc:804
Vec3 MulTV(const Vec3 &v) const
Definition: matvec3.cc:482
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj2.cc:890
void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vehj2.cc:658
void OutputPrepare(OutputHandler &OH)
Definition: vehj2.cc:337
Mat3x3 tilde_R1h
Definition: vehj2.h:50
~ViscoElasticDispJoint(void)
Definition: vehj2.cc:1414
void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
Definition: vehj2.cc:747
virtual void PutRowIndex(integer iSubRow, integer iRow)=0
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj2.cc:617
virtual ~DeformableDispJoint(void)
Definition: vehj2.cc:76
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj2.cc:671
void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vehj2.cc:1152
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj2.cc:1089
~ElasticDispJoint(void)
Definition: vehj2.cc:611
DeformableDispJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw3D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &tilde_f1, const Vec3 &tilde_f2, const Mat3x3 &tilde_R1, const Mat3x3 &tilde_R2, flag fOut)
Definition: vehj2.cc:43
Matrix< T, 2, 2 > Inv(const Matrix< T, 2, 2 > &A)
Definition: matvec.h:3282
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj2.h:553
void SetNullMatrix(void)
Definition: submat.h:1159
Definition: mbdyn.h:76
virtual VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj2.cc:248
long GetCurrentStep(void) const
Definition: output.h:116
virtual void AfterConvergence(const VectorHandler &X, const VectorHandler &XP)
Definition: vehj2.cc:1420
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: vehj2.cc:1037
ViscousDispJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw3D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &tilde_f1, const Vec3 &tilde_f2, const Mat3x3 &tilde_R1, const Mat3x3 &tilde_R2, flag fOut)
Definition: vehj2.cc:1118
Mat3x3 Rot(const Vec3 &phi)
Definition: Rot.cc:62
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
VariableSubMatrixHandler & AssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj2.cc:699
virtual std::ostream & Restart(std::ostream &out) const
Definition: joint.h:195
void AssVec(SubVectorHandler &WorkVec)
Definition: vehj2.cc:761
ElasticDispJointInv(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw3D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &tilde_f1, const Vec3 &tilde_f2, const Mat3x3 &tilde_R1, const Mat3x3 &tilde_R2, flag fOut)
Definition: vehj2.cc:863
std::ostream & Joints(void) const
Definition: output.h:443
void AfterConvergence(const T &Eps, const T &EpsPrime=mb_zero< T >())
Definition: constltp.h:288
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj2.cc:834
virtual ConstLawType::Type GetConstLawType(void) const =0
#define ASSERT(expression)
Definition: colamd.c:977
void AssVec(SubVectorHandler &WorkVec)
Definition: vehj2.cc:1243
virtual void OutputPrepare_int(const std::string &type, OutputHandler &OH, std::string &name)
Definition: joint.cc:107
virtual const Vec3 & GetXCurr(void) const
Definition: strnode.h:310
virtual void Add(integer iRow, const Vec3 &v)
Definition: vh.cc:63
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj2.cc:1165
virtual void ResizeReset(integer, integer)
Definition: submat.cc:182
virtual void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)=0
virtual doublereal dGetPrivData(unsigned int i) const
Definition: constltp.h:369
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj2.h:349
Mat3x3 Transpose(void) const
Definition: matvec3.h:816
void AssMatFDE(FullSubMatrixHandler &WMA, const Vec3 &d1, const Vec3 &d2, doublereal dCoef)
Definition: vehj2.cc:108
void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *ph=0)
Definition: vehj2.cc:398
const MatCrossCross_Manip MatCrossCross
Definition: matvec3.cc:640
#define STRLENOF(s)
Definition: mbdyn.h:166
void AssVec(SubVectorHandler &WorkVec)
Definition: vehj2.cc:1004
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: vehj2.cc:1550
virtual bool bInverseDynamics(void) const
Definition: vehj2.cc:478
Definition: elem.h:75
virtual std::ostream & Restart(std::ostream &out) const
Definition: vehj2.cc:321
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj2.cc:1296
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj2.h:248
void PutRowIndex(integer iSubRow, integer iRow)
Definition: submat.h:311
const T & GetF(void) const
Definition: constltp.h:293
const StructNode * pNode2
Definition: vehj2.h:47
void AssVec(SubVectorHandler &WorkVec)
Definition: vehj2.cc:1520
virtual doublereal dGetPrivData(unsigned int i) const
Definition: vehj2.cc:543
ViscoElasticDispJoint(unsigned int uL, const DofOwner *pDO, const ConstitutiveLaw3D *pCL, const StructNode *pN1, const StructNode *pN2, const Vec3 &tilde_f1, const Vec3 &tilde_f2, const Mat3x3 &tilde_R1, const Mat3x3 &tilde_R2, flag fOut)
Definition: vehj2.cc:1391
const doublereal * pGetVec(void) const
Definition: matvec3.h:192
virtual void WorkSpaceDim(integer *piNumRows, integer *piNumCols) const =0
void AssMats(FullSubMatrixHandler &WorkMatA, FullSubMatrixHandler &WorkMatB, doublereal dCoef)
Definition: vehj2.cc:1428
virtual const Vec3 & GetVCurr(void) const
Definition: strnode.h:322
void Sub(integer iRow, integer iCol, const Vec3 &v)
Definition: submat.cc:215
virtual void AfterPredict(VectorHandler &X, VectorHandler &XP)
Definition: vehj2.cc:1272
Definition: joint.h:50
virtual SubVectorHandler & InitialAssRes(SubVectorHandler &WorkVec, const VectorHandler &XCurr)
Definition: vehj2.cc:1632
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj2.cc:1442
virtual unsigned int iGetNumPrivData(void) const
Definition: vehj2.cc:484
virtual void SetValue(DataManager *pDM, VectorHandler &X, VectorHandler &XP, SimulationEntity::Hints *h=0)
Definition: simentity.cc:63
virtual void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
Definition: joint.cc:163
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
unsigned int GetLabel(void) const
Definition: withlab.cc:62
virtual SubVectorHandler & AssRes(SubVectorHandler &WorkVec, doublereal dCoef, const VectorHandler &XCurr, const VectorHandler &XPrimeCurr)
Definition: vehj2.cc:944
void AssMats(FullSubMatrixHandler &WMA, FullSubMatrixHandler &WMB, doublereal dCoef)
Definition: vehj2.cc:931
bool UseText(int out) const
Definition: output.cc:446
virtual void InitialWorkSpaceDim(integer *piNumRows, integer *piNumCols) const
Definition: vehj2.h:451
virtual VariableSubMatrixHandler & InitialAssJac(VariableSubMatrixHandler &WorkMat, const VectorHandler &XCurr)
Definition: vehj2.cc:1575