67 #include "screwjoint.h"
79 #define MBDYN_X_COMPATIBLE_INPUT
112 std::ostringstream os;
114 (void)OH.CreateVar(os.str(), type);
120 Var_F_local = OH.CreateVar<
Vec3>(name +
"f",
"N",
121 "local reaction force (Fx, Fy, Fz)");
123 Var_M_local = OH.CreateVar<
Vec3>(name +
"m",
"Nm",
124 "local reaction moment (Mx, My, Mz)");
126 Var_F_global = OH.CreateVar<
Vec3>(name +
"F",
"N",
127 "global reaction force (FX, FY, FZ)");
129 Var_M_global = OH.CreateVar<
Vec3>(name +
"M",
"Nm",
130 "global reaction moment (MX, MY, MZ)");
140 const Vec3& FLocal,
const Vec3& MLocal,
141 const Vec3& FGlobal,
const Vec3& MGlobal)
const
146 ASSERT(strlen(sJointName) <= 16);
150 return out << sJointName << std::setw(16+8-strlen(sJointName)) << uLabel <<
" "
151 << FLocal <<
" " << MLocal <<
" " << FGlobal <<
" " << MGlobal;
155 << std::setw(8) << uLabel
156 <<
" " << FLocal <<
" " << MLocal
157 <<
" " << FGlobal <<
" " << MGlobal;
166 "Elem::Update(" <<
invdyn2str(iOrder) <<
") for inverse dynamics not implemented yet" << std::endl);
194 const char* sKeyWords[] = {
196 "distance" "with" "offset",
203 "universal" "rotation",
206 "cardano" "rotation",
210 "revolute" "rotation",
214 "plane" "displacement",
215 "plane" "displacement" "pin",
219 "rod" "with" "offset",
221 "deformable" "hinge",
222 "deformable" "displacement" "hinge",
223 "deformable" "displacement" "joint",
224 "deformable" "joint",
225 "deformable" "axial" "joint",
227 "invariant" "deformable" "hinge",
228 "invariant" "deformable" "displacement" "joint",
229 "invariant" "deformable" "joint",
231 "angular" "velocity",
232 "linear" "acceleration",
233 "angular" "acceleration",
236 "drive" "displacement",
237 "drive" "displacement" "pin",
238 "imposed" "displacement",
239 "imposed" "displacement" "pin",
240 "imposed" "orientation",
242 "total" "internal" "reaction",
244 "total" "pin" "joint",
253 #endif // MBDYN_DEVEL
282 PLANEDISPLACEMENTPIN,
292 DEFORMABLEAXIALJOINT,
294 INVARIANTDEFORMABLEHINGE,
295 INVARIANTDEFORMABLEDISPJOINT,
296 INVARIANTDEFORMABLEJOINT,
304 DRIVEDISPLACEMENTPIN,
306 IMPOSEDDISPLACEMENTPIN,
309 TOTALINTERNALREACTION,
317 POINT_SURFACE_CONTACT,
320 #endif // MBDYN_DEVEL
332 if (CurrKeyWord >= 0) {
333 std::cout <<
"joint type: " << sKeyWords[CurrKeyWord] << std::endl;
339 bool bIsTorque(
true);
340 bool bIsPrescribedMotion(
true);
341 bool bIsErgonomy(
false);
342 bool bIsRightHandSide(
false);
344 switch (CurrKeyWord) {
377 silent_cerr(
"Joint(" << uLabel <<
"): "
378 "invalid StructNode(" << pNode1->
GetLabel() <<
") for node #1" << std::endl);
383 silent_cerr(
"Joint(" << uLabel <<
"): "
384 "invalid StructNode(" << pNode2->
GetLabel() <<
") for node #2" << std::endl);
395 - pN1->GetRCurr()*f1).
Norm();
400 pedantic_cout(
"Distance(" << uLabel <<
"): "
401 "length from nodes = " << l << std::endl);
419 pN1, pN2, f1, f2, pDC, fOut));
425 pNode1, pNode2, pDC, fOut));
429 out <<
"distance: " << uLabel
431 <<
" ", f1.
Write(out,
" ")
433 <<
" ", f2.
Write(out,
" ")
439 case DISTANCEWITHOFFSET:
444 #ifdef MBDYN_X_COMPATIBLE_INPUT
445 pedantic_cerr(
"Joint(" << uLabel <<
"): \"distance with offset\" "
446 "is deprecated; use \"distance\" instead" << std::endl);
455 #ifdef MBDYN_X_COMPATIBLE_INPUT
458 pedantic_cerr(
"Joint(" << uLabel <<
"): "
459 "missing keyword \"position\" at line "
464 #ifndef MBDYN_X_COMPATIBLE_INPUT
468 DEBUGCOUT(
"Offset 1: " << f1 << std::endl);
476 #ifdef MBDYN_X_COMPATIBLE_INPUT
479 pedantic_cerr(
"Joint(" << uLabel <<
"): "
480 "missing keyword \"position\" at line "
485 #ifndef MBDYN_X_COMPATIBLE_INPUT
489 DEBUGCOUT(
"Offset 2: " << f2 << std::endl);
495 <<
": driver data expected" << std::endl);
502 + pNode2->GetRCurr()*f2
503 - pNode1->GetRCurr()*f1).
Norm();
505 pedantic_cout(
"DistanceWithOffset(" << uLabel <<
"): "
506 "length from nodes = " << l << std::endl);
525 out <<
"distance: " << uLabel
526 <<
" " << pNode1->GetLabel()
527 <<
" ", f1.Write(out,
" ")
528 <<
" " << pNode2->GetLabel()
529 <<
" ", f2.Write(out,
" ")
547 if (HP.IsKeyWord(
"position")) {
548 #ifdef MBDYN_X_COMPATIBLE_INPUT
551 pedantic_cerr(
"Joint(" << uLabel <<
"): "
552 "missing keyword \"position\" at line "
553 << HP.GetLineData() << std::endl);
556 if (!HP.IsKeyWord(
"node")) {
558 X0 = HP.GetPosAbs(RF);
560 #ifndef MBDYN_X_COMPATIBLE_INPUT
564 DEBUGCOUT(
"X0 =" << std::endl << X0 << std::endl);
569 if (HP.IsKeyWord(
"orientation")) {
570 #ifdef MBDYN_X_COMPATIBLE_INPUT
573 pedantic_cerr(
"Joint(" << uLabel <<
"): "
574 "missing keyword \"orientation\" at line "
575 << HP.GetLineData() << std::endl);
578 if (!HP.IsKeyWord(
"node")) {
580 R0 = HP.GetRotAbs(RF);
582 #ifndef MBDYN_X_COMPATIBLE_INPUT
586 DEBUGCOUT(
"R0 =" << std::endl << R0 << std::endl);
593 ClampJoint(uLabel, pDO, pNode, X0, R0, fOut));
594 std::ostream& out = pDM->GetLogFile();
595 out <<
"clamp: " << uLabel
616 if (HP.IsKeyWord(
"position")) {
617 #ifdef MBDYN_X_COMPATIBLE_INPUT
620 pedantic_cerr(
"Joint(" << uLabel <<
"): "
621 "missing keyword \"position\" at line "
622 << HP.GetLineData() << std::endl);
625 d = HP.GetPosRel(RF);
626 #ifndef MBDYN_X_COMPATIBLE_INPUT
631 if (HP.IsKeyWord(
"orientation")) {
632 (void)HP.GetRotRel(RF);
635 DEBUGCOUT(
"Node reference frame d:" << std::endl << d << std::endl);
639 if (HP.IsKeyWord(
"position")) {
640 #ifdef MBDYN_X_COMPATIBLE_INPUT
643 pedantic_cerr(
"Joint(" << uLabel <<
"): "
644 "missing keyword \"position\" at line "
645 << HP.GetLineData() << std::endl);
649 #ifndef MBDYN_X_COMPATIBLE_INPUT
654 if (HP.IsKeyWord(
"orientation")) {
664 PinJoint(uLabel, pDO, pNode, X0, d, fOut));
666 std::ostream& out = pDM->GetLogFile();
667 out <<
"sphericalpin: " << uLabel
683 case REVOLUTEROTATION:
685 case UNIVERSALROTATION:
687 case CARDANOROTATION:
690 case PLANEDISPLACEMENT:
698 #ifndef MBDYN_X_COMPATIBLE_INPUT
699 if (HP.IsKeyWord(
"position")) {
700 d1 = HP.GetPosRel(RF1);
703 switch (CurrKeyWord) {
704 case REVOLUTEROTATION:
705 case UNIVERSALROTATION:
706 case CARDANOROTATION:
708 if (HP.IsKeyWord(
"position")) {
710 (void)HP.GetPosRel(RF1);
712 pedantic_cerr(
"Joint(" << uLabel <<
"): "
713 "missing keyword \"position\" at line "
714 << HP.GetLineData() << std::endl);
719 if (!HP.IsKeyWord(
"position")) {
720 pedantic_cerr(
"Joint(" << uLabel <<
"): "
721 "missing keyword \"position\" at line "
722 << HP.GetLineData() << std::endl);
724 d1 = HP.GetPosRel(RF1);
725 DEBUGCOUT(
"Node 1 reference frame d1:" << std::endl
732 if (HP.IsKeyWord(
"orientation")) {
733 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
734 R1h = HP.GetRotRel(RF1);
735 #ifdef MBDYN_X_COMPATIBLE_INPUT
736 }
else if (HP.IsKeyWord(
"hinge")) {
737 pedantic_cerr(
"Joint(" << uLabel <<
"): "
738 "keyword \"hinge\" at line " << HP.GetLineData()
739 <<
" is deprecated; use \"orientation\" instead"
741 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
742 R1h = HP.GetRotRel(RF1);
754 #ifndef MBDYN_X_COMPATIBLE_INPUT
755 if (HP.IsKeyWord(
"position")) {
756 d2 = HP.GetPosRel(RF2, RF1, d1);
759 switch (CurrKeyWord) {
760 case REVOLUTEROTATION:
761 case UNIVERSALROTATION:
762 case CARDANOROTATION:
764 if (HP.IsKeyWord(
"position")) {
766 (void)HP.GetPosRel(RF2, RF1, d1);
768 pedantic_cerr(
"Joint(" << uLabel <<
"): "
769 "missing keyword \"position\" at line "
770 << HP.GetLineData() << std::endl);
775 if (!HP.IsKeyWord(
"position")) {
776 pedantic_cerr(
"Joint(" << uLabel <<
"): "
777 "missing keyword \"position\" at line "
778 << HP.GetLineData() << std::endl);
780 d2 = HP.GetPosRel(RF2, RF1, d1);
781 DEBUGCOUT(
"Node 2 reference frame d2:" << std::endl
788 if (HP.IsKeyWord(
"orientation")) {
789 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
790 R2h = HP.GetRotRel(RF2, RF1, R1h);
791 #ifdef MBDYN_X_COMPATIBLE_INPUT
792 }
else if (HP.IsKeyWord(
"hinge")) {
793 pedantic_cerr(
"Joint(" << uLabel <<
"): "
794 "keyword \"hinge\" at line " << HP.GetLineData()
795 <<
" is deprecated; use \"orientation\" instead"
797 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
798 R2h = HP.GetRotRel(RF2, RF1, R1h);
804 if (CurrKeyWord == AXIALROTATION) {
805 pDC = HP.GetDriveCaller();
809 switch (CurrKeyWord) {
812 case UNIVERSALROTATION:
813 case CARDANOROTATION:
816 case REVOLUTEROTATION:
826 switch (CurrKeyWord) {
835 d1, R1h, d2, R2h, od, fOut));
836 std::ostream& out = pDM->GetLogFile();
837 out <<
"sphericalhinge: " << uLabel
849 silent_cerr(
"line " << HP.GetLineData()
850 <<
": deprecated \"plane hinge\" joint name;"
851 <<
" use \"revolute hinge\" instead" << std::endl);
854 bool calcInitdTheta =
true;
856 if (HP.IsKeyWord(
"initial" "theta")) {
857 initDTheta = HP.GetReal();
858 calcInitdTheta =
false;
864 if (HP.IsKeyWord(
"friction")) {
866 if (HP.IsKeyWord(
"preload")) {
867 preload = HP.GetReal();
875 d1, d2, R1h, R2h, od, fOut,
876 calcInitdTheta, initDTheta,
877 r, preload, bsh, bf));
878 std::ostream& out = pDM->GetLogFile();
879 out <<
"revolutehinge: " << uLabel
891 if (!HP.IsKeyWord(
"friction")) {
892 silent_cerr(
"missing keyword \"friction\" at line "
893 << HP.GetLineData() << std::endl);
899 if (HP.IsKeyWord(
"preload")) {
900 preload = HP.GetReal();
916 Brake(uLabel, pDO, pNode1, pNode2,
917 d1, d2, R1h, R2h, fOut,
920 std::ostream& out = pDM->GetLogFile();
921 out <<
"brake: " << uLabel
932 case REVOLUTEROTATION:
937 pNode1, pNode2, R1h, R2h, od, fOut));
938 std::ostream& out = pDM->GetLogFile();
939 out <<
"revoluterotation: " << uLabel
957 d1, d2, R1h, R2h, fOut));
958 std::ostream& out = pDM->GetLogFile();
959 out <<
"cardanohinge: " << uLabel
970 case UNIVERSALROTATION:
971 case CARDANOROTATION:
976 pNode1, pNode2, R1h, R2h, od, fOut));
977 std::ostream& out = pDM->GetLogFile();
978 out <<
"cardanorotation: " << uLabel
996 if (HP.IsKeyWord(
"friction")) {
998 if (HP.IsKeyWord(
"preload")) {
999 preload = HP.GetReal();
1008 d1, d2, R1h, R2h, pDC, od,
1010 r, preload, bsh, bf));
1011 std::ostream& out = pDM->GetLogFile();
1012 out <<
"axialrotation: " << uLabel
1023 case GIMBALROTATION:
1028 pNode1, pNode2, R1h, R2h, od, fOut));
1029 std::ostream& out = pDM->GetLogFile();
1030 out <<
"gimbalrotation: " << uLabel
1041 case PLANEDISPLACEMENT:
1042 silent_cerr(
"PlaneDispJoint(" << uLabel <<
"): "
1044 "use an InPlane and a RevoluteRotation"
1049 ASSERTMSG(0,
"You shouldn't have reached this point");
1059 case PLANEDISPLACEMENTPIN:
1066 if (HP.IsKeyWord(
"position")) {
1067 #ifdef MBDYN_X_COMPATIBLE_INPUT
1070 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1071 "missing keyword \"position\" at line "
1072 << HP.GetLineData() << std::endl);
1075 d = HP.GetPosRel(RF);
1076 #ifndef MBDYN_X_COMPATIBLE_INPUT
1080 DEBUGCOUT(
"Node reference frame d:" << std::endl << d << std::endl);
1083 if (HP.IsKeyWord(
"orientation")) {
1084 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1085 Rh = HP.GetRotRel(RF);
1086 #ifdef MBDYN_X_COMPATIBLE_INPUT
1087 }
else if (HP.IsKeyWord(
"hinge")) {
1088 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1089 "keyword \"hinge\" at line " << HP.GetLineData()
1090 <<
" is deprecated; use \"orientation\" instead"
1092 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1093 Rh = HP.GetRotRel(RF);
1094 DEBUGCOUT(
"Hinge Rotation matrix Rh:" << std::endl << Rh << std::endl);
1100 #ifndef MBDYN_X_COMPATIBLE_INPUT
1101 if (HP.IsKeyWord(
"position"))
1103 if (!HP.IsKeyWord(
"position")) {
1104 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1105 "keyword \"position\" expected at line " << HP.GetLineData()
1112 DEBUGCOUT(
"Absolute X:" << std::endl << X0 << std::endl);
1115 if (HP.IsKeyWord(
"orientation")) {
1116 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1118 #ifdef MBDYN_X_COMPATIBLE_INPUT
1119 }
else if (HP.IsKeyWord(
"hinge")) {
1120 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1121 "keyword \"hinge\" at line " << HP.GetLineData()
1122 <<
" is deprecated; use \"orientation\" instead"
1124 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1129 DEBUGCOUT(
"Absolute R:" << std::endl << R0 << std::endl);
1134 switch (CurrKeyWord) {
1138 silent_cerr(
"deprecated \"plane pin\" joint name;"
1139 <<
" use \"revolute pin\" instead" << std::endl);
1142 bool calcInitdTheta =
true;
1144 if (HP.IsKeyWord(
"initial" "theta")) {
1145 initDTheta = HP.GetReal();
1146 calcInitdTheta =
false;
1151 X0, R0, d, Rh, fOut,
1152 calcInitdTheta, initDTheta));
1153 std::ostream& out = pDM->GetLogFile();
1154 out <<
"revolutepin: " << uLabel
1160 <<
" " << R0.MulMT(pNode->
GetRCurr())
1170 X0, R0, d, Rh, fOut));
1171 std::ostream& out = pDM->GetLogFile();
1172 out <<
"cardanopin: " << uLabel
1178 <<
" " << R0.MulMT(pNode->
GetRCurr())
1183 case PLANEDISPLACEMENTPIN:
1184 silent_cerr(
"PlaneDispJoint(" << uLabel <<
"): "
1186 "use an \"inplane\" and a \"revolute rotation\" instead"
1191 ASSERTMSG(0,
"You shouldn't have reached this point");
1204 if (HP.IsKeyWord(
"position")) {
1205 #ifdef MBDYN_X_COMPATIBLE_INPUT
1208 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1209 "missing keyword \"position\" at line "
1210 << HP.GetLineData() << std::endl);
1213 p = HP.GetPosRel(RF);
1214 #ifndef MBDYN_X_COMPATIBLE_INPUT
1217 DEBUGCOUT(
"Node 1 reference frame p:" << std::endl << p << std::endl);
1221 v = HP.GetUnitVecRel(RF);
1223 silent_cerr(
"Joint(" << uLabel <<
"): "
1224 "null direction at line " << HP.GetLineData()
1233 bool bOffset(
false);
1236 if (HP.IsKeyWord(
"offset")) {
1239 DEBUGCOUT(
"Node 2 reference frame q:" << std::endl
1250 pNode1, pNode2, v, p, q, fOut));
1255 pNode1, pNode2, v, p, fOut));
1257 std::ostream& out = pDM->GetLogFile();
1260 out <<
"inplane: " << uLabel
1278 if (HP.IsKeyWord(
"position")) {
1279 #ifdef MBDYN_X_COMPATIBLE_INPUT
1282 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1283 "missing keyword \"position\" at line "
1284 << HP.GetLineData() << std::endl);
1287 p = HP.GetPosRel(RF);
1288 #ifndef MBDYN_X_COMPATIBLE_INPUT
1292 DEBUGCOUT(
"Node 1 reference frame p:" << std::endl << p << std::endl);
1295 if (HP.IsKeyWord(
"orientation")) {
1296 #ifdef MBDYN_X_COMPATIBLE_INPUT
1299 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1300 "missing keyword \"orientation\" at line "
1301 << HP.GetLineData() << std::endl);
1304 R = HP.GetRotRel(RF);
1305 #ifndef MBDYN_X_COMPATIBLE_INPUT
1314 bool bOffset(
false);
1317 if (HP.IsKeyWord(
"offset")) {
1320 DEBUGCOUT(
"Node 2 reference frame q:" << std::endl << p << std::endl);
1330 pNode1, pNode2,
R, p, q, fOut));
1335 pNode1, pNode2,
R, p, fOut));
1337 std::ostream& out = pDM->GetLogFile();
1338 out <<
"inline: " << uLabel
1353 bIsPrescribedMotion =
false;
1354 bIsRightHandSide =
true;
1361 bool bOffset(
false);
1370 if (HP.IsKeyWord(
"position")) {
1372 silent_cerr(
"Joint(" << uLabel <<
"): "
1373 "\"position\" not allowed with rotationless node " << pNode1->
GetLabel()
1374 <<
" at line " << HP.GetLineData() << std::endl);
1378 f1 = HP.GetPosRel(RF1);
1388 if (HP.IsKeyWord(
"position")) {
1390 silent_cerr(
"Joint(" << uLabel <<
"): "
1391 "\"position\" not allowed on second node when first node "
1392 << pNode1->
GetLabel() <<
" is rotationless"
1393 <<
" at line " << HP.GetLineData() << std::endl);
1395 }
else if (pN2 == 0) {
1396 silent_cerr(
"Joint(" << uLabel <<
"): "
1397 "\"position\" not allowed with rotationless node " << pNode2->
GetLabel()
1398 <<
" at line " << HP.GetLineData() << std::endl);
1408 bool bFromNodes(
false);
1409 if (HP.IsKeyWord(
"from" "nodes")) {
1411 DEBUGCOUT(
"Initial length will be computed from nodes position" << std::endl);
1415 DEBUGCOUT(
"Initial length = " << dL0 << std::endl);
1420 #ifdef MBDYN_X_COMPATIBLE_INPUT
1421 if (HP.IsKeyWord(
"offset")) {
1422 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1423 "keyword \"offset\" at line " << HP.GetLineData()
1424 <<
" is deprecated; use \"position\" instead"
1427 silent_cerr(
"Joint(" << uLabel <<
"): "
1428 "offsets already defined "
1429 "at line " << HP.GetLineData()
1435 silent_cerr(
"Joint(" << uLabel <<
"): "
1436 "\"offset\" not allowed when first node "
1437 << pNode1->
GetLabel() <<
" is rotationless"
1438 <<
" at line " << HP.GetLineData() << std::endl);
1440 }
else if (pN2 == 0) {
1441 silent_cerr(
"Joint(" << uLabel <<
"): "
1442 "\"offset\" not allowed when second node "
1443 << pNode2->
GetLabel() <<
" is rotationless"
1444 <<
" at line " << HP.GetLineData() << std::endl);
1450 f1 = HP.GetPosRel(RF1);
1451 DEBUGCOUT(
"Offset 1: " << f1 << std::endl);
1454 DEBUGCOUT(
"Offset 2: " << f2 << std::endl);
1460 v += pN2->GetRCurr()*f2 - pN1->GetRCurr()*f1;
1466 pedantic_cout(
"Rod[WithOffset](" << uLabel <<
"): "
1467 "length from nodes = " << dL1 << std::endl);
1470 DEBUGCOUT(
"Initial length = " << dL0 << std::endl);
1474 pDM->PushCurrData(
"L0", dL0);
1475 pDM->PushCurrData(
"L", dL1);
1477 pDM->PopCurrData(
"L");
1478 pDM->PopCurrData(
"L0");
1481 silent_cerr(
"line " << HP.GetLineData() <<
": "
1482 "rod joint does not support "
1483 "dynamic constitutive laws yet"
1490 std::ostream& out = pDM->GetLogFile();
1491 out <<
"rod: " << uLabel
1493 <<
" ", f1.Write(out,
" ")
1495 <<
" ", f2.Write(out,
" ")
1502 pN1, pN2, f1, f2, dL0, fOut));
1511 pNode1, pNode2, dL0, fOut));
1517 Rod(uLabel, pDO, pCL,
1518 pNode1, pNode2, dL0, fOut));
1528 bIsPrescribedMotion =
false;
1529 bIsRightHandSide =
true;
1539 #ifdef MBDYN_X_COMPATIBLE_INPUT
1540 pedantic_cerr(
"Joint(" << uLabel <<
"): \"rod with offset\" "
1541 "is deprecated; use \"rod\" instead" << std::endl);
1549 if (HP.IsKeyWord(
"position")) {
1550 #ifdef MBDYN_X_COMPATIBLE_INPUT
1553 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1554 "missing keyword \"position\" at line "
1555 << HP.GetLineData() << std::endl);
1558 f1 = HP.GetPosRel(RF1);
1559 #ifndef MBDYN_X_COMPATIBLE_INPUT
1564 <<
"with offset " << f1 << std::endl);
1571 if (HP.IsKeyWord(
"position")) {
1572 #ifdef MBDYN_X_COMPATIBLE_INPUT
1575 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1576 "missing keyword \"position\" at line "
1577 << HP.GetLineData() << std::endl);
1581 #ifndef MBDYN_X_COMPATIBLE_INPUT
1585 DEBUGCOUT(
"Linked to Node " << pNode2->GetLabel()
1586 <<
"with offset " << f2 << std::endl);
1589 + pNode2->GetRCurr()*f2
1593 pedantic_cout(
"RodWithOffset(" << uLabel <<
"): "
1594 "length from nodes = " << dL1 << std::endl);
1598 if (HP.IsKeyWord(
"from" "nodes")) {
1605 DEBUGCOUT(
"Initial length = " << dL0 << std::endl);
1609 pDM->PushCurrData(
"L0", dL0);
1610 pDM->PushCurrData(
"L", dL1);
1612 pDM->PopCurrData(
"L");
1613 pDM->PopCurrData(
"L0");
1616 silent_cerr(
"line " << HP.GetLineData() <<
": "
1617 "\"rod with offset\" joint does not support "
1618 "dynamic constitutive laws yet"
1625 std::ostream& out = pDM->GetLogFile();
1626 out <<
"rod: " << uLabel
1628 <<
" ", f1.Write(out,
" ")
1629 <<
" " << pNode2->GetLabel()
1630 <<
" ", f2.Write(out,
" ")
1636 pNode1, pNode2, f1, f2, dL0, fOut));
1643 bIsPrescribedMotion =
false;
1644 bIsRightHandSide =
true;
1654 if (HP.IsKeyWord(
"position")) {
1655 #ifdef MBDYN_X_COMPATIBLE_INPUT
1658 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1659 "missing keyword \"position\" at line "
1660 << HP.GetLineData() << std::endl);
1663 fO = HP.GetPosRel(RF1);
1664 #ifndef MBDYN_X_COMPATIBLE_INPUT
1669 if (HP.IsKeyWord(
"position")) {
1670 #ifdef MBDYN_X_COMPATIBLE_INPUT
1673 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1674 "missing keyword \"position\" at line "
1675 << HP.GetLineData() << std::endl);
1678 fA = HP.GetPosRel(RF1);
1679 #ifndef MBDYN_X_COMPATIBLE_INPUT
1684 <<
"with offset O " << fO
1685 <<
" and offset A " << fA << std::endl);
1693 if (HP.IsKeyWord(
"position")) {
1694 #ifdef MBDYN_X_COMPATIBLE_INPUT
1697 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1698 "missing keyword \"position\" at line "
1699 << HP.GetLineData() << std::endl);
1704 #ifndef MBDYN_X_COMPATIBLE_INPUT
1709 if (HP.IsKeyWord(
"position")) {
1710 #ifdef MBDYN_X_COMPATIBLE_INPUT
1713 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1714 "missing keyword \"position\" at line "
1715 << HP.GetLineData() << std::endl);
1720 #ifndef MBDYN_X_COMPATIBLE_INPUT
1724 bool bFromNodes =
false;
1726 if (HP.IsKeyWord(
"from" "nodes")) {
1728 DEBUGCOUT(
"Initial length computed from nodes " << std::endl);
1731 DEBUGCOUT(
"Initial length = " << dL0 << std::endl);
1735 if (HP.IsKeyWord(
"integration" "order")) {
1736 iIntOrder = HP.GetInt();
1737 if (iIntOrder < 1) {
1738 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1739 "integration order cannot be less than 1. "
1742 }
else if (iIntOrder > 10) {
1743 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1744 "maximum supported integration order is 10."
1749 int iIntSegments = 3;
1750 if (HP.IsKeyWord(
"integration" "segments")) {
1751 iIntSegments = HP.GetInt();
1752 if (iIntSegments < 1) {
1753 pedantic_cerr(
"Joint (" << uLabel <<
"): "
1754 "integration segments cannot be less than 1."
1759 DEBUGCOUT(
"Joint(" << uLabel <<
"): Linked to Node "
1760 << pNode2->GetLabel()
1761 <<
" with offset B " << fB
1762 <<
" and offset I " << fI
1763 <<
". Integration order " << iIntOrder
1764 <<
" on " << iIntSegments <<
" segments"
1772 silent_cerr(
"line " << HP.GetLineData() <<
": "
1773 "rod bezier joint does not support "
1774 "dynamic constitutive laws yet"
1781 std::ostream& out = pDM->GetLogFile();
1782 out <<
"rod bezier: " << uLabel
1784 <<
" ", fO.Write(out,
" ")
1785 <<
" ", fA.Write(out,
" ")
1786 <<
" " << pNode2->GetLabel()
1787 <<
" ", fB.Write(out,
" ")
1788 <<
" ", fI.Write(out,
" ")
1794 pNode1, pNode2, fO, fA, fB, fI,
1796 iIntOrder, iIntSegments, fOut));
1798 case DEFORMABLEHINGE:
1799 case DEFORMABLEDISPHINGE:
1800 case DEFORMABLEDISPJOINT:
1801 case DEFORMABLEAXIALJOINT:
1802 case INVARIANTDEFORMABLEHINGE:
1803 case INVARIANTDEFORMABLEDISPJOINT:
1806 bIsPrescribedMotion =
false;
1807 bIsRightHandSide =
true;
1818 switch (CurrKeyWord) {
1819 case DEFORMABLEDISPHINGE:
1820 case DEFORMABLEDISPJOINT:
1821 case INVARIANTDEFORMABLEDISPJOINT:
1822 if (HP.IsKeyWord(
"position")) {
1823 #ifdef MBDYN_X_COMPATIBLE_INPUT
1826 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1827 "missing keyword \"position\" at line "
1828 << HP.GetLineData() << std::endl);
1831 f1 = HP.GetPosRel(RF1);
1832 #ifndef MBDYN_X_COMPATIBLE_INPUT
1837 case DEFORMABLEHINGE:
1838 case DEFORMABLEAXIALJOINT:
1839 case INVARIANTDEFORMABLEHINGE:
1840 if (HP.IsKeyWord(
"position")) {
1842 f1 = HP.GetPosRel(RF1);
1850 if (HP.IsKeyWord(
"orientation")) {
1851 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1852 R1 = HP.GetRotRel(RF1);
1853 #ifdef MBDYN_X_COMPATIBLE_INPUT
1854 }
else if (HP.IsKeyWord(
"hinge")) {
1855 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1856 "keyword \"hinge\" at line " << HP.GetLineData()
1857 <<
" is deprecated; use \"orientation\" instead"
1859 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1860 R1 = HP.GetRotRel(RF1);
1872 switch (CurrKeyWord) {
1873 case DEFORMABLEDISPHINGE:
1874 case DEFORMABLEDISPJOINT:
1875 case INVARIANTDEFORMABLEDISPJOINT:
1876 if (HP.IsKeyWord(
"position")) {
1877 #ifdef MBDYN_X_COMPATIBLE_INPUT
1880 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1881 "missing keyword \"position\" at line "
1882 << HP.GetLineData() << std::endl);
1885 f2 = HP.GetPosRel(RF2, RF1, f1);
1886 #ifndef MBDYN_X_COMPATIBLE_INPUT
1891 case DEFORMABLEHINGE:
1892 case DEFORMABLEAXIALJOINT:
1893 case INVARIANTDEFORMABLEHINGE:
1894 if (HP.IsKeyWord(
"position")) {
1896 f2 = HP.GetPosRel(RF2, RF1, f1);
1904 if (HP.IsKeyWord(
"orientation")) {
1905 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1906 R2 = HP.GetRotRel(RF2, RF1, R1);
1907 #ifdef MBDYN_X_COMPATIBLE_INPUT
1908 }
else if (HP.IsKeyWord(
"hinge")) {
1909 pedantic_cerr(
"Joint(" << uLabel <<
"): "
1910 "keyword \"hinge\" at line " << HP.GetLineData()
1911 <<
" is deprecated; use \"orientation\" instead"
1913 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
1914 R2 = HP.GetRotRel(RF2, RF1, R1);
1923 unsigned iCLNumDof = 0;
1924 switch (CurrKeyWord) {
1925 case DEFORMABLEAXIALJOINT:
1926 pCL1 = HP.GetConstLaw1D(CLType);
1931 pCL3 = HP.GetConstLaw3D(CLType);
1936 if (iCLNumDof != 0) {
1937 silent_cerr(
"line " << HP.GetLineData() <<
": "
1938 "generic deformable joint does not support "
1939 "constitutive laws with internal degrees of freedom yet"
1945 switch (CurrKeyWord) {
1946 case DEFORMABLEHINGE:
1947 case INVARIANTDEFORMABLEHINGE:
1957 const char *sJointLogName = 0;
1961 switch (CurrKeyWord) {
1962 case DEFORMABLEHINGE:
1968 sJointLogName =
"deformablehinge";
1971 case INVARIANTDEFORMABLEHINGE:
1977 sJointLogName =
"deformablehinge";
1980 case DEFORMABLEDISPHINGE:
1981 case DEFORMABLEDISPJOINT:
1986 f1, f2, R1, R2, fOut));
1988 sJointLogName =
"deformabledisplacementjoint";
1991 case INVARIANTDEFORMABLEDISPJOINT:
1993 silent_cerr(
"\"invariant deformable displacement joint\" "
1994 "at line " << HP.GetLineData()
1995 <<
" not implemented yet" << std::endl);
2003 f1, f2, R1, R2, fOut));
2005 sJointLogName =
"deformabledisplacementjoint";
2009 case DEFORMABLEAXIALJOINT:
2015 sJointLogName =
"deformableaxialjoint";
2019 ASSERTMSG(0,
"You shouldn't have reached this point");
2026 switch (CurrKeyWord) {
2027 case DEFORMABLEHINGE:
2033 sJointLogName =
"deformablehinge";
2036 case INVARIANTDEFORMABLEHINGE:
2042 sJointLogName =
"deformablehinge";
2045 case DEFORMABLEDISPHINGE:
2046 case DEFORMABLEDISPJOINT:
2051 f1, f2, R1, R2, fOut));
2052 sJointLogName =
"deformabledisplacementjoint";
2055 case INVARIANTDEFORMABLEDISPJOINT:
2056 silent_cerr(
"\"invariant deformable displacement joint\" "
2057 "at line " << HP.GetLineData()
2058 <<
" not implemented yet" << std::endl);
2065 f1, f2, R1, R2, fOut));
2066 sJointLogName =
"deformabledisplacementjoint";
2070 case DEFORMABLEAXIALJOINT:
2076 sJointLogName =
"deformableaxialjoint";
2080 ASSERTMSG(0,
"You shouldn't have reached this point");
2087 switch (CurrKeyWord) {
2088 case DEFORMABLEHINGE:
2094 sJointLogName =
"deformablehinge";
2097 case INVARIANTDEFORMABLEHINGE:
2103 sJointLogName =
"deformablehinge";
2106 case DEFORMABLEDISPHINGE:
2107 case DEFORMABLEDISPJOINT:
2113 f1, f2, R1, R2, fOut));
2114 sJointLogName =
"deformabledisplacementjoint";
2117 case INVARIANTDEFORMABLEDISPJOINT:
2118 silent_cerr(
"\"invariant deformable displacement joint\" "
2119 "at line " << HP.GetLineData()
2120 <<
" not implemented yet" << std::endl);
2124 ViscoElasticDispJointInv,
2125 ViscoElasticDispJointInv(uLabel,
2128 f1, f2, R1, R2, fOut));
2129 sJointLogName =
"deformabledisplacementjoint";
2133 case DEFORMABLEAXIALJOINT:
2139 sJointLogName =
"deformableaxialjoint";
2143 ASSERTMSG(0,
"You shouldn't have reached this point");
2150 ASSERTMSG(0,
"You shouldn't have reached this point");
2154 std::ostream& out = pDM->GetLogFile();
2155 out << sJointLogName <<
": " << uLabel
2165 case DEFORMABLEJOINT:
2166 case INVARIANTDEFORMABLEJOINT:
2169 bIsPrescribedMotion =
false;
2170 bIsRightHandSide =
true;
2179 if (HP.IsKeyWord(
"position")) {
2182 Vec3 f1(HP.GetPosRel(RF1));
2185 if (HP.IsKeyWord(
"hinge") || HP.IsKeyWord(
"orientation")) {
2186 R1 = HP.GetRotRel(RF1);
2194 if (HP.IsKeyWord(
"position")) {
2197 Vec3 f2(HP.GetPosRel(RF2, RF1, f1));
2200 if (HP.IsKeyWord(
"hinge") || HP.IsKeyWord(
"orientation")) {
2201 R2 = HP.GetRotRel(RF2, RF1, R1);
2209 silent_cerr(
"line " << HP.GetLineData() <<
": "
2210 "\"deformable joint\" does not support "
2211 "dynamic constitutive laws yet"
2221 switch (CurrKeyWord) {
2222 case DEFORMABLEJOINT:
2227 f1, f2, R1, R2, od, fOut));
2230 case INVARIANTDEFORMABLEJOINT:
2235 f1, f2, R1, R2, od, fOut));
2239 ASSERTMSG(0,
"You shouldn't have reached this point");
2247 switch (CurrKeyWord) {
2248 case DEFORMABLEJOINT:
2253 f1, f2, R1, R2, od, fOut));
2256 case INVARIANTDEFORMABLEJOINT:
2257 silent_cerr(
"\"invariant deformable joint\" "
2258 "with support for viscous constitutive law "
2259 "at line " << HP.GetLineData()
2260 <<
" not implemented yet" << std::endl);
2265 ViscousJointInv(uLabel, pDO, pCL,
2267 f1, f2, R1, R2, od, fOut));
2272 ASSERTMSG(0,
"You shouldn't have reached this point");
2280 switch (CurrKeyWord) {
2281 case DEFORMABLEJOINT:
2286 f1, f2, R1, R2, od, fOut));
2289 case INVARIANTDEFORMABLEJOINT:
2290 silent_cerr(
"\"invariant deformable joint\" "
2291 "with support for viscoelastic constitutive law "
2292 "at line " << HP.GetLineData()
2293 <<
" not implemented yet" << std::endl);
2297 ViscoElasticJointInv,
2298 ViscoElasticJointInv(uLabel, pDO, pCL,
2300 f1, f2, R1, R2, od, fOut));
2305 ASSERTMSG(0,
"You shouldn't have reached this point");
2313 ASSERTMSG(0,
"You shouldn't have reached this point");
2314 silent_cerr(
"\"deformable joint\" "
2315 "at line " << HP.GetLineData()
2316 <<
" not implemented with the requested "
2317 "constitutive law type" << std::endl);
2321 std::ostream& out = pDM->GetLogFile();
2322 out <<
"deformablejoint: " << uLabel
2336 bIsPrescribedMotion =
false;
2337 bIsRightHandSide =
true;
2346 if (HP.IsKeyWord(
"position")) {
2349 Vec3 f(HP.GetPosRel(RF));
2352 if (HP.IsKeyWord(
"hinge") || HP.IsKeyWord(
"orientation")) {
2353 R = HP.GetRotRel(RF);
2361 silent_cerr(
"line " << HP.GetLineData() <<
": "
2362 "\"viscous body\" does not support "
2363 "dynamic constitutive laws yet"
2374 silent_cerr(
"\"viscous body\" "
2375 "needs viscous constitutive law "
2376 "at line " << HP.GetLineData() << std::endl);
2383 pNode, f,
R, od, fOut));
2387 ASSERTMSG(0,
"You shouldn't have reached this point");
2388 silent_cerr(
"\"viscous body\" "
2389 "at line " << HP.GetLineData()
2390 <<
" not implemented with the requested "
2391 "constitutive law type" << std::endl);
2395 std::ostream& out = pDM->GetLogFile();
2396 out <<
"viscousbody: " << uLabel
2404 case LINEARVELOCITY:
2405 case ANGULARVELOCITY:
2414 silent_cerr(
"linear/angular velocity direction is null" << std::endl);
2422 std::ostream& out = pDM->GetLogFile();
2424 switch (CurrKeyWord) {
2425 case LINEARVELOCITY:
2429 pNode, Dir, pDC, fOut));
2430 out <<
"linearvelocity: ";
2433 case ANGULARVELOCITY:
2437 pNode, Dir, pDC, fOut));
2438 out <<
"angularvelocity: ";
2442 ASSERTMSG(0,
"You shouldn't have reached this point");
2453 case LINEARACCELERATION:
2454 case ANGULARACCELERATION:
2463 silent_cerr(
"Joint(" << uLabel <<
"): "
2464 "direction is null" << std::endl);
2472 std::ostream& out = pDM->GetLogFile();
2474 switch (CurrKeyWord) {
2475 case LINEARACCELERATION:
2479 pNode, Dir, pDC, fOut));
2480 out <<
"linearacceleration: ";
2483 case ANGULARACCELERATION:
2487 pNode, Dir, pDC, fOut));
2488 out <<
"angularacceleration: ";
2492 ASSERTMSG(0,
"You shouldn't have reached this point");
2510 if (HP.IsKeyWord(
"orientation")) {
2511 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2512 R1h = HP.GetRotRel(RF1);
2513 #ifdef MBDYN_X_COMPATIBLE_INPUT
2514 }
else if (HP.IsKeyWord(
"hinge")) {
2515 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2516 "keyword \"hinge\" at line " << HP.GetLineData()
2517 <<
" is deprecated; use \"orientation\" instead"
2519 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2520 R1h = HP.GetRotRel(RF1);
2531 if (HP.IsKeyWord(
"orientation")) {
2532 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2533 R2h = HP.GetRotRel(RF2, RF1, R1h);
2534 #ifdef MBDYN_X_COMPATIBLE_INPUT
2535 }
else if (HP.IsKeyWord(
"hinge")) {
2536 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2537 "keyword \"hinge\" at line " << HP.GetLineData()
2538 <<
" is deprecated; use \"orientation\" instead"
2540 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2541 R2h = HP.GetRotRel(RF2, RF1, R1h);
2552 std::ostream& out = pDM->GetLogFile();
2553 out <<
"prismatic: " << uLabel
2570 if (HP.IsKeyWord(
"orientation")) {
2571 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2572 R1h = HP.GetRotRel(RF1);
2573 #ifdef MBDYN_X_COMPATIBLE_INPUT
2574 }
else if (HP.IsKeyWord(
"hinge")) {
2575 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2576 "keyword \"hinge\" at line " << HP.GetLineData()
2577 <<
" is deprecated; use \"orientation\" instead"
2579 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2580 R1h = HP.GetRotRel(RF1);
2592 if (HP.IsKeyWord(
"orientation")) {
2593 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2594 R2h = HP.GetRotRel(RF2, RF1, R1h);
2595 #ifdef MBDYN_X_COMPATIBLE_INPUT
2596 }
else if (HP.IsKeyWord(
"hinge")) {
2597 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2598 "keyword \"hinge\" at line " << HP.GetLineData()
2599 <<
" is deprecated; use \"orientation\" instead"
2601 DEBUGCOUT(
"Hinge orientation matrix is supplied" << std::endl);
2602 R2h = HP.GetRotRel(RF2, RF1, R1h);
2614 pNode1, pNode2, R1h, R2h, fOut));
2618 case DRIVEDISPLACEMENT:
2626 if (HP.IsKeyWord(
"position")) {
2627 #ifdef MBDYN_X_COMPATIBLE_INPUT
2630 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2631 "missing keyword \"position\" at line "
2632 << HP.GetLineData() << std::endl);
2635 f1 = HP.GetPosRel(RF1);
2636 #ifndef MBDYN_X_COMPATIBLE_INPUT
2646 if (HP.IsKeyWord(
"position")) {
2647 #ifdef MBDYN_X_COMPATIBLE_INPUT
2650 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2651 "missing keyword \"position\" at line "
2652 << HP.GetLineData() << std::endl);
2656 #ifndef MBDYN_X_COMPATIBLE_INPUT
2667 pNode1, pNode2, f1, f2, fOut));
2669 std::ostream& out = pDM->GetLogFile();
2670 out <<
"drivedisplacement: " << uLabel
2679 case DRIVEDISPLACEMENTPIN:
2686 if (HP.IsKeyWord(
"position")) {
2687 #ifdef MBDYN_X_COMPATIBLE_INPUT
2690 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2691 "missing keyword \"position\" at line "
2692 << HP.GetLineData() << std::endl);
2696 #ifndef MBDYN_X_COMPATIBLE_INPUT
2702 if (HP.IsKeyWord(
"position")) {
2703 #ifdef MBDYN_X_COMPATIBLE_INPUT
2706 pedantic_cerr(
"Joint(" << uLabel <<
"): "
2707 "missing keyword \"position\" at line "
2708 << HP.GetLineData() << std::endl);
2712 #ifndef MBDYN_X_COMPATIBLE_INPUT
2723 pNode, f, x, fOut));
2725 std::ostream& out = pDM->GetLogFile();
2726 out <<
"drivedisplacementpin: " << uLabel
2734 case IMPOSEDDISPLACEMENT:
2736 silent_cerr(
"ImposedDisplacement(" << uLabel <<
"): "
2737 "deprecated; using \"total joint\" instead" << std::endl);
2743 Vec3 f1(HP.GetPosRel(RF1));
2751 Vec3 f2(HP.GetPosRel(RF2, RF1, f1));
2755 bool bXActive[3] = {
true,
true,
true };
2756 bool bVActive[3] = {
false,
false,
false };
2760 bool bRActive[3] = {
false,
false,
false };
2761 bool bWActive[3] = {
false,
false,
false };
2770 bXActive, bVActive, pXDC,
2771 bRActive, bWActive, pTDC,
2772 pNode1, f1, R1h, R1hr,
2773 pNode2, f2, R2h, R2hr,
2776 std::ostream& out = pDM->GetLogFile();
2777 out <<
"totaljoint: " << uLabel
2786 <<
" " << bXActive[0]
2787 <<
" " << bXActive[1]
2788 <<
" " << bXActive[2]
2789 <<
" " << bVActive[0]
2790 <<
" " << bVActive[1]
2791 <<
" " << bVActive[2]
2792 <<
" " << bRActive[0]
2793 <<
" " << bRActive[1]
2794 <<
" " << bRActive[2]
2795 <<
" " << bWActive[0]
2796 <<
" " << bWActive[1]
2797 <<
" " << bWActive[2]
2801 case IMPOSEDDISPLACEMENTPIN:
2803 silent_cerr(
"ImposedDisplacementPin(" << uLabel <<
"): "
2804 "deprecated; using \"total pin joint\" instead" << std::endl);
2810 Vec3 fn(HP.GetPosRel(RF));
2818 bool bXActive[3] = {
true,
true,
true };
2819 bool bVActive[3] = {
false,
false,
false };
2823 bool bRActive[3] = {
false,
false,
false };
2824 bool bWActive[3] = {
false,
false,
false };
2833 bXActive, bVActive, pXDC,
2834 bRActive, bWActive, pTDC,
2836 pNode, fn, Rnh, Rnhr,
2839 std::ostream& out = pDM->GetLogFile();
2840 out <<
"totalpinjoint: " << uLabel
2852 case IMPOSEDORIENTATION:
2854 silent_cerr(
"ImposedOrientation(" << uLabel <<
"): "
2855 "using \"total joint\" instead" << std::endl);
2863 Mat3x3 R1hr(HP.GetRotRel(RF1));
2871 Mat3x3 R2hr(HP.GetRotRel(RF2, RF1, R1hr));
2873 bool bXActive[3] = {
false,
false,
false };
2874 bool bVActive[3] = {
false,
false,
false };
2878 bool bRActive[3] = {
true,
true,
true };
2879 bool bWActive[3] = {
false,
false,
false };
2883 pDM->GetOrientationDescription());
2891 bXActive, bVActive, pXDC,
2892 bRActive, bWActive, pTDC,
2893 pNode1, f1, R1h, R1hr,
2894 pNode2, f2, R2h, R2hr,
2897 std::ostream& out = pDM->GetLogFile();
2898 out <<
"totaljoint: " << uLabel
2903 <<
" " << pNode2->GetLabel()
2907 <<
" " << bXActive[0]
2908 <<
" " << bXActive[1]
2909 <<
" " << bXActive[2]
2910 <<
" " << bVActive[0]
2911 <<
" " << bVActive[1]
2912 <<
" " << bVActive[2]
2913 <<
" " << bRActive[0]
2914 <<
" " << bRActive[1]
2915 <<
" " << bRActive[2]
2916 <<
" " << bWActive[0]
2917 <<
" " << bWActive[1]
2918 <<
" " << bWActive[2]
2929 if (HP.IsKeyWord(
"position")) {
2930 f1 = HP.GetPosRel(RF1);
2934 if (HP.IsKeyWord(
"position" "orientation")) {
2935 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
2936 R1h = HP.GetRotRel(RF1);
2940 if (HP.IsKeyWord(
"rotation" "orientation")) {
2941 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
2942 R1hr = HP.GetRotRel(RF1);
2950 if (HP.IsKeyWord(
"position")) {
2951 f2 = HP.GetPosRel(RF2, RF1, f1);
2955 if (HP.IsKeyWord(
"position" "orientation")) {
2956 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
2957 R2h = HP.GetRotRel(RF2, RF1, R1h);
2961 if (HP.IsKeyWord(
"rotation" "orientation")) {
2962 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
2963 R2hr = HP.GetRotRel(RF2, RF1, R1hr);
2966 bool bXActive[3] = {
false,
false,
false };
2967 bool bVActive[3] = {
false,
false,
false };
2969 if (HP.IsKeyWord(
"position" "constraint")) {
2970 for (
unsigned i = 0; i < 3; i++) {
2971 if (HP.IsKeyWord(
"inactive")) {
2972 bXActive[i] =
false;
2973 bVActive[i] =
false;
2975 }
else if (HP.IsKeyWord(
"position") || HP.IsKeyWord(
"active")) {
2977 bVActive[i] =
false;
2979 }
else if (HP.IsKeyWord(
"velocity")) {
2981 bXActive[i] =
false;
2985 bool bActive = HP.GetBool();
2986 bXActive[i] = bActive;
2987 bVActive[i] = bActive;
2991 silent_cerr(
"TotalEquation(" << uLabel <<
"): "
2992 "invalid status for position component #" << i + 1
2993 <<
" at line " << HP.GetLineData() << std::endl);
3000 if (pDM->bIsInverseDynamics()) {
3009 bool bRActive[3] = {
false,
false,
false };
3010 bool bWActive[3] = {
false,
false,
false };
3012 if (HP.IsKeyWord(
"orientation" "constraint")) {
3013 for (
unsigned i = 0; i < 3; i++) {
3014 if (HP.IsKeyWord(
"inactive")) {
3015 bRActive[i] =
false;
3016 bWActive[i] =
false;
3018 }
else if (HP.IsKeyWord(
"rotation") || HP.IsKeyWord(
"active")) {
3020 bWActive[i] =
false;
3022 }
else if (HP.IsKeyWord(
"angular" "velocity")) {
3023 bRActive[i] =
false;
3028 bool bActive = HP.GetInt();
3029 bRActive[i] = bActive;
3030 bWActive[i] = bActive;
3034 silent_cerr(
"TotalEquation(" << uLabel <<
"): "
3035 "invalid status for position component #" << i + 1
3036 <<
" at line " << HP.GetLineData() << std::endl);
3043 if (pDM->bIsInverseDynamics()) {
3057 bXActive, bVActive, pXDC,
3058 bRActive, bWActive, pTDC,
3059 pNode1, f1, R1h, R1hr,
3060 pNode2, f2, R2h, R2hr,
3063 std::ostream& out = pDM->GetLogFile();
3064 out <<
"totalequation: " << uLabel
3076 case TOTALINTERNALREACTION:
3083 if (HP.IsKeyWord(
"position")) {
3084 f1 = HP.GetPosRel(RF1);
3088 if (HP.IsKeyWord(
"position" "orientation")) {
3089 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
3090 R1h = HP.GetRotRel(RF1);
3094 if (HP.IsKeyWord(
"rotation" "orientation")) {
3095 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
3096 R1hr = HP.GetRotRel(RF1);
3104 if (HP.IsKeyWord(
"position")) {
3105 f2 = HP.GetPosRel(RF2, RF1, f1);
3109 if (HP.IsKeyWord(
"position" "orientation")) {
3110 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
3111 R2h = HP.GetRotRel(RF2, RF1, R1h);
3115 if (HP.IsKeyWord(
"rotation" "orientation")) {
3116 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
3117 R2hr = HP.GetRotRel(RF2, RF1, R1hr);
3120 bool bXActive[3] = {
false,
false,
false };
3121 if (HP.IsKeyWord(
"position" "constraint")) {
3122 for (
unsigned i = 0; i < 3; i++) {
3123 if (HP.IsKeyWord(
"inactive")) {
3124 bXActive[i] =
false;
3126 }
else if (HP.IsKeyWord(
"active")) {
3131 bXActive[i] = HP.GetInt();
3135 silent_cerr(
"TotalReaction(" << uLabel <<
"): "
3136 "invalid status for position component #" << i + 1
3137 <<
" at line " << HP.GetLineData() << std::endl);
3143 bool bRActive[3] = {
false,
false,
false };
3144 if (HP.IsKeyWord(
"orientation" "constraint")) {
3145 for (
unsigned i = 0; i < 3; i++) {
3146 if (HP.IsKeyWord(
"inactive")) {
3147 bRActive[i] =
false;
3149 }
else if (HP.IsKeyWord(
"active")) {
3154 bRActive[i] = HP.GetBool();
3158 silent_cerr(
"TotalReaction(" << uLabel <<
"): "
3159 "invalid status for position component #" << i + 1
3160 <<
" at line " << HP.GetLineData() << std::endl);
3168 if (HP.IsKeyWord(
"total" "equation")) {
3169 unsigned int tot_eq_j_label = HP.GetInt();
3172 if (nested_pt != 0) {
3177 if (tot_eq_pt == 0) {
3178 silent_cerr(
"TotalEquation" "(" << tot_eq_j_label <<
") "
3179 "needed by TotalReaction(" << uLabel <<
") "
3180 "at line " << HP.GetLineData()
3181 <<
" is not defined"
3186 silent_cerr(
"Total Reaction(" << uLabel <<
") "
3187 "needs a reference to a corresponding "
3188 "TotalEquation at line " << HP.GetLineData() <<
3200 pNode1, f1, R1h, R1hr,
3201 pNode2, f2, R2h, R2hr,
3205 std::ostream& out = pDM->GetLogFile();
3206 out <<
"totalreaction: " << uLabel
3215 <<
" " << tot_eq_pt->GetLabel()
3226 if (HP.IsKeyWord(
"position")) {
3227 f1 = HP.GetPosRel(RF1);
3231 if (HP.IsKeyWord(
"position" "orientation")) {
3232 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
3233 R1h = HP.GetRotRel(RF1);
3237 if (HP.IsKeyWord(
"rotation" "orientation")) {
3238 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
3239 R1hr = HP.GetRotRel(RF1);
3247 if (HP.IsKeyWord(
"position")) {
3248 f2 = HP.GetPosRel(RF2, RF1, f1);
3252 if (HP.IsKeyWord(
"position" "orientation")) {
3253 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
3254 R2h = HP.GetRotRel(RF2, RF1, R1h);
3258 if (HP.IsKeyWord(
"rotation" "orientation")) {
3259 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
3260 R2hr = HP.GetRotRel(RF2, RF1, R1hr);
3263 bool bXActive[3] = {
false,
false,
false };
3264 bool bVActive[3] = {
false,
false,
false };
3266 if (HP.IsKeyWord(
"position" "constraint")) {
3267 for (
unsigned i = 0; i < 3; i++) {
3268 if (HP.IsKeyWord(
"inactive")) {
3269 bXActive[i] =
false;
3270 bVActive[i] =
false;
3272 }
else if (HP.IsKeyWord(
"position") || HP.IsKeyWord(
"active")) {
3274 bVActive[i] =
false;
3276 }
else if (HP.IsKeyWord(
"velocity")) {
3277 bXActive[i] =
false;
3282 bool bActive = HP.GetBool();
3283 bXActive[i] = bActive;
3284 bVActive[i] =
false;
3288 silent_cerr(
"TotalJoint(" << uLabel <<
"): "
3289 "invalid status for position component #" << i + 1
3290 <<
" at line " << HP.GetLineData() << std::endl);
3296 pDM->GetOrientationDescription());
3299 if (pDM->bIsInverseDynamics()) {
3308 bool bRActive[3] = {
false,
false,
false };
3309 bool bWActive[3] = {
false,
false,
false };
3311 if (HP.IsKeyWord(
"orientation" "constraint")) {
3312 for (
unsigned i = 0; i < 3; i++) {
3313 if (HP.IsKeyWord(
"inactive")) {
3314 bRActive[i] =
false;
3315 bWActive[i] =
false;
3317 }
else if (HP.IsKeyWord(
"rotation") || HP.IsKeyWord(
"active")) {
3319 bWActive[i] =
false;
3321 }
else if (HP.IsKeyWord(
"angular" "velocity")) {
3322 bRActive[i] =
false;
3327 bool bActive = HP.GetInt();
3328 bRActive[i] = bActive;
3329 bWActive[i] =
false;
3333 silent_cerr(
"TotalJoint(" << uLabel <<
"): "
3334 "invalid status for orientation component #" << i + 1
3335 <<
" at line " << HP.GetLineData() << std::endl);
3341 pDM->GetOrientationDescription());
3344 if (pDM->bIsInverseDynamics()) {
3358 bXActive, bVActive, pXDC,
3359 bRActive, bWActive, pTDC,
3360 pNode1, f1, R1h, R1hr,
3361 pNode2, f2, R2h, R2hr,
3364 std::ostream& out = pDM->GetLogFile();
3365 out <<
"totaljoint: " << uLabel
3374 <<
" " << bXActive[0]
3375 <<
" " << bXActive[1]
3376 <<
" " << bXActive[2]
3377 <<
" " << bVActive[0]
3378 <<
" " << bVActive[1]
3379 <<
" " << bVActive[2]
3380 <<
" " << bRActive[0]
3381 <<
" " << bRActive[1]
3382 <<
" " << bRActive[2]
3383 <<
" " << bWActive[0]
3384 <<
" " << bWActive[1]
3385 <<
" " << bWActive[2]
3396 if (HP.IsKeyWord(
"position")) {
3397 fn = HP.GetPosRel(RF);
3401 if (HP.IsKeyWord(
"position" "orientation")) {
3402 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
3403 Rnh = HP.GetRotRel(RF);
3407 if (HP.IsKeyWord(
"rotation" "orientation")) {
3408 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
3409 Rnhr = HP.GetRotRel(RF);
3414 if (HP.IsKeyWord(
"position")) {
3415 DEBUGCOUT(
"Position vector is supplied" << std::endl);
3420 if (HP.IsKeyWord(
"position" "orientation")) {
3421 DEBUGCOUT(
"Position orientation matrix is supplied" << std::endl);
3426 if (HP.IsKeyWord(
"rotation" "orientation")) {
3427 DEBUGCOUT(
"Rotation orientation matrix is supplied" << std::endl);
3431 bool bXActive[3] = {
false,
false,
false };
3432 bool bVActive[3] = {
false,
false,
false };
3434 if (HP.IsKeyWord(
"position" "constraint")) {
3435 for (
unsigned i = 0; i < 3; i++) {
3436 if (HP.IsKeyWord(
"inactive")) {
3437 bXActive[i] =
false;
3438 bVActive[i] =
false;
3440 }
else if (HP.IsKeyWord(
"position") || HP.IsKeyWord(
"active")) {
3442 bVActive[i] =
false;
3444 }
else if (HP.IsKeyWord(
"velocity")) {
3445 bXActive[i] =
false;
3450 bXActive[i] = HP.GetBool();
3451 bVActive[i] =
false;
3455 silent_cerr(
"TotalPinJoint(" << uLabel <<
"): "
3456 "invalid status for position component #" << i + 1
3457 <<
" at line " << HP.GetLineData() << std::endl);
3463 pDM->GetOrientationDescription());
3466 if (pDM->bIsInverseDynamics()) {
3475 bool bRActive[3] = {
false,
false,
false };
3476 bool bWActive[3] = {
false,
false,
false };
3478 if (HP.IsKeyWord(
"orientation" "constraint")) {
3479 for (
unsigned i = 0; i < 3; i++) {
3480 if (HP.IsKeyWord(
"inactive")) {
3481 bRActive[i] =
false;
3482 bWActive[i] =
false;
3484 }
else if (HP.IsKeyWord(
"rotation") || HP.IsKeyWord(
"active")) {
3486 bWActive[i] =
false;
3488 }
else if (HP.IsKeyWord(
"angular" "velocity")) {
3489 bRActive[i] =
false;
3494 bRActive[i] = HP.GetBool();
3495 bWActive[i] =
false;
3499 silent_cerr(
"TotalPinJoint(" << uLabel <<
"): "
3500 "invalid status for position component #" << i + 1
3501 <<
" at line " << HP.GetLineData() << std::endl);
3507 pDM->GetOrientationDescription());
3510 if (pDM->bIsInverseDynamics()) {
3524 bXActive, bVActive, pXDC,
3525 bRActive, bWActive, pTDC,
3527 pNode, fn, Rnh, Rnhr,
3530 std::ostream& out = pDM->GetLogFile();
3531 out <<
"totalpinjoint: " << uLabel
3539 <<
" " << bXActive[0]
3540 <<
" " << bXActive[1]
3541 <<
" " << bXActive[2]
3542 <<
" " << bVActive[0]
3543 <<
" " << bVActive[1]
3544 <<
" " << bVActive[2]
3545 <<
" " << bRActive[0]
3546 <<
" " << bRActive[1]
3547 <<
" " << bRActive[2]
3548 <<
" " << bWActive[0]
3549 <<
" " << bWActive[1]
3550 <<
" " << bWActive[2]
3556 silent_cerr(
"Joint(" << uLabel <<
"): "
3557 "\"kinematic\" obolete; replace with a \"total [pin] joint\" "
3558 <<
"at line " << HP.GetLineData() << std::endl);
3565 std::ostream& out = pDM->GetLogFile();
3566 out <<
"beamslider: " << uLabel;
3569 Vec3 f(HP.GetPosRel(RF));
3571 <<
"with offset " << f << std::endl);
3578 if (HP.IsKeyWord(
"hinge")) {
3579 R = HP.GetRotRel(RF);
3582 "Slider rotation matrix: " << std::endl << R << std::endl);
3588 if (HP.IsKeyWord(
"type")) {
3589 if (HP.IsKeyWord(
"spherical")) {
3591 }
else if (HP.IsKeyWord(
"classic")) {
3593 }
else if (HP.IsKeyWord(
"spline")) {
3596 silent_cerr(
"unknown slider type at line "
3597 << HP.GetLineData() << std::endl);
3602 unsigned int nB = HP.GetInt();
3604 silent_cerr(
"At least one beam is required at line "
3605 << HP.GetLineData() << std::endl);
3615 for (
unsigned int i = 0; i < nB; i++) {
3617 unsigned int uBeam = HP.GetInt();
3621 silent_cerr(
" at line " << HP.GetLineData()
3622 <<
": Beam3(" << uBeam <<
") "
3623 "not defined" << std::endl);
3627 const Beam *pBeam =
dynamic_cast<const Beam *
>(p);
3629 silent_cerr(
" at line " << HP.GetLineData()
3630 <<
": Beam(" << uBeam <<
") "
3631 "is not a Beam3" << std::endl);
3648 if (pNode1 != pLastNode) {
3649 silent_cerr(
"line " << HP.GetLineData() <<
": "
3650 "Beam(" << pBeam->
GetLabel() <<
")"
3651 ".Node1(" << pNode1->
GetLabel() <<
") "
3653 ".Node3(" << pLastNode->
GetLabel() <<
") "
3654 "do not match" << std::endl);
3658 if (HP.IsKeyWord(
"same")) {
3659 f1 = bc[i-1]->
Getf(3);
3661 f1 = HP.GetPosRel(RF);
3664 silent_cerr(
"line " << HP.GetLineData() <<
": "
3665 "Beam(" << pBeam->
GetLabel() <<
").f1 "
3667 "do not match" << std::endl);
3675 if (HP.IsKeyWord(
"hinge")) {
3676 if (HP.IsKeyWord(
"same")) {
3677 R1 = bc[i-1]->
GetR(3);
3679 R1 = HP.GetRotRel(RF);
3682 silent_cerr(
"line " << HP.GetLineData() <<
": "
3683 "Beam(" << pBeam->
GetLabel() <<
").R1 "
3685 "do not match" << std::endl);
3690 << std::endl << R1 << std::endl);
3694 f1 = HP.GetPosRel(RF);
3695 if (HP.IsKeyWord(
"hinge")) {
3696 R1 = HP.GetRotRel(RF);
3698 << std::endl << R1 << std::endl);
3712 Vec3 f2(HP.GetPosRel(RF));
3718 if (HP.IsKeyWord(
"hinge")) {
3719 R2 = HP.GetRotRel(RF);
3721 "Node 2 rotation matrix: " << std::endl
3722 << R2 << std::endl);
3735 Vec3 f3(HP.GetPosRel(RF));
3741 if (HP.IsKeyWord(
"hinge")) {
3742 R3 = HP.GetRotRel(RF);
3744 "Node 3 rotation matrix: " << std::endl
3745 << R3 << std::endl);
3754 BeamConn(pBeam, f1, f2, f3, R1, R2, R3));
3758 if (HP.IsKeyWord(
"initial" "beam")) {
3761 if (uIB < 1 || uIB > nB) {
3762 silent_cerr(
"illegal initial beam " << uIB
3763 <<
" at line " << HP.GetLineData()
3770 if (HP.IsKeyWord(
"initial" "node")) {
3773 if (uIN < 1 || uIN > 3) {
3774 silent_cerr(
"illegal initial node " << uIN
3775 <<
" at line " << HP.GetLineData() << std::endl);
3781 if (HP.IsKeyWord(
"smearing")) {
3783 if (dL < 0. || dL > .4) {
3784 silent_cerr(
"illegal smearing factor " << dL <<
"; "
3785 "using default" << std::endl);
3807 case POINT_SURFACE_CONTACT: {
3822 silent_cerr(
"PointSurfaceContact(" << uLabel <<
"): "
3823 "invalid direction at line " << HP.GetLineData()
3828 double ElasticStiffness = HP.GetReal();
3835 pNode1, pSup, SupDirection, ElasticStiffness, fOut));
3846 if (HP.IsKeyWord(
"position")) {
3847 #ifdef MBDYN_X_COMPATIBLE_INPUT
3850 pedantic_cerr(
"Joint(" << uLabel <<
"): "
3851 "missing keyword \"position\" at line "
3852 << HP.GetLineData() << std::endl);
3855 p = HP.GetPosRel(RF);
3856 #ifndef MBDYN_X_COMPATIBLE_INPUT
3860 DEBUGCOUT(
"Node 1 reference frame p:" << std::endl << p << std::endl);
3863 if (HP.IsKeyWord(
"orientation")) {
3864 #ifdef MBDYN_X_COMPATIBLE_INPUT
3867 pedantic_cerr(
"Joint(" << uLabel <<
"): "
3868 "missing keyword \"orientation\" at line "
3869 << HP.GetLineData());
3872 R = HP.GetRotRel(RF);
3873 #ifndef MBDYN_X_COMPATIBLE_INPUT
3884 if (HP.IsKeyWord(
"offset")) {
3887 DEBUGCOUT(
"Node 2 reference frame q:" << std::endl << p << std::endl);
3891 if (!HP.IsKeyWord(
"pitch")) {
3892 silent_cerr(
"Joint(" << uLabel <<
"): "
3893 "missing keyword \"pitch\" at line "
3894 << HP.GetLineData());
3903 if (HP.IsKeyWord(
"friction")) {
3910 ScrewJoint(uLabel, pDO, pNode1, pNode2,
3911 p, q, R, pitch, fOut, bsh, bf));
3913 std::ostream& out = pDM->GetLogFile();
3914 out <<
"screw: " << uLabel
3923 #endif // MBDYN_DEVEL
3928 silent_cerr(
"Joint(" << uLabel <<
"): unknown joint type "
3929 "at line " << HP.GetLineData() << std::endl);
3936 silent_cerr(
"error in allocation of element "
3937 << uLabel << std::endl);
3942 if (HP.IsKeyWord(
"inverse" "dynamics")) {
3944 if (HP.IsKeyWord(
"torque")) {
3945 bIsTorque = HP.GetYesNoOrBool(bIsTorque);
3948 bIsPrescribedMotion =
false;
3949 if (HP.IsKeyWord(
"prescribed" "motion")) {
3950 bIsPrescribedMotion = HP.GetYesNoOrBool(bIsPrescribedMotion);
3953 if (HP.IsKeyWord(
"right" "hand" "side")) {
3954 bIsRightHandSide = HP.GetYesNoOrBool(bIsRightHandSide);
3957 if (HP.IsKeyWord(
"ergonomy")) {
3958 bIsErgonomy = HP.GetYesNoOrBool(bIsErgonomy);
3963 type = pCLDO->pGetConstLaw()->GetConstLawType();
3965 type = pCLDO->pGetConstLaw()->GetConstLawType();
3967 type = pCLDO->pGetConstLaw()->GetConstLawType();
3969 silent_cerr(
"Joint(" << uLabel <<
"): is \"ergonomy\" but cannot infer constitutive law type" << std::endl);
3974 silent_cerr(
"Joint(" << uLabel <<
"): invalid constitutive law type (must be ELASTIC)" << std::endl);
3978 if (bIsRightHandSide) {
3979 silent_cerr(
"warning, Joint(" << uLabel <<
") is both \"ergonomy\" and \"right hand side\"" << std::endl);
3986 if (pDM->bIsInverseDynamics() && pEl->bInverseDynamics()) {
3991 if (bIsPrescribedMotion) {
3994 if (bIsRightHandSide) {
4002 silent_cerr(
"warning, Joint(" << uLabel <<
") is used for inverse dynamics but no flag (torque, prescribed motion, right hand side, ergonomy) is active." << std::endl);
4005 pEl->SetInverseDynamicsFlags(flags);
4008 if (HP.IsKeyWord(
"initial" "state")) {
4009 pEl->ReadInitialState(HP);
4014 silent_cerr(
"semicolon expected at line " << HP.GetLineData()
flag fReadOutput(MBDynParser &HP, const T &t) const
const Vec3 & Getf(unsigned int i) const
GradientExpression< UnaryExpr< FuncAsin, Expr > > asin(const GradientExpression< Expr > &u)
const Vec3 Zero3(0., 0., 0.)
std::ostream & Write(std::ostream &out, const char *sFill=" ") const
#define MBDYN_EXCEPT_ARGS
#define DEBUGCOUTFNAME(fname)
virtual const Mat3x3 & GetRCurr(void) const
doublereal Norm(void) const
Joint(unsigned int uL, const DofOwner *pD, flag fOut)
#define ASSERTMSG(expr, msg)
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
BasicFriction *const ParseFriction(MBDynParser &HP, DataManager *pDM)
BasicShapeCoefficient *const ParseShapeCoefficient(MBDynParser &HP)
OrientationDescription ReadOptionalOrientationDescription(DataManager *pDM, MBDynParser &HP)
Elem * ReadJoint(DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
bool IsExactlySame(const Vec3 &v) const
virtual const StructNode * pGetNode(unsigned int i) const
Vec3 MulTV(const Vec3 &v) const
bool bIsPrescribedMotion(void) const
TplDriveCaller< Vec3 > * ReadDCVecAbs(const DataManager *pDM, MBDynParser &HP, const ReferenceFrame &rf)
const ReferenceFrame AbsRefFrame(0, Vec3(0., 0., 0), Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.), Vec3(0., 0., 0), Vec3(0., 0., 0), EULER_123)
TplDriveCaller< Vec3 > * ReadDC3D(const DataManager *pDM, MBDynParser &HP)
#define SAFENEW(pnt, item)
Vec3 GetPosRel(const ReferenceFrame &rf)
bool IsExactlySame(const Mat3x3 &m) const
virtual bool IsKeyWord(const char *sKeyWord)
Mat3x3 Rot(const Vec3 &phi)
unsigned GetInverseDynamicsFlags(void) const
bool PushCurrData(const std::string &name, const TypedValue &value)
bool IsOpen(int out) const
const Beam * pGetBeam(void) const
#define ASSERT(expression)
bool PopCurrData(const std::string &name)
Mat3x3 MulTM(const Mat3x3 &m) const
VectorExpression< VectorCrossExpr< VectorLhsExpr, VectorRhsExpr >, 3 > Cross(const VectorExpression< VectorLhsExpr, 3 > &u, const VectorExpression< VectorRhsExpr, 3 > &v)
virtual void OutputPrepare_int(const std::string &type, OutputHandler &OH, std::string &name)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual const Vec3 & GetXCurr(void) const
VectorExpression< VectorExpr, N_rows >::ScalarType Norm(const VectorExpression< VectorExpr, N_rows > &u)
const Mat3x3 & GetR(unsigned int i) const
virtual unsigned int iGetNumDof(void) const
bool bIsTorque(void) const
const char * psElemNames[]
std::ostream & GetLogFile(void) const
virtual Elem::Type GetElemType(void) const
Joint * ReadModal(DataManager *pDM, MBDynParser &HP, const DofOwner *pDO, unsigned int uLabel)
#define SAFENEWARR(pnt, item, sz)
const char * invdyn2str(InverseDynamics::Order iOrder)
DriveCaller * GetDriveCaller(bool bDeferred=false)
virtual void Update(const VectorHandler &XCurr, InverseDynamics::Order iOrder=InverseDynamics::INVERSE_DYNAMICS)
virtual Elem * pGetElem(void) const
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
virtual HighParser::ErrOut GetLineData(void) const
unsigned int GetLabel(void) const
Node * ReadNode(MBDynParser &HP, Node::Type type) const
#define DEBUGLCOUT(level, msg)
TplDriveCaller< Vec3 > * ReadDCVecRel(const DataManager *pDM, MBDynParser &HP, const ReferenceFrame &rf)