| 486 | }; |
| 487 | |
| 488 | static SectionBuilder* |
| 489 | findSectionBuilder(BasicModelBuilder* builder, Tcl_Interp *interp, int argc, const char** const argv) |
| 490 | { |
| 491 | int tag; |
| 492 | bool section_passed = false; |
| 493 | for (int i = 0; i<argc; ++i) { |
| 494 | if (strcmp(argv[i], "-section") == 0) { |
| 495 | if (Tcl_GetInt(interp, argv[i+1], &tag) != TCL_OK) { |
| 496 | opserr << OpenSees::PromptValueError << "failed to parse section tag \"" << argv[i+1] << "\"\n"; |
| 497 | return nullptr; |
| 498 | } else { |
| 499 | section_passed = true; |
| 500 | break; |
| 501 | } |
| 502 | } |
| 503 | } |
| 504 | |
| 505 | if (!section_passed) |
| 506 | if (builder->getCurrentSectionBuilder(tag) != 0) { |
| 507 | return nullptr; |
| 508 | } |
| 509 | |
| 510 | if (tag == -1) |
| 511 | return nullptr; |
| 512 | |
| 513 | return builder->getTypedObject<SectionBuilder>(tag); |
| 514 | |
| 515 | } |
| 516 | |
| 517 | |
| 518 | // build the section |
no test coverage detected