| 1 | #include "sopnamsp.h" | 
|---|
| 2 | #include "machdefs.h" | 
|---|
| 3 | #include <iostream> | 
|---|
| 4 | #include <stdlib.h> | 
|---|
| 5 | #include <stdio.h> | 
|---|
| 6 | #include <string.h> | 
|---|
| 7 | #include <math.h> | 
|---|
| 8 | #include <unistd.h> | 
|---|
| 9 | #include "timing.h" | 
|---|
| 10 | #include "ntuple.h" | 
|---|
| 11 |  | 
|---|
| 12 | #include "cosmocalc.h" | 
|---|
| 13 | #include "pkspectrum.h" | 
|---|
| 14 |  | 
|---|
| 15 | void usage(void); | 
|---|
| 16 | void usage(void) {cout<<"cmvtgrowth z1,z2,nz [Omatter0,Lambda0]"<<endl;} | 
|---|
| 17 |  | 
|---|
| 18 | int main(int narg,char *arg[]) | 
|---|
| 19 | { | 
|---|
| 20 |  | 
|---|
| 21 | double z1=0., z2=10.; | 
|---|
| 22 | int nz = 100;; | 
|---|
| 23 | if(narg>1) sscanf(arg[1],"%lf,%lf,%d",&z1,&z2,&nz); | 
|---|
| 24 | if(nz<=0) nz = 100; | 
|---|
| 25 | double dz = (z2-z1)/nz; | 
|---|
| 26 | cout<<"z1="<<z1<<"  z2="<<z2<<"  nz="<<nz<<"  dz="<<dz<<endl; | 
|---|
| 27 |  | 
|---|
| 28 | double om0=0.267804, ol0=0.73; | 
|---|
| 29 | if(narg>2) sscanf(arg[2],"%lf,%lf",&om0,&ol0); | 
|---|
| 30 | cout<<"Om0="<<om0<<"  Ol0="<<ol0<<endl; | 
|---|
| 31 |  | 
|---|
| 32 | GrowthEisenstein growth(om0,ol0); | 
|---|
| 33 | cout<<"D1(z=0) = "<<growth(0.)<<endl; | 
|---|
| 34 |  | 
|---|
| 35 | const int n = 3; | 
|---|
| 36 | const char *vname[n] = {"z","d1","d1dz"}; | 
|---|
| 37 | NTuple nt(n,vname); | 
|---|
| 38 | double xnt[n]; | 
|---|
| 39 | for(double z=z1;z<z2+dz/2.;z+=dz) { | 
|---|
| 40 | xnt[0]  = z; | 
|---|
| 41 | xnt[1]  = growth(z); | 
|---|
| 42 | xnt[2]  = growth.DsDz(z,dz/2.); | 
|---|
| 43 | nt.Fill(xnt); | 
|---|
| 44 | } | 
|---|
| 45 |  | 
|---|
| 46 | cout<<">>>> Ecriture"<<endl; | 
|---|
| 47 | string tag = "cmvtgrowth.ppf"; | 
|---|
| 48 | POutPersist pos(tag); | 
|---|
| 49 | tag = "nt"; pos.PutObject(nt,tag); | 
|---|
| 50 |  | 
|---|
| 51 | return 0; | 
|---|
| 52 | } | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | /* | 
|---|
| 56 | openppf cmvtgrowth.ppf | 
|---|
| 57 |  | 
|---|
| 58 | set cut 1 | 
|---|
| 59 | set cut z<5 | 
|---|
| 60 |  | 
|---|
| 61 | # --- growth | 
|---|
| 62 | n/plot nt.d1%z $cut ! "nsta connectpoints" | 
|---|
| 63 | n/plot nt.1./(1.+z)%z $cut ! "nsta connectpoints red same" | 
|---|
| 64 |  | 
|---|
| 65 | # --- growth'/growth | 
|---|
| 66 | n/plot nt.d1dz/d1%z $cut ! "nsta connectpoints" | 
|---|
| 67 | n/plot nt.-1./(1.+z)%z $cut ! "nsta connectpoints red same" | 
|---|
| 68 |  | 
|---|
| 69 | # --- d(growth)/dz | 
|---|
| 70 | zmin = 0. | 
|---|
| 71 | zmax = 10. | 
|---|
| 72 | set npt ${dv.size} | 
|---|
| 73 | dd = ($zmax-$zmin)/(${npt}-1.) | 
|---|
| 74 | exptovec dv nt d1 | 
|---|
| 75 | c++exec for(int i=1;i<dv.Size(); i++) dv(i-1) = dv(i)-dv(i-1); | 
|---|
| 76 |  | 
|---|
| 77 | n/plot nt.-1./pow(1.+z,2.)%z $cut ! "nsta connectpoints red" | 
|---|
| 78 | n/plot nt.d1dz%z $cut ! "nsta connectpoints same" | 
|---|
| 79 | n/plot dv.val/${dd}%${zmin}+(n+1)*$dd ! ! "nsta plusmarker5 green same" | 
|---|
| 80 |  | 
|---|
| 81 | */ | 
|---|