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

Function OPS_sensSectionForce

SRC/interpreter/OpenSeesOutputCommands.cpp:3500–3594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3498}
3499
3500int OPS_sensSectionForce()
3501{
3502 if (OPS_GetNumRemainingInputArgs() < 3) {
3503 opserr << "WARNING want - sensSectionForce eleTag? <secNum?> dof? paramTag?\n";
3504 return -1;
3505 }
3506
3507 //opserr << "sensSectionForce: ";
3508 //for (int i = 0; i < argc; i++)
3509 // opserr << argv[i] << ' ' ;
3510 //opserr << endln;
3511
3512 int numdata = OPS_GetNumRemainingInputArgs();
3513 std::vector<int> data(numdata);
3514 if (OPS_GetIntInput(&numdata, &data[0]) < 0) {
3515 opserr << "WARNING: failed to read input data\n";
3516 return -1;
3517 }
3518
3519 int tag, dof, paramTag;
3520 int secNum = -1;
3521 if (numdata == 3) {
3522 tag = data[0];
3523 dof = data[1];
3524 paramTag = data[2];
3525 } else {
3526 tag = data[0];
3527 secNum = data[1];
3528 dof = data[2];
3529 paramTag = data[3];
3530 }
3531
3532 Domain* domain = OPS_GetDomain();
3533 if (domain == 0) return 0;
3534
3535 ParameterIter &pIter = domain->getParameters();
3536 Parameter *theParam;
3537 while ((theParam = pIter()) != 0) {
3538 theParam->activate(false);
3539 }
3540
3541 theParam = domain->getParameter(paramTag);
3542 int gradIndex = theParam->getGradIndex();
3543 theParam->activate(true);
3544
3545 Element *theElement = domain->getElement(tag);
3546 if (theElement == 0) {
3547 opserr << "WARNING sensSectionForce element with tag " << tag << " not found in domain \n";
3548 return -1;
3549 }
3550
3551 char a[80] = "section";
3552 char b[80];
3553 sprintf(b, "%d", secNum);
3554 char c[80] = "dsdh";
3555 const char *argvv[3];
3556 int argcc = 3;
3557 argvv[0] = a;

Callers 2

Tcl_ops_sensSectionForceFunction · 0.85
Py_ops_sensSectionForceFunction · 0.85

Calls 12

getParametersMethod · 0.80
OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
activateMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45
getElementMethod · 0.45
setResponseMethod · 0.45
SizeMethod · 0.45

Tested by

no test coverage detected