| 147 | |
| 148 | |
| 149 | int |
| 150 | MatlabEvaluator::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 |
nothing calls this directly
no test coverage detected