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

Function OPS_sensNodeAccel

SRC/interpreter/OpenSeesOutputCommands.cpp:3415–3457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3413}
3414
3415int OPS_sensNodeAccel()
3416{
3417 // make sure at least one other argument to contain type of system
3418 if (OPS_GetNumRemainingInputArgs() < 3) {
3419 opserr << "WARNING want - sensNodeAccel nodeTag? dof? paramTag?\n";
3420 return -1;
3421 }
3422
3423 int data[3];
3424 int numdata = 3;
3425 if (OPS_GetIntInput(&numdata, &data[0]) < 0) {
3426 opserr << "WARNING: failed to get tag, dof or paramTag\n";
3427 return -1;
3428 }
3429
3430 Domain* domain = OPS_GetDomain();
3431 if (domain == 0) return 0;
3432
3433
3434 Node *theNode = domain->getNode(data[0]);
3435 if (theNode == 0) {
3436 opserr << "sensNodeAccel: node " << data[0] << " not found" << "\n";
3437 return -1;
3438 }
3439
3440 Parameter *theParam = domain->getParameter(data[2]);
3441 if (theParam == 0) {
3442 opserr << "sensNodeAccel: parameter " << data[2] << " not found" << "\n";
3443 return -1;
3444 }
3445
3446 int gradIndex = theParam->getGradIndex();
3447
3448 double value = theNode->getAccSensitivity(data[1],gradIndex);
3449
3450 numdata = 1;
3451 if (OPS_SetDoubleOutput(&numdata, &value, true) < 0) {
3452 opserr<<"WARNING failed to set output\n";
3453 return -1;
3454 }
3455
3456 return 0;
3457}
3458
3459int OPS_sensLambda()
3460{

Callers 2

Tcl_ops_sensNodeAccelFunction · 0.85
Py_ops_sensNodeAccelFunction · 0.85

Calls 8

OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
getNodeMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45
getAccSensitivityMethod · 0.45

Tested by

no test coverage detected