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

Method runAnalysis

SRC/reliability/domain/functionEvaluator/MatlabEvaluator.cpp:149–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147
148
149int
150MatlabEvaluator::runAnalysis(const Vector &x)
151{
152
153 // Let's just make a direct call since we have the pointer to OpenSees domain
154 // This replaces above call to Tcl command; however, in the reset command
155 // revertToStart() is also called on theTransientIntegrator -- MHS needs to check
156 if (theOpenSeesDomain->revertToStart() != 0) {
157 opserr << "ERROR MatlabEvaluator -- error in resetting Domain" << endln;
158 return -1;
159 }
160
161 // Put random variables into the structural domain according to the RandomVariablePositioners
162 int rvIndex;
163 RandomVariablePositionerIter rvPosIter = theReliabilityDomain->getRandomVariablePositioners();
164 RandomVariablePositioner *theRVPos;
165 while ((theRVPos = rvPosIter()) != 0) {
166 rvIndex = theRVPos->getRvIndex();
167 theRVPos->update(x(rvIndex));
168 }
169
170 // Start a Matlab engine
171 Engine *ep;
172 ep = engOpen("\0");
173
174 // Execute a Matlab function called 'matlabgfun'
175 char theMatlabCommand[50];
176 sprintf(theMatlabCommand,"matlabgfun");
177 engEvalString(ep, theMatlabCommand);
178
179 // Shut down the Matlab engine
180 engClose(ep);
181
182 return 0;
183}
184

Callers

nothing calls this directly

Calls 3

getRvIndexMethod · 0.80
revertToStartMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected