| 175 | |
| 176 | |
| 177 | PyObject *ops_addNode(PyObject *self, PyObject *args) |
| 178 | { |
| 179 | // check model builder |
| 180 | if(pBuilder.isSet() == false) { |
| 181 | PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set"); |
| 182 | return NULL; |
| 183 | } |
| 184 | |
| 185 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 186 | |
| 187 | // get node |
| 188 | Node* theNode = (Node*) OPS_Node(); |
| 189 | if(theNode == 0) { |
| 190 | PyErr_SetString(PyExc_RuntimeError,"ERROR failed to create node"); |
| 191 | return NULL; |
| 192 | } |
| 193 | |
| 194 | // add the node to the domain |
| 195 | Domain *theDomain = OPS_GetDomain(); |
| 196 | if(theDomain->addNode(theNode) == false) { |
| 197 | PyErr_SetString(PyExc_RuntimeError,"ERROR failed to add node to domain"); |
| 198 | delete theNode; |
| 199 | return NULL; |
| 200 | } |
| 201 | |
| 202 | return Py_BuildValue("i", theNode->getTag()); |
| 203 | } |
| 204 | |
| 205 | PyObject *ops_addHomogeneousBC(PyObject *self, PyObject *args) |
| 206 | { |
nothing calls this directly
no test coverage detected