-
Notifications
You must be signed in to change notification settings - Fork 0
/
DMcalcGLUT.cpp
905 lines (577 loc) · 17.5 KB
/
DMcalcGLUT.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
// 4-19-16
//
// Diffusion Equation with spatial diffusion, diffusion const independent of spatial coordinate -> D(E). Uses GSL and Darksusy
//
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <math.h>
#include <cmath>
#include <ctime>
#include <vector>
#include <gsl/gsl_integration.h>
#include <gsl/gsl_errno.h>
#include <iomanip>
#include "Constants.h"
/* to compile and run, use command
g++ -o DMcalcGLUT DMcalcGLUT.cpp -I/home/alex/research/darksusy-5.1.2/include -L/home/alex/research/darksusy-5.1.2/lib -lgsl -lgslcblas -ldarksusy -lFH -lHB -lgfortran
*/
//////////////////////////// routines for calling fortran/darksusy stuff /////////////////////////
extern"C" { //interface with fortran code to initialize darksusy
void dsinit_();
}
extern"C" { // dshayield gives injection spectrum
double dshayield_(double *mwimp, double *emuthr, int *ch, int *yieldk, int *istat);
}
//////////////////////////////////////////////////////////////////////////////////////////////////
class Cluster{
public:
std::string name;
//Cluster Parameters
double z ; //redshift
double rh; //halo radius in kpc
double rcore ; //core radius in kpc
//Bfield parameters
double B0 ; //microGauss
double Bmu;
double beta;
double eta;
//DM density parameters
int DM; //selects DM profile, 0 -> NFW, 1-> Einasto
double rhos_NFW; //characteristic density for NFW in GeV/cm^3
double rs_NFW; //scale radius for NFW in kpc
double rs_NFWa;
double rhos_Ein; //characteristic density for Einasto in GeV/cm^3
double rs_Ein; //scale radius for Einasto in kpc
double alpha;
//energy loss coeff. in 1e-16 Gev/s
double bsynch;
double bIC;
double bbrem;
double bcoul;
// Diffusion Parameters
int SD; //switch to turn on diffusion, 0 -> NSD, 1-> SD
double gamma; // D(E) ~ E^gamma
double db; // minimum scale of uniformity for mag field, from Colafrancesco.
double D0; //in cm^2/s
// v lookup table parameters
int vsize;
double vscale;
std::vector<double> vlookup;
// Greens lookupt table parameters
int n_r;
int n_rootdv;
int rootdv_max;
std::vector< std::vector<double> > GLUT;
Cluster() : name("Coma_default"),
z(0.0232),
rh(1000.0),
rcore(291.0),
B0(5.0),
Bmu(1.0),
beta(0.75),
eta(0.5),
DM(0),
rhos_NFW(0.039974),
rs_NFW(25),
rs_NFWa(404),
rhos_Ein(0.08296),
rs_Ein(280.0),
alpha(0.17),
bsynch(0.0253),
bIC(0.265),
bbrem(1.51),
bcoul(6.13),
SD(1),
gamma(0.3),
db(20.0),
D0(3.1e28),
vsize(1000000),
vlookup(vsize),
vscale(1), //calculated in create_vLUT()
n_r((int)(rh) + 1),
n_rootdv(1000 + 1),
rootdv_max(100), //calculated in createGLUT()
GLUT( n_r , std::vector<double>(n_rootdv) )
{ //everything labelled or Coma, should work in user options
std::cout << "creating cluster... " << std::endl;
}
double bfield_model (double r) {
double rc = rcore * kpc2cm;
double B_field = B0 * pow(( 1 + r*r/(rc*rc)),(-1.5*beta*eta)); // Storm et al 2013
return B_field;
};
double bloss(double E , double r){
double bloss = bsynch*pow(bfield_model(r), 2)*E*E //bsyn bfield_model(r)
+ bIC * pow(1 + z, 4 )*E*E //bIC
+ bbrem*nele*(0.36 + log(E/me/nele) ) //+ 1.51*n*(0.36 + log(E/me) )*E //bbrem Note this is most likely incorrect, no factor of E, and should be E/me/nin log
+ bcoul*nele*( 1 + log(E/me/nele)/75); //bcoul
bloss *=1e-16;
return bloss;
};
double bloss(double E ){ //overload so that we can just have bloss(E), could also have same as b(E, r) but set r=0 ?? kinda sloppy
double bloss = bsynch*pow(Bmu, 2.0)*E*E //bsyn bfield_model(r)
+ bIC /** pow(1 + c.z, 4 )*/*E*E //bIC
+ bbrem*nele*(0.36 + log(E/me/nele) ) //brem , in Emma's code has + 1.51*n*(0.36 + log(E/me) )*E
+ bcoul*nele*( 1 + log(E/me/nele)/75); //bcoul
//bloss *=1e-16;
return bloss;
};
double DM_profile(double r){
double rho;
if (DM == 0){
//NFW
double rs = rs_NFW * kpc2cm;
rho = rhos_NFW / ( r/rs * pow(1 + r/rs , 2 )) ;
}
else if (DM == 1){
// Einasto
double rs = rs_Ein * kpc2cm;
rho = (rhos_Ein) * exp(-2.0/alpha * ( pow(r/rs, alpha) - 1 ));
}
return rho;
};
double D(double E){
double D = D0 *pow( db , 2.0/3.0 )* pow(E, gamma)/pow(Bmu, 1.0/3.0);
return D;
};
};
class Particle {
public:
int ch;
double mx;
double sv;
Particle() : ch(25) , mx(1000), sv(0){}
};
Cluster c;
Particle p;
/////////////////// root_dv ////////////////////////////////
double dv(double E , void * params){
double dv = c.D(E)/c.bloss(E);
return dv;
}
double v( double E ){
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
gsl_function F;
F.function = &dv;
gsl_integration_qags (&F, E, p.mx, 0, 1e-8, 1000,
w, &result, &error);
gsl_integration_workspace_free (w);
result *= 1e16;
return result;
}
double root_dv(double Ep, double vE){
double root_dv = sqrt( ( vE ) - v(Ep) ) ;
return root_dv;
}
////////////////////////////////////////////////
double ddist(double z , void * params){
double distint = mpc2cm * clight / ( H0 * sqrt( OmegaM * pow(1 + z , 3) + OmegaL ) );
return distint;
}
//distance as a function of redshift
double Dist(){
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
gsl_function F;
F.function = &ddist;
gsl_integration_qags (&F, 0, c.z, 0, 1e-3, 1000,
w, &result, &error);
gsl_integration_workspace_free (w);
return result;
}
double rconst(double rcm){
double thetaB = 25; // beam size in arcsec
double dist_z = Dist() / (1 + c.z);
double rb = 0.5 * dist_z *thetaB/(3600) * (pi/180); //beam size in cm
double rconst;
if( rb < rcm){
rconst = rcm;
}
else if(rb > rcm){
rconst = rb;
};
return rconst;
}
double dGreens(double rp, void * params ){
std::vector<double> greenParam = *(std::vector<double> *)params;
double ri = greenParam[0];
double r = greenParam[1];
double root_dv = greenParam[2]; //
double dGreens = pow(root_dv , -1) * rp/ri * (exp( - pow( (rp-ri)/(2*root_dv) , 2))
- exp( - pow( ( rp + ri)/(2*root_dv) , 2)) ) * pow( c.DM_profile(rp),2)/pow( c.DM_profile(r),2);
return dGreens;
}
double gslInt_Greens(double ri , double r, double root_dv, double rh){
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
std::vector<double> greenParam (3);
greenParam[0] = ri;
greenParam[1] = r;
greenParam[2] = root_dv;
gsl_function F;
F.function = &dGreens;
F.params = &greenParam;
gsl_set_error_handler_off();
gsl_integration_qags (&F, 1e-16, rh, 0, 1e-3, 1000, //x?
w, &result, &error);
gsl_integration_workspace_free (w);
return result;
}
double Greens (double r, double root_dv) { //called by ddsyn
double rh = c.rh * kpc2cm ;
int imNum = 7; //number of image charges = 2*imNum + 1
double Gsum = 0 ;
for (int i = - imNum; i < imNum + 1; ++i ){
double ri;
if (i == 0)
ri = r;
else
ri = (pow(-1 , i)*r + 2*i*rh);
Gsum += pow(-1, i) * gslInt_Greens(ri, r, root_dv, rh);
}
double Greens = pow(4*pi , -1.0/2.0)*Gsum ;
//std::cout << "rdv " << root_dv/kpc2cm << std::endl;
return Greens;
};
double darksusy (double Ep){
int yieldk = 151;
int istat;
double ds = dshayield_(&p.mx, &Ep, &p.ch, &yieldk, &istat);
return ds;
}
double ddiffusion(double Ep, void * params){
std::vector<double> diffusionParams = *(std::vector<double> *)params;
double E = diffusionParams[0];
double vE = diffusionParams[1];
double r = diffusionParams[2];
double ddiffusion;
if(c.SD == 1){
double Ep_scaled = (int)(Ep/c.vscale) ;
double rootdv = sqrt( std::abs(vE - c.vlookup[Ep_scaled]) ); // 0.035*mpc2cm ; // //
//std::cout << "E = " << E << " vE = "<< vE <<" Ep = " << Ep << " vEp = "<< c.vlookup[Ep_scaled]<< " rootdv = "<<rootdv << "\n";
double rootdv_max = c.rootdv_max*kpc2cm;
double r_scale = c.rh/c.n_r;
//std::cout << c.rh <<" "<< r_scale <<"\n";
double rootdv_scale = rootdv_max/c.n_rootdv;
double r_int = (int)(( 1 + r/kpc2cm )/r_scale);
double rootdv_int = (int)(rootdv/rootdv_scale);
//std::cout <<" rdv in kpc = "<<rootdv*1000/mpc2cm << "\n";
//std::cout <<" rdv scaled = "<<rootdv*1000/mpc2cm/rootdv_scale << "\n";
//std::cout <<" rdv int = "<<rootdv_int << "\n";
if(r_int >= c.n_r)
r_int = c.n_r - 1;
ddiffusion = c.GLUT[r_int][rootdv_int] * darksusy(Ep);
if(isnan(c.GLUT[r_int][rootdv_int]) == 1)
std::cout << "GLUT " << c.GLUT[r_int][rootdv_int] << ", r = "<<r/kpc2cm << " r_int = "<< r_int <<", rootdv = " << rootdv/kpc2cm<<std::endl;
}
else{
ddiffusion = darksusy(Ep);
}
return ddiffusion;
}
double gslInt_diffusion( double E, double r){ // int over Ep
double E_scaled = (int)(E/c.vscale);
double vE = c.vlookup[E_scaled];
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
std::vector<double> diffusionParams (3);
diffusionParams[0] = E;
diffusionParams[1] = vE;
diffusionParams[2] = r;
gsl_function F;
F.function = &ddiffusion;
F.params = &diffusionParams; //pass Ep to rootdv(), pass r from dndeeq as well,
gsl_set_error_handler_off();
gsl_integration_qags (&F, E, p.mx, 0, 1e-2, 1000,
w, &result, &error);
gsl_integration_workspace_free (w);
return result;
}
double dndeeq(double E, double r ){
//total time timer start
std::clock_t start;
double duration;
start = std::clock();
///////before algorithm
double dndeeq = (1 / c.bloss(E,r))*gslInt_diffusion(E, r);
////////after algorithm
duration = (std::clock() - start)/(double) CLOCKS_PER_SEC;
if ( isnan(dndeeq) == 1)
std::cout << "dndeeq(E = "<< E << " , r = " << r/kpc2cm << " ) = "<< dndeeq <<" --> " << duration << std::endl;
return dndeeq;
}
//SYnchrotron emmission spectral function form Cola2006.
double fff(double x){
double fff = 1.25 * pow( x , 1.0/3.0) * exp( -x )* pow((648 + x*x) , 1.0/12.0);
return fff;
}
double dpsyn(double theta, void * params ){
std::vector<double> psynParams = *(std::vector<double> *)params;
double E = psynParams[0];
double r = psynParams[1];
double nu = 1.4; //Ghz
double psyn0 = 1.46323e-25 ; //Gev/s/Hz
double x0 = 62.1881 ; //dimensionless constant
double nu_em = ( 1 + c.z )* nu; //(observing freq)*(1+z)
double x = x0 *nu_em / ( c.bfield_model( r ) * pow( E, 2) );
//std::cout << "x = " << x << " B = " << c.bfield_model(psynParams[1]) << std::endl;
double dpsyn = psyn0 * c.bfield_model(r) * 0.5 * pow( sin(theta) , 2)* fff( x /sin(theta) );
return dpsyn;
}
double gslInt_psyn( double E, double r){ //int over theta
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
std::vector<double> psynParams (2);
psynParams[0] = E;
psynParams[1] = r;
gsl_function F;
F.function = &dpsyn;
F.params = &psynParams;
gsl_integration_qags (&F, 1e-16, pi, 0, 1e-3, 1000, //x?
w, &result, &error);
gsl_integration_workspace_free (w);
return result;
}
double djsyn(double E , void * params){
double r = *(double *)params;
double djsyn = 2* gslInt_psyn(E, r)* dndeeq(E , r);
return djsyn;
}
double gslInt_jsyn(double r){ // int over E
///////////
std::clock_t start;
double duration;
start = std::clock();
///////////
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
gsl_function F;
F.function = &djsyn;
F.params = &r;
gsl_integration_qags (&F, me, p.mx, 0, 1e-2, 1000,
w, &result, &error);
gsl_integration_workspace_free (w);
duration = (std::clock() - start)/(double) CLOCKS_PER_SEC;
if (duration > 1)
std::cout << "alpha = "<< c.alpha << ", jsyn( r = " << r/kpc2cm <<" ) = "<< result <<" duration: " << duration <<std::endl; // ~30s-60s
return result;
}
double dssyn( double r, void * params ){
double dist_z = Dist() / (1+c.z);
double ssynIntegrand = 4 *pi /pow(dist_z , 2) *pow(r,2) * pow(c.DM_profile(r) , 2)*gslInt_jsyn(r);
return ssynIntegrand;
}
double gslInt_ssyn( double r ){ // int over r
gsl_integration_workspace * w
= gsl_integration_workspace_alloc (1000);
double result, error;
gsl_function F;
F.function = &dssyn;
gsl_integration_qags (&F, 1e-16 , r, 0, 1e-2, 1000,
w, &result, &error);
return result;
}
double min_flux(double r){
double thetaB = 25.0; // beam size in arcsec
double frms = 1e-5; //noise per beam in Jy
double dist_z = Dist() / (1.0 + c.z);
double thetaH = r/dist_z * 180.0/pi * 3600.0;
double min_flux = 4.0 * log(2.0) * frms * pow(thetaH/thetaB, 2.0);
return min_flux;
}
double Calc_sv(double r){ // potentially add ch, z here?
double Sin = gslInt_ssyn(r) * GeVJy ;
double Sout = min_flux(r);
double sv = 8*pi * pow(p.mx, 2) * (Sout/Sin);
return sv ;
}
void create_vLUT(){
// iteration timer start
std::clock_t vstart;
double vduration;
vstart = std::clock();
///////before algorithm
std::cout << "creating LUT..." <<std::endl;
for (int j = 0 ; j < c.vsize ; ++j ){
c.vscale = p.mx/c.vsize;
c.vlookup[j] = v(j*c.vscale);
}
////////after algorithm
vduration = (std::clock() - vstart)/(double) CLOCKS_PER_SEC;
std::cout << "vlookup time = " << vduration <<std::endl;
}
void createGLUT(){
// iteration timer start
std::clock_t Gstart;
double Greensduration;
Gstart = std::clock();
///////before algorithm
std::cout << "creating GLUT..." << std::endl;
double rh = c.rh*kpc2cm;
double r_scale = rh/c.n_r;
std::cout <<rh - r_scale<< std::endl;
double rdv = sqrt(v(me));
c.rootdv_max = (int)(rdv/kpc2cm + 1);
std::cout << c.rootdv_max<<std::endl;
//c.n_rootdv = (c.rootdv_max*20 + 1);
double rootdv_scale = c.rootdv_max*kpc2cm/c.n_rootdv;
c.GLUT[0][0] = 1;
for (int i = 1 ; i < c.n_r ; ++i ){
// std::cout << i*r_scale/kpc2cm <<std::endl;
for(int j = 1; j < c.n_rootdv ; ++j){
c.GLUT[i][j] = Greens(i*r_scale, j*rootdv_scale);
c.GLUT[0][j] = 0;
c.GLUT[i][0] = 1;
c.GLUT[c.n_r - 1][j] = 0;
}
int a = (int)( (kpc2cm*0.1)/rootdv_scale );
std::cout << i << "/" << c.n_r - 1 << " " << c.GLUT[i][a] << std::endl;
};
////////after algorithm
Greensduration = (std::clock() - Gstart)/(double) CLOCKS_PER_SEC;
std::cout << "GLUT time = " << Greensduration <<std::endl;
}
void run(int ch){
p.ch = ch; //darksusy channel
double rcm = c.rh * kpc2cm ;
double rmax = rconst(rcm);
double mx_min;
if(p.ch == 13)
mx_min = 81;
else
mx_min = 5;
double mx_max = 1000;
double data;
std::string channel;
if(p.ch == 13){
channel = "WW";
}
else if(p.ch == 15){
channel = "ee";
}
else if(p.ch == 17){
channel = "mumu";
}
else if(p.ch == 19){
channel = "tt";
}
else if(p.ch == 25){
channel = "bb";
};
std::ostringstream makefilename;
makefilename <<"NULL"<<c.name << "_" << channel << "_gamma_"<<c.gamma <<".txt" ;
std::string filename = makefilename.str();
std::ofstream file(filename.c_str());
int n_mx = 50 ;//number of mx values used
for (int i = 0 ; i < n_mx + 1 ; ++i){
// iteration timer start
std::clock_t start;
double duration;
start = std::clock();
///////before algorithm
p.mx = mx_min * ( exp( (log(mx_max) - log(mx_min))/ n_mx * i));
if(c.SD==1)
create_vLUT();
data = Calc_sv(rmax);
file << p.mx << "\t" << data <<std::endl;
std::cout << "sv( " << p.mx << " ) = " << data << std::endl;
////////after algorithm
duration = (std::clock() - start)/(double) CLOCKS_PER_SEC;
std::cout << i << "/"<< n_mx << " ";
std::cout << p.ch << ", " << c.name << ", time = " << duration <<std::endl;
};
//end runComa()
}
main(){
//total time timer start
std::clock_t start;
double duration;
start = std::clock();
///////before algorithm
dsinit_(); //initialize DarkSUSY
c.name = "d1_NSD";
c.z = 1e-6;
c.rh = 1.4;
c.rcore = 0.1;
c.B0 = 1.0;
c.Bmu = 0.5;
c.DM = 0;
c.rhos_NFW = 7.1 ;
c.rs_NFW = 0.28;
c.bsynch = 0.02549;
c.bIC = 0.2499;
c.bbrem = 0;
c.bcoul = 0;
c.gamma = 0.7;
c.db = 1.0;
c.D0 = pow(c.Bmu, 1/3)*3e26;
createGLUT();
run(13);
run(19);
run(25);
///////////////////////////
c.name = "d2_NSD";
c.z = 1e-6;
c.rh = 1.4;
c.rcore = 0.1;
c.B0 = 0.6;
c.Bmu = 0.3;
c.DM = 0;
c.rhos_NFW = 7.1;
c.rs_NFW = 0.28;
c.bsynch = 0.02549;
c.bIC = 0.2499;
c.bbrem = 0;
c.bcoul = 0;
c.gamma = 0.7;
c.db = 1;
c.D0 = pow(c.Bmu, 1/3)*3e26;
//createGLUT();
run(13);
run(19);
run(25);
////////////////
c.name = "d3_NSD";
c.z = 1e-6;
c.rh = 1.4;
c.rcore = 0.1;
c.B0 = 1.0;
c.Bmu = 0.5;
c.DM = 0;
c.rhos_NFW = .8 ;
c.rs_NFW = 3;
c.bsynch = 0.02549;
c.bIC = 0.2499;
c.bbrem = 0;
c.bcoul = 0;
c.gamma = 0.7;
c.db = 1;
c.D0 = pow(c.Bmu, 1/3)*3e26;
//createGLUT();
run(13);
run(19);
run(25);
////////////////
////////after algorithm
duration = (std::clock() - start)/(double) CLOCKS_PER_SEC;
std::cout << "Total time: " << duration <<std::endl;
}
/*
//total time timer start
std::clock_t start;
double duration;
start = std::clock();
///////before algorithm
////////after algorithm
duration = (std::clock() - start)/(double) CLOCKS_PER_SEC;
std::cout << "Total time: " << duration <<std::endl;
*/