| 1194 | } |
| 1195 | |
| 1196 | Response* |
| 1197 | FiberSectionWarping3d::setResponse(const char **argv, int argc, OPS_Stream &output) |
| 1198 | { |
| 1199 | const ID &type = this->getType(); |
| 1200 | int typeSize = this->getOrder(); |
| 1201 | |
| 1202 | Response *theResponse = 0; |
| 1203 | |
| 1204 | static double yLocs[10000]; |
| 1205 | static double zLocs[10000]; |
| 1206 | static double fiberArea[10000]; |
| 1207 | static double omega[10000]; |
| 1208 | |
| 1209 | if (sectionIntegr != 0) { |
| 1210 | sectionIntegr->getFiberLocations(numFibers, yLocs, zLocs); |
| 1211 | sectionIntegr->getFiberWeights(numFibers, fiberArea); |
| 1212 | sectionIntegr->getFiberSectorials(numFibers, omega); |
| 1213 | } |
| 1214 | else { |
| 1215 | for (int i = 0; i < numFibers; i++) { |
| 1216 | yLocs[i] = matData[4*i]; |
| 1217 | zLocs[i] = matData[4*i+1]; |
| 1218 | fiberArea[i] = matData[4*i+2]; |
| 1219 | omega[i] = matData[4*i+3]; |
| 1220 | } |
| 1221 | } |
| 1222 | |
| 1223 | if (argc > 2 && strcmp(argv[0],"fiber") == 0) { |
| 1224 | |
| 1225 | int key = numFibers; |
| 1226 | int passarg = 2; |
| 1227 | |
| 1228 | if (argc <= 3) { // fiber number was input directly |
| 1229 | |
| 1230 | key = atoi(argv[1]); |
| 1231 | |
| 1232 | } else if (argc > 4) { // find fiber closest to coord. with mat tag |
| 1233 | int matTag = atoi(argv[3]); |
| 1234 | double yCoord = atof(argv[1]); |
| 1235 | double zCoord = atof(argv[2]); |
| 1236 | double closestDist = 0.0; |
| 1237 | double ySearch, zSearch, dy, dz; |
| 1238 | double distance; |
| 1239 | int j; |
| 1240 | |
| 1241 | // Find first fiber with specified material tag |
| 1242 | for (j = 0; j < numFibers; j++) { |
| 1243 | if (matTag == theMaterials[j]->getTag()) { |
| 1244 | ySearch = -matData[4*j]; |
| 1245 | zSearch = matData[4*j+1]; |
| 1246 | dy = ySearch-yCoord; |
| 1247 | dz = zSearch-zCoord; |
| 1248 | closestDist = sqrt(dy*dy + dz*dz); |
| 1249 | key = j; |
| 1250 | break; |
| 1251 | } |
| 1252 | } |
| 1253 |
nothing calls this directly
no test coverage detected