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

Function ops_addFiberToSection

SRC/interpreter/PythonModelBuilder.cpp:515–575  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

513}
514
515static int ops_addFiberToSection(SectionForceDeformation* section, Fiber* theFiber)
516{
517 if(section==0 || theFiber==0) return 0;
518 if(section->getClassTag() == SEC_TAG_FiberSection2d) {
519 FiberSection2d* sec = dynamic_cast<FiberSection2d*>(section);
520 if(sec != 0) {
521 if(sec->addFiber(*theFiber) < 0) {
522 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to add Fiber to section");
523 delete theFiber;
524 return -1;
525 }
526 } else {
527 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to get Fiber section");
528 delete theFiber;
529 return -1;
530 }
531 } else if(section->getClassTag() == SEC_TAG_FiberSection3d) {
532 FiberSection3d* sec = dynamic_cast<FiberSection3d*>(section);
533 if(sec != 0) {
534 if(sec->addFiber(*theFiber) < 0) {
535 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to add Fiber to section");
536 delete theFiber;
537 return -1;
538 } else {
539 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to get Fiber section");
540 delete theFiber;
541 return -1;
542 }
543 }
544
545 } else if(section->getClassTag() == SEC_TAG_NDFiberSection2d) {
546 NDFiberSection2d* sec = dynamic_cast<NDFiberSection2d*>(section);
547 if(sec != 0) {
548 if(sec->addFiber(*theFiber) < 0) {
549 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to add Fiber to section");
550 delete theFiber;
551 return -1;
552 } else {
553 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to get Fiber section");
554 delete theFiber;
555 return -1;
556 }
557 }
558
559 } else if(section->getClassTag() == SEC_TAG_NDFiberSection3d) {
560 NDFiberSection3d* sec = dynamic_cast<NDFiberSection3d*>(section);
561 if(sec != 0) {
562 if(sec->addFiber(*theFiber) < 0) {
563 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to add Fiber to section");
564 delete theFiber;
565 return -1;
566 } else {
567 PyErr_SetString(PyExc_RuntimeError,"ERROR failed to get Fiber section");
568 delete theFiber;
569 return -1;
570 }
571 }
572 }

Callers 3

ops_addFiberFunction · 0.85
ops_addPatchFunction · 0.85
ops_addLayerFunction · 0.85

Calls 2

getClassTagMethod · 0.45
addFiberMethod · 0.45

Tested by

no test coverage detected