| 8003 | |
| 8004 | |
| 8005 | int |
| 8006 | sensSectionForce(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) |
| 8007 | { |
| 8008 | #ifdef _RELIABILITY |
| 8009 | // make sure at least one other argument to contain type of system |
| 8010 | if (argc < 4) { |
| 8011 | opserr << "WARNING want - sensSectionForce eleTag? <secNum?> dof? paramTag?\n"; |
| 8012 | return TCL_ERROR; |
| 8013 | } |
| 8014 | |
| 8015 | //opserr << "sensSectionForce: "; |
| 8016 | //for (int i = 0; i < argc; i++) |
| 8017 | // opserr << argv[i] << ' ' ; |
| 8018 | //opserr << endln; |
| 8019 | |
| 8020 | int tag, dof, paramTag; |
| 8021 | int secNum = 0; |
| 8022 | |
| 8023 | if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) { |
| 8024 | opserr << "WARNING sensSectionForce eleTag? secNum? dof? paramTag?- could not read eleTag? \n"; |
| 8025 | return TCL_ERROR; |
| 8026 | } |
| 8027 | |
| 8028 | // Make this work for zeroLengthSection too |
| 8029 | int currentArg = 2; |
| 8030 | if (argc > 4) { |
| 8031 | if (Tcl_GetInt(interp, argv[currentArg++], &secNum) != TCL_OK) { |
| 8032 | opserr << "WARNING sensSectionForce eleTag? secNum? dof? paramTag?- could not read secNum? \n"; |
| 8033 | return TCL_ERROR; |
| 8034 | } |
| 8035 | } |
| 8036 | if (Tcl_GetInt(interp, argv[currentArg++], &dof) != TCL_OK) { |
| 8037 | opserr << "WARNING sensSectionForce eleTag? secNum? dof? paramTag?- could not read dof? \n"; |
| 8038 | return TCL_ERROR; |
| 8039 | } |
| 8040 | if (Tcl_GetInt(interp, argv[currentArg++], ¶mTag) != TCL_OK) { |
| 8041 | opserr << "WARNING sensSectionForce eleTag? secNum? dof? paramTag?- could not read paramTag? \n"; |
| 8042 | return TCL_ERROR; |
| 8043 | } |
| 8044 | |
| 8045 | ParameterIter &pIter = theDomain.getParameters(); |
| 8046 | Parameter *theParam; |
| 8047 | while ((theParam = pIter()) != 0) |
| 8048 | theParam->activate(false); |
| 8049 | |
| 8050 | theParam = theDomain.getParameter(paramTag); |
| 8051 | int gradIndex = theParam->getGradIndex(); |
| 8052 | theParam->activate(true); |
| 8053 | |
| 8054 | Element *theElement = theDomain.getElement(tag); |
| 8055 | if (theElement == 0) { |
| 8056 | opserr << "WARNING sensSectionForce element with tag " << tag << " not found in domain \n"; |
| 8057 | return TCL_ERROR; |
| 8058 | } |
| 8059 | |
| 8060 | char a[80] = "section"; |
| 8061 | char b[80]; |
| 8062 | sprintf(b, "%d", secNum); |
nothing calls this directly
no test coverage detected