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

Function ops_addSection

SRC/interpreter/PythonModelBuilder.cpp:457–486  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

455}
456
457PyObject *ops_addSection(PyObject *self, PyObject *args)
458{
459 // check model builder
460 if(pBuilder.isSet() == false) {
461 PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set");
462 return NULL;
463 }
464
465 OPS_ResetCommandLine(PyTuple_Size(args), 0, args);
466
467 const char *secType = OPS_GetString();
468 SectionForceDeformation* theSec = OPS_ParseSectionCommand(secType);
469
470 if(theSec == 0) {
471 PyErr_SetString(PyExc_RuntimeError, "ERROR could not create Section.");
472 return NULL;
473 }
474
475 // Now add the section
476 if(OPS_addSectionForceDeformation(theSec) == false) {
477 PyErr_SetString(PyExc_RuntimeError, "ERROR could not add Section.");
478 delete theSec; // invoke the material objects destructor, otherwise mem leak
479 return NULL;
480 }
481
482 // set current section
483 pBuilder.setCurrentSection(theSec);
484
485 return Py_BuildValue("d", theSec->getTag());
486}
487
488PyObject *ops_addNDMaterial(PyObject *self, PyObject *args)
489{

Callers

nothing calls this directly

Calls 6

OPS_ResetCommandLineFunction · 0.85
isSetMethod · 0.80
setCurrentSectionMethod · 0.80
OPS_GetStringFunction · 0.70
getTagMethod · 0.45

Tested by

no test coverage detected