add patch to fiber section
| 926 | // add patch to fiber section |
| 927 | // |
| 928 | int |
| 929 | TclCommand_addPatch(ClientData clientData, |
| 930 | Tcl_Interp *interp, |
| 931 | int argc, |
| 932 | TCL_Char ** const argv) |
| 933 | { |
| 934 | assert(clientData != nullptr); |
| 935 | BasicModelBuilder* builder = static_cast<BasicModelBuilder*>(clientData); |
| 936 | |
| 937 | SectionBuilder* fiberSectionRepr = findSectionBuilder(builder, interp, argc, argv); |
| 938 | if (fiberSectionRepr == nullptr) { |
| 939 | opserr << OpenSees::PromptValueError << "cannot retrieve section\n"; |
| 940 | return TCL_ERROR; |
| 941 | } |
| 942 | |
| 943 | |
| 944 | // make sure at least one other argument to contain patch type |
| 945 | if (argc < 2) { |
| 946 | opserr << OpenSees::PromptValueError << "need to specify a patch type \n"; |
| 947 | return TCL_ERROR; |
| 948 | } |
| 949 | |
| 950 | // check argv[1] for type of patch and create the object |
| 951 | if (strcmp(argv[1], "quad") == 0 || strcmp(argv[1], "quadr") == 0) { |
| 952 | int numSubdivIJ, numSubdivJK, matTag; |
| 953 | double vertexCoordY, vertexCoordZ; |
| 954 | MatrixND<4,2> vertexCoords{}; |
| 955 | |
| 956 | if (argc < 13) { |
| 957 | opserr << OpenSees::PromptValueError << "invalid number of parameters: patch quad matTag " |
| 958 | "numSubdivIJ numSubdivJK yVertI zVertI yVertJ zVertJ yVertK " |
| 959 | "zVertK yVertL zVertL\n"; |
| 960 | return TCL_ERROR; |
| 961 | } |
| 962 | |
| 963 | int argi = 2; |
| 964 | |
| 965 | if (Tcl_GetInt(interp, argv[argi++], &matTag) != TCL_OK) { |
| 966 | opserr << OpenSees::PromptValueError << "invalid matTag: patch quad matTag numSubdivIJ " |
| 967 | "numSubdivJK yVertI zVertI yVertJ zVertJ yVertK zVertK yVertL " |
| 968 | "zVertL\n"; |
| 969 | return TCL_ERROR; |
| 970 | } |
| 971 | |
| 972 | if (Tcl_GetInt(interp, argv[argi++], &numSubdivIJ) != TCL_OK) { |
| 973 | opserr << OpenSees::PromptValueError << "invalid numSubdivIJ: patch quad matTag numSubdivIJ " |
| 974 | "numSubdivJK yVertI zVertI yVertJ zVertJ yVertK zVertK yVertL " |
| 975 | "zVertL\n"; |
| 976 | return TCL_ERROR; |
| 977 | } |
| 978 | |
| 979 | if (Tcl_GetInt(interp, argv[argi++], &numSubdivJK) != TCL_OK) { |
| 980 | opserr << OpenSees::PromptValueError << "invalid numSubdivJK: patch quad matTag numSubdivIJ " |
| 981 | "numSubdivJK yVertI zVertI yVertJ zVertJ yVertK zVertK yVertL " |
| 982 | "zVertL\n"; |
| 983 | return TCL_ERROR; |
| 984 | } |
| 985 |
nothing calls this directly
no test coverage detected