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

Function ops_addFiber

SRC/interpreter/PythonModelBuilder.cpp:577–615  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577PyObject *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
617PyObject *ops_addPatch(PyObject *self, PyObject *args)
618{

Callers

nothing calls this directly

Calls 10

OPS_ResetCommandLineFunction · 0.85
OPS_UniaxialFiber2dFunction · 0.85
OPS_UniaxialFiber3dFunction · 0.85
OPS_NDFiber2dFunction · 0.85
OPS_NDFiber3dFunction · 0.85
ops_addFiberToSectionFunction · 0.85
isSetMethod · 0.80
getCurrentSectionMethod · 0.80
getClassTagMethod · 0.45
getTagMethod · 0.45

Tested by

no test coverage detected