| 2049 | } |
| 2050 | |
| 2051 | int OPS_getNDFF() |
| 2052 | { |
| 2053 | |
| 2054 | int ndf; |
| 2055 | int numdata = 1; |
| 2056 | |
| 2057 | if (OPS_GetNumRemainingInputArgs() > 0) { |
| 2058 | |
| 2059 | int tag; |
| 2060 | |
| 2061 | if (OPS_GetIntInput(&numdata, &tag) < 0) { |
| 2062 | opserr << "WARNING getNDF nodeTag? \n"; |
| 2063 | return -1; |
| 2064 | } |
| 2065 | |
| 2066 | Domain* theDomain = OPS_GetDomain(); |
| 2067 | if (theDomain == 0) return -1; |
| 2068 | Node *theNode = theDomain->getNode(tag); |
| 2069 | |
| 2070 | if (theNode == 0) { |
| 2071 | opserr << "WARNING node "<< tag <<" does not exist\n"; |
| 2072 | return -1; |
| 2073 | } |
| 2074 | |
| 2075 | ndf = theNode->getNumberDOF(); |
| 2076 | |
| 2077 | } else { |
| 2078 | |
| 2079 | ndf = OPS_GetNDF(); |
| 2080 | |
| 2081 | } |
| 2082 | |
| 2083 | int size = 1; |
| 2084 | |
| 2085 | if (OPS_SetIntOutput(&size, &ndf, false) < 0) { |
| 2086 | opserr << "WARNING failed to set output\n"; |
| 2087 | return -1; |
| 2088 | } |
| 2089 | |
| 2090 | return 0; |
| 2091 | } |
| 2092 | |
| 2093 | int OPS_classType() |
| 2094 | { |
no test coverage detected