| 2243 | } |
| 2244 | |
| 2245 | int 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 | |
| 2290 | int OPS_nodeMass() { |
| 2291 | if (OPS_GetNumRemainingInputArgs() < 1) { |
no test coverage detected