Skip to content

Commit

Permalink
improve the saft bound for changing delta_tau in beastMode 2
Browse files Browse the repository at this point in the history
  • Loading branch information
chunshen1987 committed Sep 12, 2024
1 parent c88e090 commit eeb608b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/evolve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,11 +89,14 @@ int Evolve::EvolveIt(Fields &arenaFieldsPrev, Fields &arenaFieldsCurr,
const int NtauBlock = 200;
while (tau < tauMax) {
if (DATA.beastMode == 2 && it > 0 && (it % NtauBlock == 0)) {
DATA.delta_tau = std::min(0.04, 2*DATA.delta_tau);
DATA.facTau = std::max(1, static_cast<int>(DATA.facTau/2));
DATA.output_evolution_every_N_timesteps = (
std::max(1, static_cast<int>(
DATA.output_evolution_every_N_timesteps/2)));
if (DATA.delta_x/(2.*DATA.delta_tau) > 5) {
DATA.delta_tau = 2.*DATA.delta_tau;
DATA.facTau = std::max(1, static_cast<int>(DATA.facTau/2.));
DATA.output_evolution_every_N_timesteps = (
std::max(1, static_cast<int>(
DATA.output_evolution_every_N_timesteps/2))
);
}
}
int facTau = DATA.facTau;
int Nskip_timestep = DATA.output_evolution_every_N_timesteps;
Expand Down

0 comments on commit eeb608b

Please sign in to comment.