| 115 | // |
| 116 | |
| 117 | int |
| 118 | TclSectionTester_setSection(ClientData clientData, Tcl_Interp *interp, int argc, |
| 119 | TCL_Char **argv) |
| 120 | { |
| 121 | count = 1; |
| 122 | // ensure the destructor has not been called - |
| 123 | if (theTclBuilder == 0) { |
| 124 | opserr << "WARNING builder has been destroyed\n"; |
| 125 | return TCL_ERROR; |
| 126 | } |
| 127 | |
| 128 | // check number of arguments in command line |
| 129 | if (argc < 2) { |
| 130 | opserr << "WARNING bad command - want: sectionTest secID?\n"; |
| 131 | return TCL_ERROR; |
| 132 | } |
| 133 | |
| 134 | // get the matID form command line |
| 135 | int sectionID; |
| 136 | if (Tcl_GetInt(interp, argv[1], §ionID) != TCL_OK) { |
| 137 | opserr << "WARNING could not read sectionID: sectionTest sectionID?\n"; |
| 138 | return TCL_ERROR; |
| 139 | } |
| 140 | |
| 141 | // delete the old testing material |
| 142 | if (theTestingSection !=0) { |
| 143 | delete theTestingSection; |
| 144 | theTestingSection = 0; |
| 145 | } |
| 146 | |
| 147 | // get the material from the modelbuilder with sectionID |
| 148 | // and set the testing material to point to a copy of it |
| 149 | SectionForceDeformation *theOrigMaterial = theTclBuilder->getSection(sectionID); |
| 150 | if (theOrigMaterial == 0) { |
| 151 | opserr << "WARNING no material found with sectionID\n"; |
| 152 | return TCL_ERROR; |
| 153 | } else { |
| 154 | theTestingSection = theOrigMaterial->getCopy(); |
| 155 | } |
| 156 | |
| 157 | return TCL_OK; |
| 158 | } |
| 159 | |
| 160 | |
| 161 | int |
nothing calls this directly
no test coverage detected