You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 18, 2019. It is now read-only.
std::cout << "You failed heavily at iter = " << iter << " and simtime " << _algLoop->getSimTime() << std::endl;
308
+
if(true){
309
+
try{
310
+
_algLoop->setReal(_y);
311
+
_algLoop->evaluate();
312
+
_algLoop->getRHS(rhs);
313
+
314
+
double*ypluseps=newdouble [_dimSys];
315
+
double*rhs2=newdouble [_dimSys];
316
+
memcpy(ypluseps,_y,_dimSys*sizeof(double));
317
+
for(int i=0;i<_dimSys;i++){
318
+
ypluseps[i]*=(1.0+std::numeric_limits<double>::epsilon()*8.0);//increase _ypluseps in the smallest amount possible.
319
+
}
320
+
_algLoop->setReal(ypluseps);
321
+
_algLoop->evaluate();
322
+
_algLoop->getRHS(rhs2);
323
+
double threshold=0.0;
324
+
for(int i=0;i<_dimSys;i++){
325
+
threshold+=(rhs2[i]-rhs[i])*(rhs2[i]-rhs[i]);
326
+
}
327
+
threshold=std::sqrt(threshold);
328
+
329
+
delete [] ypluseps;
330
+
delete [] rhs2;
331
+
332
+
if(_statusTestNormF->getNormF()<2*threshold){
333
+
std::cout << "threshold (this should typically be a very small value (we vary the real value by ). In case of occurence of rounding errors, the threshold should be big though.) = " << threshold << ", simtime = " << _algLoop->getSimTime() << ", algloop " << _algLoop->getEquationIndex() << std::endl;
334
+
_algLoop->setReal(_y);
335
+
_algLoop->evaluate();
336
+
_algLoop->getRHS(rhs);
337
+
_iterationStatus=DONE;
338
+
break;
339
+
}
340
+
}
341
+
catch(const std::exception &ex)
342
+
{
343
+
if (_generateoutput) std::cout << "algloop evaluation after solve failed with error message:" << std::endl << ex.what() << std::endl << "Trying to continue without. This should hopefully lead to statusTest::Failed." << std::endl;
0 commit comments