@@ -137,7 +137,7 @@ int runSimulation() {
137137#endif
138138 config.delta_old = config.delta ;
139139 config.delta = update (pool);
140-
140+
141141 if (config.tail_fit_enabled ) {
142142#if DMFE_WITH_CUDA
143143 // Optional tail fit/blend near theta->1 (toggle with --tail-fit)
@@ -250,11 +250,14 @@ int runSimulation() {
250250 }
251251 }
252252
253- // primitive time-step adaptation
253+ // primitive time-step adaptation
254254#if DMFE_WITH_CUDA
255- if (config.delta < config.delta_max && config.loop > 5 &&
255+ if ((config.gpu && (config.delta < config.delta_max && config.loop > 5 &&
256+ (config.delta < 1.1 * config.delta_old || config.delta_old < config.delta_max /1000 ) &&
257+ config.rmax [rk->device ->init -1 ] / config.specRad > config.delta_t && (config.gpu ? sim->device ->delta_t_ratio .back () : sim->host ->delta_t_ratio .back ()) == 1.0 )) ||
258+ (!config.gpu && (config.delta < config.delta_max && config.loop > 5 &&
256259 (config.delta < 1.1 * config.delta_old || config.delta_old < config.delta_max /1000 ) &&
257- config.rmax [rk->device ->init -1 ] / config.specRad > config.delta_t && (config. gpu ? sim->device -> delta_t_ratio . back () : sim-> host ->delta_t_ratio .back ()) == 1.0 )
260+ config.rmax [rk->host ->init -1 ] / config.specRad > config.delta_t && sim->host ->delta_t_ratio .back () == 1.0 )) )
258261#else
259262 if (config.delta < config.delta_max && config.loop > 5 &&
260263 (config.delta < 1.1 * config.delta_old || config.delta_old < config.delta_max /1000 ) &&
@@ -316,7 +319,7 @@ int runSimulation() {
316319#endif
317320
318321 // Status: continuous multi-line TUI for TTY when debug is off; otherwise line-per-iteration
319- std::string method = (rk->host ->init == 1 ? " RK54" : rk->host ->init == 2 ? " SSPRK104" : " SERK2(" + std::to_string (2 * (rk->host ->init - 2 )) + " )" );
322+ std::string method = config. gpu ? (rk-> device -> init == 1 ? " RK54 " : rk-> device -> init == 2 ? " SSPRK104 " : " SERK2( " + std::to_string ( 2 * (rk-> device -> init - 2 )) + " ) " ) : (rk->host ->init == 1 ? " RK54" : rk->host ->init == 2 ? " SSPRK104" : " SERK2(" + std::to_string (2 * (rk->host ->init - 2 )) + " )" );
320323 if (continuous_status) {
321324 ui.update_status (t, config.tmax , config.loop , config.delta_t , method);
322325 } else if (config.debug ) {
0 commit comments