41 #if defined(USE_RUNTIME_LOADING) && defined(HAVE_LTDL_H)
43 #endif // USE_RUNTIME_LOADING && HAVE_LTDL_H
216 const char *initial_file)
218 moduleInitialized(
false),
242 for (SFType::iterator i =
SF.begin(); i !=
SF.end(); ++i) {
247 for (RFType::iterator i =
RF.begin(); i !=
RF.end(); ++i) {
252 for (HFType::iterator i =
HF.begin(); i !=
HF.end(); ++i) {
257 for (ADType::iterator i =
AD.begin(); i !=
AD.end(); ++i) {
263 for (CL1DType::iterator i =
CL1D.begin(); i !=
CL1D.end(); ++i) {
268 for (CL3DType::iterator i =
CL3D.begin(); i !=
CL3D.end(); ++i) {
273 for (CL6DType::iterator i =
CL6D.begin(); i !=
CL6D.end(); ++i) {
278 for (DCType::iterator i =
DC.begin(); i !=
DC.end(); ++i) {
284 silent_cerr(
"MBDynParser::~MBDynParser: "
285 "manipulators' stack not empty" << std::endl);
288 #if defined(USE_RUNTIME_LOADING)
292 #endif // USE_RUNTIME_LOADING
302 silent_cerr(
"no drive handler is associated to data manager?"
307 for (DCType::const_iterator i =
DC.begin(); i !=
DC.end(); ++i) {
321 Mat3x3(1., 0., 0., 0., 1., 0., 0., 0., 1.),
330 silent_cerr(
"Parser error in MBDynParser::Reference_int(),"
331 " arg expected at line "
336 unsigned int uLabel(
GetInt());
364 silent_cerr(
"ReferenceFrame(" << uLabel <<
"): invalid reference specification at line " <<
GetLineData() << std::endl);
376 x = rfOut.
GetX() + Xr;
377 R = rfOut.
GetR()*Rtheta*Ralpha;
383 pedantic_cerr(
"ReferenceFrame(" << uLabel
384 <<
"): missing keyword \"position\" at line "
390 pedantic_cerr(
"ReferenceFrame(" << uLabel
391 <<
"): missing keyword \"orientation\" at line "
398 pedantic_cerr(
"ReferenceFrame(" << uLabel
399 <<
"): missing keyword \"velocity\" at line "
405 pedantic_cerr(
"ReferenceFrame(" << uLabel
406 <<
"): missing keyword \"angular velocity\" at line "
415 silent_cerr(
"semicolon expected after reference " << uLabel
416 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
422 <<
"\tX = " << x << std::endl
423 <<
"\tR = " << R << std::endl
424 <<
"\tV = " << v << std::endl
425 <<
"\tW = " << w << std::endl);
433 if (!
RF.insert(RFType::value_type(uLabel, pRF)).second) {
434 silent_cerr(
"Reference frame " << uLabel
440 if (!sName.empty()) {
451 silent_cerr(
"Parser error in MBDynParser::HydraulicFluid_int(),"
452 " arg expected at line "
457 unsigned int uLabel(
GetInt());
468 silent_cerr(
"unable to read hydraulic fluid " << uLabel
474 silent_cerr(
"semicolon expected after hydraulic fluid " << uLabel
475 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
480 if (!
HF.insert(HFType::value_type(uLabel, pHF)).second) {
481 silent_cerr(
"hydraulic fluid " << uLabel
487 if (!sName.empty()) {
498 silent_cerr(
"Parser error in MBDynParser::C81Data_int(),"
504 unsigned int uLabel(
GetInt());
514 if (filename.empty()) {
515 silent_cerr(
"C81Data(" << uLabel <<
"): "
516 "invalid file at line "
520 std::ifstream in(filename.c_str());
522 silent_cerr(
"C81Data(" << uLabel <<
"): "
523 "unable to open file '" << filename <<
"' at line "
529 <<
" from file '" << filename <<
"'" << std::endl);
538 silent_cerr(
"C81Data(" << uLabel <<
"): "
539 "invalid c81 data tolerance at line "
548 silent_cerr(
"C81Data(" << uLabel <<
"): "
549 "unable to read c81 data " << uLabel
550 <<
" from file '" << filename <<
"' "
551 "in fc511 format at line " <<
GetLineData() << std::endl);
557 silent_cerr(
"C81Data(" << uLabel <<
"): "
558 "unable to read c81 data " << uLabel
559 <<
" from file '" << filename <<
"' "
560 "in NREL format at line " <<
GetLineData() << std::endl);
566 silent_cerr(
"C81Data(" << uLabel <<
"): "
567 "unable to read c81 data " << uLabel
568 <<
" from file '" << filename <<
"' "
569 "in free format at line " <<
GetLineData() << std::endl);
578 silent_cerr(
"C81Data(" << uLabel <<
"): "
579 "unable to read c81 data " << uLabel
580 <<
" from file '" << filename <<
"' "
595 if (data->
al[0] > -180.) {
596 silent_cerr(
"C81Data(" << uLabel <<
"): "
597 "warning, CL alpha[0]=" << data->
al[0] <<
" > -180 (error=" << 100*(data->
al[0]/180. + 1.) <<
"%)" << std::endl);
599 if (data->
al[data->
NAL - 1] < 180.) {
600 silent_cerr(
"C81Data(" << uLabel <<
"): "
601 "warning, CL alpha[" << data->
NAL - 1 <<
"]=" << data->
al[data->
NAL - 1] <<
" < 180 (error=" << 100*(data->
al[data->
NAL - 1]/180. - 1.) <<
"%)" << std::endl);
603 if (data->
ml[0] > 0.) {
604 silent_cerr(
"C81Data(" << uLabel <<
"): "
605 "warning, CL mach[0]=" << data->
ml[0] <<
" > 0" << std::endl);
609 if (data->
ad[0] > -180.) {
610 silent_cerr(
"C81Data(" << uLabel <<
"): "
611 "warning, CD alpha[0]=" << data->
ad[0] <<
" > -180 (error=" << 100*(data->
ad[0]/180. + 1.) <<
"%)" << std::endl);
613 if (data->
ad[data->
NAD - 1] < 180.) {
614 silent_cerr(
"C81Data(" << uLabel <<
"): "
615 "warning, CD alpha[" << data->
NAD - 1 <<
"]=" << data->
ad[data->
NAD - 1] <<
" < 180 (error=" << 100*(data->
ad[data->
NAD - 1]/180. - 1.) <<
"%)" << std::endl);
617 if (data->
md[0] > 0.) {
618 silent_cerr(
"C81Data(" << uLabel <<
"): "
619 "warning, CD mach[0]=" << data->
md[0] <<
" > 0" << std::endl);
623 if (data->
am[0] > -180.) {
624 silent_cerr(
"C81Data(" << uLabel <<
"): "
625 "warning, CM alpha[0]=" << data->
am[0] <<
" > -180 (error=" << 100*(data->
am[0]/180. + 1.) <<
"%)" << std::endl);
627 if (data->
am[data->
NAM - 1] < 180.) {
628 silent_cerr(
"C81Data(" << uLabel <<
"): "
629 "warning, CM alpha[" << data->
NAM - 1 <<
"]=" << data->
am[data->
NAM - 1] <<
" < 180 (error=" << 100*(data->
am[data->
NAM - 1]/180. - 1.) <<
"%)" << std::endl);
631 if (data->
mm[0] > 0.) {
632 silent_cerr(
"C81Data(" << uLabel <<
"): "
633 "warning, CM mach[0]=" << data->
mm[0] <<
" > 0" << std::endl);
638 if (sOutName == NULL) {
639 silent_cerr(
"C81Data(" << uLabel <<
"): "
640 "unable to read output file name "
645 std::ofstream out(sOutName);
647 silent_cerr(
"C81Data(" << uLabel <<
"): "
648 "unable to open output file "
649 "\"" << sOutName <<
"\" "
657 }
else if (!
IsArg()) {
666 silent_cerr(
"C81Data(" << uLabel <<
"): "
667 "unknown output format "
674 silent_cerr(
"semicolon expected after c81 data " << uLabel
675 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
680 if (!
AD.insert(ADType::value_type(uLabel, data)).second) {
681 silent_cerr(
"C81Data(" << uLabel <<
"): "
687 if (!sName.empty()) {
698 silent_cerr(
"Parser error in MBDynParser::ConstitutiveLaw_int(),"
699 " arg expected at line "
705 silent_cerr(
"constitutive law parsing at line "
707 "only after control data block" << std::endl);
711 unsigned int uLabel(
GetInt());
728 silent_cerr(
"unable to read constitutive law 1D "
730 if (!sName.empty()) {
731 silent_cerr(
" (" << sName <<
")");
739 if (!sName.empty()) {
743 if (!
CL1D.insert(CL1DType::value_type(uLabel, pCL)).second) {
744 silent_cerr(
"constitutive law 1D " << uLabel);
745 if (!sName.empty()) {
746 silent_cerr(
" (" << sName <<
")");
748 silent_cerr(
" already defined at line "
760 silent_cerr(
"unable to read constitutive law 3D "
762 if (!sName.empty()) {
763 silent_cerr(
" (" << sName <<
")");
771 if (!sName.empty()) {
775 if (!
CL3D.insert(CL3DType::value_type(uLabel, pCL)).second) {
776 silent_cerr(
"constitutive law 3D " << uLabel);
777 if (!sName.empty()) {
778 silent_cerr(
" (" << sName <<
")");
780 silent_cerr(
" already defined at line "
792 silent_cerr(
"unable to read constitutive law 6D "
794 if (!sName.empty()) {
795 silent_cerr(
" (" << sName <<
")");
803 if (!sName.empty()) {
807 if (!
CL6D.insert(CL6DType::value_type(uLabel, pCL)).second) {
808 silent_cerr(
"constitutive law 6D " << uLabel);
809 if (!sName.empty()) {
810 silent_cerr(
" (" << sName <<
")");
812 silent_cerr(
" already defined at line "
820 silent_cerr(
"unknown constitutive law dimensionality "
827 silent_cerr(
"semicolon expected after constitutive law " << uLabel
828 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
893 silent_cerr(
"Parser error in MBDynParser::DriveCaller_int(), "
894 " arg expected at line "
899 unsigned int uLabel(
GetInt());
908 bool bDeferred(
false);
916 silent_cerr(
"unable to read drive caller " << uLabel
917 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
925 silent_cerr(
"semicolon expected after drive caller " << uLabel
926 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
932 if (!sName.empty()) {
936 if (!
DC.insert(DCType::value_type(uLabel, pDC)).second) {
937 silent_cerr(
"drive caller " << uLabel);
938 if (!sName.empty()) {
939 silent_cerr(
" (" << sName <<
")");
941 silent_cerr(
" already defined at line "
953 silent_cerr(
"Parser error in MBDynParser::TplDriveCaller_int(), "
954 " arg expected at line "
959 unsigned int uLabel(
GetInt());
978 if (strcasecmp(s,
"1") == 0) {
981 }
else if (strcasecmp(s,
"3") == 0) {
984 }
else if (strcasecmp(s,
"6") == 0) {
987 }
else if (strcasecmp(s,
"3x3") == 0) {
990 }
else if (strcasecmp(s,
"6x6") == 0) {
994 silent_cerr(
"unable to read template drive caller " << uLabel
995 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
996 "unsupported type \"" << s <<
"\" "
1017 silent_cerr(
"unable to read template drive caller " << uLabel
1018 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1019 "unsupported order " << dim <<
" "
1028 type =
"doublereal ";
1031 silent_cerr(
"unable to read doublereal template drive caller " << uLabel
1032 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1038 pDC->PutLabel(uLabel);
1039 if (!sName.empty()) {
1040 pDC->PutName(sName);
1044 if (!
DC1D.insert(DC1DType::value_type(uLabel, pDC)).second) {
1045 silent_cerr(
"doublereal template drive caller" << uLabel
1046 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1047 "already defined at line "
1057 silent_cerr(
"unable to read Vec3 template drive caller " << uLabel
1058 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1064 pDC->PutLabel(uLabel);
1065 if (!sName.empty()) {
1066 pDC->PutName(sName);
1070 if (!
DC3D.insert(DC3DType::value_type(uLabel, pDC)).second) {
1071 silent_cerr(
"Vec3 template drive caller" << uLabel
1072 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1073 "already defined at line "
1083 silent_cerr(
"unable to read Vec6 template drive caller " << uLabel
1084 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1090 pDC->PutLabel(uLabel);
1091 if (!sName.empty()) {
1092 pDC->PutName(sName);
1096 if (!
DC6D.insert(DC6DType::value_type(uLabel, pDC)).second) {
1097 silent_cerr(
"Vec6 template drive caller" << uLabel
1098 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1099 "already defined at line "
1109 silent_cerr(
"unable to read Mat3x3 template drive caller " << uLabel
1110 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1116 pDC->PutLabel(uLabel);
1117 if (!sName.empty()) {
1118 pDC->PutName(sName);
1122 if (!
DC3x3D.insert(DC3x3DType::value_type(uLabel, pDC)).second) {
1123 silent_cerr(
"Mat3x3 template drive caller" << uLabel
1124 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1125 "already defined at line "
1135 silent_cerr(
"unable to read Mat6x6 template drive caller " << uLabel
1136 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1142 pDC->PutLabel(uLabel);
1143 if (!sName.empty()) {
1144 pDC->PutName(sName);
1148 if (!
DC6x6D.insert(DC6x6DType::value_type(uLabel, pDC)).second) {
1149 silent_cerr(
"Mat6x6 template drive caller" << uLabel
1150 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1151 "already defined at line "
1159 silent_cerr(
"semicolon expected after " << type <<
"template drive caller " << uLabel
1160 <<
" (" << (sName.empty() ?
"unknown" : sName.c_str()) <<
") "
1172 silent_cerr(
"Parser error in MBDynParser::ScalarFunction_int(), "
1173 " arg expected at line "
1181 silent_cerr(
"semicolon expected after scalar function "
1192 #ifndef USE_RUNTIME_LOADING
1193 silent_cerr(
"ModuleLoad_int: dynamic modules not supported; libltdl support needed"
1197 #else // USE_RUNTIME_LOADING
1199 silent_cerr(
"Parser error in MBDynParser::ModuleLoad_int(), "
1200 " arg expected at line "
1208 silent_cerr(
"ModuleLoad_int: unable to get module name"
1213 std::string module_name(s);
1220 pedantic_cout(
"module \"" << module_name <<
"\" loading..." << std::endl);
1222 lt_dlhandle handle = lt_dlopenext(module_name.c_str());
1224 if (handle == NULL) {
1225 const char* err = lt_dlerror();
1230 silent_cerr(
"ModuleLoad_int: "
1231 <<
"unable to open module <" << module_name
1237 typedef int (*sym_t)(
const char *,
void *,
void *);
1238 sym_t sym = (sym_t)lt_dlsym(handle,
"module_init");
1240 const char* err = lt_dlerror();
1242 silent_cerr(
"ModuleLoad_int: module_init() "
1243 "function not available "
1244 "in module <" << module_name
1248 silent_cerr(
"ModuleLoad_int: "
1249 <<
"error while binding to symbol "
1250 "module_init() in module <" << module_name
1257 if ((*sym)(module_name.c_str(), (
void *)
pDM, (
void *)
this)) {
1258 silent_cerr(
"ModuleLoad_int: module_init() "
1259 "of module <" << module_name
1266 silent_cerr(
"semicolon expected after module "
1267 "\"" << module_name <<
"\""
1272 silent_cout(
"module \"" << module_name <<
"\" loaded" << std::endl);
1275 #endif // ! USE_RUNTIME_LOADING
1309 unsigned int uLabel((
unsigned int)
GetInt());
1310 RFType::const_iterator i =
RF.find(uLabel);
1311 if (i ==
RF.end()) {
1312 silent_cerr(
"reference " << uLabel <<
" is undefined at line "
1325 for (RFType::const_iterator i =
RF.begin(); i !=
RF.end(); ++i) {
1326 i->second->Output(out);
1353 silent_cerr(
"GetPosRel: \"other\" meaningless in this context "
1358 ASSERTMSG(0,
"You shouldn't have reached this point");
1390 silent_cerr(
"GetPosRel: \"other\" meaningless in this context "
1395 ASSERTMSG(0,
"You shouldn't have reached this point");
1423 silent_cerr(
"GetPosAbs: \"other\" meaningless in this context "
1428 ASSERTMSG(0,
"You shouldn't have reached this point");
1433 #if 0 // TODO; not really needed: use MBDynParser::GetPosAbs(::AbsRefFrame, ...) instead
1471 silent_cerr(
"GetVelRel: \"other\" meaningless in this context "
1476 ASSERTMSG(0,
"You shouldn't have reached this point");
1507 silent_cerr(
"GetVelAbs: \"other\" meaningless in this context "
1512 ASSERTMSG(0,
"You shouldn't have reached this point");
1540 silent_cerr(
"GetOmeRel: \"other\" meaningless in this context "
1545 ASSERTMSG(0,
"You shouldn't have reached this point");
1573 silent_cerr(
"GetOmeAbs: \"other\" meaningless in this context "
1578 ASSERTMSG(0,
"You shouldn't have reached this point");
1594 silent_cerr(
"'from node' at line " <<
GetLineData()
1595 <<
" not implemented yet :)" << std::endl);
1599 unsigned int uLabel =
GetInt();
1604 silent_cerr(
"missing keyword 'to node' at line "
1630 silent_cerr(
"GetVecRel: \"other\" meaningless in this context "
1635 ASSERTMSG(0,
"You shouldn't have reached this point");
1648 silent_cerr(
"'from node' at line " <<
GetLineData()
1649 <<
" not implemented yet :)" << std::endl);
1653 unsigned int uLabel =
GetInt();
1656 silent_cerr(
"missing keyword 'to node' at line "
1684 silent_cerr(
"GetVecAbs: \"other\" meaningless in this context "
1689 ASSERTMSG(0,
"You shouldn't have reached this point");
1700 if (d <= std::numeric_limits<doublereal>::epsilon()) {
1706 if (
std::fabs(d - 1.) > std::numeric_limits<doublereal>::epsilon()) {
1707 silent_cerr(
"warning: non-unit vector (norm=" << d <<
") "
1709 "normalized" << std::endl);
1721 if (d <= std::numeric_limits<doublereal>::epsilon()) {
1727 if (
std::fabs(d - 1.) > std::numeric_limits<doublereal>::epsilon()) {
1728 silent_cerr(
"warning: non-unit vector (norm=" << d <<
") "
1730 "normalized" << std::endl);
1755 silent_cerr(
"GetMatRel: \"other\" meaningless in this context "
1760 ASSERTMSG(0,
"You shouldn't have reached this point");
1784 silent_cerr(
"GetMatAbs: \"other\" meaningless in this context "
1789 ASSERTMSG(0,
"You shouldn't have reached this point");
1813 silent_cerr(
"GetRotRel: \"other\" meaningless in this context "
1818 ASSERTMSG(0,
"You shouldn't have reached this point");
1840 silent_cerr(
"GetRotRel: \"other\" meaningless in this context "
1851 ASSERTMSG(0,
"You shouldn't have reached this point");
1875 silent_cerr(
"GetRotAbs: \"other\" meaningless in this context "
1880 ASSERTMSG(0,
"You shouldn't have reached this point");
1885 #if 0 // TODO; not really needed: use MBDynParser::GetRotAbs(::AbsRefFrame, ...) instead
1897 silent_cerr(
"hydraulic fluid expected at line "
1908 unsigned int uLabel =
GetInt();
1909 HFType::const_iterator i =
HF.find(uLabel);
1910 if (i ==
HF.end()) {
1911 silent_cerr(
"hydraulic fluid " << uLabel
1917 return i->second->pCopy();
1924 ADType::const_iterator i =
AD.find(profile);
1925 if (i ==
AD.end()) {
1926 silent_cerr(
"c81 data " << profile <<
" is undefined at line "
1931 if (i ==
AD.end()) {
1932 silent_cerr(
"c81 data " << profile <<
" is undefined at line "
1944 silent_cerr(
"constitutive law parsing at line "
1946 "only after control data block" << std::endl);
1954 unsigned int uLabel =
GetInt();
1955 CL1DType::const_iterator i =
CL1D.find(uLabel);
1956 if (i ==
CL1D.end()) {
1957 silent_cerr(
"constitutive law 1D " << uLabel
1958 <<
" is undefined at line "
1963 clt = i->second->GetConstLawType();
1964 return i->second->pCopy();
1971 silent_cerr(
"constitutive law parsing at line "
1973 "only after control data block" << std::endl);
1981 unsigned int uLabel =
GetInt();
1982 CL3DType::const_iterator i =
CL3D.find(uLabel);
1983 if (i ==
CL3D.end()) {
1984 silent_cerr(
"constitutive law 3D " << uLabel
1985 <<
" is undefined at line "
1990 clt = i->second->GetConstLawType();
1991 return i->second->pCopy();
1998 silent_cerr(
"constitutive law parsing at line "
2000 "only after control data block" << std::endl);
2008 unsigned int uLabel =
GetInt();
2009 CL6DType::const_iterator i =
CL6D.find(uLabel);
2010 if (i ==
CL6D.end()) {
2011 silent_cerr(
"constitutive law 6D " << uLabel
2012 <<
" is undefined at line "
2017 clt = i->second->GetConstLawType();
2018 return i->second->pCopy();
2024 DCType::const_iterator i =
DC.find(uLabel);
2025 if (i ==
DC.end()) {
2041 silent_cerr(
"the required drive caller must appear "
2042 "inside or after the \"control data\" "
2050 unsigned int uLabel =
GetInt();
2053 silent_cerr(
"drive caller " << uLabel
2054 <<
" is undefined at line "
2059 return pDC->
pCopy();
2067 DC1DType::const_iterator i =
DC1D.find(uLabel);
2068 if (i ==
DC1D.end()) {
2074 }
else if (
typeid(T) ==
typeid(
Vec3)) {
2075 DC3DType::const_iterator i =
DC3D.find(uLabel);
2076 if (i ==
DC3D.end()) {
2082 }
else if (
typeid(T) ==
typeid(
Vec6)) {
2083 DC6DType::const_iterator i =
DC6D.find(uLabel);
2084 if (i ==
DC6D.end()) {
2090 }
else if (
typeid(T) ==
typeid(
Mat3x3)) {
2091 DC3x3DType::const_iterator i =
DC3x3D.find(uLabel);
2098 }
else if (
typeid(T) ==
typeid(
Mat6x6)) {
2099 DC6x6DType::const_iterator i =
DC6x6D.find(uLabel);
2120 }
else if (
typeid(T) ==
typeid(
Vec3)) {
2123 }
else if (
typeid(T) ==
typeid(
Vec6)) {
2126 }
else if (
typeid(T) ==
typeid(
Mat3x3)) {
2129 }
else if (
typeid(T) ==
typeid(
Mat6x6)) {
2137 silent_cerr(
"the required drive caller must appear "
2138 "inside or after the \"control data\" block"
2145 unsigned int uLabel =
GetInt();
2148 silent_cerr(
"template drive caller " << uLabel
2149 <<
" is undefined at line "
2154 return pDC->
pCopy();
2171 SFType::const_iterator i =
SF.find(s);
2172 if (i !=
SF.end()) {
2181 return SF.insert(SFType::value_type(s, sf)).second;
2199 if (
manip.empty()) {
2209 return manip.empty();
2272 Mat3x3 R(r11, r21, r31, r12, r22, r32, r13, r23, r33);
2277 silent_cerr(
"invalid (negative) tolerance while reading orientation matrix in \"matr\" format at line " <<
GetLineData() << std::endl);
2283 silent_cerr(
"warning: orientation matrix orthogonality not within tolerance at line " <<
GetLineData() << std::endl);
2298 return EulerParams2MatR(
Vec3(e1, e2, e3));
2301 <<
": Euler parameters not implemented yet"
2373 if (
fabs(v1(3)) >
fabs(v1(i_max))) {
2375 }
else if (
fabs(v1(3)) <
fabs(v1(i_min))) {
2380 v2(i_max) = -v1(i_min)/v1(i_max);
2391 }
catch (std::exception& e) {
2392 silent_cerr(
"MBDynParser::GetMatR2vec: " << e.what() <<
" at line " <<
GetLineData() << std::endl);
2417 m =
Mat3x3(m11, 0., 0., 0., m22, 0., 0., 0., m33);
2426 m =
Mat3x3(m11, m12, m13, m12, m22, m23, m13, m23, m33);
2465 m =
Mat3x3(m11, 0., 0., 0., m22, 0., 0., 0., m33);
2474 m =
Mat3x3(m11, m12, m13, m12, m22, m23, m13, m23, m33);
2480 m =
Mat3x3(0., -v3, v2, v3, 0., -v1, -v2, v1, 0.);
2497 m =
Mat3x3(m11, m21, m31, m12, m22, m32, m13, m23, m33);
2535 Vec6 v(x1, x2, x3, x4, x5, x6);
2578 m11, 0., 0., 0., 0., 0.,
2579 0., m22, 0., 0., 0., 0.,
2580 0., 0., m33, 0., 0., 0.,
2581 0., 0., 0., m44, 0., 0.,
2582 0., 0., 0., 0., m55, 0.,
2583 0., 0., 0., 0., 0., m66);
2614 m11, m12, m13, m14, m15, m16,
2615 m12, m22, m23, m24, m25, m26,
2616 m13, m23, m33, m34, m35, m36,
2617 m14, m24, m34, m44, m45, m46,
2618 m15, m25, m35, m45, m55, m56,
2619 m16, m26, m36, m46, m56, m66);
2670 m11, m21, m31, m41, m51, m61,
2671 m12, m22, m32, m42, m52, m62,
2672 m13, m23, m33, m43, m53, m63,
2673 m14, m24, m34, m44, m54, m64,
2674 m15, m25, m35, m45, m55, m65,
2675 m16, m26, m36, m46, m56, m66);
2726 m11, m21, m31, m41, m51, m61,
2727 m12, m22, m32, m42, m52, m62,
2728 m13, m23, m33, m43, m53, m63,
2729 m14, m24, m34, m44, m54, m64,
2730 m15, m25, m35, m45, m55, m65,
2731 m16, m26, m36, m46, m56, m66);
2754 int vi[] = { 1, 2, 3 };
2766 for (
int i = 0; i < 3; i++) {
2767 for (
integer j = 1; j <= iNumCols; j++) {
2772 for (
int i = 0; i < 3; i++) {
2773 for (
integer j = 1; j <= iNumCols; j++) {
2790 bool bManip =
false;
2869 MBDynParser::RefVec6Manip::Get(
const Vec6& v)
const
2883 switch (HP.GetRef(rfOut)) {
2885 Vec6 v(HP.GetVec6());
2886 return MultRV(v, rf.GetR());
2891 return HighParser::Get(t);
2895 Vec6 v(HighParser::Get(t)());
2900 Vec6 v(HighParser::Get(t)());
2908 silent_cerr(
"Get<Vec6>: \"other\" meaningless in this context "
2923 return HighParser::Get(t)();
2926 Vec6 v(HighParser::Get(t)());
2932 Vec6 v(HighParser::Get(t)());
2937 Vec6 v(HighParser::Get(t)());
2944 silent_cerr(
"Get<Vec6>: \"other\" meaningless in this context "
2968 ASSERTMSG(0,
"You shouldn't have reached this point");
2981 return HP.GetPosRel(rf);
2984 return HP.GetPosAbs(rf);
2992 return HP.GetOmeRel(rf);
2995 return HP.GetOmeAbs(rf);
2998 return HP.GetVecRel(rf);
3001 return HP.GetVecAbs(rf);
3004 return HP.GetUnitVecRel(rf);
3007 return HP.GetUnitVecAbs(rf);
3052 #if 0 // defined(__ICC)
3053 static Table dummy_t(
false);
3056 static MBDynParser dummy_hp(dummy_mp, dummy_in,
"dummy initialization");
3059 MBDynParser_dummy_init(
void)
virtual ~RefTplManip(void)
void PushManip(const Manip *)
virtual Mat6x6 GetMat6x6(void)
TplDriveCaller< doublereal > * ReadDC1D(const DataManager *pDM, MBDynParser &HP)
Mat3x3 GetRotRel(const ReferenceFrame &rf)
bool bEmptyManip(void) const
void PutName(const std::string &sN)
Mat3x3 MatR2vec(unsigned short int ia, const Vec3 &va, unsigned short int ib, const Vec3 &vb)
void module_initialize(void)
TplDriveCaller< T > * GetTplDriveCaller(void)
const DC6x6DType & GetDriveCaller6x6DContainer(void) const
const Vec3 Zero3(0., 0., 0.)
Vec3 Cross(const Vec3 &v) const
const TplDriveCaller< T > * GetTplDrive(unsigned uLabel) const
bool Read(HighParser &HP)
Vec3 MultRV(const Vec3 &v, const Mat3x3 &R)
const BasicScalarFunction * GetScalarFunction(void)
std::map< unsigned, const TplDriveCaller< Vec3 > * > DC3DType
void Put(int i, integer j, const doublereal &d)
#define MBDYN_EXCEPT_ARGS
static unsigned desc_done
void module_finalize(void)
virtual integer GetInt(integer iDefval=0)
const Vec3 & GetVec2(void) const
bool Read(HighParser &HP)
const DCType & GetDriveCallerContainer(void) const
void DestroyFileDriveContentTypes(void)
Mat3x3 GetRotAbs(const ReferenceFrame &rf)
bool ConstitutiveLaw_int(void)
const Vec3 & GetV(void) const
bool Read(HighParser &HP)
void SetDrvHdl(DriveHandler *)
doublereal Dot(const Vec3 &v) const
const Mat6x6 Zero6x6(0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0.)
const DriveCaller * GetDrive(unsigned uLabel) const
virtual void GetMat6xN(Mat3xN &m1, Mat3xN &m2, integer iNumCols)
void c81_data_destroy(c81_data *data)
bool SetDescData(const std::string &name, DescRead *rf)
const Manip * GetManip(void) const
Vec3 GetVelAbs(const ReferenceFrame &rf, const Vec3 &x)
ConstitutiveLaw< Vec3, Mat3x3 > * ReadCL3D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
void mbdyn_warranty(void)
virtual Vec6 GetVec6(void)
#define ASSERTMSG(expr, msg)
void DestroyStreamOutputContentTypes(void)
const Mat3x3 Eye3(1., 0., 0., 0., 1., 0., 0., 0., 1.)
virtual const char * GetFileName(enum Delims Del=DEFAULTDELIM)
int c81_data_write_free_format(std::ostream &out, c81_data *data)
void DestroyFileDriveCallerTypes(void)
int c81_data_flip(c81_data *data)
TplDriveCaller< Mat6x6 > * ReadDC6x6D(const DataManager *pDM, MBDynParser &HP)
const DriveHandler * pGetDrvHdl(void) const
virtual ~RefVec3Manip(void)
ConstitutiveLaw< Vec6, Mat6x6 > * ReadCL6D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
bool DriveCaller_int(void)
bool TplDriveCaller_int(void)
std::map< unsigned, const TplDriveCaller< Mat3x3 > * > DC3x3DType
bool ModuleLoad_int(void)
OrientationDescription ReadOptionalOrientationDescription(DataManager *pDM, MBDynParser &HP)
Mat3x3 EulerAngles313_2MatR(const Vec3 &v)
MBDynParser(const MBDynParser &)
GradientExpression< UnaryExpr< FuncFabs, Expr > > fabs(const GradientExpression< Expr > &u)
virtual ~VecRelManip(void)
bool Read(HighParser &HP)
Vec3 GetOmeRel(const ReferenceFrame &rf)
Vec3 MulTV(const Vec3 &v) const
bool SetScalarFunction(const std::string &s, const BasicScalarFunction *sf)
std::stack< const Manip * > manip
const c81_data * GetC81Data(unsigned profile) const
const Mat3x3 Zero3x3(0., 0., 0., 0., 0., 0., 0., 0., 0.)
int c81_data_read_free_format(std::istream &in, c81_data *data, const doublereal dcltol)
int c81_data_read(std::istream &in, c81_data *data, const doublereal dcltol, int *ff)
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)
const Mat3x3 & GetR(void) const
TplDriveCaller< Vec3 > * ReadDC3D(const DataManager *pDM, MBDynParser &HP)
Mat3x3 EulerAngles123_2MatR(const Vec3 &v)
std::map< unsigned, const DriveCaller * > DCType
const Vec3 & GetVec1(void) const
Vec3 GetVelRel(const ReferenceFrame &rf, const Vec3 &x)
Vec3 GetPosRel(const ReferenceFrame &rf)
const Vec3 & GetX(void) const
const DC3DType & GetDriveCaller3DContainer(void) const
bool HydraulicFluid_int(void)
std::map< unsigned, const TplDriveCaller< doublereal > * > DC1DType
const Vec3 & GetW(void) const
Frame GetRef(ReferenceFrame &rf)
const Vec6 Zero6(0., 0., 0., 0., 0., 0.)
VecAbsManip(MBDynParser &HP, const ReferenceFrame &rf)
void DestroyDriveCallerData(void)
bool Read(HighParser &HP)
virtual Mat3x3 GetMatR2vec(void)
Vec3 GetOmeAbs(const ReferenceFrame &rf)
std::map< unsigned, C81Data * > ADType
Mat3x3 GetMatRel(const ReferenceFrame &rf)
virtual Mat3x3 GetMat3x3(void)
void Reset(const doublereal &d=0.)
const DC3x3DType & GetDriveCaller3x3DContainer(void) const
RefVec3Manip(MBDynParser &HP, const ReferenceFrame &rf, VecMatOpType type)
Vec3 GetPosAbs(const ReferenceFrame &rf)
virtual const char * GetStringWithDelims(enum Delims Del=DEFAULTDELIM, bool escape=true)
bool ScalarFunction_int(void)
const HFType & GetHydraulicFluidContainer(void) const
Mat3x3 GetMatAbs(const ReferenceFrame &rf)
TplDriveCaller< Vec6 > * ReadDC6D(const DataManager *pDM, MBDynParser &HP)
Mat3x3 Rot(const Vec3 &phi)
bool Read(HighParser &HP)
DataManager * GetDataManager(void) const
integer iGetNumCols(void) const
const RFType & GetReferenceFrameContainer(void) const
std::map< unsigned, const TplDriveCaller< Vec6 > * > DC6DType
virtual TplDriveCaller< T > * pCopy(void) const =0
bool Read(HighParser &HP)
std::map< unsigned, const ReferenceFrame * > RFType
#define ASSERT(expression)
Mat3x3 EulerAngles321_2MatR(const Vec3 &v)
ConstitutiveLaw6D * GetConstLaw6D(ConstLawType::Type &clt)
GradientExpression< UnaryExpr< FuncSqrt, Expr > > sqrt(const GradientExpression< Expr > &u)
Mat3x3 MulTM(const Mat3x3 &m) const
bool Read(HighParser &HP)
virtual ~VecAbsManip(void)
Vec3 GetUnitVecAbs(const ReferenceFrame &rf)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
virtual const Vec3 & GetXCurr(void) const
virtual DriveCaller * pCopy(void) const =0
Vec3 GetVecRel(const ReferenceFrame &rf)
Vec3 GetVecAbs(const ReferenceFrame &rf)
std::map< unsigned, const HydraulicFluid * > HFType
Mat3x3 Transpose(void) const
int c81_data_fc511_read(std::istream &in, c81_data *data, const doublereal dcltol)
virtual Vec3 Get(const Vec3 &v) const
const Mat6x6 Eye6(1., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 1., 0., 0., 0., 0., 0., 0., 1.)
DriveCaller * ReadDriveCallerData(const DataManager *pDM, MBDynParser &HP, bool bDeferred)
virtual int IsKeyWord(void)
TplDriveCaller< Mat3x3 > * ReadDC3x3D(const DataManager *pDM, MBDynParser &HP)
const ADType & GetC81DataContainer(void) const
virtual Mat3x3 GetMat3x3Sym(void)
virtual bool IsStringWithDelims(enum Delims Del=DEFAULTDELIM)
virtual T Get(const T &t) const =0
int c81_data_nrel_read(std::istream &in, c81_data *data, const doublereal dcltol)
std::map< unsigned, const TplDriveCaller< Mat6x6 > * > DC6x6DType
ConstitutiveLaw< doublereal, doublereal > * ReadCL1D(const DataManager *pDM, MBDynParser &HP, ConstLawType::Type &CLType)
bool Read(HighParser &HP)
void InitDriveCallerData(void)
bool Read(HighParser &HP)
void SetDataManager(DataManager *pdm)
HydraulicFluid * GetHydraulicFluid(void)
DriveCaller * GetDriveCaller(bool bDeferred=false)
static const doublereal a
void InitStreamOutputContentTypes(void)
static void ReadOutput(DriveCaller *pDC, const DataManager *pDM, MBDynParser &HP)
Vec3 GetUnitVecRel(const ReferenceFrame &rf)
void PutLabel(unsigned int uL)
const DC6DType & GetDriveCaller6DContainer(void) const
static void InitDescData(void)
virtual doublereal Get(const doublereal &d)
ConstitutiveLaw3D * GetConstLaw3D(ConstLawType::Type &clt)
virtual HighParser::ErrOut GetLineData(void) const
const BasicScalarFunction *const ParseScalarFunction(MBDynParser &HP, DataManager *const pDM)
int c81_data_write(std::ostream &out, c81_data *data)
#define DEBUGLCOUT(level, msg)
RefTplManip(MBDynParser &HP, const ReferenceFrame &rf, VecMatOpType type)
ConstitutiveLaw1D * GetConstLaw1D(ConstLawType::Type &clt)
virtual Vec3 GetVec3(void)
HydraulicFluid * ReadHydraulicFluid(MBDynParser &HP, unsigned int uLabel)
void OutputFrames(std::ostream &out) const
VecRelManip(MBDynParser &HP, const ReferenceFrame &rf)
bool IsSame(const Mat3x3 &m, const doublereal &dTol) const
const DC1DType & GetDriveCaller1DContainer(void) const
virtual doublereal GetReal(const doublereal &dDefval=0.0)