| 1491 | } |
| 1492 | |
| 1493 | int OPS_nodeResponse() |
| 1494 | { |
| 1495 | // make sure at least one other argument to contain type of system |
| 1496 | if (OPS_GetNumRemainingInputArgs() < 3) { |
| 1497 | opserr << "WARNING want - nodeResponse nodeTag? dof? responseID?\n"; |
| 1498 | return -1; |
| 1499 | } |
| 1500 | |
| 1501 | int data[3]; |
| 1502 | int numdata = 3; |
| 1503 | if (OPS_GetIntInput(&numdata, data) < 0) { |
| 1504 | opserr << "WARNING nodeResponse - could not read int inputs \n"; |
| 1505 | return -1; |
| 1506 | } |
| 1507 | |
| 1508 | int tag=data[0], dof=data[1], responseID=data[2]; |
| 1509 | |
| 1510 | dof--; |
| 1511 | |
| 1512 | Domain* theDomain = OPS_GetDomain(); |
| 1513 | if (theDomain == 0) return -1; |
| 1514 | |
| 1515 | const Vector *nodalResponse = theDomain->getNodeResponse(tag, (NodeResponseType)responseID); |
| 1516 | if (nodalResponse == 0 || nodalResponse->Size() < dof || dof < 0) { |
| 1517 | opserr << "WARNING errors in read response\n"; |
| 1518 | return -1; |
| 1519 | } |
| 1520 | |
| 1521 | double value = (*nodalResponse)(dof); |
| 1522 | numdata = 1; |
| 1523 | |
| 1524 | // now we copy the value to the tcl string that is returned |
| 1525 | if (OPS_SetDoubleOutput(&numdata, &value, true) < 0) { |
| 1526 | opserr << "WARNING failed to set output\n"; |
| 1527 | return -1; |
| 1528 | } |
| 1529 | |
| 1530 | return 0; |
| 1531 | } |
| 1532 | |
| 1533 | int OPS_nodeCoord() |
| 1534 | { |
no test coverage detected