diff --git a/src/assist.c b/src/assist.c index af4b8d7..46c52d4 100644 --- a/src/assist.c +++ b/src/assist.c @@ -37,14 +37,11 @@ #include "planets.h" #include "forces.h" -const int reb_max_messages_length = 1024; // needs to be constant expression for array size -const int reb_max_messages_N = 10; - #define STRINGIFY(s) str(s) #define str(s) #s const char* assist_build_str = __DATE__ " " __TIME__; // Date and time build string. -const char* assist_version_str = "1.1.7"; // **VERSIONLINE** This line gets updated automatically. Do not edit manually. +const char* assist_version_str = "1.1.9"; // **VERSIONLINE** This line gets updated automatically. Do not edit manually. const char* assist_githash_str = STRINGIFY(ASSISTGITHASH);// This line gets updated automatically. Do not edit manually. @@ -308,6 +305,7 @@ void assist_init(struct assist_extras* assist, struct reb_simulation* sim, struc sim->extras_cleanup = assist_extras_cleanup; sim->additional_forces = assist_additional_forces; sim->force_is_velocity_dependent = 1; + sim->ri_ias15.adaptive_mode = 1; // Use legacy IAS15 timestepping mode } void assist_free_pointers(struct assist_extras* assist){ @@ -485,11 +483,14 @@ void assist_integrate_or_interpolate(struct assist_extras* ax, double t){ } double dts = copysign(1., sim->dt_last_done); - if ( !(dts*(sim->t-sim->dt_last_done) < dts*t && dts*t < dts*sim->t) ){ + double h = 1.0-(sim->t -t) / sim->dt_last_done; + // KK: this seems to be causing issues for us, I think it needs to be !(isnormal(h)) + if ( !(dts*(sim->t-sim->dt_last_done) < dts*t && dts*t < dts*sim->t) && isnormal(h) ){ // Integrate if requested time not in interval of last timestep reb_simulation_integrate(sim, t); } - double h = 1.0-(sim->t -t) / sim->dt_last_done; + + h = 1.0-(sim->t -t) / sim->dt_last_done; if (sim->t - t==0.){ memcpy(ax->current_state, sim->particles, sizeof(struct reb_particle)*sim->N); }else if (h<0.0 || h>=1.0 || !isnormal(h)){ @@ -580,3 +581,4 @@ static void assist_pre_timestep_modifications(struct reb_simulation* sim){ memcpy(assist->last_state, sim->particles, sizeof(struct reb_particle)*sim->N); } +