| 7905 | } |
| 7906 | |
| 7907 | int |
| 7908 | sensNodeAccel(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) |
| 7909 | { |
| 7910 | |
| 7911 | // make sure at least one other argument to contain type of system |
| 7912 | if (argc < 4) { |
| 7913 | opserr << "WARNING want - sensNodeAccel nodeTag? dof? paramTag?\n"; |
| 7914 | return TCL_ERROR; |
| 7915 | } |
| 7916 | |
| 7917 | int tag, dof, paramTag; |
| 7918 | |
| 7919 | if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) { |
| 7920 | opserr << "WARNING sensNodeAccel nodeTag? dof? paramTag? - could not read nodeTag? \n"; |
| 7921 | return TCL_ERROR; |
| 7922 | } |
| 7923 | if (Tcl_GetInt(interp, argv[2], &dof) != TCL_OK) { |
| 7924 | opserr << "WARNING sensNodeAccel nodeTag? dof? paramTag? - could not read dof? \n"; |
| 7925 | return TCL_ERROR; |
| 7926 | } |
| 7927 | if (Tcl_GetInt(interp, argv[3], ¶mTag) != TCL_OK) { |
| 7928 | opserr << "WARNING sendNodeAccel nodeTag? dof? paramTag? - could not read paramTag? \n"; |
| 7929 | return TCL_ERROR; |
| 7930 | } |
| 7931 | |
| 7932 | Node *theNode = theDomain.getNode(tag); |
| 7933 | if (theNode == 0) { |
| 7934 | opserr << "sensNodeAccel: node " << tag << " not found" << endln; |
| 7935 | return TCL_ERROR; |
| 7936 | } |
| 7937 | |
| 7938 | Parameter *theParam = theDomain.getParameter(paramTag); |
| 7939 | if (theParam == 0) { |
| 7940 | opserr << "sensNodeAccel: parameter " << paramTag << " not found" << endln; |
| 7941 | return TCL_ERROR; |
| 7942 | } |
| 7943 | |
| 7944 | int gradIndex = theParam->getGradIndex(); |
| 7945 | |
| 7946 | double value = theNode->getAccSensitivity(dof,gradIndex); |
| 7947 | |
| 7948 | char buffer[40]; |
| 7949 | sprintf(buffer,"%35.20f",value); |
| 7950 | |
| 7951 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 7952 | |
| 7953 | return TCL_OK; |
| 7954 | } |
| 7955 | |
| 7956 | int |
| 7957 | sensNodePressure(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) |
nothing calls this directly
no test coverage detected