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

Function sensNodePressure

SRC/runtime/commands/domain/sensitivity.cpp:193–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

191}
192
193int
194sensNodePressure(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], &paramTag) != 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
244int
245sensSectionForce(ClientData clientData, Tcl_Interp *interp, int argc,

Callers

nothing calls this directly

Calls 5

getPressureNodeMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45
getVelSensitivityMethod · 0.45

Tested by

no test coverage detected