void reb_integrator_hybrid_part1(struct reb_simulation* r){
	const double ratio = get_min_ratio(r);
	if (initial_dt==0.){
		initial_dt = r->dt;
	}
	if (ratio<r->ri_hybrid.switch_ratio){
		if (r->ri_hybrid.mode==SYMPLECTIC){
			reb_integrator_ias15_reset(r); //previous guesses no good anymore
			if (reb_integrator_hybrid_switch_warning==0.){
				reb_integrator_hybrid_switch_warning++;
				fprintf(stderr,"\n\033[1mInfo!\033[0m Switching to HIGHORDER for the first time at t=%.9e.\n",r->t);
			}
			reb_integrator_whfast_synchronize(r);
			r->gravity_ignore_10 = 0;
		}
		r->ri_hybrid.mode = HIGHORDER;
	}else{
		if (r->ri_hybrid.mode==HIGHORDER){
			//reb_integrator_whfast_reset(r); 
			r->ri_whfast.recalculate_jacobi_this_timestep = 1;
			r->dt = initial_dt;
		}
		r->ri_hybrid.mode = SYMPLECTIC;
	}
	switch(r->ri_hybrid.mode){
		case SYMPLECTIC:
			reb_integrator_whfast_part1(r);
			break;
		case HIGHORDER:
			reb_integrator_ias15_part1(r);
			break;
		default:
			break;
	}
}
void reb_integrator_hybrid_synchronize(struct reb_simulation* r){
	switch(r->ri_hybrid.mode){
		case SYMPLECTIC:
			reb_integrator_whfast_synchronize(r);
			break;
		default:
			break;
	}
}
Beispiel #3
0
void reb_integrator_hermes_synchronize(struct reb_simulation* r){
    // Do nothing.
    reb_integrator_whfast_synchronize(r);
}