| 88 | |
| 89 | |
| 90 | static PyObject *ops_setStrain(PyObject *self, PyObject *args) |
| 91 | { |
| 92 | int argc = PyTuple_Size(args); |
| 93 | if (argc == 0) { |
| 94 | return NULL; |
| 95 | PyErr_SetString(PyExc_RuntimeError, "You must provide a strain value."); |
| 96 | } |
| 97 | |
| 98 | PyObject *o = PyTuple_GetItem(args,0); |
| 99 | if (!PyFloat_Check(o)) { |
| 100 | PyErr_SetString(PyExc_ValueError,"setStrain expected a floating point value"); |
| 101 | return NULL; |
| 102 | } |
| 103 | |
| 104 | double opsStrain = PyFloat_AS_DOUBLE(o); |
| 105 | if (theTestingUniaxialMaterial !=0 ) { |
| 106 | theTestingUniaxialMaterial->setTrialStrain(opsStrain); |
| 107 | theTestingUniaxialMaterial->commitState(); |
| 108 | } else { |
| 109 | PyErr_SetString(PyExc_ValueError,"setStrain WARNING no active UniaxialMaterial - use testUniaxialMaterial command"); |
| 110 | return NULL; |
| 111 | } |
| 112 | PyObject *ret = Py_BuildValue("d", opsStrain); |
| 113 | return ret; |
| 114 | } |
| 115 | |
| 116 | |
| 117 | static PyObject *ops_getStrain(PyObject *self, PyObject *args) |
nothing calls this directly
no test coverage detected