MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / sectionForce

Function sectionForce

SRC/tcl/commands.cpp:8101–8178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8099}
8100
8101int
8102sectionForce(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv)
8103{
8104 // make sure at least one other argument to contain type of system
8105 if (argc < 3) {
8106 opserr << "WARNING want - sectionForce eleTag? <secNum?> dof? \n";
8107 return TCL_ERROR;
8108 }
8109
8110 //opserr << "sectionForce: ";
8111 //for (int i = 0; i < argc; i++)
8112 // opserr << argv[i] << ' ' ;
8113 //opserr << endln;
8114
8115 int tag, dof;
8116 int secNum = 0;
8117
8118 if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) {
8119 opserr << "WARNING sectionForce eleTag? secNum? dof? - could not read eleTag? \n";
8120 return TCL_ERROR;
8121 }
8122
8123 // Make this work for zeroLengthSection too
8124 int currentArg = 2;
8125 if (argc > 3) {
8126 if (Tcl_GetInt(interp, argv[currentArg++], &secNum) != TCL_OK) {
8127 opserr << "WARNING sectionForce eleTag? secNum? dof? - could not read secNum? \n";
8128 return TCL_ERROR;
8129 }
8130 }
8131 if (Tcl_GetInt(interp, argv[currentArg++], &dof) != TCL_OK) {
8132 opserr << "WARNING sectionForce eleTag? secNum? dof? - could not read dof? \n";
8133 return TCL_ERROR;
8134 }
8135
8136 Element *theElement = theDomain.getElement(tag);
8137 if (theElement == 0) {
8138 opserr << "WARNING sectionForce element with tag " << tag << " not found in domain \n";
8139 return TCL_ERROR;
8140 }
8141
8142 int argcc = 3;
8143 char a[80] = "section";
8144 char b[80];
8145 sprintf(b, "%d", secNum);
8146 char c[80] = "force";
8147 const char *argvv[3];
8148 argvv[0] = a;
8149 argvv[1] = b;
8150 argvv[2] = c;
8151 if (argc < 4) { // For zeroLengthSection
8152 argcc = 2;
8153 argvv[1] = c;
8154 }
8155
8156 DummyStream dummy;
8157
8158 Response *theResponse = theElement->setResponse(argvv, argcc, dummy);

Callers

nothing calls this directly

Calls 3

getElementMethod · 0.45
setResponseMethod · 0.45
getResponseMethod · 0.45

Tested by

no test coverage detected