| 455 | } |
| 456 | |
| 457 | PyObject *ops_addSection(PyObject *self, PyObject *args) |
| 458 | { |
| 459 | // check model builder |
| 460 | if(pBuilder.isSet() == false) { |
| 461 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 462 | return NULL; |
| 463 | } |
| 464 | |
| 465 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 466 | |
| 467 | const char *secType = OPS_GetString(); |
| 468 | SectionForceDeformation* theSec = OPS_ParseSectionCommand(secType); |
| 469 | |
| 470 | if(theSec == 0) { |
| 471 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not create Section."); |
| 472 | return NULL; |
| 473 | } |
| 474 | |
| 475 | // Now add the section |
| 476 | if(OPS_addSectionForceDeformation(theSec) == false) { |
| 477 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not add Section."); |
| 478 | delete theSec; // invoke the material objects destructor, otherwise mem leak |
| 479 | return NULL; |
| 480 | } |
| 481 | |
| 482 | // set current section |
| 483 | pBuilder.setCurrentSection(theSec); |
| 484 | |
| 485 | return Py_BuildValue("d", theSec->getTag()); |
| 486 | } |
| 487 | |
| 488 | PyObject *ops_addNDMaterial(PyObject *self, PyObject *args) |
| 489 | { |
nothing calls this directly
no test coverage detected