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

Function ops_specifyAnalysis

SRC/interpreter/PythonAnalysisBuilder.cpp:882–915  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

880}
881
882PyObject *ops_specifyAnalysis(PyObject *self, PyObject *args)
883{
884 OPS_ResetCommandLine(PyTuple_Size(args), 0, args);
885
886 if(OPS_GetNumRemainingInputArgs() < 1) {
887 PyErr_SetString(PyExc_RuntimeError,"must specify analysis name ");
888 return NULL;
889 }
890
891 // analysis type
892 std::string type = OPS_GetString();
893
894 // create analysis
895 if(type == "Static") {
896 anaBuilder.newStaticAnalysis();
897 } else if(type == "Transient") {
898 anaBuilder.newTransientAnalysis();
899 } else if(type == "PFEM") {
900 int numData = OPS_GetNumRemainingInputArgs();
901 if(numData < 2) {
902 PyErr_SetString(PyExc_RuntimeError,"must specify dtmax and dtmin for PFEM analysis");
903 return NULL;
904 }
905
906 double data[3] = {0,0,0.5};
907 if(numData > 3) numData = 3;
908 if(OPS_GetDoubleInput(&numData,&data[0]) < 0) return 0;
909
910 anaBuilder.newPFEMAnalysis(data[0],data[1],data[2]);
911 }
912
913 Py_INCREF(Py_None);
914 return Py_None;
915}
916
917PyObject *ops_specifyCTest(PyObject *self, PyObject *args)
918{

Callers

nothing calls this directly

Calls 7

OPS_ResetCommandLineFunction · 0.85
newStaticAnalysisMethod · 0.80
newPFEMAnalysisMethod · 0.80
OPS_GetStringFunction · 0.70
OPS_GetDoubleInputFunction · 0.70
newTransientAnalysisMethod · 0.45

Tested by

no test coverage detected