| 1277 | } |
| 1278 | |
| 1279 | int |
| 1280 | LoadPattern::saveLoadFactorSensitivity(double dlambdadh, int gradIndex, int numGrads) |
| 1281 | { |
| 1282 | |
| 1283 | //opserr << "LoadPattern::savedlamdh " << gradIndex << ' ' << numGrads << endln; |
| 1284 | if (dLambdadh == 0) { |
| 1285 | dLambdadh = new Vector(numGrads); |
| 1286 | } |
| 1287 | |
| 1288 | if (dLambdadh == 0 || dLambdadh->Size() != numGrads) { |
| 1289 | if (dLambdadh != 0) |
| 1290 | delete dLambdadh; |
| 1291 | dLambdadh = new Vector(numGrads); |
| 1292 | } |
| 1293 | |
| 1294 | if (gradIndex >= 0 && gradIndex < numGrads) { |
| 1295 | (*dLambdadh)(gradIndex) = dlambdadh; |
| 1296 | return 0; |
| 1297 | } |
| 1298 | else { |
| 1299 | opserr << "LoadPattern::saveLoadFactorSensitivity -- gradIndex out of bounds" << endln; |
| 1300 | return -1; |
| 1301 | } |
| 1302 | } |
| 1303 | |
| 1304 | double |
| 1305 | LoadPattern::getLoadFactorSensitivity(int gradIndex) |
no test coverage detected