| 358 | } |
| 359 | |
| 360 | int LayeredShellFiberSectionThermal::setParameter(const char** argv, int argc, Parameter& param) |
| 361 | { |
| 362 | // if the user explicitly wants to update a material in this section... |
| 363 | if (argc > 1) { |
| 364 | // case 1: fiber value (all fibers) |
| 365 | // case 2: fiber id value (one specific fiber) |
| 366 | if (strcmp(argv[0], "fiber") == 0 || strcmp(argv[0], "Fiber") == 0) { |
| 367 | // test case 2 (one specific fiber) ... |
| 368 | if (argc > 2) { |
| 369 | int pointNum = atoi(argv[1]); |
| 370 | if (pointNum > 0 && pointNum <= nLayers) { |
| 371 | return theFibers[pointNum - 1]->setParameter(&argv[2], argc - 2, param); |
| 372 | } |
| 373 | } |
| 374 | // ... otherwise case 1 (all fibers), if the argv[1] is not a valid id |
| 375 | int mixed_result = -1; |
| 376 | for (int i = 0; i < nLayers; ++i) { |
| 377 | if (theFibers[i]->setParameter(&argv[1], argc - 1, param) == 0) |
| 378 | mixed_result = 0; // if at least one fiber handles the param, make it successful |
| 379 | } |
| 380 | return mixed_result; |
| 381 | } |
| 382 | } |
| 383 | // if we are here, the first keyword is not "fiber", so we can check for parameters |
| 384 | // specific to this section (if any) or forward the request to all fibers. |
| 385 | if (argc > 0) { |
| 386 | // we don't have parameters for this section, so we directly forward it to all fibers. |
| 387 | // placeholder for future implementations: if we will have parameters for this class, check them here |
| 388 | // before forwarding to all fibers |
| 389 | int mixed_result = -1; |
| 390 | for (int i = 0; i < nLayers; ++i) { |
| 391 | if (theFibers[i]->setParameter(argv, argc, param) == 0) |
| 392 | mixed_result = 0; // if at least one fiber handles the param, make it successful |
| 393 | } |
| 394 | return mixed_result; |
| 395 | } |
| 396 | // fallback to base class implementation |
| 397 | return SectionForceDeformation::setParameter(argv, argc, param); |
| 398 | } |
| 399 | |
| 400 | int LayeredShellFiberSectionThermal::updateParameter(int parameterID, Information& info) |
| 401 | { |
nothing calls this directly
no test coverage detected