File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -198,25 +198,40 @@ void generate_p_space(Grid &par){
198198 int yDim = par.ival (" yDim" );
199199 int zDim = par.ival (" zDim" );
200200 double xMax = par.dval (" xMax" );
201- double yMax = par.dval (" yMax" );
201+ double yMax = 0 ;
202+ if (dimnum > 1 ){
203+ yMax = par.dval (" yMax" );
204+ }
202205 double zMax = 0 ;
203206 if (dimnum == 3 ){
204207 zMax = par.dval (" zMax" );
205208 }
209+
206210 double pxMax = par.dval (" pxMax" );
207- double pyMax = par.dval (" pyMax" );
211+ double pyMax = 0 ;
212+ if (dimnum > 1 ){
213+ pyMax = par.dval (" pyMax" );
214+ }
208215 double pzMax = 0 ;
209216 if (dimnum == 3 ){
210217 pzMax = par.dval (" pzMax" );
211218 }
219+
212220 double dx = par.dval (" dx" );
213- double dy = par.dval (" dy" );
221+ double dy = 0 ;
222+ if (dimnum > 1 ){
223+ dy = par.dval (" dy" );
224+ }
214225 double dz = 0 ;
215226 if (dimnum == 3 ){
216227 dz = par.dval (" dz" );
217228 }
229+
218230 double dpx = par.dval (" dpx" );
219- double dpy = par.dval (" dpy" );
231+ double dpy = 0 ;
232+ if (dimnum > 1 ){
233+ dpy = par.dval (" dpy" );
234+ }
220235 double dpz = 0 ;
221236 if (dimnum == 3 ){
222237 dpz = par.dval (" dpz" );
@@ -284,6 +299,24 @@ void generate_p_space(Grid &par){
284299
285300 }
286301
302+ }
303+ else if (dimnum == 1 ){
304+ for (int i=0 ; i<xDim/2 ; ++i){
305+ x[i] = -xMax + i*dx;
306+ x[i + (xDim/2 )] = i*dx;
307+
308+ px[i] = i*dpx;
309+ px[i + (xDim/2 )] = -pxMax + i*dpx;
310+
311+ }
312+
313+ for (int i = 0 ; i < zDim; ++i){
314+ z[i] = 0 ;
315+ pz[i] = 0 ;
316+ y[i] = 0 ;
317+ py[i] = 0 ;
318+ }
319+
287320 }
288321 par.store (" x" ,x);
289322 par.store (" y" ,y);
Original file line number Diff line number Diff line change @@ -1168,8 +1168,8 @@ void evolve_test(){
11681168 par.store (" esteps" , esteps);
11691169 par.store (" gsteps" , gsteps);
11701170 par.store (" printSteps" , 30000 );
1171- par.store (" write_file" , false );
1172- par.store (" write_it" , false );
1171+ par.store (" write_file" , true );
1172+ par.store (" write_it" , true );
11731173 par.store (" energy_calc" , true );
11741174 par.store (" box_size" , 0.00007 );
11751175 par.store (" xDim" , 64 );
@@ -1178,7 +1178,7 @@ void evolve_test(){
11781178
11791179
11801180 // Running through all the dimensions to check the energy
1181- for (int i = 2 ; i <= 3 ; ++i){
1181+ for (int i = 1 ; i <= 3 ; ++i){
11821182 if (i == 2 ){
11831183 par.store (" yDim" , 64 );
11841184 }
You can’t perform that action at this time.
0 commit comments