MCPcopy Create free account
hub / github.com/OpenSees/OpenSees / getCopy

Function getCopy

SRC/runtime/python/OpenSeesPyRT.cpp:130–145  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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(

Callers 15

getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85
getCopyMethod · 0.85

Calls 2

attrMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected