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

Function ops_addNode

SRC/interpreter/PythonModelBuilder.cpp:177–203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175
176
177PyObject *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
205PyObject *ops_addHomogeneousBC(PyObject *self, PyObject *args)
206{

Callers

nothing calls this directly

Calls 6

OPS_ResetCommandLineFunction · 0.85
isSetMethod · 0.80
OPS_GetDomainFunction · 0.70
OPS_NodeFunction · 0.50
addNodeMethod · 0.45
getTagMethod · 0.45

Tested by

no test coverage detected