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

Function ops_addNDMaterial

SRC/interpreter/PythonModelBuilder.cpp:488–513  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

486}
487
488PyObject *ops_addNDMaterial(PyObject *self, PyObject *args)
489{
490 // check model builder
491 if(pBuilder.isSet() == false) {
492 PyErr_SetString(PyExc_RuntimeError,"ERROR builder has not been set");
493 return NULL;
494 }
495
496 OPS_ResetCommandLine(PyTuple_Size(args), 0, args);
497
498 const char *matType = OPS_GetString();
499 NDMaterial* theMat = OPS_ParseNDMaterialCommand(matType);
500
501 if(theMat == 0) {
502 PyErr_SetString(PyExc_RuntimeError, "ERROR could not create NDMaterial.");
503 return NULL;
504 }
505
506 if(OPS_addNDMaterial(theMat) == false) {
507 PyErr_SetString(PyExc_RuntimeError, "ERROR could not add NDMaterial.");
508 delete theMat; // invoke the material objects destructor, otherwise mem leak
509 return NULL;
510 }
511
512 return Py_BuildValue("d", theMat->getTag());
513}
514
515static int ops_addFiberToSection(SectionForceDeformation* section, Fiber* theFiber)
516{

Callers

nothing calls this directly

Calls 5

OPS_ResetCommandLineFunction · 0.85
isSetMethod · 0.80
OPS_GetStringFunction · 0.70
OPS_addNDMaterialFunction · 0.50
getTagMethod · 0.45

Tested by

no test coverage detected