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

Function OPS_nodeDOFs

SRC/interpreter/OpenSeesOutputCommands.cpp:2245–2288  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2243}
2244
2245int OPS_nodeDOFs()
2246{
2247 if (OPS_GetNumRemainingInputArgs() < 1) {
2248 opserr << "WARNING want - nodeDOFs nodeTag?\n";
2249 return -1;
2250 }
2251
2252 int tag;
2253 int numdata = 1;
2254
2255 if (OPS_GetIntInput(&numdata, &tag) < 0) {
2256 opserr << "WARNING nodeDOFs nodeTag?\n";
2257 return -1;
2258 }
2259
2260 Domain* theDomain = OPS_GetDomain();
2261 if (theDomain == 0) return -1;
2262
2263 Node *theNode = theDomain->getNode(tag);
2264 if (theNode == 0) {
2265 opserr << "WARNING nodeDOFs node " << tag << " not found" << endln;
2266 return -1;
2267 }
2268 int numDOF = theNode->getNumberDOF();
2269
2270 DOF_Group *theDOFgroup = theNode->getDOF_GroupPtr();
2271 if (theDOFgroup == 0) {
2272 opserr << "WARNING nodeDOFs DOF group null" << endln;
2273 return -1;
2274 }
2275 const ID &eqnNumbers = theDOFgroup->getID();
2276 int *data = new int[numDOF];
2277 for (int i = 0; i < numDOF; i++) {
2278 data[i] = eqnNumbers(i);
2279 }
2280 if (OPS_SetIntOutput(&numDOF, data, false) < 0) {
2281 opserr << "WARNING nodeDOFs failed to set outputs\n";
2282 delete [] data;
2283 return -1;
2284 }
2285 delete [] data;
2286
2287 return 0;
2288}
2289
2290int OPS_nodeMass() {
2291 if (OPS_GetNumRemainingInputArgs() < 1) {

Callers 2

Tcl_ops_nodeDOFsFunction · 0.85
Py_ops_nodeDOFsFunction · 0.85

Calls 8

getIDMethod · 0.80
OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_SetIntOutputFunction · 0.70
getNodeMethod · 0.45
getNumberDOFMethod · 0.45
getDOF_GroupPtrMethod · 0.45

Tested by

no test coverage detected