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

Function OPS_sensNodePressure

SRC/interpreter/OpenSeesOutputCommands.cpp:3596–3640  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3594}
3595
3596int OPS_sensNodePressure()
3597{
3598 // make sure at least one other argument to contain type of system
3599 if (OPS_GetNumRemainingInputArgs() < 2) {
3600 opserr << "WARNING want - sensNodePressure nodeTag? paramTag?\n";
3601 return -1;
3602 }
3603
3604 int data[2];
3605 int numdata = 2;
3606 if (OPS_GetIntInput(&numdata, &data[0]) < 0) {
3607 opserr << "WARNING: failed to get tag or paramTag\n";
3608 return -1;
3609 }
3610
3611 Domain* domain = OPS_GetDomain();
3612 if (domain == 0) return 0;
3613
3614 double dp = 0.0;
3615 Pressure_Constraint* thePC = domain->getPressure_Constraint(data[0]);
3616 if(thePC != 0) {
3617 // int ptag = thePC->getPressureNode();
3618 // Node* pNode = theDomain.getNode(ptag);
3619 Node* pNode = thePC->getPressureNode();
3620 if(pNode != 0) {
3621
3622 Parameter *theParam = domain->getParameter(data[1]);
3623 if (theParam == 0) {
3624 opserr << "sensNodePressure: parameter " << data[1] << " not found" << endln;
3625 return -1;
3626 }
3627
3628 int gradIndex = theParam->getGradIndex();
3629 dp = pNode->getVelSensitivity(1,gradIndex);
3630 }
3631 }
3632
3633 numdata = 1;
3634 if (OPS_SetDoubleOutput(&numdata, &dp, true) < 0) {
3635 opserr<<"WARNING failed to set output\n";
3636 return -1;
3637 }
3638
3639 return 0;
3640}
3641
3642int OPS_getEleClassTags()
3643{

Callers 2

Tcl_ops_sensNodePressureFunction · 0.85
Py_ops_sensNodePressureFunction · 0.85

Calls 9

OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetDoubleOutputFunction · 0.70
getPressureNodeMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45
getVelSensitivityMethod · 0.45

Tested by

no test coverage detected