| 8292 | } |
| 8293 | |
| 8294 | int |
| 8295 | sectionStiffness(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) |
| 8296 | { |
| 8297 | // make sure at least one other argument to contain type of system |
| 8298 | if (argc < 3) { |
| 8299 | opserr << "WARNING want - sectionStiffness eleTag? secNum? \n"; |
| 8300 | return TCL_ERROR; |
| 8301 | } |
| 8302 | |
| 8303 | //opserr << "sectionDeformation: "; |
| 8304 | //for (int i = 0; i < argc; i++) |
| 8305 | // opserr << argv[i] << ' ' ; |
| 8306 | //opserr << endln; |
| 8307 | |
| 8308 | int tag, secNum; |
| 8309 | |
| 8310 | if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) { |
| 8311 | opserr << "WARNING sectionStiffness eleTag? secNum? - could not read eleTag? \n"; |
| 8312 | return TCL_ERROR; |
| 8313 | } |
| 8314 | if (Tcl_GetInt(interp, argv[2], &secNum) != TCL_OK) { |
| 8315 | opserr << "WARNING sectionStiffness eleTag? secNum? - could not read secNum? \n"; |
| 8316 | return TCL_ERROR; |
| 8317 | } |
| 8318 | |
| 8319 | Element *theElement = theDomain.getElement(tag); |
| 8320 | if (theElement == 0) { |
| 8321 | opserr << "WARNING sectionStiffness element with tag " << tag << " not found in domain \n"; |
| 8322 | return TCL_ERROR; |
| 8323 | } |
| 8324 | |
| 8325 | int argcc = 3; |
| 8326 | char a[80] = "section"; |
| 8327 | char b[80]; |
| 8328 | sprintf(b, "%d", secNum); |
| 8329 | char c[80] = "stiffness"; |
| 8330 | const char *argvv[3]; |
| 8331 | argvv[0] = a; |
| 8332 | argvv[1] = b; |
| 8333 | argvv[2] = c; |
| 8334 | |
| 8335 | DummyStream dummy; |
| 8336 | |
| 8337 | Response *theResponse = theElement->setResponse(argvv, argcc, dummy); |
| 8338 | if (theResponse == 0) { |
| 8339 | char buffer [] = "0.0"; |
| 8340 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 8341 | return TCL_OK; |
| 8342 | } |
| 8343 | |
| 8344 | theResponse->getResponse(); |
| 8345 | Information &info = theResponse->getInformation(); |
| 8346 | |
| 8347 | const Matrix &theMat = *(info.theMatrix); |
| 8348 | int nsdof = theMat.noCols(); |
| 8349 | |
| 8350 | char buffer[200]; |
| 8351 | for (int i = 0; i < nsdof; i++) { |
nothing calls this directly
no test coverage detected