| 128 | PYBIND11_OVERRIDE_PURE(int, UniaxialMaterial, revertToStart); |
| 129 | } |
| 130 | UniaxialMaterial *getCopy() override { |
| 131 | py::gil_scoped_acquire acquire; |
| 132 | |
| 133 | auto self = py::cast(this); |
| 134 | auto cloned = self.attr("getCopy")(); |
| 135 | |
| 136 | auto keep_python_state_alive = std::make_shared<py::object>(cloned); |
| 137 | // auto ptr = cloned.cast<UniaxialMaterial*>(); |
| 138 | auto ptr = py::cast<PyUniaxialMaterial*>(cloned.release()); |
| 139 | |
| 140 | py::gil_scoped_release release; |
| 141 | return ptr; |
| 142 | // return std::shared_ptr<UniaxialMaterial>(keep_python_state_alive, ptr); |
| 143 | // PYBIND11_OVERRIDE_PURE(UniaxialMaterial*, UniaxialMaterial, getCopy); |
| 144 | // return this->clone(); |
| 145 | } |
| 146 | |
| 147 | int setTrialStrain(double strain, double strainRate=0) override { |
| 148 | PYBIND11_OVERRIDE_PURE( |