| 575 | } |
| 576 | |
| 577 | PyObject *ops_addFiber(PyObject *self, PyObject *args) |
| 578 | { |
| 579 | // check model builder |
| 580 | if(pBuilder.isSet() == false) { |
| 581 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 582 | return NULL; |
| 583 | } |
| 584 | |
| 585 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 586 | |
| 587 | // check if a section is being processed |
| 588 | SectionForceDeformation* section = pBuilder.getCurrentSection(); |
| 589 | if(section == 0) { |
| 590 | PyErr_SetString(PyExc_RuntimeError,"ERROR no current section"); |
| 591 | return NULL; |
| 592 | } |
| 593 | |
| 594 | // create fiber |
| 595 | Fiber *theFiber =0; |
| 596 | if(section->getClassTag() == SEC_TAG_FiberSection2d) { |
| 597 | theFiber = (Fiber*) OPS_UniaxialFiber2d(); |
| 598 | } else if(section->getClassTag() == SEC_TAG_FiberSection3d) { |
| 599 | theFiber = (Fiber*) OPS_UniaxialFiber3d(); |
| 600 | } else if(section->getClassTag() == SEC_TAG_NDFiberSection2d) { |
| 601 | theFiber = (Fiber*) OPS_NDFiber2d(); |
| 602 | } else if(section->getClassTag() == SEC_TAG_NDFiberSection3d) { |
| 603 | theFiber = (Fiber*) OPS_NDFiber3d(); |
| 604 | } |
| 605 | |
| 606 | if(theFiber == 0) { |
| 607 | PyErr_SetString(PyExc_RuntimeError,"ERROR failed to create Fiber"); |
| 608 | return NULL; |
| 609 | } |
| 610 | |
| 611 | // add fiber to the section |
| 612 | if(ops_addFiberToSection(section,theFiber) < 0) return NULL; |
| 613 | |
| 614 | return Py_BuildValue("d", section->getTag()); |
| 615 | } |
| 616 | |
| 617 | PyObject *ops_addPatch(PyObject *self, PyObject *args) |
| 618 | { |
nothing calls this directly
no test coverage detected