Skip to content

Commit

Permalink
fix interface bug, update tests a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
rieder committed Dec 12, 2023
1 parent 301fdfa commit 377585a
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 88 deletions.
19 changes: 12 additions & 7 deletions src/amuse/community/rebound/interface.cc
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,13 @@ int get_total_radius(double * radius){
return 0;
}

int new_particle(int * index_of_the_particle, double mass, double x,
double y, double z, double vx, double vy, double vz, double radius, int code_index){
int new_particle(
int * index_of_the_particle,
double mass,
double x, double y, double z,
double vx, double vy, double vz,
double radius, int code_index
){
if(code_index < 0 || code_index >= (signed) codes.size()){
*index_of_the_particle=0;
return -10;
Expand Down Expand Up @@ -859,20 +864,20 @@ int _set_integrator(int value, int code_index){
code->integrator = reb_simulation::REB_INTEGRATOR_JANUS;
break;
case 9:
code->integrator = reb_simulation::REB_INTEGRATOR_WHFAST512;
code->integrator = reb_simulation::REB_INTEGRATOR_MERCURIUS;
break;
case 10:
code->integrator = reb_simulation::REB_INTEGRATOR_SABA;
break;
case 11:
code->integrator = reb_simulation::REB_INTEGRATOR_MERCURIUS;
break;
case 12:
code->integrator = reb_simulation::REB_INTEGRATOR_EOS;
break;
case 13:
case 12:
code->integrator = reb_simulation::REB_INTEGRATOR_BS;
break;
case 21:
code->integrator = reb_simulation::REB_INTEGRATOR_WHFAST512;
break;
default:
code->integrator = reb_simulation::REB_INTEGRATOR_NONE;
return -1;
Expand Down
8 changes: 4 additions & 4 deletions src/amuse/community/rebound/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,11 +195,11 @@ def _get_integrator():
"whfast-helio": 6, # removed
"none": 7,
"janus": 8,
"whfast512": 9,
"mercurius": 9,
"saba": 10,
"mercurius": 11,
"eos": 12,
"bs": 13,
"eos": 11,
"bs": 12,
"whfast512": 21,
}

def set_integrator(self, name, code_index=0):
Expand Down

0 comments on commit 377585a

Please sign in to comment.