MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
ModelNameSpace Class Reference

#include <modelns.h>

Inheritance diagram for ModelNameSpace:
Collaboration diagram for ModelNameSpace:

Public Types

typedef
MathParser::MathArgPriv_t
< const DataManager * > 
MathArgDM
 
typedef
MathParser::MathArgPriv_t
< const ModelNameSpace * > 
MathArgMNS
 
typedef
MathParser::MathArgPriv_t
< const BasicScalarFunction * > 
MathArgSF
 
typedef
MathParser::MathArgPriv_t
< Node::Type
MathArgNode
 
typedef
MathParser::MathArgPriv_t
< Elem::Type
MathArgElem
 
typedef
MathParser::MathArgPriv_t
< const SimulationEntity * > 
MathArgSEPtr
 
typedef
MathParser::MathArgPriv_t
< unsigned int
MathArgSEIdx
 
typedef
MathParser::MathArgPriv_t
< const DriveCaller * > 
MathArgDCPtr
 

Public Member Functions

 ModelNameSpace (const DataManager *pDM)
 
 ~ModelNameSpace (void)
 
bool IsFunc (const std::string &fname) const
 
MathParser::MathFunc_tGetFunc (const std::string &fname) const
 
TypedValue EvalFunc (MathParser::MathFunc_t *f) const
 
virtual TableGetTable (void)
 
bool PushCurrData (const std::string &name, const TypedValue &value)
 
bool PopCurrData (const std::string &name)
 
bool GetCurrData (const std::string &name, TypedValue &value) const
 
- Public Member Functions inherited from MathParser::NameSpace
 NameSpace (const std::string &name)
 
virtual ~NameSpace (void)
 
virtual const std::string & sGetName (void) const
 

Protected Types

typedef std::map< std::string,
MathParser::MathFunc_t * > 
funcType
 
typedef std::map< std::string,
TypedValue
currDataType
 

Protected Member Functions

bool FindFunc (const std::string &fname, MathParser::MathFunc_t **fpp=0) const
 

Protected Attributes

const DataManagerpDM
 
funcType func
 
MathParser::MathFunc_t sf_func
 
MathParser::MathFunc_t node_func
 
MathParser::MathFunc_t elem_func
 
MathParser::MathFunc_t unique_elem_func
 
currDataType currData
 

Detailed Description

Definition at line 38 of file modelns.h.

Member Typedef Documentation

typedef std::map<std::string, TypedValue> ModelNameSpace::currDataType
protected

Definition at line 61 of file modelns.h.

typedef std::map<std::string, MathParser::MathFunc_t *> ModelNameSpace::funcType
protected

Definition at line 53 of file modelns.h.

Definition at line 50 of file modelns.h.

Definition at line 43 of file modelns.h.

Definition at line 44 of file modelns.h.

Definition at line 49 of file modelns.h.

Constructor & Destructor Documentation

ModelNameSpace::ModelNameSpace ( const DataManager pDM)

Definition at line 1090 of file modelns.cc.

References MathParser::AF_OPTIONAL, MathParser::MathFunc_t::args, elem_func, MathParser::MathFunc_t::f, MathParser::MathFunc_t::fname, func, MBDYN_EXCEPT_ARGS, model_curr(), model_node(), model_sf(), node_func, MathParser::MathFunc_t::ns, sf_func, MathParser::MathFunc_t::t, unique_elem_func, Node::UNKNOWN, and Elem::UNKNOWN.

1091 : MathParser::NameSpace("model"), pDM(pDM)
1092 {
1094 
1095  // position
1096  f = new MathParser::MathFunc_t;
1097  f->fname = "position";
1098  f->ns = this;
1099  f->args.resize(1 + 1 + 1);
1100  f->args[0] = new MathParser::MathArgReal_t;
1101  f->args[1] = new MathParser::MathArgInt_t;
1102  f->args[2] = new MathArgDM(pDM);
1103  f->f = position<NORM, CURR>;
1104  f->t = 0;
1105 
1106  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1107  silent_cerr("model namespace: "
1108  "unable to insert handler "
1109  "for function " << f->fname << std::endl);
1111  }
1112 
1113  // position2
1114  f = new MathParser::MathFunc_t;
1115  f->fname = "position2";
1116  f->ns = this;
1117  f->args.resize(1 + 1 + 1);
1118  f->args[0] = new MathParser::MathArgReal_t;
1119  f->args[1] = new MathParser::MathArgInt_t;
1120  f->args[2] = new MathArgDM(pDM);
1121  f->f = position<SQUARE, CURR>;
1122  f->t = 0;
1123 
1124  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1125  silent_cerr("model namespace: "
1126  "unable to insert handler "
1127  "for function " << f->fname << std::endl);
1129  }
1130 
1131  // xposition
1132  f = new MathParser::MathFunc_t;
1133  f->fname = "xposition";
1134  f->ns = this;
1135  f->args.resize(1 + 1 + 1);
1136  f->args[0] = new MathParser::MathArgReal_t;
1137  f->args[1] = new MathParser::MathArgInt_t;
1138  f->args[2] = new MathArgDM(pDM);
1139  f->f = position<IDX1, CURR>;
1140  f->t = 0;
1141 
1142  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1143  silent_cerr("model namespace: "
1144  "unable to insert handler "
1145  "for function " << f->fname << std::endl);
1147  }
1148 
1149  // yposition
1150  f = new MathParser::MathFunc_t;
1151  f->fname = "yposition";
1152  f->ns = this;
1153  f->args.resize(1 + 1 + 1);
1154  f->args[0] = new MathParser::MathArgReal_t;
1155  f->args[1] = new MathParser::MathArgInt_t;
1156  f->args[2] = new MathArgDM(pDM);
1157  f->f = position<IDX2, CURR>;
1158  f->t = 0;
1159 
1160  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1161  silent_cerr("model namespace: "
1162  "unable to insert handler "
1163  "for function " << f->fname << std::endl);
1165  }
1166 
1167  // zposition
1168  f = new MathParser::MathFunc_t;
1169  f->fname = "zposition";
1170  f->ns = this;
1171  f->args.resize(1 + 1 + 1);
1172  f->args[0] = new MathParser::MathArgReal_t;
1173  f->args[1] = new MathParser::MathArgInt_t;
1174  f->args[2] = new MathArgDM(pDM);
1175  f->f = position<IDX3, CURR>;
1176  f->t = 0;
1177 
1178  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1179  silent_cerr("model namespace: "
1180  "unable to insert handler "
1181  "for function " << f->fname << std::endl);
1183  }
1184 
1185  // distance
1186  f = new MathParser::MathFunc_t;
1187  f->fname = "distance";
1188  f->ns = this;
1189  f->args.resize(1 + 2 + 1);
1190  f->args[0] = new MathParser::MathArgReal_t;
1191  f->args[1] = new MathParser::MathArgInt_t;
1192  f->args[2] = new MathParser::MathArgInt_t;
1193  f->args[3] = new MathArgDM(pDM);
1194  f->f = distance<NORM, CURR>;
1195  f->t = 0;
1196 
1197  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1198  silent_cerr("model namespace: "
1199  "unable to insert handler "
1200  "for function " << f->fname << std::endl);
1202  }
1203 
1204  // distance2
1205  f = new MathParser::MathFunc_t;
1206  f->fname = "distance2";
1207  f->ns = this;
1208  f->args.resize(1 + 2 + 1);
1209  f->args[0] = new MathParser::MathArgReal_t;
1210  f->args[1] = new MathParser::MathArgInt_t;
1211  f->args[2] = new MathParser::MathArgInt_t;
1212  f->args[3] = new MathArgDM(pDM);
1213  f->f = distance<SQUARE, CURR>;
1214  f->t = 0;
1215 
1216  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1217  silent_cerr("model namespace: "
1218  "unable to insert handler "
1219  "for function " << f->fname << std::endl);
1221  }
1222 
1223  // xdistance
1224  f = new MathParser::MathFunc_t;
1225  f->fname = "xdistance";
1226  f->ns = this;
1227  f->args.resize(1 + 2 + 1);
1228  f->args[0] = new MathParser::MathArgReal_t;
1229  f->args[1] = new MathParser::MathArgInt_t;
1230  f->args[2] = new MathParser::MathArgInt_t;
1231  f->args[3] = new MathArgDM(pDM);
1232  f->f = distance<IDX1, CURR>;
1233  f->t = 0;
1234 
1235  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1236  silent_cerr("model namespace: "
1237  "unable to insert handler "
1238  "for function " << f->fname << std::endl);
1240  }
1241 
1242  // ydistance
1243  f = new MathParser::MathFunc_t;
1244  f->fname = "ydistance";
1245  f->ns = this;
1246  f->args.resize(1 + 2 + 1);
1247  f->args[0] = new MathParser::MathArgReal_t;
1248  f->args[1] = new MathParser::MathArgInt_t;
1249  f->args[2] = new MathParser::MathArgInt_t;
1250  f->args[3] = new MathArgDM(pDM);
1251  f->f = distance<IDX2, CURR>;
1252  f->t = 0;
1253 
1254  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1255  silent_cerr("model namespace: "
1256  "unable to insert handler "
1257  "for function " << f->fname << std::endl);
1259  }
1260 
1261  // zdistance
1262  f = new MathParser::MathFunc_t;
1263  f->fname = "zdistance";
1264  f->ns = this;
1265  f->args.resize(1 + 2 + 1);
1266  f->args[0] = new MathParser::MathArgReal_t;
1267  f->args[1] = new MathParser::MathArgInt_t;
1268  f->args[2] = new MathParser::MathArgInt_t;
1269  f->args[3] = new MathArgDM(pDM);
1270  f->f = distance<IDX3, CURR>;
1271  f->t = 0;
1272 
1273  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1274  silent_cerr("model namespace: "
1275  "unable to insert handler "
1276  "for function " << f->fname << std::endl);
1278  }
1279 
1280  // xunitvec
1281  f = new MathParser::MathFunc_t;
1282  f->fname = "xunitvec";
1283  f->ns = this;
1284  f->args.resize(1 + 2 + 1);
1285  f->args[0] = new MathParser::MathArgReal_t;
1286  f->args[1] = new MathParser::MathArgInt_t;
1287  f->args[2] = new MathParser::MathArgInt_t;
1288  f->args[3] = new MathArgDM(pDM);
1289  f->f = unitvec<IDX1, CURR>;
1290  f->t = 0;
1291 
1292  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1293  silent_cerr("model namespace: "
1294  "unable to insert handler "
1295  "for function " << f->fname << std::endl);
1297  }
1298 
1299  // yunitvec
1300  f = new MathParser::MathFunc_t;
1301  f->fname = "yunitvec";
1302  f->ns = this;
1303  f->args.resize(1 + 2 + 1);
1304  f->args[0] = new MathParser::MathArgReal_t;
1305  f->args[1] = new MathParser::MathArgInt_t;
1306  f->args[2] = new MathParser::MathArgInt_t;
1307  f->args[3] = new MathArgDM(pDM);
1308  f->f = unitvec<IDX2, CURR>;
1309  f->t = 0;
1310 
1311  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1312  silent_cerr("model namespace: "
1313  "unable to insert handler "
1314  "for function " << f->fname << std::endl);
1316  }
1317 
1318  // zunitvec
1319  f = new MathParser::MathFunc_t;
1320  f->fname = "zunitvec";
1321  f->ns = this;
1322  f->args.resize(1 + 2 + 1);
1323  f->args[0] = new MathParser::MathArgReal_t;
1324  f->args[1] = new MathParser::MathArgInt_t;
1325  f->args[2] = new MathParser::MathArgInt_t;
1326  f->args[3] = new MathArgDM(pDM);
1327  f->f = unitvec<IDX3, CURR>;
1328  f->t = 0;
1329 
1330  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1331  silent_cerr("model namespace: "
1332  "unable to insert handler "
1333  "for function " << f->fname << std::endl);
1335  }
1336 
1337  // angle
1338  f = new MathParser::MathFunc_t;
1339  f->fname = "angle";
1340  f->ns = this;
1341  f->args.resize(1 + 1 + 1);
1342  f->args[0] = new MathParser::MathArgReal_t;
1343  f->args[1] = new MathParser::MathArgInt_t;
1344  f->args[2] = new MathArgDM(pDM);
1345  f->f = angle<NORM, CURR>;
1346  f->t = 0;
1347 
1348  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1349  silent_cerr("model namespace: "
1350  "unable to insert handler "
1351  "for function " << f->fname << std::endl);
1353  }
1354 
1355  // xangle
1356  f = new MathParser::MathFunc_t;
1357  f->fname = "xangle";
1358  f->ns = this;
1359  f->args.resize(1 + 1 + 1);
1360  f->args[0] = new MathParser::MathArgReal_t;
1361  f->args[1] = new MathParser::MathArgInt_t;
1362  f->args[2] = new MathArgDM(pDM);
1363  f->f = angle<IDX1, CURR>;
1364  f->t = 0;
1365 
1366  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1367  silent_cerr("model namespace: "
1368  "unable to insert handler "
1369  "for function " << f->fname << std::endl);
1371  }
1372 
1373  // yangle
1374  f = new MathParser::MathFunc_t;
1375  f->fname = "yangle";
1376  f->ns = this;
1377  f->args.resize(1 + 1 + 1);
1378  f->args[0] = new MathParser::MathArgReal_t;
1379  f->args[1] = new MathParser::MathArgInt_t;
1380  f->args[2] = new MathArgDM(pDM);
1381  f->f = angle<IDX2, CURR>;
1382  f->t = 0;
1383 
1384  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1385  silent_cerr("model namespace: "
1386  "unable to insert handler "
1387  "for function " << f->fname << std::endl);
1389  }
1390 
1391  // zangle
1392  f = new MathParser::MathFunc_t;
1393  f->fname = "zangle";
1394  f->ns = this;
1395  f->args.resize(1 + 1 + 1);
1396  f->args[0] = new MathParser::MathArgReal_t;
1397  f->args[1] = new MathParser::MathArgInt_t;
1398  f->args[2] = new MathArgDM(pDM);
1399  f->f = angle<IDX3, CURR>;
1400  f->t = 0;
1401 
1402  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1403  silent_cerr("model namespace: "
1404  "unable to insert handler "
1405  "for function " << f->fname << std::endl);
1407  }
1408 
1409  // anglerel
1410  f = new MathParser::MathFunc_t;
1411  f->fname = "anglerel";
1412  f->ns = this;
1413  f->args.resize(1 + 2 + 1);
1414  f->args[0] = new MathParser::MathArgReal_t;
1415  f->args[1] = new MathParser::MathArgInt_t;
1416  f->args[2] = new MathParser::MathArgInt_t;
1417  f->args[3] = new MathArgDM(pDM);
1418  f->f = anglerel<NORM, CURR>;
1419  f->t = 0;
1420 
1421  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1422  silent_cerr("model namespace: "
1423  "unable to insert handler "
1424  "for function " << f->fname << std::endl);
1426  }
1427 
1428  // xanglerel
1429  f = new MathParser::MathFunc_t;
1430  f->fname = "xanglerel";
1431  f->ns = this;
1432  f->args.resize(1 + 2 + 1);
1433  f->args[0] = new MathParser::MathArgReal_t;
1434  f->args[1] = new MathParser::MathArgInt_t;
1435  f->args[2] = new MathParser::MathArgInt_t;
1436  f->args[3] = new MathArgDM(pDM);
1437  f->f = anglerel<IDX1, CURR>;
1438  f->t = 0;
1439 
1440  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1441  silent_cerr("model namespace: "
1442  "unable to insert handler "
1443  "for function " << f->fname << std::endl);
1445  }
1446 
1447  // yanglerel
1448  f = new MathParser::MathFunc_t;
1449  f->fname = "yanglerel";
1450  f->ns = this;
1451  f->args.resize(1 + 2 + 1);
1452  f->args[0] = new MathParser::MathArgReal_t;
1453  f->args[1] = new MathParser::MathArgInt_t;
1454  f->args[2] = new MathParser::MathArgInt_t;
1455  f->args[3] = new MathArgDM(pDM);
1456  f->f = anglerel<IDX2, CURR>;
1457  f->t = 0;
1458 
1459  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1460  silent_cerr("model namespace: "
1461  "unable to insert handler "
1462  "for function " << f->fname << std::endl);
1464  }
1465 
1466  // zanglerel
1467  f = new MathParser::MathFunc_t;
1468  f->fname = "zanglerel";
1469  f->ns = this;
1470  f->args.resize(1 + 2 + 1);
1471  f->args[0] = new MathParser::MathArgReal_t;
1472  f->args[1] = new MathParser::MathArgInt_t;
1473  f->args[2] = new MathParser::MathArgInt_t;
1474  f->args[3] = new MathArgDM(pDM);
1475  f->f = anglerel<IDX3, CURR>;
1476  f->t = 0;
1477 
1478  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1479  silent_cerr("model namespace: "
1480  "unable to insert handler "
1481  "for function " << f->fname << std::endl);
1483  }
1484 
1485  // velocity
1486  f = new MathParser::MathFunc_t;
1487  f->fname = "velocity";
1488  f->ns = this;
1489  f->args.resize(1 + 1 + 1);
1490  f->args[0] = new MathParser::MathArgReal_t;
1491  f->args[1] = new MathParser::MathArgInt_t;
1492  f->args[2] = new MathArgDM(pDM);
1493  f->f = velocity<NORM, CURR>;
1494  f->t = 0;
1495 
1496  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1497  silent_cerr("model namespace: "
1498  "unable to insert handler "
1499  "for function " << f->fname << std::endl);
1501  }
1502 
1503  // velocity2
1504  f = new MathParser::MathFunc_t;
1505  f->fname = "velocity2";
1506  f->ns = this;
1507  f->args.resize(1 + 1 + 1);
1508  f->args[0] = new MathParser::MathArgReal_t;
1509  f->args[1] = new MathParser::MathArgInt_t;
1510  f->args[2] = new MathArgDM(pDM);
1511  f->f = velocity<SQUARE, CURR>;
1512  f->t = 0;
1513 
1514  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1515  silent_cerr("model namespace: "
1516  "unable to insert handler "
1517  "for function " << f->fname << std::endl);
1519  }
1520 
1521  // xvelocity
1522  f = new MathParser::MathFunc_t;
1523  f->fname = "xvelocity";
1524  f->ns = this;
1525  f->args.resize(1 + 1 + 1);
1526  f->args[0] = new MathParser::MathArgReal_t;
1527  f->args[1] = new MathParser::MathArgInt_t;
1528  f->args[2] = new MathArgDM(pDM);
1529  f->f = velocity<IDX1, CURR>;
1530  f->t = 0;
1531 
1532  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1533  silent_cerr("model namespace: "
1534  "unable to insert handler "
1535  "for function " << f->fname << std::endl);
1537  }
1538 
1539  // yvelocity
1540  f = new MathParser::MathFunc_t;
1541  f->fname = "yvelocity";
1542  f->ns = this;
1543  f->args.resize(1 + 1 + 1);
1544  f->args[0] = new MathParser::MathArgReal_t;
1545  f->args[1] = new MathParser::MathArgInt_t;
1546  f->args[2] = new MathArgDM(pDM);
1547  f->f = velocity<IDX2, CURR>;
1548  f->t = 0;
1549 
1550  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1551  silent_cerr("model namespace: "
1552  "unable to insert handler "
1553  "for function " << f->fname << std::endl);
1555  }
1556 
1557  // zvelocity
1558  f = new MathParser::MathFunc_t;
1559  f->fname = "zvelocity";
1560  f->ns = this;
1561  f->args.resize(1 + 1 + 1);
1562  f->args[0] = new MathParser::MathArgReal_t;
1563  f->args[1] = new MathParser::MathArgInt_t;
1564  f->args[2] = new MathArgDM(pDM);
1565  f->f = velocity<IDX3, CURR>;
1566  f->t = 0;
1567 
1568  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1569  silent_cerr("model namespace: "
1570  "unable to insert handler "
1571  "for function " << f->fname << std::endl);
1573  }
1574 
1575  // vrel
1576  f = new MathParser::MathFunc_t;
1577  f->fname = "vrel";
1578  f->ns = this;
1579  f->args.resize(1 + 2 + 1);
1580  f->args[0] = new MathParser::MathArgReal_t;
1581  f->args[1] = new MathParser::MathArgInt_t;
1582  f->args[2] = new MathParser::MathArgInt_t;
1583  f->args[3] = new MathArgDM(pDM);
1584  f->f = vrel<NORM, CURR>;
1585  f->t = 0;
1586 
1587  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1588  silent_cerr("model namespace: "
1589  "unable to insert handler "
1590  "for function " << f->fname << std::endl);
1592  }
1593 
1594  // vrel2
1595  f = new MathParser::MathFunc_t;
1596  f->fname = "vrel2";
1597  f->ns = this;
1598  f->args.resize(1 + 2 + 1);
1599  f->args[0] = new MathParser::MathArgReal_t;
1600  f->args[1] = new MathParser::MathArgInt_t;
1601  f->args[2] = new MathParser::MathArgInt_t;
1602  f->args[3] = new MathArgDM(pDM);
1603  f->f = vrel<SQUARE, CURR>;
1604  f->t = 0;
1605 
1606  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1607  silent_cerr("model namespace: "
1608  "unable to insert handler "
1609  "for function " << f->fname << std::endl);
1611  }
1612 
1613  // xvrel
1614  f = new MathParser::MathFunc_t;
1615  f->fname = "xvrel";
1616  f->ns = this;
1617  f->args.resize(1 + 2 + 1);
1618  f->args[0] = new MathParser::MathArgReal_t;
1619  f->args[1] = new MathParser::MathArgInt_t;
1620  f->args[2] = new MathParser::MathArgInt_t;
1621  f->args[3] = new MathArgDM(pDM);
1622  f->f = vrel<IDX1, CURR>;
1623  f->t = 0;
1624 
1625  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1626  silent_cerr("model namespace: "
1627  "unable to insert handler "
1628  "for function " << f->fname << std::endl);
1630  }
1631 
1632  // yvrel
1633  f = new MathParser::MathFunc_t;
1634  f->fname = "yvrel";
1635  f->ns = this;
1636  f->args.resize(1 + 2 + 1);
1637  f->args[0] = new MathParser::MathArgReal_t;
1638  f->args[1] = new MathParser::MathArgInt_t;
1639  f->args[2] = new MathParser::MathArgInt_t;
1640  f->args[3] = new MathArgDM(pDM);
1641  f->f = vrel<IDX2, CURR>;
1642  f->t = 0;
1643 
1644  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1645  silent_cerr("model namespace: "
1646  "unable to insert handler "
1647  "for function " << f->fname << std::endl);
1649  }
1650 
1651  // zvrel
1652  f = new MathParser::MathFunc_t;
1653  f->fname = "zvrel";
1654  f->ns = this;
1655  f->args.resize(1 + 2 + 1);
1656  f->args[0] = new MathParser::MathArgReal_t;
1657  f->args[1] = new MathParser::MathArgInt_t;
1658  f->args[2] = new MathParser::MathArgInt_t;
1659  f->args[3] = new MathArgDM(pDM);
1660  f->f = vrel<IDX3, CURR>;
1661  f->t = 0;
1662 
1663  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1664  silent_cerr("model namespace: "
1665  "unable to insert handler "
1666  "for function " << f->fname << std::endl);
1668  }
1669 
1670  // angvel
1671  f = new MathParser::MathFunc_t;
1672  f->fname = "angvel";
1673  f->ns = this;
1674  f->args.resize(1 + 1 + 1);
1675  f->args[0] = new MathParser::MathArgReal_t;
1676  f->args[1] = new MathParser::MathArgInt_t;
1677  f->args[2] = new MathArgDM(pDM);
1678  f->f = angvel<NORM, CURR>;
1679  f->t = 0;
1680 
1681  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1682  silent_cerr("model namespace: "
1683  "unable to insert handler "
1684  "for function " << f->fname << std::endl);
1686  }
1687 
1688  // angvel
1689  f = new MathParser::MathFunc_t;
1690  f->fname = "angvel2";
1691  f->ns = this;
1692  f->args.resize(1 + 1 + 1);
1693  f->args[0] = new MathParser::MathArgReal_t;
1694  f->args[1] = new MathParser::MathArgInt_t;
1695  f->args[2] = new MathArgDM(pDM);
1696  f->f = angvel<SQUARE, CURR>;
1697  f->t = 0;
1698 
1699  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1700  silent_cerr("model namespace: "
1701  "unable to insert handler "
1702  "for function " << f->fname << std::endl);
1704  }
1705 
1706  // xangvel
1707  f = new MathParser::MathFunc_t;
1708  f->fname = "xangvel";
1709  f->ns = this;
1710  f->args.resize(1 + 1 + 1);
1711  f->args[0] = new MathParser::MathArgReal_t;
1712  f->args[1] = new MathParser::MathArgInt_t;
1713  f->args[2] = new MathArgDM(pDM);
1714  f->f = angvel<IDX1, CURR>;
1715  f->t = 0;
1716 
1717  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1718  silent_cerr("model namespace: "
1719  "unable to insert handler "
1720  "for function " << f->fname << std::endl);
1722  }
1723 
1724  // yangvel
1725  f = new MathParser::MathFunc_t;
1726  f->fname = "yangvel";
1727  f->ns = this;
1728  f->args.resize(1 + 1 + 1);
1729  f->args[0] = new MathParser::MathArgReal_t;
1730  f->args[1] = new MathParser::MathArgInt_t;
1731  f->args[2] = new MathArgDM(pDM);
1732  f->f = angvel<IDX2, CURR>;
1733  f->t = 0;
1734 
1735  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1736  silent_cerr("model namespace: "
1737  "unable to insert handler "
1738  "for function " << f->fname << std::endl);
1740  }
1741 
1742  // zangvel
1743  f = new MathParser::MathFunc_t;
1744  f->fname = "zangvel";
1745  f->ns = this;
1746  f->args.resize(1 + 1 + 1);
1747  f->args[0] = new MathParser::MathArgReal_t;
1748  f->args[1] = new MathParser::MathArgInt_t;
1749  f->args[2] = new MathArgDM(pDM);
1750  f->f = angvel<IDX3, CURR>;
1751  f->t = 0;
1752 
1753  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1754  silent_cerr("model namespace: "
1755  "unable to insert handler "
1756  "for function " << f->fname << std::endl);
1758  }
1759 
1760  // angvrel
1761  f = new MathParser::MathFunc_t;
1762  f->fname = "angvrel";
1763  f->ns = this;
1764  f->args.resize(1 + 2 + 1);
1765  f->args[0] = new MathParser::MathArgReal_t;
1766  f->args[1] = new MathParser::MathArgInt_t;
1767  f->args[2] = new MathParser::MathArgInt_t;
1768  f->args[3] = new MathArgDM(pDM);
1769  f->f = angvrel<NORM, CURR>;
1770  f->t = 0;
1771 
1772  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1773  silent_cerr("model namespace: "
1774  "unable to insert handler "
1775  "for function " << f->fname << std::endl);
1777  }
1778 
1779  // angvrel2
1780  f = new MathParser::MathFunc_t;
1781  f->fname = "angvrel2";
1782  f->ns = this;
1783  f->args.resize(1 + 2 + 1);
1784  f->args[0] = new MathParser::MathArgReal_t;
1785  f->args[1] = new MathParser::MathArgInt_t;
1786  f->args[2] = new MathParser::MathArgInt_t;
1787  f->args[3] = new MathArgDM(pDM);
1788  f->f = angvrel<SQUARE, CURR>;
1789  f->t = 0;
1790 
1791  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1792  silent_cerr("model namespace: "
1793  "unable to insert handler "
1794  "for function " << f->fname << std::endl);
1796  }
1797 
1798  // xangvrel
1799  f = new MathParser::MathFunc_t;
1800  f->fname = "xangvrel";
1801  f->ns = this;
1802  f->args.resize(1 + 2 + 1);
1803  f->args[0] = new MathParser::MathArgReal_t;
1804  f->args[1] = new MathParser::MathArgInt_t;
1805  f->args[2] = new MathParser::MathArgInt_t;
1806  f->args[3] = new MathArgDM(pDM);
1807  f->f = angvrel<IDX1, CURR>;
1808  f->t = 0;
1809 
1810  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1811  silent_cerr("model namespace: "
1812  "unable to insert handler "
1813  "for function " << f->fname << std::endl);
1815  }
1816 
1817  // yangvrel
1818  f = new MathParser::MathFunc_t;
1819  f->fname = "yangvrel";
1820  f->ns = this;
1821  f->args.resize(1 + 2 + 1);
1822  f->args[0] = new MathParser::MathArgReal_t;
1823  f->args[1] = new MathParser::MathArgInt_t;
1824  f->args[2] = new MathParser::MathArgInt_t;
1825  f->args[3] = new MathArgDM(pDM);
1826  f->f = angvrel<IDX2, CURR>;
1827  f->t = 0;
1828 
1829  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1830  silent_cerr("model namespace: "
1831  "unable to insert handler "
1832  "for function " << f->fname << std::endl);
1834  }
1835 
1836  // zangvrel
1837  f = new MathParser::MathFunc_t;
1838  f->fname = "zangvrel";
1839  f->ns = this;
1840  f->args.resize(1 + 2 + 1);
1841  f->args[0] = new MathParser::MathArgReal_t;
1842  f->args[1] = new MathParser::MathArgInt_t;
1843  f->args[2] = new MathParser::MathArgInt_t;
1844  f->args[3] = new MathArgDM(pDM);
1845  f->f = angvrel<IDX3, CURR>;
1846  f->t = 0;
1847 
1848  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1849  silent_cerr("model namespace: "
1850  "unable to insert handler "
1851  "for function " << f->fname << std::endl);
1853  }
1854 
1855  // position_prev
1856  f = new MathParser::MathFunc_t;
1857  f->fname = "position_prev";
1858  f->ns = this;
1859  f->args.resize(1 + 1 + 1);
1860  f->args[0] = new MathParser::MathArgReal_t;
1861  f->args[1] = new MathParser::MathArgInt_t;
1862  f->args[2] = new MathArgDM(pDM);
1863  f->f = position<NORM, PREV>;
1864  f->t = 0;
1865 
1866  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1867  silent_cerr("model namespace: "
1868  "unable to insert handler "
1869  "for function " << f->fname << std::endl);
1871  }
1872 
1873  // position2_prev
1874  f = new MathParser::MathFunc_t;
1875  f->fname = "position2_prev";
1876  f->ns = this;
1877  f->args.resize(1 + 1 + 1);
1878  f->args[0] = new MathParser::MathArgReal_t;
1879  f->args[1] = new MathParser::MathArgInt_t;
1880  f->args[2] = new MathArgDM(pDM);
1881  f->f = position<SQUARE, PREV>;
1882  f->t = 0;
1883 
1884  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1885  silent_cerr("model namespace: "
1886  "unable to insert handler "
1887  "for function " << f->fname << std::endl);
1889  }
1890 
1891  // xposition_prev
1892  f = new MathParser::MathFunc_t;
1893  f->fname = "xposition_prev";
1894  f->ns = this;
1895  f->args.resize(1 + 1 + 1);
1896  f->args[0] = new MathParser::MathArgReal_t;
1897  f->args[1] = new MathParser::MathArgInt_t;
1898  f->args[2] = new MathArgDM(pDM);
1899  f->f = position<IDX1, PREV>;
1900  f->t = 0;
1901 
1902  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1903  silent_cerr("model namespace: "
1904  "unable to insert handler "
1905  "for function " << f->fname << std::endl);
1907  }
1908 
1909  // yposition_prev
1910  f = new MathParser::MathFunc_t;
1911  f->fname = "yposition_prev";
1912  f->ns = this;
1913  f->args.resize(1 + 1 + 1);
1914  f->args[0] = new MathParser::MathArgReal_t;
1915  f->args[1] = new MathParser::MathArgInt_t;
1916  f->args[2] = new MathArgDM(pDM);
1917  f->f = position<IDX2, PREV>;
1918  f->t = 0;
1919 
1920  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1921  silent_cerr("model namespace: "
1922  "unable to insert handler "
1923  "for function " << f->fname << std::endl);
1925  }
1926 
1927  // zposition_prev
1928  f = new MathParser::MathFunc_t;
1929  f->fname = "zposition_prev";
1930  f->ns = this;
1931  f->args.resize(1 + 1 + 1);
1932  f->args[0] = new MathParser::MathArgReal_t;
1933  f->args[1] = new MathParser::MathArgInt_t;
1934  f->args[2] = new MathArgDM(pDM);
1935  f->f = position<IDX3, PREV>;
1936  f->t = 0;
1937 
1938  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1939  silent_cerr("model namespace: "
1940  "unable to insert handler "
1941  "for function " << f->fname << std::endl);
1943  }
1944 
1945  // distance_prev
1946  f = new MathParser::MathFunc_t;
1947  f->fname = "distance_prev";
1948  f->ns = this;
1949  f->args.resize(1 + 2 + 1);
1950  f->args[0] = new MathParser::MathArgReal_t;
1951  f->args[1] = new MathParser::MathArgInt_t;
1952  f->args[2] = new MathParser::MathArgInt_t;
1953  f->args[3] = new MathArgDM(pDM);
1954  f->f = distance<NORM, PREV>;
1955  f->t = 0;
1956 
1957  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1958  silent_cerr("model namespace: "
1959  "unable to insert handler "
1960  "for function " << f->fname << std::endl);
1962  }
1963 
1964  // distance2_prev
1965  f = new MathParser::MathFunc_t;
1966  f->fname = "distance2_prev";
1967  f->ns = this;
1968  f->args.resize(1 + 2 + 1);
1969  f->args[0] = new MathParser::MathArgReal_t;
1970  f->args[1] = new MathParser::MathArgInt_t;
1971  f->args[2] = new MathParser::MathArgInt_t;
1972  f->args[3] = new MathArgDM(pDM);
1973  f->f = distance<SQUARE, PREV>;
1974  f->t = 0;
1975 
1976  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1977  silent_cerr("model namespace: "
1978  "unable to insert handler "
1979  "for function " << f->fname << std::endl);
1981  }
1982 
1983  // xdistance_prev
1984  f = new MathParser::MathFunc_t;
1985  f->fname = "xdistance_prev";
1986  f->ns = this;
1987  f->args.resize(1 + 2 + 1);
1988  f->args[0] = new MathParser::MathArgReal_t;
1989  f->args[1] = new MathParser::MathArgInt_t;
1990  f->args[2] = new MathParser::MathArgInt_t;
1991  f->args[3] = new MathArgDM(pDM);
1992  f->f = distance<IDX1, PREV>;
1993  f->t = 0;
1994 
1995  if (!func.insert(funcType::value_type(f->fname, f)).second) {
1996  silent_cerr("model namespace: "
1997  "unable to insert handler "
1998  "for function " << f->fname << std::endl);
2000  }
2001 
2002  // ydistance_prev
2003  f = new MathParser::MathFunc_t;
2004  f->fname = "ydistance_prev";
2005  f->ns = this;
2006  f->args.resize(1 + 2 + 1);
2007  f->args[0] = new MathParser::MathArgReal_t;
2008  f->args[1] = new MathParser::MathArgInt_t;
2009  f->args[2] = new MathParser::MathArgInt_t;
2010  f->args[3] = new MathArgDM(pDM);
2011  f->f = distance<IDX2, PREV>;
2012  f->t = 0;
2013 
2014  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2015  silent_cerr("model namespace: "
2016  "unable to insert handler "
2017  "for function " << f->fname << std::endl);
2019  }
2020 
2021  // zdistance_prev
2022  f = new MathParser::MathFunc_t;
2023  f->fname = "zdistance_prev";
2024  f->ns = this;
2025  f->args.resize(1 + 2 + 1);
2026  f->args[0] = new MathParser::MathArgReal_t;
2027  f->args[1] = new MathParser::MathArgInt_t;
2028  f->args[2] = new MathParser::MathArgInt_t;
2029  f->args[3] = new MathArgDM(pDM);
2030  f->f = distance<IDX3, PREV>;
2031  f->t = 0;
2032 
2033  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2034  silent_cerr("model namespace: "
2035  "unable to insert handler "
2036  "for function " << f->fname << std::endl);
2038  }
2039 
2040  // xunitvec_prev
2041  f = new MathParser::MathFunc_t;
2042  f->fname = "xunitvec_prev";
2043  f->ns = this;
2044  f->args.resize(1 + 2 + 1);
2045  f->args[0] = new MathParser::MathArgReal_t;
2046  f->args[1] = new MathParser::MathArgInt_t;
2047  f->args[2] = new MathParser::MathArgInt_t;
2048  f->args[3] = new MathArgDM(pDM);
2049  f->f = unitvec<IDX1, PREV>;
2050  f->t = 0;
2051 
2052  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2053  silent_cerr("model namespace: "
2054  "unable to insert handler "
2055  "for function " << f->fname << std::endl);
2057  }
2058 
2059  // yunitvec_prev
2060  f = new MathParser::MathFunc_t;
2061  f->fname = "yunitvec_prev";
2062  f->ns = this;
2063  f->args.resize(1 + 2 + 1);
2064  f->args[0] = new MathParser::MathArgReal_t;
2065  f->args[1] = new MathParser::MathArgInt_t;
2066  f->args[2] = new MathParser::MathArgInt_t;
2067  f->args[3] = new MathArgDM(pDM);
2068  f->f = unitvec<IDX2, PREV>;
2069  f->t = 0;
2070 
2071  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2072  silent_cerr("model namespace: "
2073  "unable to insert handler "
2074  "for function " << f->fname << std::endl);
2076  }
2077 
2078  // zunitvec_prev
2079  f = new MathParser::MathFunc_t;
2080  f->fname = "zunitvec_prev";
2081  f->ns = this;
2082  f->args.resize(1 + 2 + 1);
2083  f->args[0] = new MathParser::MathArgReal_t;
2084  f->args[1] = new MathParser::MathArgInt_t;
2085  f->args[2] = new MathParser::MathArgInt_t;
2086  f->args[3] = new MathArgDM(pDM);
2087  f->f = unitvec<IDX3, PREV>;
2088  f->t = 0;
2089 
2090  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2091  silent_cerr("model namespace: "
2092  "unable to insert handler "
2093  "for function " << f->fname << std::endl);
2095  }
2096 
2097  // angle_prev
2098  f = new MathParser::MathFunc_t;
2099  f->fname = "angle_prev";
2100  f->ns = this;
2101  f->args.resize(1 + 1 + 1);
2102  f->args[0] = new MathParser::MathArgReal_t;
2103  f->args[1] = new MathParser::MathArgInt_t;
2104  f->args[2] = new MathArgDM(pDM);
2105  f->f = angle<NORM, PREV>;
2106  f->t = 0;
2107 
2108  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2109  silent_cerr("model namespace: "
2110  "unable to insert handler "
2111  "for function " << f->fname << std::endl);
2113  }
2114 
2115  // xangle_prev
2116  f = new MathParser::MathFunc_t;
2117  f->fname = "xangle_prev";
2118  f->ns = this;
2119  f->args.resize(1 + 1 + 1);
2120  f->args[0] = new MathParser::MathArgReal_t;
2121  f->args[1] = new MathParser::MathArgInt_t;
2122  f->args[2] = new MathArgDM(pDM);
2123  f->f = angle<IDX1, PREV>;
2124  f->t = 0;
2125 
2126  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2127  silent_cerr("model namespace: "
2128  "unable to insert handler "
2129  "for function " << f->fname << std::endl);
2131  }
2132 
2133  // yangle_prev
2134  f = new MathParser::MathFunc_t;
2135  f->fname = "yangle_prev";
2136  f->ns = this;
2137  f->args.resize(1 + 1 + 1);
2138  f->args[0] = new MathParser::MathArgReal_t;
2139  f->args[1] = new MathParser::MathArgInt_t;
2140  f->args[2] = new MathArgDM(pDM);
2141  f->f = angle<IDX2, PREV>;
2142  f->t = 0;
2143 
2144  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2145  silent_cerr("model namespace: "
2146  "unable to insert handler "
2147  "for function " << f->fname << std::endl);
2149  }
2150 
2151  // zangle_prev
2152  f = new MathParser::MathFunc_t;
2153  f->fname = "zangle_prev";
2154  f->ns = this;
2155  f->args.resize(1 + 1 + 1);
2156  f->args[0] = new MathParser::MathArgReal_t;
2157  f->args[1] = new MathParser::MathArgInt_t;
2158  f->args[2] = new MathArgDM(pDM);
2159  f->f = angle<IDX3, PREV>;
2160  f->t = 0;
2161 
2162  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2163  silent_cerr("model namespace: "
2164  "unable to insert handler "
2165  "for function " << f->fname << std::endl);
2167  }
2168 
2169  // anglerel_prev
2170  f = new MathParser::MathFunc_t;
2171  f->fname = "anglerel_prev";
2172  f->ns = this;
2173  f->args.resize(1 + 2 + 1);
2174  f->args[0] = new MathParser::MathArgReal_t;
2175  f->args[1] = new MathParser::MathArgInt_t;
2176  f->args[2] = new MathParser::MathArgInt_t;
2177  f->args[3] = new MathArgDM(pDM);
2178  f->f = anglerel<NORM, PREV>;
2179  f->t = 0;
2180 
2181  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2182  silent_cerr("model namespace: "
2183  "unable to insert handler "
2184  "for function " << f->fname << std::endl);
2186  }
2187 
2188  // xanglerel_prev
2189  f = new MathParser::MathFunc_t;
2190  f->fname = "xanglerel_prev";
2191  f->ns = this;
2192  f->args.resize(1 + 2 + 1);
2193  f->args[0] = new MathParser::MathArgReal_t;
2194  f->args[1] = new MathParser::MathArgInt_t;
2195  f->args[2] = new MathParser::MathArgInt_t;
2196  f->args[3] = new MathArgDM(pDM);
2197  f->f = anglerel<IDX1, PREV>;
2198  f->t = 0;
2199 
2200  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2201  silent_cerr("model namespace: "
2202  "unable to insert handler "
2203  "for function " << f->fname << std::endl);
2205  }
2206 
2207  // yanglerel_prev
2208  f = new MathParser::MathFunc_t;
2209  f->fname = "yanglerel_prev";
2210  f->ns = this;
2211  f->args.resize(1 + 2 + 1);
2212  f->args[0] = new MathParser::MathArgReal_t;
2213  f->args[1] = new MathParser::MathArgInt_t;
2214  f->args[2] = new MathParser::MathArgInt_t;
2215  f->args[3] = new MathArgDM(pDM);
2216  f->f = anglerel<IDX2, PREV>;
2217  f->t = 0;
2218 
2219  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2220  silent_cerr("model namespace: "
2221  "unable to insert handler "
2222  "for function " << f->fname << std::endl);
2224  }
2225 
2226  // zanglerel_prev
2227  f = new MathParser::MathFunc_t;
2228  f->fname = "zanglerel_prev";
2229  f->ns = this;
2230  f->args.resize(1 + 2 + 1);
2231  f->args[0] = new MathParser::MathArgReal_t;
2232  f->args[1] = new MathParser::MathArgInt_t;
2233  f->args[2] = new MathParser::MathArgInt_t;
2234  f->args[3] = new MathArgDM(pDM);
2235  f->f = anglerel<IDX3, PREV>;
2236  f->t = 0;
2237 
2238  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2239  silent_cerr("model namespace: "
2240  "unable to insert handler "
2241  "for function " << f->fname << std::endl);
2243  }
2244 
2245  // velocity_prev
2246  f = new MathParser::MathFunc_t;
2247  f->fname = "velocity_prev";
2248  f->ns = this;
2249  f->args.resize(1 + 1 + 1);
2250  f->args[0] = new MathParser::MathArgReal_t;
2251  f->args[1] = new MathParser::MathArgInt_t;
2252  f->args[2] = new MathArgDM(pDM);
2253  f->f = velocity<NORM, PREV>;
2254  f->t = 0;
2255 
2256  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2257  silent_cerr("model namespace: "
2258  "unable to insert handler "
2259  "for function " << f->fname << std::endl);
2261  }
2262 
2263  // velocity2_prev
2264  f = new MathParser::MathFunc_t;
2265  f->fname = "velocity2_prev";
2266  f->ns = this;
2267  f->args.resize(1 + 1 + 1);
2268  f->args[0] = new MathParser::MathArgReal_t;
2269  f->args[1] = new MathParser::MathArgInt_t;
2270  f->args[2] = new MathArgDM(pDM);
2271  f->f = velocity<SQUARE, PREV>;
2272  f->t = 0;
2273 
2274  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2275  silent_cerr("model namespace: "
2276  "unable to insert handler "
2277  "for function " << f->fname << std::endl);
2279  }
2280 
2281  // xvelocity_prev
2282  f = new MathParser::MathFunc_t;
2283  f->fname = "xvelocity_prev";
2284  f->ns = this;
2285  f->args.resize(1 + 1 + 1);
2286  f->args[0] = new MathParser::MathArgReal_t;
2287  f->args[1] = new MathParser::MathArgInt_t;
2288  f->args[2] = new MathArgDM(pDM);
2289  f->f = velocity<IDX1, PREV>;
2290  f->t = 0;
2291 
2292  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2293  silent_cerr("model namespace: "
2294  "unable to insert handler "
2295  "for function " << f->fname << std::endl);
2297  }
2298 
2299  // yvelocity_prev
2300  f = new MathParser::MathFunc_t;
2301  f->fname = "yvelocity_prev";
2302  f->ns = this;
2303  f->args.resize(1 + 1 + 1);
2304  f->args[0] = new MathParser::MathArgReal_t;
2305  f->args[1] = new MathParser::MathArgInt_t;
2306  f->args[2] = new MathArgDM(pDM);
2307  f->f = velocity<IDX2, PREV>;
2308  f->t = 0;
2309 
2310  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2311  silent_cerr("model namespace: "
2312  "unable to insert handler "
2313  "for function " << f->fname << std::endl);
2315  }
2316 
2317  // zvelocity_prev
2318  f = new MathParser::MathFunc_t;
2319  f->fname = "zvelocity_prev";
2320  f->ns = this;
2321  f->args.resize(1 + 1 + 1);
2322  f->args[0] = new MathParser::MathArgReal_t;
2323  f->args[1] = new MathParser::MathArgInt_t;
2324  f->args[2] = new MathArgDM(pDM);
2325  f->f = velocity<IDX3, PREV>;
2326  f->t = 0;
2327 
2328  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2329  silent_cerr("model namespace: "
2330  "unable to insert handler "
2331  "for function " << f->fname << std::endl);
2333  }
2334 
2335  // vrel_prev
2336  f = new MathParser::MathFunc_t;
2337  f->fname = "vrel_prev";
2338  f->ns = this;
2339  f->args.resize(1 + 2 + 1);
2340  f->args[0] = new MathParser::MathArgReal_t;
2341  f->args[1] = new MathParser::MathArgInt_t;
2342  f->args[2] = new MathParser::MathArgInt_t;
2343  f->args[3] = new MathArgDM(pDM);
2344  f->f = vrel<NORM, PREV>;
2345  f->t = 0;
2346 
2347  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2348  silent_cerr("model namespace: "
2349  "unable to insert handler "
2350  "for function " << f->fname << std::endl);
2352  }
2353 
2354  // vrel2_prev
2355  f = new MathParser::MathFunc_t;
2356  f->fname = "vrel2_prev";
2357  f->ns = this;
2358  f->args.resize(1 + 2 + 1);
2359  f->args[0] = new MathParser::MathArgReal_t;
2360  f->args[1] = new MathParser::MathArgInt_t;
2361  f->args[2] = new MathParser::MathArgInt_t;
2362  f->args[3] = new MathArgDM(pDM);
2363  f->f = vrel<SQUARE, PREV>;
2364  f->t = 0;
2365 
2366  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2367  silent_cerr("model namespace: "
2368  "unable to insert handler "
2369  "for function " << f->fname << std::endl);
2371  }
2372 
2373  // xvrel_prev
2374  f = new MathParser::MathFunc_t;
2375  f->fname = "xvrel_prev";
2376  f->ns = this;
2377  f->args.resize(1 + 2 + 1);
2378  f->args[0] = new MathParser::MathArgReal_t;
2379  f->args[1] = new MathParser::MathArgInt_t;
2380  f->args[2] = new MathParser::MathArgInt_t;
2381  f->args[3] = new MathArgDM(pDM);
2382  f->f = vrel<IDX1, PREV>;
2383  f->t = 0;
2384 
2385  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2386  silent_cerr("model namespace: "
2387  "unable to insert handler "
2388  "for function " << f->fname << std::endl);
2390  }
2391 
2392  // yvrel_prev
2393  f = new MathParser::MathFunc_t;
2394  f->fname = "yvrel_prev";
2395  f->ns = this;
2396  f->args.resize(1 + 2 + 1);
2397  f->args[0] = new MathParser::MathArgReal_t;
2398  f->args[1] = new MathParser::MathArgInt_t;
2399  f->args[2] = new MathParser::MathArgInt_t;
2400  f->args[3] = new MathArgDM(pDM);
2401  f->f = vrel<IDX2, PREV>;
2402  f->t = 0;
2403 
2404  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2405  silent_cerr("model namespace: "
2406  "unable to insert handler "
2407  "for function " << f->fname << std::endl);
2409  }
2410 
2411  // zvrel_prev
2412  f = new MathParser::MathFunc_t;
2413  f->fname = "zvrel_prev";
2414  f->ns = this;
2415  f->args.resize(1 + 2 + 1);
2416  f->args[0] = new MathParser::MathArgReal_t;
2417  f->args[1] = new MathParser::MathArgInt_t;
2418  f->args[2] = new MathParser::MathArgInt_t;
2419  f->args[3] = new MathArgDM(pDM);
2420  f->f = vrel<IDX3, PREV>;
2421  f->t = 0;
2422 
2423  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2424  silent_cerr("model namespace: "
2425  "unable to insert handler "
2426  "for function " << f->fname << std::endl);
2428  }
2429 
2430  // angvel_prev
2431  f = new MathParser::MathFunc_t;
2432  f->fname = "angvel_prev";
2433  f->ns = this;
2434  f->args.resize(1 + 1 + 1);
2435  f->args[0] = new MathParser::MathArgReal_t;
2436  f->args[1] = new MathParser::MathArgInt_t;
2437  f->args[2] = new MathArgDM(pDM);
2438  f->f = angvel<NORM, PREV>;
2439  f->t = 0;
2440 
2441  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2442  silent_cerr("model namespace: "
2443  "unable to insert handler "
2444  "for function " << f->fname << std::endl);
2446  }
2447 
2448  // angvel_prev
2449  f = new MathParser::MathFunc_t;
2450  f->fname = "angvel2_prev";
2451  f->ns = this;
2452  f->args.resize(1 + 1 + 1);
2453  f->args[0] = new MathParser::MathArgReal_t;
2454  f->args[1] = new MathParser::MathArgInt_t;
2455  f->args[2] = new MathArgDM(pDM);
2456  f->f = angvel<SQUARE, PREV>;
2457  f->t = 0;
2458 
2459  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2460  silent_cerr("model namespace: "
2461  "unable to insert handler "
2462  "for function " << f->fname << std::endl);
2464  }
2465 
2466  // xangvel_prev
2467  f = new MathParser::MathFunc_t;
2468  f->fname = "xangvel_prev";
2469  f->ns = this;
2470  f->args.resize(1 + 1 + 1);
2471  f->args[0] = new MathParser::MathArgReal_t;
2472  f->args[1] = new MathParser::MathArgInt_t;
2473  f->args[2] = new MathArgDM(pDM);
2474  f->f = angvel<IDX1, PREV>;
2475  f->t = 0;
2476 
2477  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2478  silent_cerr("model namespace: "
2479  "unable to insert handler "
2480  "for function " << f->fname << std::endl);
2482  }
2483 
2484  // yangvel_prev
2485  f = new MathParser::MathFunc_t;
2486  f->fname = "yangvel_prev";
2487  f->ns = this;
2488  f->args.resize(1 + 1 + 1);
2489  f->args[0] = new MathParser::MathArgReal_t;
2490  f->args[1] = new MathParser::MathArgInt_t;
2491  f->args[2] = new MathArgDM(pDM);
2492  f->f = angvel<IDX2, PREV>;
2493  f->t = 0;
2494 
2495  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2496  silent_cerr("model namespace: "
2497  "unable to insert handler "
2498  "for function " << f->fname << std::endl);
2500  }
2501 
2502  // zangvel_prev
2503  f = new MathParser::MathFunc_t;
2504  f->fname = "zangvel_prev";
2505  f->ns = this;
2506  f->args.resize(1 + 1 + 1);
2507  f->args[0] = new MathParser::MathArgReal_t;
2508  f->args[1] = new MathParser::MathArgInt_t;
2509  f->args[2] = new MathArgDM(pDM);
2510  f->f = angvel<IDX3, PREV>;
2511  f->t = 0;
2512 
2513  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2514  silent_cerr("model namespace: "
2515  "unable to insert handler "
2516  "for function " << f->fname << std::endl);
2518  }
2519 
2520  // angvrel_prev
2521  f = new MathParser::MathFunc_t;
2522  f->fname = "angvrel_prev";
2523  f->ns = this;
2524  f->args.resize(1 + 2 + 1);
2525  f->args[0] = new MathParser::MathArgReal_t;
2526  f->args[1] = new MathParser::MathArgInt_t;
2527  f->args[2] = new MathParser::MathArgInt_t;
2528  f->args[3] = new MathArgDM(pDM);
2529  f->f = angvrel<NORM, PREV>;
2530  f->t = 0;
2531 
2532  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2533  silent_cerr("model namespace: "
2534  "unable to insert handler "
2535  "for function " << f->fname << std::endl);
2537  }
2538 
2539  // angvrel2_prev
2540  f = new MathParser::MathFunc_t;
2541  f->fname = "angvrel2_prev";
2542  f->ns = this;
2543  f->args.resize(1 + 2 + 1);
2544  f->args[0] = new MathParser::MathArgReal_t;
2545  f->args[1] = new MathParser::MathArgInt_t;
2546  f->args[2] = new MathParser::MathArgInt_t;
2547  f->args[3] = new MathArgDM(pDM);
2548  f->f = angvrel<SQUARE, PREV>;
2549  f->t = 0;
2550 
2551  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2552  silent_cerr("model namespace: "
2553  "unable to insert handler "
2554  "for function " << f->fname << std::endl);
2556  }
2557 
2558  // xangvrel_prev
2559  f = new MathParser::MathFunc_t;
2560  f->fname = "xangvrel_prev";
2561  f->ns = this;
2562  f->args.resize(1 + 2 + 1);
2563  f->args[0] = new MathParser::MathArgReal_t;
2564  f->args[1] = new MathParser::MathArgInt_t;
2565  f->args[2] = new MathParser::MathArgInt_t;
2566  f->args[3] = new MathArgDM(pDM);
2567  f->f = angvrel<IDX1, PREV>;
2568  f->t = 0;
2569 
2570  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2571  silent_cerr("model namespace: "
2572  "unable to insert handler "
2573  "for function " << f->fname << std::endl);
2575  }
2576 
2577  // yangvrel_prev
2578  f = new MathParser::MathFunc_t;
2579  f->fname = "yangvrel_prev";
2580  f->ns = this;
2581  f->args.resize(1 + 2 + 1);
2582  f->args[0] = new MathParser::MathArgReal_t;
2583  f->args[1] = new MathParser::MathArgInt_t;
2584  f->args[2] = new MathParser::MathArgInt_t;
2585  f->args[3] = new MathArgDM(pDM);
2586  f->f = angvrel<IDX2, PREV>;
2587  f->t = 0;
2588 
2589  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2590  silent_cerr("model namespace: "
2591  "unable to insert handler "
2592  "for function " << f->fname << std::endl);
2594  }
2595 
2596  // zangvrel_prev
2597  f = new MathParser::MathFunc_t;
2598  f->fname = "zangvrel_prev";
2599  f->ns = this;
2600  f->args.resize(1 + 2 + 1);
2601  f->args[0] = new MathParser::MathArgReal_t;
2602  f->args[1] = new MathParser::MathArgInt_t;
2603  f->args[2] = new MathParser::MathArgInt_t;
2604  f->args[3] = new MathArgDM(pDM);
2605  f->f = angvrel<IDX3, PREV>;
2606  f->t = 0;
2607 
2608  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2609  silent_cerr("model namespace: "
2610  "unable to insert handler "
2611  "for function " << f->fname << std::endl);
2613  }
2614 
2615  // drive
2616  f = new MathParser::MathFunc_t;
2617  f->fname = "drive";
2618  f->ns = this;
2619  f->args.resize(1 + 2 + 2);
2620  f->args[0] = new MathParser::MathArgReal_t;
2621  f->args[1] = new MathParser::MathArgInt_t;
2622  f->args[2] = new MathParser::MathArgReal_t;
2623  f->args[3] = new MathArgDCPtr(0);
2624  f->args[4] = new MathArgDM(pDM);
2625  f->f = drive<false>;
2626  f->t = 0;
2627 
2628  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2629  silent_cerr("model namespace: "
2630  "unable to insert handler "
2631  "for function " << f->fname << std::endl);
2633  }
2634 
2635  // drivep
2636  f = new MathParser::MathFunc_t;
2637  f->fname = "drivep";
2638  f->ns = this;
2639  f->args.resize(1 + 2 + 2);
2640  f->args[0] = new MathParser::MathArgReal_t;
2641  f->args[1] = new MathParser::MathArgInt_t;
2642  f->args[2] = new MathParser::MathArgReal_t;
2643  f->args[3] = new MathArgDCPtr(0);
2644  f->args[4] = new MathArgDM(pDM);
2645  f->f = drive<true>;
2646  f->t = 0;
2647 
2648  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2649  silent_cerr("model namespace: "
2650  "unable to insert handler "
2651  "for function " << f->fname << std::endl);
2653  }
2654 
2655  // current simulation entity function
2656  f = new MathParser::MathFunc_t;
2657  f->fname = "current";
2658  f->ns = this;
2659  f->args.resize(1 + 1 + 1);
2660  f->args[0] = new MathParser::MathArgReal_t;
2661  f->args[1] = new MathParser::MathArgString_t;
2662  f->args[2] = new MathArgMNS(this);
2663  f->f = model_curr;
2664  f->t = 0;
2665 
2666  if (!func.insert(funcType::value_type(f->fname, f)).second) {
2667  silent_cerr("model namespace: "
2668  "unable to insert handler "
2669  "for function " << f->fname << std::endl);
2671  }
2672 
2673  // scalar functions
2674  sf_func.fname = "sf";
2675  sf_func.ns = this;
2676  sf_func.args.resize(1 + 2 + 1);
2680  sf_func.args[3] = new MathArgSF(0);
2681  sf_func.f = model_sf;
2682  sf_func.t = 0;
2683 
2684  // node functions
2685  node_func.fname = "node";
2686  node_func.ns = this;
2687  node_func.args.resize(1 + 2 + 4);
2692  node_func.args[4] = new MathArgSEPtr(0);
2693  node_func.args[5] = new MathArgSEIdx(0);
2694  node_func.args[6] = new MathArgDM(pDM);
2696  node_func.t = 0;
2697 
2698  // element functions
2699  elem_func.fname = "element";
2700  elem_func.ns = this;
2701  elem_func.args.resize(1 + 2 + 4);
2706  elem_func.args[4] = new MathArgSEPtr(0);
2707  elem_func.args[5] = new MathArgSEIdx(0);
2708  elem_func.args[6] = new MathArgDM(pDM);
2709  elem_func.f = model_elem<false>;
2710  elem_func.t = 0;
2711 
2712  // unique element functions
2713  unique_elem_func.fname = "uniqueElement";
2714  unique_elem_func.ns = this;
2715  unique_elem_func.args.resize(1 + 1 + 4);
2719  unique_elem_func.args[3] = new MathArgSEPtr(0);
2720  unique_elem_func.args[4] = new MathArgSEIdx(0);
2721  unique_elem_func.args[5] = new MathArgDM(pDM);
2722  unique_elem_func.f = model_elem<true>;
2723  unique_elem_func.t = 0;
2724 }
static int model_curr(const MathParser::MathArgs &args)
Definition: modelns.cc:1061
MathArgPriv_t< Real, AT_REAL > MathArgReal_t
Definition: mathp.h:155
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
funcType func
Definition: modelns.h:54
MathParser::MathArgPriv_t< Node::Type > MathArgNode
Definition: modelns.h:46
MathParser::MathFunc_t unique_elem_func
Definition: modelns.h:59
const DataManager * pDM
Definition: modelns.h:40
MathFunc_f f
Definition: mathp.h:170
MathFuncTest_f t
Definition: mathp.h:171
MathParser::MathFunc_t node_func
Definition: modelns.h:57
MathParser::MathArgPriv_t< const DataManager * > MathArgDM
Definition: modelns.h:43
MathParser::MathArgPriv_t< const BasicScalarFunction * > MathArgSF
Definition: modelns.h:45
MathParser::MathFunc_t elem_func
Definition: modelns.h:58
MathParser::MathArgPriv_t< const DriveCaller * > MathArgDCPtr
Definition: modelns.h:50
MathArgPriv_t< std::string, AT_STRING > MathArgString_t
Definition: mathp.h:156
MathParser::MathArgPriv_t< unsigned int > MathArgSEIdx
Definition: modelns.h:49
MathParser::MathArgPriv_t< const SimulationEntity * > MathArgSEPtr
Definition: modelns.h:48
static int model_node(const MathParser::MathArgs &args)
Definition: modelns.cc:832
NameSpace * ns
Definition: mathp.h:168
static int model_sf(const MathParser::MathArgs &args)
Definition: modelns.cc:781
MathParser::MathArgPriv_t< Elem::Type > MathArgElem
Definition: modelns.h:47
MathArgPriv_t< Int, AT_INT > MathArgInt_t
Definition: mathp.h:154
MathParser::MathArgPriv_t< const ModelNameSpace * > MathArgMNS
Definition: modelns.h:44
std::string fname
Definition: mathp.h:167
MathParser::MathFunc_t sf_func
Definition: modelns.h:56

Here is the call graph for this function:

ModelNameSpace::~ModelNameSpace ( void  )

Definition at line 2726 of file modelns.cc.

References func.

2727 {
2728  for (funcType::iterator f = func.begin(); f != func.end(); ++f) {
2729  delete f->second;
2730  }
2731 }
funcType func
Definition: modelns.h:54

Member Function Documentation

TypedValue ModelNameSpace::EvalFunc ( MathParser::MathFunc_t f) const
virtual

Implements MathParser::NameSpace.

Definition at line 2901 of file modelns.cc.

References MathParser::MathFunc_t::args, MathParser::AT_INT, MathParser::AT_PRIVATE, MathParser::AT_REAL, MathParser::AT_VOID, MathParser::MathFunc_t::f, MBDYN_EXCEPT_ARGS, and pDM.

2902 {
2903 #if 0
2904  for (unsigned i = 0; i != args.size(); i++) {
2905  if (args[i]->Type() == MathParser::AT_PRIVATE) {
2906  MathArgDM *dm = dynamic_cast<MathArgDM *>(args[i]);
2907  if (dm) {
2908  (*dm)() = pDM;
2909  }
2910  }
2911  }
2912 #endif
2913 
2914  f->f(f->args);
2915 
2916  switch (f->args[0]->Type()) {
2917  case MathParser::AT_VOID:
2918  return TypedValue(0);
2919 
2920  case MathParser::AT_INT:
2921  return TypedValue((*dynamic_cast<MathParser::MathArgInt_t *>(f->args[0]))());
2922 
2923  case MathParser::AT_REAL:
2924  return TypedValue((*dynamic_cast<MathParser::MathArgReal_t *>(f->args[0]))());
2925 
2926  default:
2928  }
2929 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
const DataManager * pDM
Definition: modelns.h:40
MathFunc_f f
Definition: mathp.h:170
MathParser::MathArgPriv_t< const DataManager * > MathArgDM
Definition: modelns.h:43
bool ModelNameSpace::FindFunc ( const std::string &  fname,
MathParser::MathFunc_t **  fpp = 0 
) const
protected

Definition at line 2740 of file modelns.cc.

References MathParser::MathFunc_t::args, DataManager::ElemDataStructure::bIsUnique(), elem_func, MathParser::MathFunc_t::fname, func, DataManager::GetElemDataStructure(), DataManager::GetMBDynParser(), MBDynParser::GetScalarFunction(), node_func, pDM, sf_func, str2elemtype(), str2nodetype(), unique_elem_func, Node::UNKNOWN, and Elem::UNKNOWN.

Referenced by GetFunc(), and IsFunc().

2741 {
2742  static const std::string sf_prefix("sf::");
2743  if (fname.compare(0, sf_prefix.size(), sf_prefix) == 0) {
2744  std::string sfname(fname, sf_prefix.size());
2746 
2747  if (sf == 0) {
2748  silent_cerr("ModelNameSpace::FindFunc(" << fname << "): unable to find scalar function \"" << sfname << "\"" << std::endl);
2749  return false;
2750  }
2751 
2752  if (fpp) {
2754  *fpp = fp;
2755 
2756  (*dynamic_cast<MathArgSF *>(fp->args[3]))() = sf;
2757  }
2758 
2759  return true;
2760  }
2761 
2762  static const std::string node_prefix = "node::";
2763  if (fname.compare(0, node_prefix.size(), node_prefix) == 0) {
2764  std::string type(fname, node_prefix.size());
2765  const Node::Type t = str2nodetype(type.c_str());
2766  if (t == Node::UNKNOWN) {
2767  silent_cerr("ModelNameSpace::GetFunc(" << fname << "): unable to find node type \"" << type << "\"" << std::endl);
2768  return false;
2769  }
2770 
2771  if (fpp) {
2773  *fpp = fp;
2774 
2775  fp->fname += "::";
2776  fp->fname += type;
2777  (*dynamic_cast<MathParser::MathArgInt_t *>(fp->args[1]))() = -1;
2778  (*dynamic_cast<MathArgNode *>(fp->args[3]))() = t;
2779  }
2780 
2781  return true;
2782  }
2783 
2784  static const std::string elem_prefix = "element::";
2785  if (fname.compare(0, elem_prefix.size(), elem_prefix) == 0) {
2786  std::string type(fname, elem_prefix.size());
2787  Elem::Type t = str2elemtype(type.c_str());
2788  if (t == Elem::UNKNOWN) {
2789  silent_cerr("ModelNameSpace::GetFunc(" << fname << "): unable to find element type \"" << type << "\"" << std::endl);
2790  return false;
2791  }
2792 
2793  if (fpp) {
2794  MathParser::MathFunc_t* fp = 0;
2795 
2796  if (pDM->GetElemDataStructure(t).bIsUnique()) {
2798 
2799  (*dynamic_cast<MathArgElem *>(fp->args[2]))() = t;
2800 
2801  } else {
2803 
2804  (*dynamic_cast<MathParser::MathArgInt_t *>(fp->args[1]))() = -1;
2805  (*dynamic_cast<MathArgElem *>(fp->args[3]))() = t;
2806  }
2807 
2808  *fpp = fp;
2809 
2810  fp->fname += "::";
2811  fp->fname += type;
2812  }
2813 
2814  return true;
2815  }
2816 
2817  funcType::const_iterator i = func.find(fname);
2818 
2819  if (i != func.end()) {
2820  if (fpp) {
2821  MathParser::MathFunc_t* fp = new MathParser::MathFunc_t(*i->second);
2822  *fpp = fp;
2823  }
2824  return true;
2825  }
2826 
2827  return false;
2828 }
const BasicScalarFunction * GetScalarFunction(void)
Definition: mbpar.cc:2158
Elem::Type str2elemtype(const char *const s)
Definition: elem.cc:159
funcType func
Definition: modelns.h:54
MathParser::MathArgPriv_t< Node::Type > MathArgNode
Definition: modelns.h:46
Node::Type str2nodetype(const char *const s)
Definition: node.cc:94
MathParser::MathFunc_t unique_elem_func
Definition: modelns.h:59
const DataManager * pDM
Definition: modelns.h:40
bool bIsUnique(void) const
Definition: dataman.h:583
MathParser::MathFunc_t node_func
Definition: modelns.h:57
MathParser::MathArgPriv_t< const BasicScalarFunction * > MathArgSF
Definition: modelns.h:45
Type
Definition: node.h:71
MathParser::MathFunc_t elem_func
Definition: modelns.h:58
const DataManager::ElemDataStructure & GetElemDataStructure(Elem::Type Typ) const
Definition: dataman.h:661
Type
Definition: elem.h:91
MBDynParser & GetMBDynParser(void) const
Definition: dataman.h:342
MathParser::MathArgPriv_t< Elem::Type > MathArgElem
Definition: modelns.h:47
std::string fname
Definition: mathp.h:167
MathParser::MathFunc_t sf_func
Definition: modelns.h:56

Here is the call graph for this function:

bool ModelNameSpace::GetCurrData ( const std::string &  name,
TypedValue value 
) const

Definition at line 2957 of file modelns.cc.

References currData.

Referenced by model_curr().

2958 {
2959  currDataType::const_iterator i = currData.find(name);
2960  if (i == currData.end()) {
2961  return false;
2962  }
2963 
2964  value = i->second;
2965 
2966  return true;
2967 }
std::string name
Definition: mathp.h:192
currDataType currData
Definition: modelns.h:62
MathParser::MathFunc_t * ModelNameSpace::GetFunc ( const std::string &  fname) const
virtual

Implements MathParser::NameSpace.

Definition at line 2831 of file modelns.cc.

References MathParser::MathFunc_t::args, DataManager::ElemDataStructure::bIsUnique(), elem_func, FindFunc(), func, DataManager::GetElemDataStructure(), DataManager::GetMBDynParser(), MBDynParser::GetScalarFunction(), MBDYN_EXCEPT_ARGS, node_func, pDM, sf_func, str2elemtype(), str2nodetype(), unique_elem_func, Node::UNKNOWN, and Elem::UNKNOWN.

2832 {
2833  MathParser::MathFunc_t* fp = 0;
2834  FindFunc(fname, &fp);
2835  return fp;
2836 
2837 #if 0
2838  static const std::string sf_prefix("sf::");
2839  if (fname.compare(0, sf_prefix.size(), sf_prefix) == 0) {
2840  std::string sfname(fname, sf_prefix.size());
2842 
2843  if (sf == 0) {
2844  silent_cerr("ModelNameSpace::FindFunc(" << fname << "): unable to find scalar function \"" << sfname << "\"" << std::endl);
2846  }
2847 
2848  (*dynamic_cast<MathArgSF *>(sf_func.args[3]))() = sf;
2849 
2850  return const_cast<MathParser::MathFunc_t *>(&sf_func);
2851  }
2852 
2853  static const std::string node_prefix = "node::";
2854  if (fname.compare(0, node_prefix.size(), node_prefix) == 0) {
2855  std::string type(fname, node_prefix.size());
2856  const Node::Type t = str2nodetype(type.c_str());
2857  if (t == Node::UNKNOWN) {
2858  silent_cerr("ModelNameSpace::GetFunc(" << fname << "): unable to find node type \"" << type << "\"" << std::endl);
2860  }
2861 
2862  (*dynamic_cast<MathParser::MathArgInt_t *>(node_func.args[1]))() = -1;
2863  (*dynamic_cast<MathArgNode *>(node_func.args[3]))() = t;
2864 
2865  return const_cast<MathParser::MathFunc_t *>(&node_func);
2866  }
2867 
2868  static const std::string elem_prefix = "element::";
2869  if (fname.compare(0, elem_prefix.size(), elem_prefix) == 0) {
2870  std::string type(fname, elem_prefix.size());
2871  Elem::Type t = str2elemtype(type.c_str());
2872  if (t == Elem::UNKNOWN) {
2873  silent_cerr("ModelNameSpace::GetFunc(" << fname << "): unable to find element type \"" << type << "\"" << std::endl);
2875  }
2876 
2877  if (pDM->GetElemDataStructure(t).bIsUnique()) {
2878  (*dynamic_cast<MathArgElem *>(unique_elem_func.args[2]))() = t;
2879 
2880  return const_cast<MathParser::MathFunc_t *>(&unique_elem_func);
2881 
2882  } else {
2883  (*dynamic_cast<MathParser::MathArgInt_t *>(elem_func.args[1]))() = -1;
2884  (*dynamic_cast<MathArgElem *>(elem_func.args[3]))() = t;
2885 
2886  return const_cast<MathParser::MathFunc_t *>(&elem_func);
2887  }
2888  }
2889 
2890  funcType::const_iterator i = func.find(fname);
2891 
2892  if (i != func.end()) {
2893  return i->second;
2894  }
2895 
2896  return 0;
2897 #endif
2898 }
const BasicScalarFunction * GetScalarFunction(void)
Definition: mbpar.cc:2158
Elem::Type str2elemtype(const char *const s)
Definition: elem.cc:159
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
funcType func
Definition: modelns.h:54
MathParser::MathArgPriv_t< Node::Type > MathArgNode
Definition: modelns.h:46
Node::Type str2nodetype(const char *const s)
Definition: node.cc:94
MathParser::MathFunc_t unique_elem_func
Definition: modelns.h:59
const DataManager * pDM
Definition: modelns.h:40
bool bIsUnique(void) const
Definition: dataman.h:583
MathParser::MathFunc_t node_func
Definition: modelns.h:57
MathParser::MathArgPriv_t< const BasicScalarFunction * > MathArgSF
Definition: modelns.h:45
Type
Definition: node.h:71
MathParser::MathFunc_t elem_func
Definition: modelns.h:58
const DataManager::ElemDataStructure & GetElemDataStructure(Elem::Type Typ) const
Definition: dataman.h:661
Type
Definition: elem.h:91
MBDynParser & GetMBDynParser(void) const
Definition: dataman.h:342
MathParser::MathArgPriv_t< Elem::Type > MathArgElem
Definition: modelns.h:47
bool FindFunc(const std::string &fname, MathParser::MathFunc_t **fpp=0) const
Definition: modelns.cc:2740
MathParser::MathFunc_t sf_func
Definition: modelns.h:56

Here is the call graph for this function:

Table * ModelNameSpace::GetTable ( void  )
virtual

Implements MathParser::NameSpace.

Definition at line 2932 of file modelns.cc.

2933 {
2934  return 0;
2935 }
bool ModelNameSpace::IsFunc ( const std::string &  fname) const
virtual

Implements MathParser::NameSpace.

Definition at line 2734 of file modelns.cc.

References FindFunc().

2735 {
2736  return FindFunc(fname);
2737 }
bool FindFunc(const std::string &fname, MathParser::MathFunc_t **fpp=0) const
Definition: modelns.cc:2740

Here is the call graph for this function:

bool ModelNameSpace::PopCurrData ( const std::string &  name)

Definition at line 2944 of file modelns.cc.

References currData.

Referenced by DataManager::PopCurrData().

2945 {
2946  currDataType::iterator i = currData.find(name);
2947  if (i == currData.end()) {
2948  return false;
2949  }
2950 
2951  currData.erase(i);
2952 
2953  return true;
2954 }
std::string name
Definition: mathp.h:192
currDataType currData
Definition: modelns.h:62
bool ModelNameSpace::PushCurrData ( const std::string &  name,
const TypedValue value 
)

Definition at line 2938 of file modelns.cc.

References currData.

Referenced by DataManager::PushCurrData().

2939 {
2940  return currData.insert(currDataType::value_type(name, value)).second;
2941 }
std::string name
Definition: mathp.h:192
currDataType currData
Definition: modelns.h:62

Member Data Documentation

currDataType ModelNameSpace::currData
protected

Definition at line 62 of file modelns.h.

Referenced by GetCurrData(), PopCurrData(), and PushCurrData().

MathParser::MathFunc_t ModelNameSpace::elem_func
protected

Definition at line 58 of file modelns.h.

Referenced by FindFunc(), GetFunc(), and ModelNameSpace().

funcType ModelNameSpace::func
protected

Definition at line 54 of file modelns.h.

Referenced by FindFunc(), GetFunc(), ModelNameSpace(), and ~ModelNameSpace().

MathParser::MathFunc_t ModelNameSpace::node_func
protected

Definition at line 57 of file modelns.h.

Referenced by FindFunc(), GetFunc(), and ModelNameSpace().

const DataManager* ModelNameSpace::pDM
protected

Definition at line 40 of file modelns.h.

Referenced by EvalFunc(), FindFunc(), and GetFunc().

MathParser::MathFunc_t ModelNameSpace::sf_func
protected

Definition at line 56 of file modelns.h.

Referenced by FindFunc(), GetFunc(), and ModelNameSpace().

MathParser::MathFunc_t ModelNameSpace::unique_elem_func
protected

Definition at line 59 of file modelns.h.

Referenced by FindFunc(), GetFunc(), and ModelNameSpace().


The documentation for this class was generated from the following files: