| 191 | } |
| 192 | |
| 193 | int |
| 194 | sensNodePressure(ClientData clientData, Tcl_Interp *interp, int argc, |
| 195 | TCL_Char ** const argv) |
| 196 | { |
| 197 | assert(clientData != nullptr); |
| 198 | Domain *theDomain = (Domain *)clientData; |
| 199 | |
| 200 | // make sure at least one other argument to contain type of system |
| 201 | if (argc < 3) { |
| 202 | opserr << OpenSees::PromptValueError << "want - sensNodePressure nodeTag? paramTag?\n"; |
| 203 | return TCL_ERROR; |
| 204 | } |
| 205 | |
| 206 | int tag, paramTag; |
| 207 | |
| 208 | if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) { |
| 209 | opserr << OpenSees::PromptValueError << "sensNodePressure nodeTag? paramTag?- could not read " |
| 210 | "nodeTag? "; |
| 211 | return TCL_ERROR; |
| 212 | } |
| 213 | if (Tcl_GetInt(interp, argv[2], ¶mTag) != TCL_OK) { |
| 214 | opserr << OpenSees::PromptValueError << "sensNodePressure paramTag? paramTag?- could not read " |
| 215 | "paramTag? "; |
| 216 | return TCL_ERROR; |
| 217 | } |
| 218 | |
| 219 | double dp = 0.0; |
| 220 | Pressure_Constraint *thePC = theDomain->getPressure_Constraint(tag); |
| 221 | if (thePC != nullptr) { |
| 222 | // int ptag = thePC->getPressureNode(); |
| 223 | // Node* pNode = theDomain->getNode(ptag); |
| 224 | Node *pNode = thePC->getPressureNode(); |
| 225 | if (pNode != nullptr) { |
| 226 | |
| 227 | Parameter *theParam = theDomain->getParameter(paramTag); |
| 228 | if (theParam == nullptr) { |
| 229 | opserr << "sensNodePressure: parameter " << paramTag << " not found" |
| 230 | << "\n"; |
| 231 | return TCL_ERROR; |
| 232 | } |
| 233 | |
| 234 | int gradIndex = theParam->getGradIndex(); |
| 235 | dp = pNode->getVelSensitivity(1, gradIndex); |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | Tcl_SetObjResult(interp, Tcl_NewDoubleObj(dp)); |
| 240 | |
| 241 | return TCL_OK; |
| 242 | } |
| 243 | |
| 244 | int |
| 245 | sensSectionForce(ClientData clientData, Tcl_Interp *interp, int argc, |
nothing calls this directly
no test coverage detected