| 3187 | } |
| 3188 | |
| 3189 | int OPS_basicStiffness() |
| 3190 | { |
| 3191 | // make sure at least one other argument to contain type of system |
| 3192 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 3193 | opserr << "WARNING want - basicStiffness eleTag? \n"; |
| 3194 | return -1; |
| 3195 | } |
| 3196 | |
| 3197 | //opserr << "basicStiffness: "; |
| 3198 | //for (int i = 0; i < argc; i++) |
| 3199 | // opserr << argv[i] << ' ' ; |
| 3200 | //opserr << endln; |
| 3201 | |
| 3202 | int numdata = 1; |
| 3203 | int tag; |
| 3204 | |
| 3205 | if (OPS_GetIntInput(&numdata, &tag) < 0) { |
| 3206 | opserr << "WARNING basicStiffness eleTag? - could not read eleTag? \n"; |
| 3207 | return -1; |
| 3208 | } |
| 3209 | |
| 3210 | Domain* theDomain = OPS_GetDomain(); |
| 3211 | if (theDomain == 0) return -1; |
| 3212 | |
| 3213 | Element *theElement = theDomain->getElement(tag); |
| 3214 | if (theElement == 0) { |
| 3215 | opserr << "WARNING basicStiffness element with tag " << tag << " not found in domain \n"; |
| 3216 | return -1; |
| 3217 | } |
| 3218 | |
| 3219 | int argcc = 1; |
| 3220 | char a[80] = "basicStiffness"; |
| 3221 | const char *argvv[1]; |
| 3222 | argvv[0] = a; |
| 3223 | |
| 3224 | DummyStream dummy; |
| 3225 | |
| 3226 | Response *theResponse = theElement->setResponse(argvv, argcc, dummy); |
| 3227 | if (theResponse == 0) { |
| 3228 | return 0; |
| 3229 | } |
| 3230 | |
| 3231 | theResponse->getResponse(); |
| 3232 | Information &info = theResponse->getInformation(); |
| 3233 | |
| 3234 | // Matrix |
| 3235 | if (info.theMatrix != 0) { |
| 3236 | const Matrix &theMatrix = *(info.theMatrix); |
| 3237 | int nbf = theMatrix.noCols(); |
| 3238 | |
| 3239 | std::vector<double> values; |
| 3240 | int size = nbf*nbf; |
| 3241 | if (size == 0) { |
| 3242 | if (OPS_SetDoubleOutput(&size, 0, false) < 0) { |
| 3243 | opserr << "WARNING failed to set output\n"; |
| 3244 | delete theResponse; |
| 3245 | return -1; |
| 3246 | } |
no test coverage detected