| 959 | } |
| 960 | |
| 961 | Response* |
| 962 | SectionAggregator::setResponse(const char **argv, int argc, OPS_Stream &output) |
| 963 | { |
| 964 | |
| 965 | Response *theResponse =0; |
| 966 | |
| 967 | if (argc > 2 && (strcmp(argv[0],"addition") == 0 || strcmp(argv[0],"material") == 0)) { |
| 968 | |
| 969 | int sectionCode = SECTION_RESPONSE_NONE; |
| 970 | if (strcmp(argv[1],"Mz") == 0) |
| 971 | sectionCode = SECTION_RESPONSE_MZ; |
| 972 | if (strcmp(argv[1],"My") == 0) |
| 973 | sectionCode = SECTION_RESPONSE_MY; |
| 974 | if (strcmp(argv[1],"Vy") == 0) |
| 975 | sectionCode = SECTION_RESPONSE_VY; |
| 976 | if (strcmp(argv[1],"Vz") == 0) |
| 977 | sectionCode = SECTION_RESPONSE_VZ; |
| 978 | if (strcmp(argv[1],"P") == 0) |
| 979 | sectionCode = SECTION_RESPONSE_P; |
| 980 | if (strcmp(argv[1],"T") == 0) |
| 981 | sectionCode = SECTION_RESPONSE_T; |
| 982 | // Can add the warping and shell response too (would also need to |
| 983 | // add them in OPS_SectionAggregator) |
| 984 | |
| 985 | if (sectionCode != SECTION_RESPONSE_NONE) { |
| 986 | int sectionOrder = (theSection == 0) ? 0 : theSection->getOrder(); |
| 987 | for (int i = 0; i < numMats; i++) |
| 988 | if (sectionCode == (*theCode)(sectionOrder + i)) |
| 989 | return theAdditions[i]->setResponse(&argv[2], argc-2, output); |
| 990 | } |
| 991 | else { |
| 992 | // Get the tag of the material |
| 993 | int materialTag = atoi(argv[1]); |
| 994 | |
| 995 | // Loop to find the right material |
| 996 | int ok = 0; |
| 997 | for (int i = 0; i < numMats; i++) |
| 998 | if (materialTag == theAdditions[i]->getTag()) |
| 999 | return theAdditions[i]->setResponse(&argv[2], argc-2, output); |
| 1000 | } |
| 1001 | } |
| 1002 | |
| 1003 | // For backward compatibility |
| 1004 | if (argc > 1 && strcmp(argv[0],"section") == 0 && theSection != 0) |
| 1005 | theResponse = theSection->setResponse(&argv[1], argc-1, output); |
| 1006 | |
| 1007 | // Call default method |
| 1008 | if (theResponse == 0) |
| 1009 | theResponse = SectionForceDeformation::setResponse(argv, argc, output); |
| 1010 | |
| 1011 | // If that didn't work, pass along to section |
| 1012 | if (theResponse == 0 && theSection != 0) |
| 1013 | theResponse = theSection->setResponse(argv, argc, output); |
| 1014 | |
| 1015 | return theResponse; |
| 1016 | } |
| 1017 | |
| 1018 | int |