| 2916 | } |
| 2917 | |
| 2918 | int OPS_runFORMAnalysis() { |
| 2919 | if (OPS_GetNumRemainingInputArgs() < 1) { |
| 2920 | opserr << "WARNING: Wrong number of input parameter to FORM " |
| 2921 | "analysis\n"; |
| 2922 | return -1; |
| 2923 | } |
| 2924 | |
| 2925 | // get file name |
| 2926 | const char *filename = OPS_GetString(); |
| 2927 | |
| 2928 | ReliabilityDomain *theReliabilityDomain = cmds->getDomain(); |
| 2929 | if (theReliabilityDomain == 0) { |
| 2930 | opserr << "FORMAnalysis -- ReliabilityDomain is not defined\n"; |
| 2931 | return -1; |
| 2932 | } |
| 2933 | |
| 2934 | // Check for essential ingredients |
| 2935 | FunctionEvaluator *theFunctionEvaluator = cmds->getFunctionEvaluator(); |
| 2936 | if (theFunctionEvaluator == 0) { |
| 2937 | opserr << "Need theGFunEvaluator before a FORMAnalysis can " |
| 2938 | "be created\n"; |
| 2939 | return -1; |
| 2940 | } |
| 2941 | |
| 2942 | FindDesignPointAlgorithm *theFindDesignPointAlgorithm = |
| 2943 | cmds->getFindDesignPointAlgorithm(); |
| 2944 | if (theFindDesignPointAlgorithm == 0) { |
| 2945 | opserr << "Need theFindDesignPointAlgorithm before a " |
| 2946 | "FORMAnalysis " |
| 2947 | "can be created\n"; |
| 2948 | return -1; |
| 2949 | } |
| 2950 | |
| 2951 | ProbabilityTransformation *theProbabilityTransformation = |
| 2952 | cmds->getProbabilityTransformation(); |
| 2953 | if (theProbabilityTransformation == 0) { |
| 2954 | opserr << "FORMAnalysis - probability transformation not defined - "; |
| 2955 | opserr << "assuming all independent transformation" << endln; |
| 2956 | theProbabilityTransformation = |
| 2957 | new AllIndependentTransformation(theReliabilityDomain, 0); |
| 2958 | cmds->setProbabilityTransformation(theProbabilityTransformation); |
| 2959 | } |
| 2960 | |
| 2961 | Domain *theStructuralDomain = cmds->getStructuralDomain(); |
| 2962 | if (theStructuralDomain == 0) { |
| 2963 | opserr << "Structural Domain is not defined\n"; |
| 2964 | return -1; |
| 2965 | } |
| 2966 | |
| 2967 | // Read input parameter(s) |
| 2968 | int relSensTag = 0; |
| 2969 | if (OPS_GetNumRemainingInputArgs() > 1) { |
| 2970 | const char *type = OPS_GetString(); |
| 2971 | if (strcmp(type, "-relSens") == 0) { |
| 2972 | int numdata = 1; |
| 2973 | if (OPS_GetIntInput(&numdata, &relSensTag) < 0) { |
| 2974 | opserr << "ERROR: invalid input: relSensTag \n"; |
| 2975 | return -1; |
no test coverage detected