| 313 | } |
| 314 | |
| 315 | PyObject *ops_addPattern(PyObject *self, PyObject *args) |
| 316 | { |
| 317 | // check model builder |
| 318 | if(pBuilder.isSet() == false) { |
| 319 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 320 | return NULL; |
| 321 | } |
| 322 | |
| 323 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 324 | |
| 325 | const char *pType = OPS_GetString(); |
| 326 | LoadPattern* thePattern = OPS_ParseLoadPatternCommand(pType); |
| 327 | |
| 328 | if(thePattern == 0) { |
| 329 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not create LoadPattern."); |
| 330 | return NULL; |
| 331 | } |
| 332 | |
| 333 | // Now add the pattern |
| 334 | Domain& theDomain = *(OPS_GetDomain()); |
| 335 | if(theDomain.addLoadPattern(thePattern) == false) { |
| 336 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not add LoadPattern."); |
| 337 | delete thePattern; // invoke the material objects destructor, otherwise mem leak |
| 338 | return NULL; |
| 339 | } |
| 340 | |
| 341 | // set current pattern |
| 342 | std::string type = pType; |
| 343 | if(type == "Plain") { |
| 344 | pBuilder.setCurrentLoadPattern(thePattern); |
| 345 | } else if(type == "MultipleSupport") { |
| 346 | pBuilder.setCurrentMultiPattern(dynamic_cast<MultiSupportPattern*>(thePattern)); |
| 347 | } |
| 348 | |
| 349 | return Py_BuildValue("d", thePattern->getTag()); |
| 350 | |
| 351 | } |
| 352 | |
| 353 | PyObject *ops_addNodalLoad(PyObject *self, PyObject *args) |
| 354 | { |
nothing calls this directly
no test coverage detected