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

Function sensNodeDisp

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

Source from the content-addressed store, hash-verified

32
33
34int
35sensNodeDisp(ClientData clientData, Tcl_Interp *interp, int argc,
36 TCL_Char ** const argv)
37{
38 assert(clientData != nullptr);
39 Domain *theDomain = (Domain *)clientData;
40
41 // make sure at least one other argument to contain type of system
42 if (argc < 4) {
43 opserr << OpenSees::PromptValueError << "want - sensNodeDisp nodeTag? dof? paramTag?\n";
44 return TCL_ERROR;
45 }
46
47 int tag, dof, paramTag;
48
49 if (Tcl_GetInt(interp, argv[1], &tag) != TCL_OK) {
50 opserr
51 << OpenSees::PromptValueError << "nodeDisp nodeTag? dof? paramTag?- could not read nodeTag? ";
52 return TCL_ERROR;
53 }
54 if (Tcl_GetInt(interp, argv[2], &dof) != TCL_OK) {
55 opserr << OpenSees::PromptValueError << "nodeDisp nodeTag? dof? paramTag?- could not read dof? ";
56 return TCL_ERROR;
57 }
58 if (Tcl_GetInt(interp, argv[3], &paramTag) != TCL_OK) {
59 opserr << OpenSees::PromptValueError << "nodeDisp paramTag? dof? paramTag?- could not read "
60 "paramTag? ";
61 return TCL_ERROR;
62 }
63
64 //
65 //
66 Node *theNode = theDomain->getNode(tag);
67 if (theNode == nullptr) {
68 opserr << "sensNodeDisp: node " << tag << " not found" << "\n";
69 return TCL_ERROR;
70 }
71
72 Parameter *theParam = theDomain->getParameter(paramTag);
73 if (theParam == nullptr) {
74 opserr << "sensNodeDisp: parameter " << paramTag << " not found" << "\n";
75 return TCL_ERROR;
76 }
77
78 int gradIndex = theParam->getGradIndex();
79
80 double value = theNode->getDispSensitivity(dof, gradIndex);
81
82 Tcl_SetObjResult(interp, Tcl_NewDoubleObj(value));
83
84 return TCL_OK;
85}
86
87int
88sensNodeVel(ClientData clientData, Tcl_Interp *interp, int argc,

Callers

nothing calls this directly

Calls 4

getNodeMethod · 0.45
getParameterMethod · 0.45
getGradIndexMethod · 0.45
getDispSensitivityMethod · 0.45

Tested by

no test coverage detected