build the section This function assumes torsion is not NULL when num==3
| 518 | // build the section |
| 519 | // This function assumes torsion is not NULL when num==3 |
| 520 | static int |
| 521 | initSectionCommands(ClientData clientData, Tcl_Interp *interp, |
| 522 | int secTag, |
| 523 | UniaxialMaterial *theTorsion, |
| 524 | double Ys, double Zs, |
| 525 | double alpha, |
| 526 | const FiberSectionConfig& options) |
| 527 | { |
| 528 | assert(clientData != nullptr); |
| 529 | BasicModelBuilder *builder = static_cast<BasicModelBuilder*>(clientData); |
| 530 | |
| 531 | // Dimension of the structure |
| 532 | int ndm = builder->getNDM(); |
| 533 | |
| 534 | SectionBuilder *sbuilder = nullptr; |
| 535 | FrameSection *section = nullptr; |
| 536 | // Create 2d section |
| 537 | if (ndm == 2) { |
| 538 | if (options.isND) { |
| 539 | if (options.isNew) { |
| 540 | auto sec = new FrameSolidSection3d(secTag, 30); |
| 541 | sbuilder = new FiberSectionBuilder<2, NDMaterial, FrameSolidSection3d>(*builder, *sec); |
| 542 | section = sec; |
| 543 | } |
| 544 | else if (options.isWarping) { |
| 545 | auto sec = new NDFiberSectionWarping2d(secTag, 30, alpha); |
| 546 | sbuilder = new FiberSectionBuilder<2, NDMaterial, NDFiberSectionWarping2d>(*builder, *sec); |
| 547 | section = sec; |
| 548 | } |
| 549 | else { |
| 550 | auto sec = new NDFiberSection2d(secTag, options.computeCentroid); |
| 551 | sbuilder = new FiberSectionBuilder<2, NDMaterial, NDFiberSection2d>(*builder, *sec); |
| 552 | section = sec; |
| 553 | } |
| 554 | } else { |
| 555 | if (options.isThermal) { |
| 556 | auto sec = new FiberSection2dThermal(secTag, options.computeCentroid); |
| 557 | sbuilder = new FiberSectionBuilder<2, UniaxialMaterial, FiberSection2dThermal>(*builder, *sec); |
| 558 | section = sec; |
| 559 | } else { |
| 560 | auto sec = new FiberSection2d(secTag, options.computeCentroid); |
| 561 | sbuilder = new FiberSectionBuilder<2, UniaxialMaterial, FiberSection2d>(*builder, *sec); |
| 562 | section = sec; |
| 563 | } |
| 564 | } |
| 565 | } |
| 566 | |
| 567 | else if (ndm == 3) { |
| 568 | |
| 569 | if (options.isND) { |
| 570 | if (options.isNew) { |
| 571 | auto sec = new FrameSolidSection3d(secTag, 30); |
| 572 | sbuilder = new FiberSectionBuilder<3, NDMaterial, FrameSolidSection3d>(*builder, *sec); |
| 573 | section = sec; |
| 574 | } |
| 575 | else { |
| 576 | auto sec = new NDFiberSection3d(secTag, |
| 577 | options.computeCentroid); |
no test coverage detected