| 1714 | } |
| 1715 | |
| 1716 | int |
| 1717 | getLoadFactor(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char **argv) |
| 1718 | { |
| 1719 | if (argc < 2) { |
| 1720 | opserr << "WARNING no load pattern supplied -- getLoadFactor\n"; |
| 1721 | return TCL_ERROR; |
| 1722 | } |
| 1723 | |
| 1724 | int pattern; |
| 1725 | if (Tcl_GetInt(interp, argv[1], &pattern) != TCL_OK) { |
| 1726 | opserr << "ERROR reading load pattern tag -- getLoadFactor\n"; |
| 1727 | return TCL_ERROR; |
| 1728 | } |
| 1729 | |
| 1730 | LoadPattern *thePattern = theDomain.getLoadPattern(pattern); |
| 1731 | if (thePattern == 0) { |
| 1732 | opserr << "ERROR load pattern with tag " << pattern << " not found in domain -- getLoadFactor\n"; |
| 1733 | return TCL_ERROR; |
| 1734 | } |
| 1735 | |
| 1736 | double factor = thePattern->getLoadFactor(); |
| 1737 | |
| 1738 | // sprintf(interp->result,"%f",factor); |
| 1739 | |
| 1740 | char buffer [40]; |
| 1741 | sprintf(buffer,"%35.20f", factor); |
| 1742 | Tcl_SetResult(interp, buffer, TCL_VOLATILE); |
| 1743 | |
| 1744 | return TCL_OK; |
| 1745 | } |
| 1746 | |
| 1747 | ////////////////////////////////////////////////Abbas////////////////////////////// |
| 1748 |
nothing calls this directly
no test coverage detected