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

Function OPS_sensNodeVel

SRC/interpreter/OpenSeesOutputCommands.cpp:3371–3413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3369}
3370
3371int OPS_sensNodeVel()
3372{
3373 // make sure at least one other argument to contain type of system
3374 if (OPS_GetNumRemainingInputArgs() < 3) {
3375 opserr << "WARNING want - sensNodeVel nodeTag? dof? paramTag?\n";
3376 return -1;
3377 }
3378
3379 int data[3];
3380 int numdata = 3;
3381 if (OPS_GetIntInput(&numdata, &data[0]) < 0) {
3382 opserr << "WARNING: failed to get tag, dof or paramTag\n";
3383 return -1;
3384 }
3385
3386 Domain* domain = OPS_GetDomain();
3387 if (domain == 0) return 0;
3388
3389
3390 Node *theNode = domain->getNode(data[0]);
3391 if (theNode == 0) {
3392 opserr << "sensNodeVel: node " << data[0] << " not found" << "\n";
3393 return -1;
3394 }
3395
3396 Parameter *theParam = domain->getParameter(data[2]);
3397 if (theParam == 0) {
3398 opserr << "sensNodeVel: parameter " << data[2] << " not found" << "\n";
3399 return -1;
3400 }
3401
3402 int gradIndex = theParam->getGradIndex();
3403
3404 double value = theNode->getVelSensitivity(data[1],gradIndex);
3405
3406 numdata = 1;
3407 if (OPS_SetDoubleOutput(&numdata, &value, true) < 0) {
3408 opserr<<"WARNING failed to set output\n";
3409 return -1;
3410 }
3411
3412 return 0;
3413}
3414
3415int OPS_sensNodeAccel()
3416{

Callers 2

Tcl_ops_sensNodeVelFunction · 0.85
Py_ops_sensNodeVelFunction · 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
getVelSensitivityMethod · 0.45

Tested by

no test coverage detected