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

Function OPS_getNDFF

SRC/interpreter/OpenSeesOutputCommands.cpp:2051–2091  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2049}
2050
2051int 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
2093int OPS_classType()
2094{

Callers 1

Py_ops_getNDFFFunction · 0.85

Calls 7

OPS_GetIntInputFunction · 0.70
OPS_GetDomainFunction · 0.70
OPS_GetNDFFunction · 0.70
OPS_SetIntOutputFunction · 0.70
getNodeMethod · 0.45
getNumberDOFMethod · 0.45

Tested by

no test coverage detected