void reb_step(struct reb_simulation* const r){ // Update walltime struct timeval time_beginning; gettimeofday(&time_beginning,NULL); // A 'DKD'-like integrator will do the first 'D' part. PROFILING_START() if (r->pre_timestep_modifications){ reb_integrator_synchronize(r); r->pre_timestep_modifications(r); r->ri_whfast.recalculate_coordinates_this_timestep = 1; r->ri_mercurius.recalculate_coordinates_this_timestep = 1; } reb_integrator_part1(r); PROFILING_STOP(PROFILING_CAT_INTEGRATOR) // Update and simplify tree. // Prepare particles for distribution to other nodes. // This function also creates the tree if called for the first time. if (r->tree_needs_update || r->gravity==REB_GRAVITY_TREE || r->collision==REB_COLLISION_TREE){ // Check for root crossings. PROFILING_START() reb_boundary_check(r); PROFILING_STOP(PROFILING_CAT_BOUNDARY) // Update tree (this will remove particles which left the box) PROFILING_START() reb_tree_update(r); PROFILING_STOP(PROFILING_CAT_GRAVITY) }
EXPORTIT void reb_step(struct reb_simulation* const r){ // A 'DKD'-like integrator will do the first 'D' part. PROFILING_START() reb_integrator_part1(r); PROFILING_STOP(PROFILING_CAT_INTEGRATOR) // Update and simplify tree. // Prepare particles for distribution to other nodes. // This function also creates the tree if called for the first time. if (r->tree_needs_update || r->gravity==REB_GRAVITY_TREE || r->collision==REB_COLLISION_TREE){ // Check for root crossings. PROFILING_START() reb_boundary_check(r); PROFILING_STOP(PROFILING_CAT_BOUNDARY) // Update tree (this will remove particles which left the box) PROFILING_START() reb_tree_update(r); PROFILING_STOP(PROFILING_CAT_GRAVITY) }