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

Function TclCommand_addFiberSection

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

Source from the content-addressed store, hash-verified

644}
645
646int
647TclCommand_addFiberSection(ClientData clientData, Tcl_Interp *interp, int argc,
648 TCL_Char ** const argv)
649{
650 assert(clientData != nullptr);
651 BasicModelBuilder* builder = static_cast<BasicModelBuilder*>(clientData);
652
653 // Check if we are being invoked from Python or Tcl
654 bool openseespy = false;
655 if (Tcl_GetVar(interp, "opensees::pragma::openseespy", 0) != nullptr) {
656 openseespy = true;
657 }
658
659 int ndm = builder->getNDM();
660
661 // cmp - Check argument counts; In Tcl we require the brace argument
662 // in Python it can be omitted, but only for legacy reasons
663 if (argc < 4 && !openseespy) {
664 opserr << "Insufficient arguments, expected at least 4\n";
665 return TCL_ERROR;
666 }
667 else if (argc < 3 && openseespy) {
668 opserr << "Insufficient arguments, expected at least 3\n";
669 return TCL_ERROR;
670 }
671
672
673 int secTag;
674 if (Tcl_GetInt(interp, argv[2], &secTag) != TCL_OK) {
675 opserr << OpenSees::PromptValueError
676 << "failed to parse section tag \"" << argv[2] << "\""
677 << OpenSees::SignalMessageEnd;
678 return TCL_ERROR;
679 }
680
681 builder->setCurrentSectionBuilder(secTag);
682
683 FiberSectionConfig options;
684 if (strcmp(argv[1], "NDFiber") == 0 ||
685 strcmp(argv[1], "ShearFiber") == 0)
686 options.isND = true;
687
688 if (strcmp(argv[1], "NDFiberWarping") == 0) {
689 options.isND = true;
690 options.isWarping = true;
691 }
692 else if (strcmp(argv[1], "FrameFiber") == 0 ||
693 strcmp(argv[1], "FiberFrame") == 0 ||
694 strcmp(argv[1], "AxialFiber") == 0 ||
695 strcmp(argv[1], "ShearFiber") == 0
696 )
697 options.isNew = true;
698
699 else if (strcmp(argv[1], "FiberThermal") == 0 ||
700 strcmp(argv[1], "fiberSecThermal") == 0)
701 options.isThermal = true;
702
703 else if (strstr(argv[1], "Asym") != nullptr)

Callers 1

TclCommand_addSectionFunction · 0.70

Calls 3

initSectionCommandsFunction · 0.85
getNDMMethod · 0.45

Tested by

no test coverage detected