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

Function OPS_runFOSMAnalysis

SRC/interpreter/OpenSeesReliabilityCommands.cpp:2861–2916  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2859}
2860
2861int OPS_runFOSMAnalysis() {
2862 if (OPS_GetNumRemainingInputArgs() < 1) {
2863 opserr << "WARNING: Wrong number of input parameter to FOSM "
2864 "analysis\n";
2865 return -1;
2866 }
2867
2868 // get file name
2869 const char *filename = OPS_GetString();
2870
2871 ReliabilityDomain *theReliabilityDomain = cmds->getDomain();
2872 if (theReliabilityDomain == 0) {
2873 opserr << "FOSMAnalysis -- ReliabilityDomain is not defined\n";
2874 return -1;
2875 }
2876
2877 // Check for essential ingredients
2878 FunctionEvaluator *theFunctionEvaluator = cmds->getFunctionEvaluator();
2879 if (theFunctionEvaluator == 0) {
2880 opserr << "Need theGFunEvaluator before a FOSMAnalysis can "
2881 "be created\n";
2882 return -1;
2883 }
2884
2885 GradientEvaluator *theGradientEvaluator = cmds->getGradientEvaluator();
2886 if (theGradientEvaluator == 0) {
2887 opserr << "Need theGradientEvaluator before a FOSMAnalysis "
2888 "can be created\n";
2889 return -1;
2890 }
2891
2892 Domain *theStructuralDomain = cmds->getStructuralDomain();
2893 if (theStructuralDomain == 0) {
2894 opserr << "Structural Domain is not defined\n";
2895 return -1;
2896 }
2897
2898 FOSMAnalysis *theFOSMAnalysis = new FOSMAnalysis(
2899 theReliabilityDomain, theStructuralDomain, theFunctionEvaluator,
2900 theGradientEvaluator, 0, filename);
2901
2902 if (theFOSMAnalysis == 0) {
2903 opserr << "Unable to create FOSM analysis" << endln;
2904 return -1;
2905 }
2906
2907 cmds->setFOSMAnalysis(theFOSMAnalysis);
2908
2909 // Now run the analysis
2910 if (theFOSMAnalysis->analyze() < 0) {
2911 opserr << "WARNING: the FOSM analysis failed\n";
2912 return -1;
2913 }
2914
2915 return 0;
2916}
2917
2918int OPS_runFORMAnalysis() {

Callers 1

Py_ops_runFOSMAnalysisFunction · 0.85

Calls 8

getFunctionEvaluatorMethod · 0.80
getGradientEvaluatorMethod · 0.80
getStructuralDomainMethod · 0.80
setFOSMAnalysisMethod · 0.80
OPS_GetStringFunction · 0.70
getDomainMethod · 0.45
analyzeMethod · 0.45

Tested by

no test coverage detected