52 time_step = cfg.require(
"time_step", 0.0);
62 template<
class T,
class Gravitation>
74 const static int nbod = T::n;
85 ensemble::SystemRef& sys;
86 Gravitation& calcForces;
90 :_params(p),sys(s),calcForces(calc){}
106 bool body_component_grid;
107 bool first_thread_in_system;
121 GPUAPI
void init() { }
122 GPUAPI
void shutdown() { }
127 GPUAPI
void convert_internal_to_std_coord() {}
129 GPUAPI
void convert_std_to_internal_coord() {}
134 static GENERIC int thread_per_system(){
return nbod * 3; }
135 static GENERIC int shmem_per_system() {
return 0; }
149 double pos = 0.0, vel = 0.0;
150 double acc = 0.0, jerk = 0.0;
154 if( body_component_grid ) pos = sys[b][c].pos() , vel = sys[b][c].vel();
162 calcForces(ij,b,c,pos,vel,acc,jerk);
167 double h = min(_params.time_step, max_timestep);
171 pos = pos + h * ( vel + (h*0.5) * (acc + (h/3.0)*jerk ) );
172 vel = vel + h * ( acc + (h*0.5) * jerk );
177 if( body_component_grid ) sys[b][c].pos() = pos , sys[b][c].vel() = vel;
178 if( first_thread_in_system ) sys.time() += h;