Skip to content

Commit

Permalink
tabs
Browse files Browse the repository at this point in the history
  • Loading branch information
hannorein committed May 30, 2016
1 parent 6bf67d6 commit 00cb6df
Showing 1 changed file with 109 additions and 109 deletions.
218 changes: 109 additions & 109 deletions src/rebound.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,16 +130,16 @@ void reb_step(struct reb_simulation* const r){
reb_boundary_check(r);
if (r->tree_needs_update){
// Update tree (this will remove particles which left the box)
reb_tree_update(r);
}
PROFILING_STOP(PROFILING_CAT_BOUNDARY)
reb_tree_update(r);
}
PROFILING_STOP(PROFILING_CAT_BOUNDARY)

// Search for collisions using local and essential tree.
PROFILING_START()
if (r->integrator!=REB_INTEGRATOR_HYBARID){ //Hybrid integrator will search for collisions in mini simulation.
reb_collision_search(r);
}
PROFILING_STOP(PROFILING_CAT_COLLISION)
PROFILING_STOP(PROFILING_CAT_COLLISION)
}

void reb_exit(const char* const msg){
Expand Down Expand Up @@ -204,45 +204,45 @@ void reb_free_simulation(struct reb_simulation* const r){
}

void reb_free_pointers(struct reb_simulation* const r){
reb_tree_delete(r);
free(r->gravity_cs );
free(r->collisions );
reb_integrator_wh_reset(r);
reb_integrator_whfast_reset(r);
reb_integrator_ias15_reset(r);
reb_tree_delete(r);
free(r->gravity_cs);
free(r->collisions);
reb_integrator_wh_reset(r);
reb_integrator_whfast_reset(r);
reb_integrator_ias15_reset(r);
reb_integrator_hybarid_reset(r);
free(r->particles );
free(r->particles);
}

void reb_reset_temporary_pointers(struct reb_simulation* const r){
// Note: this will not clear the particle array.
r->gravity_cs_allocatedN = 0;
r->gravity_cs = NULL;
r->collisions_allocatedN = 0;
r->collisions = NULL;
// ********** WHFAST
r->ri_whfast.allocated_N = 0;
r->ri_whfast.eta = NULL;
r->ri_whfast.p_j = NULL;
// ********** IAS15
r->ri_ias15.allocatedN = 0;
set_dp7_null(&(r->ri_ias15.g));
set_dp7_null(&(r->ri_ias15.b));
set_dp7_null(&(r->ri_ias15.csb));
set_dp7_null(&(r->ri_ias15.e));
set_dp7_null(&(r->ri_ias15.br));
set_dp7_null(&(r->ri_ias15.er));
r->ri_ias15.at = NULL;
r->ri_ias15.x0 = NULL;
r->ri_ias15.v0 = NULL;
r->ri_ias15.a0 = NULL;
r->ri_ias15.csx = NULL;
r->ri_ias15.csv = NULL;
r->ri_ias15.csa0 = NULL;
r->ri_ias15.at = NULL;
// ********** WH
r->ri_wh.allocatedN = 0;
r->ri_wh.eta = NULL;
// Note: this will not clear the particle array.
r->gravity_cs_allocatedN = 0;
r->gravity_cs = NULL;
r->collisions_allocatedN = 0;
r->collisions = NULL;
// ********** WHFAST
r->ri_whfast.allocated_N = 0;
r->ri_whfast.eta = NULL;
r->ri_whfast.p_j = NULL;
// ********** IAS15
r->ri_ias15.allocatedN = 0;
set_dp7_null(&(r->ri_ias15.g));
set_dp7_null(&(r->ri_ias15.b));
set_dp7_null(&(r->ri_ias15.csb));
set_dp7_null(&(r->ri_ias15.e));
set_dp7_null(&(r->ri_ias15.br));
set_dp7_null(&(r->ri_ias15.er));
r->ri_ias15.at = NULL;
r->ri_ias15.x0 = NULL;
r->ri_ias15.v0 = NULL;
r->ri_ias15.a0 = NULL;
r->ri_ias15.csx = NULL;
r->ri_ias15.csv = NULL;
r->ri_ias15.csa0 = NULL;
r->ri_ias15.at = NULL;
// ********** WH
r->ri_wh.allocatedN = 0;
r->ri_wh.eta = NULL;
// ********** HYBARID
r->ri_hybarid.global_index_from_mini_index = NULL;
r->ri_hybarid.global_index_from_mini_index_N = 0;
Expand Down Expand Up @@ -277,82 +277,82 @@ void reb_init_simulation(struct reb_simulation* r){
while (logo[i]!=NULL){ printf("%s",logo[i++]); }
printf("Built: %s\n\n",reb_build_str);
#endif // LIBREBOUND
reb_tools_init_srand();
reb_reset_temporary_pointers(r);
reb_reset_function_pointers(r);
r->t = 0;
r->G = 1;
r->softening = 0;
r->dt = 0.001;
r->dt_last_done = 0.;
r->root_size = -1;
r->root_nx = 1;
r->root_ny = 1;
r->root_nz = 1;
r->root_n = 1;
r->nghostx = 0;
r->nghosty = 0;
r->nghostz = 0;
r->N = 0;
r->allocatedN = 0;
r->N_active = -1;
r->testparticle_type = 0;
r->N_var = 0;
r->var_config_N = 0;
r->var_config = NULL;
r->exit_min_distance = 0;
r->exit_max_distance = 0;
r->max_radius[0] = 0.;
r->max_radius[1] = 0.;
r->status = REB_RUNNING;
r->exact_finish_time = 1;
r->force_is_velocity_dependent = 0;
r->gravity_ignore_10 = 0;
r->calculate_megno = 0;
r->output_timing_last = -1;

r->minimum_collision_velocity = 0;
r->collisions_plog = 0;
r->collisions_Nlog = 0;
// Default modules
r->integrator = REB_INTEGRATOR_IAS15;
r->boundary = REB_BOUNDARY_NONE;
r->gravity = REB_GRAVITY_BASIC;
r->collision = REB_COLLISION_NONE;


// Integrators
// ********** WHFAST
// the defaults below are chosen to safeguard the user against spurious results, but
// will be slower and less accurate
r->ri_whfast.corrector = 0;
r->ri_whfast.safe_mode = 1;
r->ri_whfast.recalculate_jacobi_this_timestep = 0;
r->ri_whfast.is_synchronized = 1;
r->ri_whfast.timestep_warning = 0;
r->ri_whfast.recalculate_jacobi_but_not_synchronized_warning = 0;
// ********** IAS15
r->ri_ias15.epsilon = 1e-9;
r->ri_ias15.min_dt = 0;
r->ri_ias15.epsilon_global = 1;
r->ri_ias15.iterations_max_exceeded = 0;
// ********** SEI
r->ri_sei.OMEGA = 1;
r->ri_sei.OMEGAZ = -1;
r->ri_sei.lastdt = 0;
reb_tools_init_srand();
reb_reset_temporary_pointers(r);
reb_reset_function_pointers(r);
r->t = 0;
r->G = 1;
r->softening = 0;
r->dt = 0.001;
r->dt_last_done = 0.;
r->root_size = -1;
r->root_nx = 1;
r->root_ny = 1;
r->root_nz = 1;
r->root_n = 1;
r->nghostx = 0;
r->nghosty = 0;
r->nghostz = 0;
r->N = 0;
r->allocatedN = 0;
r->N_active = -1;
r->testparticle_type = 0;
r->N_var = 0;
r->var_config_N = 0;
r->var_config = NULL;
r->exit_min_distance = 0;
r->exit_max_distance = 0;
r->max_radius[0] = 0.;
r->max_radius[1] = 0.;
r->status = REB_RUNNING;
r->exact_finish_time = 1;
r->force_is_velocity_dependent = 0;
r->gravity_ignore_10 = 0;
r->calculate_megno = 0;
r->output_timing_last = -1;
r->minimum_collision_velocity = 0;
r->collisions_plog = 0;
r->collisions_Nlog = 0;
// Default modules
r->integrator = REB_INTEGRATOR_IAS15;
r->boundary = REB_BOUNDARY_NONE;
r->gravity = REB_GRAVITY_BASIC;
r->collision = REB_COLLISION_NONE;
// Integrators
// ********** WHFAST
// the defaults below are chosen to safeguard the user against spurious results, but
// will be slower and less accurate
r->ri_whfast.corrector = 0;
r->ri_whfast.safe_mode = 1;
r->ri_whfast.recalculate_jacobi_this_timestep = 0;
r->ri_whfast.is_synchronized = 1;
r->ri_whfast.timestep_warning = 0;
r->ri_whfast.recalculate_jacobi_but_not_synchronized_warning = 0;
// ********** IAS15
r->ri_ias15.epsilon = 1e-9;
r->ri_ias15.min_dt = 0;
r->ri_ias15.epsilon_global = 1;
r->ri_ias15.iterations_max_exceeded = 0;
// ********** SEI
r->ri_sei.OMEGA = 1;
r->ri_sei.OMEGAZ = -1;
r->ri_sei.lastdt = 0;

// ********** HYBARID
r->ri_hybarid.mini = NULL;
r->ri_hybarid.global = NULL;
r->ri_hybarid.mini = NULL;
r->ri_hybarid.global = NULL;
r->ri_hybarid.switch_ratio = 0.;
r->ri_hybarid.CE_radius = 0.;
r->ri_hybarid.mini_active = 0;
r->ri_hybarid.timestep_too_large_warning = 0;

// Tree parameters. Will not be used unless gravity or collision search makes use of tree.
// Tree parameters. Will not be used unless gravity or collision search makes use of tree.
r->tree_needs_update= 0;
r->tree_root = NULL;
r->opening_angle2 = 0.25;
Expand Down

0 comments on commit 00cb6df

Please sign in to comment.