Skip to content

Commit 30a5085

Browse files
committed
delete the prediction of dt by eps that has been upgraded on 14 Aug.
1 parent 457fc92 commit 30a5085

1 file changed

Lines changed: 5 additions & 15 deletions

File tree

time_disc/limex_integrator.hpp

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ class LimexTimeIntegrator
363363

364364

365365
/// tolerance
366-
void set_tolerance(double tol) { m_tol = tol;m_epsmin=tol;}
366+
void set_tolerance(double tol) { m_tol = tol;}
367367
void set_stepsize_safety_factor(double rho) { m_rhoSafety = rho;}
368368
void set_stepsize_reduction_factor(double sigma) { m_sigmaReduction = sigma;}
369369
void set_stepsize_greedy_order_factor(double sigma) { m_greedyOrderIncrease = sigma;}
@@ -587,7 +587,6 @@ class LimexTimeIntegrator
587587

588588
bool m_bInterrupt;
589589
int m_limex_step; ///<Current counter
590-
number m_epsmin;
591590

592591

593592
};
@@ -668,14 +667,8 @@ int LimexTimeIntegrator<TDomain,TAlgebra>::apply_integrator_threads(number dtcur
668667
// integrate (t0, t0+dtcurr)
669668
time_integrator_type integrator(m_vThreadData[i].get_time_stepper());
670669
integrator.set_time_step(dtcurr/m_vSteps[i]);
671-
/*integrator.set_dt_min(dtcurr/m_vSteps[i]);
672-
integrator.set_dt_max(dtcurr/m_vSteps[i]);*/
673-
number dtFactor=1.0;
674-
if(m_tol>0 && m_epsmin>0)
675-
dtFactor=std::max(1.0, std::log(m_epsmin)/std::log(m_tol));
676-
677-
integrator.set_dt_min(dtcurr/m_vSteps[i]/dtFactor); // /(log(m_epsmin)/log(m_tol))
678-
integrator.set_dt_max(dtcurr/m_vSteps[i]*dtFactor); // *log(m_epsmin)/log(m_tol)
670+
integrator.set_dt_min(dtcurr/m_vSteps[i]);
671+
integrator.set_dt_max(dtcurr/m_vSteps[i]);
679672
integrator.set_reduction_factor(0.0); // quit immediately, if step fails
680673
integrator.set_solver(m_vThreadData[i].get_solver());
681674
integrator.set_derivative(m_vThreadData[i].get_derivative());
@@ -1084,8 +1077,6 @@ apply(SmartPtr<grid_function_type> u, number t1, ConstSmartPtr<grid_function_typ
10841077

10851078
// select (predicted) order for next step//double dtpred = dtcurr*std::min(m_lambda[qpred-1], itime_integrator_type::get_increase_factor());
10861079
double dtpred = dtcurr*std::min(m_lambda[qpred-1], itime_integrator_type::get_increase_factor());
1087-
if(m_epsmin>0 && m_tol>0)
1088-
dtpred = dtcurr*std::min(m_lambda[qpred-1], itime_integrator_type::get_increase_factor())*std::max(1.0, (epsmin>m_epsmin*0.1 && epsmin<m_epsmin*10)? (std::log(epsmin)/std::log(m_tol)/2) : std::log(epsmin)/std::log(m_epsmin));
10891080
//double dtpred = dtcurr*m_lambda[qpred-1];
10901081
UG_LOG("+++++\nget_increase_factor() gives "<<itime_integrator_type::get_increase_factor()<<" \n+++++++")
10911082
UG_LOG("koptim=\t" << jbest << ",\t eps(k)=" << epsmin << ",\t q=\t" << qpred<< "("<< ntest << "), lambda(q)=" << m_lambda[qpred-1] << ", alpha(q-1,q)=" << monitor(qpred-1, qpred) << "dt(q)=" << dtpred<< std::endl);
@@ -1137,9 +1128,9 @@ apply(SmartPtr<grid_function_type> u, number t1, ConstSmartPtr<grid_function_typ
11371128
// solver failed -> cut time step //
11381129
number base_dtmin=base_type::get_dt_min();
11391130
if(dtcurr <= base_dtmin)
1140-
base_type::set_dt_min(base_dtmin*std::sqrt(m_tol));
1131+
base_type::set_dt_min(base_dtmin*m_sigmaReduction);
11411132

1142-
dtcurr=std::max(base_type::get_dt_min(), dtcurr*std::min(m_sigmaReduction, (m_epsmin>0)? (std::log(m_tol)/std::log(m_epsmin)): std::sqrt(m_tol)));
1133+
dtcurr=std::max(base_type::get_dt_min(), dtcurr*m_sigmaReduction);
11431134

11441135
//dtcurr=std:max(base_type::get_dt_min(), dtcurr);
11451136
}
@@ -1154,7 +1145,6 @@ apply(SmartPtr<grid_function_type> u, number t1, ConstSmartPtr<grid_function_typ
11541145
UG_LOG("+++ LimexTimestep +++" << m_limex_step << " ACCEPTED"<< std::endl);
11551146
UG_LOG(" :\t time \t dt (success) \t dt (pred) \tq=\t order (curr)" << qcurr+1 << std::endl);
11561147
UG_LOG("LIMEX-ACCEPTING:\t" << t <<"\t"<< dt << "\t" << dtcurr << "\tq=\t" << qcurr+1 << std::endl);
1157-
m_epsmin=epsmin;
11581148

11591149
// update PID controller
11601150
/*qlast = qcurr;

0 commit comments

Comments
 (0)