| 742 | } |
| 743 | |
| 744 | int MembranePlateFiberSection::setParameter(const char** argv, int argc, Parameter& param) |
| 745 | { |
| 746 | // if the user explicitly wants to update a material in this section... |
| 747 | if (argc > 1) { |
| 748 | // case 1: fiber value (all fibers) |
| 749 | // case 2: fiber id value (one specific fiber) |
| 750 | if (strcmp(argv[0], "fiber") == 0 || strcmp(argv[0], "Fiber") == 0) { |
| 751 | // test case 2 (one specific fiber) ... |
| 752 | if (argc > 2) { |
| 753 | int pointNum = atoi(argv[1]); |
| 754 | if (pointNum > 0 && pointNum <= numFibers) { |
| 755 | return theFibers[pointNum - 1]->setParameter(&argv[2], argc - 2, param); |
| 756 | } |
| 757 | } |
| 758 | // ... otherwise case 1 (all fibers), if the argv[1] is not a valid id |
| 759 | int mixed_result = -1; |
| 760 | for (int i = 0; i < numFibers; ++i) { |
| 761 | if (theFibers[i]->setParameter(&argv[1], argc - 1, param) == 0) |
| 762 | mixed_result = 0; // if at least one fiber handles the param, make it successful |
| 763 | } |
| 764 | return mixed_result; |
| 765 | } |
| 766 | } |
| 767 | // if we are here, the first keyword is not "fiber", so we can check for parameters |
| 768 | // specific to this section (if any) or forward the request to all fibers. |
| 769 | if (argc > 0) { |
| 770 | // we don't have parameters for this section, so we directly forward it to all fibers. |
| 771 | // placeholder for future implementations: if we will have parameters for this class, check them here |
| 772 | // before forwarding to all fibers |
| 773 | int mixed_result = -1; |
| 774 | for (int i = 0; i < numFibers; ++i) { |
| 775 | if (theFibers[i]->setParameter(argv, argc, param) == 0) |
| 776 | mixed_result = 0; // if at least one fiber handles the param, make it successful |
| 777 | } |
| 778 | return mixed_result; |
| 779 | } |
| 780 | // fallback to base class implementation |
| 781 | return SectionForceDeformation::setParameter(argv, argc, param); |
| 782 | } |
| 783 | |
| 784 | int MembranePlateFiberSection::updateParameter(int parameterID, Information& info) |
| 785 | { |
nothing calls this directly
no test coverage detected