| 1681 | |
| 1682 | |
| 1683 | int |
| 1684 | TclCommand_addNodalLoad(ClientData clientData, Tcl_Interp *interp, int argc, |
| 1685 | TCL_Char **argv) |
| 1686 | { |
| 1687 | // ensure the destructor has not been called - |
| 1688 | if (theTclBuilder == 0) { |
| 1689 | opserr << "WARNING builder has been destroyed - load \n"; |
| 1690 | return TCL_ERROR; |
| 1691 | } |
| 1692 | |
| 1693 | // int ndf = theTclBuilder->getNDF(); |
| 1694 | |
| 1695 | int ndf = argc - 2; |
| 1696 | NodalLoad *theLoad = 0; |
| 1697 | |
| 1698 | bool isLoadConst = false; |
| 1699 | bool userSpecifiedPattern = false; |
| 1700 | int loadPatternTag = 0; |
| 1701 | //The above definition are moved forward for the use in both cases |
| 1702 | |
| 1703 | //-------------Adding Proc for NodalThermalAction, By Liming Jiang, [SIF] 2017 |
| 1704 | if ((strcmp(argv[2], "-NodalThermal") == 0) || (strcmp(argv[2], "-nodalThermal") == 0)) { |
| 1705 | |
| 1706 | int nodeId; |
| 1707 | if (Tcl_GetInt(interp, argv[1], &nodeId) != TCL_OK) { |
| 1708 | opserr << "WARNING invalid nodeId: " << argv[1] << endln; |
| 1709 | return TCL_ERROR; |
| 1710 | } |
| 1711 | |
| 1712 | Vector* thecrds = new Vector(); |
| 1713 | Node* theNode = theTclDomain->getNode(nodeId); |
| 1714 | if (theNode == 0) { |
| 1715 | opserr << "WARNING invalid nodeID: " << argv[1] << endln; |
| 1716 | return TCL_ERROR; |
| 1717 | } |
| 1718 | (*thecrds) = theNode->getCrds(); |
| 1719 | |
| 1720 | int count = 3; |
| 1721 | if (strcmp(argv[count], "-source") == 0) { |
| 1722 | count++; |
| 1723 | const char *pwd = getInterpPWD(interp); |
| 1724 | simulationInfo.addInputFile(argv[count], pwd); |
| 1725 | TimeSeries* theSeries; |
| 1726 | |
| 1727 | int dataLen = 9;//default num of temperature input for nodal ThermalAction; |
| 1728 | |
| 1729 | if (argc - count == 5) { |
| 1730 | //which indicates the nodal thermal action is applied to 3D I section Beam; |
| 1731 | dataLen = 15; |
| 1732 | theSeries = new PathTimeSeriesThermal(nodeId, argv[count], dataLen); |
| 1733 | count++; |
| 1734 | double RcvLoc1, RcvLoc2, RcvLoc3, RcvLoc4; |
| 1735 | if (Tcl_GetDouble(interp, argv[count], &RcvLoc1) != TCL_OK) { |
| 1736 | opserr << "WARNING NodalLoad - invalid loc1 " << argv[count] << " for NodalThermalAction\n"; |
| 1737 | return TCL_ERROR; |
| 1738 | } |
| 1739 | if (Tcl_GetDouble(interp, argv[count + 1], &RcvLoc2) != TCL_OK) { |
| 1740 | opserr << "WARNING NodalLoad - invalid loc2 " << argv[count + 1] << " for NodalThermalAction\n"; |
nothing calls this directly
no test coverage detected