| 256 | } |
| 257 | |
| 258 | PyObject *ops_addElement(PyObject *self, PyObject *args) |
| 259 | { |
| 260 | // check model builder |
| 261 | if(pBuilder.isSet() == false) { |
| 262 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 263 | return NULL; |
| 264 | } |
| 265 | |
| 266 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 267 | |
| 268 | const char *eleType = OPS_GetString(); |
| 269 | Element* theEle = OPS_ParseElementCommand(eleType); |
| 270 | |
| 271 | if(theEle == 0) { |
| 272 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not create element."); |
| 273 | return NULL; |
| 274 | } |
| 275 | |
| 276 | // Now add the element to the modelBuilder |
| 277 | Domain* theDomain = OPS_GetDomain(); |
| 278 | if(theDomain->addElement(theEle) == false) { |
| 279 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not add element to domain."); |
| 280 | delete theEle; // invoke the material objects destructor, otherwise mem leak |
| 281 | return NULL; |
| 282 | } |
| 283 | |
| 284 | return Py_BuildValue("d", theEle->getTag()); |
| 285 | } |
| 286 | |
| 287 | PyObject *ops_addTimeSeries(PyObject *self, PyObject *args) |
| 288 | { |
nothing calls this directly
no test coverage detected