to create a coordinate transformation
| 44 | // to create a coordinate transformation |
| 45 | // |
| 46 | int |
| 47 | TclCommand_addDamping(ClientData clientData, Tcl_Interp *interp, |
| 48 | int argc, TCL_Char **argv, |
| 49 | Domain *theDomain, |
| 50 | TclModelBuilder *theBuilder) |
| 51 | |
| 52 | { |
| 53 | // Make sure there is a minimum number of arguments |
| 54 | if (argc < 2) { |
| 55 | opserr << "WARNING insufficient number of damping arguments\n"; |
| 56 | opserr << "Want: damping type? tag? <specific transf args>" << endln; |
| 57 | return TCL_ERROR; |
| 58 | } |
| 59 | |
| 60 | theTclModelBuilderDomain = theDomain; |
| 61 | theTclModelBuilder = theBuilder; |
| 62 | |
| 63 | int dampingTag; |
| 64 | |
| 65 | if (argc < 3) { |
| 66 | opserr << "WARNING insufficient arguments - want: damping type? tag? <specific damping args>\n"; |
| 67 | return TCL_ERROR; |
| 68 | } |
| 69 | |
| 70 | if (Tcl_GetInt(interp, argv[2], &dampingTag) != TCL_OK) { |
| 71 | opserr << "WARNING invalid tag - want: damping type? tag? <specific damping args>\n"; |
| 72 | return TCL_ERROR; |
| 73 | } |
| 74 | |
| 75 | // construct the transformation object |
| 76 | |
| 77 | Damping *Damping = 0; |
| 78 | |
| 79 | if (strcmp(argv[1],"Uniform") == 0) |
| 80 | { |
| 81 | double zeta, freq1, freq2; |
| 82 | double ta = 0.0, td = 1e20; |
| 83 | TimeSeries *facSeries = 0; |
| 84 | if (Tcl_GetDouble(interp, argv[3], &zeta) != TCL_OK) |
| 85 | { |
| 86 | opserr << "WARNING invalid damping ratio - want: damping Uniform tag zeta freq1 freq2\n"; |
| 87 | return TCL_ERROR; |
| 88 | } |
| 89 | if (Tcl_GetDouble(interp, argv[4], &freq1) != TCL_OK) |
| 90 | { |
| 91 | opserr << "WARNING invalid frequency range - want: damping Uniform tag zeta freq1 freq2\n"; |
| 92 | return TCL_ERROR; |
| 93 | } |
| 94 | if (Tcl_GetDouble(interp, argv[5], &freq2) != TCL_OK) |
| 95 | { |
| 96 | opserr << "WARNING invalid frequency range - want: damping Uniform tag zeta freq1 freq2\n"; |
| 97 | return TCL_ERROR; |
| 98 | } |
| 99 | int count = 6; |
| 100 | while (argc > count) |
| 101 | { |
| 102 | if ((strcmp(argv[count],"-activateTime") == 0) || (strcmp(argv[count],"-ActivateTime") == 0)) |
| 103 | { |
no test coverage detected