| 995 | } |
| 996 | |
| 997 | int |
| 998 | TclCommand_addNode(ClientData clientData, Tcl_Interp *interp, int argc, |
| 999 | TCL_Char **argv) |
| 1000 | { |
| 1001 | |
| 1002 | // ensure the destructor has not been called - |
| 1003 | if (theTclBuilder == 0) { |
| 1004 | opserr << "WARNING builder has been destroyed" << endln; |
| 1005 | return TCL_ERROR; |
| 1006 | } |
| 1007 | |
| 1008 | int ndm = theTclBuilder->getNDM(); |
| 1009 | int ndf = theTclBuilder->getNDF(); |
| 1010 | |
| 1011 | // make sure correct number of arguments on command line |
| 1012 | if (argc < 2+ndm) { |
| 1013 | opserr << "WARNING insufficient arguments\n"; |
| 1014 | printCommand(argc, argv); |
| 1015 | opserr << "Want: node nodeTag? [ndm coordinates?] <-mass [ndf values?]>\n"; |
| 1016 | return TCL_ERROR; |
| 1017 | } |
| 1018 | |
| 1019 | Node *theNode = 0; |
| 1020 | |
| 1021 | // get the nodal id |
| 1022 | int nodeId; |
| 1023 | if (Tcl_GetInt(interp, argv[1], &nodeId) != TCL_OK) { |
| 1024 | opserr << "WARNING invalid nodeTag\n"; |
| 1025 | opserr << "Want: node nodeTag? [ndm coordinates?] <-mass [ndf values?]>\n"; |
| 1026 | return TCL_ERROR; |
| 1027 | } |
| 1028 | |
| 1029 | // read in the coordinates and create the node |
| 1030 | double xLoc, yLoc, zLoc; |
| 1031 | if (ndm == 1) { |
| 1032 | // create a node in 1d space |
| 1033 | if (Tcl_GetDouble(interp, argv[2], &xLoc) != TCL_OK) { |
| 1034 | opserr << "WARNING invalid XCoordinate\n"; |
| 1035 | opserr << "node: " << nodeId << endln; |
| 1036 | return TCL_ERROR; |
| 1037 | } |
| 1038 | // theNode = new Node(nodeId,ndf,xLoc); |
| 1039 | } |
| 1040 | |
| 1041 | else if (ndm == 2) { |
| 1042 | // create a node in 2d space |
| 1043 | if (Tcl_GetDouble(interp, argv[2], &xLoc) != TCL_OK) { |
| 1044 | opserr << "WARNING invalid XCoordinate\n"; |
| 1045 | opserr << "node: " << nodeId << endln; |
| 1046 | return TCL_ERROR; |
| 1047 | } |
| 1048 | if (Tcl_GetDouble(interp, argv[3], &yLoc) != TCL_OK) { |
| 1049 | opserr << "WARNING invalid YCoordinate\n"; |
| 1050 | opserr << "node: " << nodeId << endln; |
| 1051 | return TCL_ERROR; |
| 1052 | } |
| 1053 | // theNode = new Node(nodeId,ndf,xLoc,yLoc); |
| 1054 | } |
nothing calls this directly
no test coverage detected