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

Function OPS_sensLambda

SRC/interpreter/OpenSeesOutputCommands.cpp:3459–3498  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3457}
3458
3459int OPS_sensLambda()
3460{
3461 if (OPS_GetNumRemainingInputArgs() < 2) {
3462 opserr << "WARNING no load pattern supplied -- getLoadFactor\n";
3463 return -1;
3464 }
3465
3466 int data[2];
3467 int numdata = 2;
3468 if (OPS_GetIntInput(&numdata, &data[0]) < 0) {
3469 opserr << "WARNING: failed to read patternTag or paramTag\n";
3470 return -1;
3471 }
3472
3473 Domain* domain = OPS_GetDomain();
3474 if (domain == 0) return 0;
3475
3476 LoadPattern *thePattern = domain->getLoadPattern(data[0]);
3477 if (thePattern == 0) {
3478 opserr << "ERROR load pattern with tag " << data[0] << " not found in domain\n";
3479 return -1;
3480 }
3481
3482 Parameter *theParam = domain->getParameter(data[1]);
3483 if (theParam == 0) {
3484 opserr << "sensLambda: parameter " << data[1] << " not found" << "\n";
3485 return -1;
3486 }
3487
3488 int gradIndex = theParam->getGradIndex();
3489 double factor = thePattern->getLoadFactorSensitivity(gradIndex);
3490
3491 numdata = 1;
3492 if (OPS_SetDoubleOutput(&numdata, &factor, true) < 0) {
3493 opserr<<"WARNING failed to set output\n";
3494 return -1;
3495 }
3496
3497 return 0;
3498}
3499
3500int OPS_sensSectionForce()
3501{

Callers 2

Tcl_ops_sensLambdaFunction · 0.85
Py_ops_sensLambdaFunction · 0.85

Calls 8

OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
getLoadPatternMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45

Tested by

no test coverage detected