| 933 | } |
| 934 | |
| 935 | PyObject *ops_analyzeModel(PyObject *self, PyObject *args) |
| 936 | { |
| 937 | OPS_ResetCommandLine(PyTuple_Size(args), 0, args); |
| 938 | |
| 939 | int result = 0; |
| 940 | |
| 941 | StaticAnalysis* theStaticAnalysis = anaBuilder.getStaticAnalysis(); |
| 942 | DirectIntegrationAnalysis* theTransientAnalysis = anaBuilder.getTransientAnalysis(); |
| 943 | PFEMAnalysis* thePFEMAnalysis = anaBuilder.getPFEMAnalysis(); |
| 944 | VariableTimeStepDirectIntegrationAnalysis* theVariableTimeStepTransientAnalysis = |
| 945 | anaBuilder.getVariableTimeStepDirectIntegrationAnalysis(); |
| 946 | |
| 947 | if(theStaticAnalysis != 0) { |
| 948 | // static analysis |
| 949 | if(OPS_GetNumRemainingInputArgs() < 1) { |
| 950 | PyErr_SetString(PyExc_RuntimeError,"must set numStep"); |
| 951 | return NULL; |
| 952 | } |
| 953 | |
| 954 | // get step |
| 955 | int numStep; |
| 956 | int numData = 1; |
| 957 | if(OPS_GetIntInput(&numData,&numStep) < 0) return NULL; |
| 958 | result = theStaticAnalysis->analyze(numStep); |
| 959 | |
| 960 | } else if(thePFEMAnalysis != 0) { |
| 961 | // PFEM analysis |
| 962 | result = thePFEMAnalysis->analyze(); |
| 963 | |
| 964 | } else if(theTransientAnalysis != 0) { |
| 965 | // transient analysis |
| 966 | if(OPS_GetNumRemainingInputArgs() < 2) { |
| 967 | PyErr_SetString(PyExc_RuntimeError,"must set numStep and dT"); |
| 968 | return NULL; |
| 969 | } |
| 970 | // get step |
| 971 | int numStep; |
| 972 | int numData = 1; |
| 973 | if(OPS_GetIntInput(&numData,&numStep) < 0) return NULL; |
| 974 | |
| 975 | // get dT |
| 976 | double dT; |
| 977 | numData = 1; |
| 978 | if(OPS_GetDoubleInput(&numData,&dT) < 0) return NULL; |
| 979 | |
| 980 | // set global time step variable |
| 981 | ops_Dt = dT; |
| 982 | |
| 983 | // variable transient analysis |
| 984 | if(OPS_GetNumRemainingInputArgs() > 3) { |
| 985 | // get dtmin and dtmax |
| 986 | double dtm[2] = {0,0}; |
| 987 | numData = 2; |
| 988 | if(OPS_GetDoubleInput(&numData,&dtm[0]) < 0) return NULL; |
| 989 | |
| 990 | // get Jd |
| 991 | int Jd; |
| 992 | numData = 1; |
nothing calls this directly
no test coverage detected