| 31 | extern "C" void OPS_ResetCommandLine(int nArgs, int cArg, PyObject *args); |
| 32 | |
| 33 | static PyObject *ops_UniaxialMaterialCommand(PyObject *self, PyObject *args) |
| 34 | { |
| 35 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 36 | int numberArgs = OPS_GetNumRemainingInputArgs(); |
| 37 | |
| 38 | if (numberArgs < 2) { |
| 39 | PyErr_SetString(PyExc_RuntimeError, "ERROR too few arguments: uniaxialMaterial type? tag? args."); |
| 40 | return NULL; |
| 41 | } |
| 42 | |
| 43 | const char *matType = OPS_GetString(); |
| 44 | UniaxialMaterial *theMaterial = OPS_ParseUniaxialMaterialCommand(matType); |
| 45 | |
| 46 | if (theMaterial == 0) { |
| 47 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not create uniaxialMaterial."); |
| 48 | return NULL; |
| 49 | } |
| 50 | |
| 51 | // Now add the material to the modelBuilder |
| 52 | if (OPS_addUniaxialMaterial(theMaterial) == false) { |
| 53 | PyErr_SetString(PyExc_RuntimeError, "ERROR could not add uniaxialMaterial."); |
| 54 | delete theMaterial; // invoke the material objects destructor, otherwise mem leak |
| 55 | return NULL; |
| 56 | } |
| 57 | |
| 58 | PyObject *ret = Py_BuildValue("d", 0.0); |
| 59 | return ret; |
| 60 | } |
| 61 | |
| 62 | static PyObject *ops_testUniaxialMaterial(PyObject *self, PyObject *args) |
| 63 | { |
nothing calls this directly
no test coverage detected