MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / findSectionBuilder

Function findSectionBuilder

SRC/runtime/commands/modeling/section.cpp:488–515  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486};
487
488static SectionBuilder*
489findSectionBuilder(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

Callers 4

TclCommand_addPatchFunction · 0.85
TclCommand_addFiberFunction · 0.85
TclCommand_addHFiberFunction · 0.85
TclCommand_addReinfLayerFunction · 0.85

Calls 1

Tested by

no test coverage detected