@@ -71,7 +71,7 @@ static inline particle_location get_particle_from_identity(int index_of_the_part
7171 for ( ReboundSimulationVector::iterator i = codes.begin (); i != codes.end (); i++) {
7272 code_state cs = *i;
7373 particle.code = cs.code ;
74- particle.p = reb_get_particle_by_hash (particle.code , index_of_the_particle);
74+ particle.p = reb_simulation_particle_by_hash (particle.code , index_of_the_particle);
7575 if (particle.p != NULL ) break ;
7676 // *i = cs;
7777 }
@@ -124,7 +124,7 @@ int set_mass(int index_of_the_particle, double mass){
124124
125125 if (p->m ==0 ){
126126 if (mass>0 ){
127- int index_old=reb_get_particle_index (p);
127+ int index_old=reb_simulation_particle_index (p);
128128 if (index_old!=code->N_active ){
129129 struct reb_particle tmp = code->particles [index_old];
130130 for (int j=index_old; j>code->N_active ; j--){
@@ -137,7 +137,7 @@ int set_mass(int index_of_the_particle, double mass){
137137 }
138138 else {
139139 if (mass==0 ){
140- int index_old=reb_get_particle_index (p);
140+ int index_old=reb_simulation_particle_index (p);
141141 code->N_active --;
142142
143143 if (index_old!=code->N_active ){
@@ -178,7 +178,7 @@ int new_particle(int * index_of_the_particle, double mass, double x,
178178 pt.m = mass;
179179 pt.r = radius;
180180 pt.hash = new_hash;
181- reb_add (codes[code_index].code , pt);
181+ reb_simulation_add (codes[code_index].code , pt);
182182 // std::cout<<"new particle :"<<pt.id<< " << "<<code_index<<" << "<<pt.x<<std::endl;
183183 *index_of_the_particle = new_hash;
184184
@@ -275,10 +275,10 @@ int _evolve_code(double _tmax, code_state * cs){
275275 return (1 );
276276 }
277277
278- reb_step (code); // 0 to not do timing within step
278+ reb_simulation_step (code); // 0 to not do timing within step
279279
280280 if ((code->t +code->dt )*dtsign>=tmax*dtsign && exact_finish_time==1 ){
281- reb_integrator_synchronize (code);
281+ reb_simulation_synchronize (code);
282282 code->dt = tmax-code->t ;
283283 last_step++;
284284 }else {
@@ -383,7 +383,7 @@ int _evolve_code(double _tmax, code_state * cs){
383383 }
384384 }
385385 }
386- reb_integrator_synchronize (code);
386+ reb_simulation_synchronize (code);
387387 code->dt = code->dt_last_done ;
388388 get_kinetic_energy (cs->subset , &ke1);
389389 // printf("Code time: %d , %f -> %f (%f,%f)\n",cs->subset , code->t, tmax, ke1, (ke1-ke)/ke);
@@ -437,7 +437,7 @@ int _delete_particle(int index_of_the_particle, int code_index){
437437 if (code_index < 0 || code_index >= (signed ) codes.size ()){
438438 return -10 ;
439439 }
440- reb_remove_by_hash (codes[code_index].code , index_of_the_particle, keepSorted);
440+ reb_simulation_remove_particle_by_hash (codes[code_index].code , index_of_the_particle, keepSorted);
441441 return 0 ;
442442}
443443
@@ -495,7 +495,7 @@ int get_state(int index_of_the_particle, double * mass, double * x,
495495#endif // COLLISIONS_NONE
496496 for ( ReboundSimulationVector::iterator i = codes.begin (); i != codes.end (); i++) {
497497 code_state cs = *i;
498- p = reb_get_particle_by_hash (cs.code , index_of_the_particle);
498+ p = reb_simulation_particle_by_hash (cs.code , index_of_the_particle);
499499 if (p != NULL ) {
500500 *subset = cs.subset ;
501501 break ;
@@ -608,7 +608,7 @@ int get_subset(int index_of_the_particle, int * subset){
608608 struct reb_particle * p=NULL ;
609609 for ( ReboundSimulationVector::iterator i = codes.begin (); i != codes.end (); i++) {
610610 code_state cs = *i;
611- p = reb_get_particle_by_hash (cs.code , index_of_the_particle);
611+ p = reb_simulation_particle_by_hash (cs.code , index_of_the_particle);
612612 if (p != NULL ) {
613613 *subset = cs.subset ;
614614 break ;
@@ -638,7 +638,7 @@ int set_subset(int index_of_the_particle, int subset){
638638 struct reb_particle * p=NULL ;
639639 for ( ReboundSimulationVector::iterator i = codes.begin (); i != codes.end (); i++) {
640640 code_state cs = *i;
641- p = reb_get_particle_by_hash (cs.code , index_of_the_particle);
641+ p = reb_simulation_particle_by_hash (cs.code , index_of_the_particle);
642642 if (p != NULL ) {
643643 if (cs.subset != subset) {return -2 ;}
644644 break ;
@@ -653,8 +653,8 @@ int cleanup_code() {
653653 for ( ReboundSimulationVector::iterator i = codes.begin (); i != codes.end (); i++) {
654654 code_state cs = *i;
655655 if (cs.code ){
656- reb_remove_all (cs.code );
657- reb_free_simulation (cs.code );
656+ reb_simulation_remove_all_particles (cs.code );
657+ reb_simulation_free (cs.code );
658658 cs.code = 0 ;
659659 *i = cs;
660660 }
@@ -679,7 +679,7 @@ int initialize_code(){
679679 int nt = omp_get_max_threads ();
680680 omp_set_num_threads (nt);
681681#endif
682- reb_simulation * code = reb_create_simulation ();
682+ reb_simulation * code = reb_simulation_create ();
683683 codes.push_back (code_state (code));
684684 code->integrator = reb_simulation::REB_INTEGRATOR_IAS15 ;
685685 code->N_active = 0 ;
@@ -789,8 +789,8 @@ int set_velocity(int index_of_the_particle, double vx, double vy,
789789}
790790
791791int new_subset (int * index, double time_offset) {
792- reb_simulation * code = reb_create_simulation ();
793- reb_integrator_reset (code);
792+ reb_simulation * code = reb_simulation_create ();
793+ reb_simulation_reset_integrator (code);
794794 code->dt = timestep;
795795 if (time_offset < 0 ) {time_offset = _time;}
796796 code->integrator = reb_simulation::REB_INTEGRATOR_IAS15 ;
@@ -811,8 +811,8 @@ int stop_subset(int code_index) {
811811 code_state cs = codes[code_index];
812812 if (cs.code ) {
813813 reb_simulation * code = cs.code ;
814- reb_remove_all (code);
815- reb_free_simulation (code);
814+ reb_simulation_remove_all_particles (code);
815+ reb_simulation_free (code);
816816 cs.code = 0 ;
817817 codes[code_index] = cs;
818818 }
@@ -845,17 +845,34 @@ int _set_integrator(int value, int code_index){
845845 code->integrator = reb_simulation::REB_INTEGRATOR_LEAPFROG ;
846846 break ;
847847 case 5 :
848- code->integrator = reb_simulation::REB_INTEGRATOR_HERMES ;
848+ // This integrator was removed
849+ return -1 ;
849850 break ;
850851 case 6 :
851- code->integrator = reb_simulation::REB_INTEGRATOR_WHFASTHELIO ;
852+ // This integrator was removed
853+ return -1 ;
852854 break ;
853855 case 7 :
854856 code->integrator = reb_simulation::REB_INTEGRATOR_NONE ;
855857 break ;
856858 case 8 :
857859 code->integrator = reb_simulation::REB_INTEGRATOR_JANUS ;
858860 break ;
861+ case 9 :
862+ code->integrator = reb_simulation::REB_INTEGRATOR_WHFAST512 ;
863+ break ;
864+ case 10 :
865+ code->integrator = reb_simulation::REB_INTEGRATOR_SABA ;
866+ break ;
867+ case 11 :
868+ code->integrator = reb_simulation::REB_INTEGRATOR_MERCURIUS ;
869+ break ;
870+ case 12 :
871+ code->integrator = reb_simulation::REB_INTEGRATOR_EOS ;
872+ break ;
873+ case 13 :
874+ code->integrator = reb_simulation::REB_INTEGRATOR_BS ;
875+ break ;
859876 default :
860877 code->integrator = reb_simulation::REB_INTEGRATOR_NONE ;
861878 return -1 ;
@@ -1014,7 +1031,7 @@ int set_boundary_size(double boundary_size, int code_index){
10141031 return -11 ;
10151032 }
10161033 reb_simulation * code = codes[code_index].code ;
1017- reb_configure_box (code,boundary_size,1 ,1 ,1 );
1034+ reb_simulation_configure_box (code,boundary_size,1 ,1 ,1 );
10181035 return 0 ;
10191036}
10201037
0 commit comments