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

Method analyze

SRC/reliability/analysis/analysis/FOSMAnalysis.cpp:82–363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81
82int
83FOSMAnalysis::analyze(void)
84{
85
86 // Alert the user that the FORM analysis has started
87 opserr << "FOSM Analysis is running ... " << endln;
88
89 // Open output file
90 ofstream outputFile( fileName, ios::out );
91 int result;
92
93 // Get number of random variables and limit-state function
94 int nrv = theReliabilityDomain->getNumberOfRandomVariables();
95 int numberOfParameters = theOpenSeesDomain->getNumParameters();
96 int numLsf = theReliabilityDomain->getNumberOfLimitStateFunctions();
97 LimitStateFunction *theLSF;
98
99 // Get mean point
100 Vector meanVector(nrv);
101 // Establish vector of standard deviations
102 Vector stdvVector(nrv);
103
104
105 // set start point to be the mean for FOSM
106 for (int j = 0; j < nrv; j++) {
107 RandomVariable *theRV = theReliabilityDomain->getRandomVariablePtrFromIndex(j);
108 int param_indx = theReliabilityDomain->getParameterIndexFromRandomVariableIndex(j);
109 Parameter *theParam = theOpenSeesDomain->getParameterFromIndex(param_indx);
110
111 meanVector(j) = theRV->getMean();
112 stdvVector(j) = theRV->getStdv();
113
114 // now we should update the parameter value
115 theParam->update( meanVector(j) );
116 }
117
118
119 // Perform analysis using mean vector
120 Vector meanEstimates(numLsf);
121
122 // set values in the variable namespace
123 if (theGFunEvaluator->setVariables() < 0) {
124 opserr << "FOSMAnalysis::analyze() - " << endln
125 << " could not set variables in namespace. " << endln;
126 return -1;
127 }
128
129 // run analysis
130 if (theGFunEvaluator->runAnalysis() < 0) {
131 opserr << "FOSMAnalysis::analyze() - " << endln
132 << " could not run analysis to evaluate limit-state function. " << endln;
133 return -1;
134 }
135
136 // Loop over number of limit-state functions and evaluate
137 //LimitStateFunctionIter lsfIter = theReliabilityDomain->getLimitStateFunctions();
138 //while ((theLSF = lsfIter()) != 0) {
139 for (int lsf = 0; lsf < numLsf; lsf++ ) {

Callers

nothing calls this directly

Tested by

no test coverage detected