| 1935 | |
| 1936 | |
| 1937 | int |
| 1938 | TclCommand_addElementalLoad(ClientData clientData, Tcl_Interp *interp, int argc, |
| 1939 | TCL_Char **argv) |
| 1940 | { |
| 1941 | // ensure the destructor has not been called - |
| 1942 | if (theTclBuilder == 0) { |
| 1943 | opserr << "WARNING current builder has been destroyed - eleLoad\n"; |
| 1944 | return TCL_ERROR; |
| 1945 | } |
| 1946 | |
| 1947 | if (theTclLoadPattern == 0) { |
| 1948 | opserr << "WARNING no active load pattern - eleLoad\n"; |
| 1949 | return TCL_ERROR; |
| 1950 | } |
| 1951 | |
| 1952 | int ndm = theTclBuilder->getNDM(); |
| 1953 | ElementalLoad *theLoad = 0; |
| 1954 | |
| 1955 | ID theEleTags(0,16); |
| 1956 | |
| 1957 | // we first create an ID containing the ele tags of all elements |
| 1958 | // for which the load applies. |
| 1959 | int count = 1; |
| 1960 | int doneEle = 0; |
| 1961 | int eleCount = 0; |
| 1962 | while (doneEle == 0 && count < argc) { |
| 1963 | if (strcmp(argv[count],"-ele") == 0) { |
| 1964 | count ++; |
| 1965 | int eleStart = count; |
| 1966 | int eleEnd = 0; |
| 1967 | int eleID; |
| 1968 | while (count < argc && eleEnd == 0) { |
| 1969 | if (Tcl_GetInt(interp, argv[count], &eleID) != TCL_OK) |
| 1970 | eleEnd = count; |
| 1971 | else |
| 1972 | count++; |
| 1973 | } |
| 1974 | if (eleStart != eleEnd) { |
| 1975 | for (int i=eleStart; i<eleEnd; i++) { |
| 1976 | Tcl_GetInt(interp, argv[i], &eleID); |
| 1977 | theEleTags[eleCount++] = eleID; |
| 1978 | } |
| 1979 | } |
| 1980 | } |
| 1981 | else if (strcmp(argv[count],"-range") == 0) { |
| 1982 | count ++; |
| 1983 | int eleStart, eleEnd; |
| 1984 | if (Tcl_GetInt(interp, argv[count], &eleStart) != TCL_OK) { |
| 1985 | opserr << "WARNING eleLoad -range invalid eleStart " << argv[count] << "\n"; |
| 1986 | return TCL_ERROR; |
| 1987 | } |
| 1988 | count++; |
| 1989 | if (Tcl_GetInt(interp, argv[count], &eleEnd) != TCL_OK) { |
| 1990 | opserr << "WARNING eleLoad -range invalid eleEnd " << argv[count] << "\n"; |
| 1991 | return TCL_ERROR; |
| 1992 | } |
| 1993 | count++; |
| 1994 | for (int i=eleStart; i<=eleEnd; i++) |
nothing calls this directly
no test coverage detected