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

Method setResponse

SRC/material/section/FiberSectionWarping3d.cpp:1196–1398  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1194}
1195
1196Response*
1197FiberSectionWarping3d::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

Callers

nothing calls this directly

Calls 9

getOrderMethod · 0.95
getTypeMethod · 0.45
getFiberLocationsMethod · 0.45
getFiberWeightsMethod · 0.45
getFiberSectorialsMethod · 0.45
getTagMethod · 0.45
tagMethod · 0.45
attrMethod · 0.45
endTagMethod · 0.45

Tested by

no test coverage detected