| 185 | } |
| 186 | |
| 187 | int |
| 188 | TclCommand_wipeModel(ClientData clientData, Tcl_Interp *interp, int argc, TCL_Char *argv[]) |
| 189 | { |
| 190 | Tcl_Eval(interp, "_clearAnalysis"); |
| 191 | |
| 192 | BasicModelBuilder *builder = static_cast<BasicModelBuilder*>(clientData); |
| 193 | |
| 194 | if (theDatabase != nullptr) |
| 195 | delete theDatabase; |
| 196 | |
| 197 | if (builder != nullptr) { |
| 198 | Domain* theDomain = builder->getDomain(); |
| 199 | theDomain->clearAll(); |
| 200 | ops_TheActiveDomain = nullptr; |
| 201 | delete theDomain; |
| 202 | delete builder; |
| 203 | builtModel = false; |
| 204 | } |
| 205 | Tcl_CreateCommand(interp, "model", &TclCommand_specifyModel, nullptr, nullptr); |
| 206 | Tcl_CreateCommand(interp, "wipe", &TclCommand_wipeModel, nullptr, nullptr); |
| 207 | |
| 208 | ops_Dt = 0.0; |
| 209 | |
| 210 | #ifdef _PARALLEL_PROCESSING |
| 211 | OPS_PARTITIONED = false; |
| 212 | #endif |
| 213 | |
| 214 | theDatabase = nullptr; |
| 215 | |
| 216 | // the domain deletes the record objects, |
| 217 | // just have to delete the private array |
| 218 | return TCL_OK; |
| 219 | } |
| 220 | |
| 221 | // command invoked to build the model, i.e. to invoke buildFE_Model() |
| 222 | // on the ModelBuilder |