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

Function sensSectionForce

SRC/tcl/commands.cpp:8005–8099  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8003
8004
8005int
8006sensSectionForce(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++], &paramTag) != 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);

Callers

nothing calls this directly

Calls 7

getParametersMethod · 0.80
activateMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45
getElementMethod · 0.45
setResponseMethod · 0.45

Tested by

no test coverage detected