| 486 | } |
| 487 | |
| 488 | PyObject *ops_addNDMaterial(PyObject *self, PyObject *args) |
| 489 | { |
| 490 | // check model builder |
| 491 | if(pBuilder.isSet() == false) { |
| 492 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 493 | return NULL; |
| 494 | } |
| 495 | |
| 496 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 497 | |
| 498 | const char *matType = OPS_GetString(); |
| 499 | NDMaterial* theMat = OPS_ParseNDMaterialCommand(matType); |
| 500 | |
| 501 | if(theMat == 0) { |
| 502 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not create NDMaterial."); |
| 503 | return NULL; |
| 504 | } |
| 505 | |
| 506 | if(OPS_addNDMaterial(theMat) == false) { |
| 507 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not add NDMaterial."); |
| 508 | delete theMat; // invoke the material objects destructor, otherwise mem leak |
| 509 | return NULL; |
| 510 | } |
| 511 | |
| 512 | return Py_BuildValue("d", theMat->getTag()); |
| 513 | } |
| 514 | |
| 515 | static int ops_addFiberToSection(SectionForceDeformation* section, Fiber* theFiber) |
| 516 | { |
nothing calls this directly
no test coverage detected