@@ -38,7 +38,7 @@ namespace deposit{
38
38
std::string _cached_path;
39
39
RunningStateHost_t _cached_data;
40
40
size_t _cached_nparticles;
41
- size_t cached_group ;
41
+ size_t _cached_group ;
42
42
double _cached_length;
43
43
44
44
std::string _path;
@@ -62,13 +62,13 @@ namespace deposit{
62
62
// initialise
63
63
64
64
void init (singleconf& cf){
65
- this ->init (std::get<std::string>(cf.get (" path" )), std::get<size_t >(cf.get (" nparticles" )),std::get<double >(cf.get (" length" ), ,std::get<size_t >(cf.get (" group" )));
65
+ this ->init (std::get<std::string>(cf.get (" path" )), std::get<size_t >(cf.get (" nparticles" )),std::get<double >(cf.get (" length" )) ,std::get<size_t >(cf.get (" group" )));
66
66
}
67
67
68
68
void init (std::string path, size_t nparticles, double length, size_t group=DEFAULT_GROUP){
69
69
if (_path==DEFAULT_PATH){
70
70
if (nparticles!=_cached_nparticles || length!=_cached_length || group!=_cached_group){
71
- _data = this ->gendummy (nparticles,length);
71
+ this ->gendummy (nparticles,length,group );
72
72
}
73
73
else {
74
74
_data.resize (_nparticles);
@@ -110,11 +110,10 @@ namespace deposit{
110
110
hydra::Random<> Generator ( std::chrono::system_clock::now ().time_since_epoch ().count ());
111
111
size_t np=(nparticles<=0 ) ? MAXPARTICLES : nparticles;
112
112
if (np==1 ){
113
- auto data_d1=RunningStateHost_t (np,RunningTuple_t (std::copysign (1 .,length),0 .,0 .,0 ., 0 .,1 .,0 .,0 .,0 .,0 .,0 .,0 .));
114
- return data_d1;
113
+ _data=RunningStateHost_t (np,RunningTuple_t (std::copysign (1 .,length),0 .,0 .,0 ., 0 .,1 .,0 .,0 .,0 .,0 .,0 .,0 .));
115
114
}
116
115
size_t halfsize=np/2 ;
117
- RunningStateHost_t data_d (halfsize*2 );
116
+ _data. resize (halfsize*2 );
118
117
auto data_de=RunningStateHost_t (halfsize,RunningTuple_t (-1 .,0 .,0 .,0 ., 1 .,0 .,0 .,0 .,0 .,0 .,0 .,0 .));
119
118
auto data_dh=RunningStateHost_t (halfsize,RunningTuple_t (1 .,0 .,0 .,0 ., 1 .,0 .,0 .,0 .,0 .,0 .,0 .,0 .));
120
119
@@ -127,17 +126,18 @@ namespace deposit{
127
126
Generator.SetSeed (seed);
128
127
Generator.Uniform (0 ., length, data_dh.begin (_tc_z), data_dh.end (_tc_z));
129
128
}
130
- hydra::copy (data_de,hydra::make_range (data_d.begin (),data_d.begin ()+halfsize));
131
- hydra::copy (data_dh,hydra::make_range (data_d.begin ()+halfsize,data_d.end ()));
129
+ hydra::copy (data_de,hydra::make_range (_data.begin (),_data.begin ()+halfsize));
130
+ hydra::copy (data_dh,hydra::make_range (_data.begin ()+halfsize,_data.end ()));
131
+
132
132
}
133
133
134
134
// get deposit
135
135
RunningStateHost_t getdata (){return _data;}
136
136
137
137
// get deposit and change if different
138
- void SendToDevice (RunningStateDev_t& todev, singleconf)
139
-
140
- }
138
+ // void SendToDevice(RunningStateDev_t& todev, singleconf)
139
+ //
140
+ // }
141
141
};
142
142
}
143
143
0 commit comments