41 using namespace swarm::gpu::bppt;
46 template<
class Monitor ,
template<
class T>
class Gravitation >
52 typedef Monitor monitor_t;
53 typedef typename monitor_t::params mon_params_t;
60 mon_params_t _mon_params;
68 _time_step = cfg.
require(
"time_step", 0.0);
87 GPUAPI
void convert_internal_to_std_coord() {}
89 GPUAPI
void convert_std_to_internal_coord() {}
102 __device__
void kernel(T compile_time_param){
106 if(
sysid()>=_dens.nsys())
return;
110 ensemble::SystemRef sys = _dens[
sysid()];
116 typedef Gravitation<T> Grav;
117 typedef typename Grav::shared_data grav_t;
123 monitor_t montest(_mon_params,sys,*_log) ;
129 const int nbod = T::n;
143 double pos = 0.0, vel = 0.0 , acc = 0.0, jerk = 0.0;
144 if( (b < nbod) && (c < 3) )
145 { pos = sys[b][
c].pos(); vel = sys[b][
c].vel(); }
156 for(
int iter = 0 ; (iter < _max_iterations) && sys.is_active() ; iter ++ )
170 double h = min(_destination_time - sys.time(), _time_step);
174 pos = pos + h*(vel+(h*0.5)*(acc+(h/3.0)*jerk));
175 vel = vel + h*(acc+(h*0.5)*jerk);
179 if( (b < nbod) && (c < 3) )
180 { sys[b][
c].pos() = pos; sys[b][
c].vel() = vel; }
198 if( sys.time() >= _destination_time )
199 { sys.set_inactive(); }