source: Sophya/trunk/Cosmo/SimLSS/cmvtgrowth.cc@ 3983

Last change on this file since 3983 was 3805, checked in by cmv, 15 years ago

Refonte totale de la structure des classes InitialSpectrum, TransfertFunction, GrowthFactor, PkSpectrum et classes tabulate pour lecture des fichiers CAMB, cmv 24/07/2010

File size: 1.8 KB
Line 
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
15void usage(void);
16void usage(void) {cout<<"cmvtgrowth z1,z2,nz [Omatter0,Lambda0]"<<endl;}
17
18int 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/*
56openppf cmvtgrowth.ppf
57
58set cut 1
59set cut z<5
60
61# --- growth
62n/plot nt.d1%z $cut ! "nsta connectpoints"
63n/plot nt.1./(1.+z)%z $cut ! "nsta connectpoints red same"
64
65# --- growth'/growth
66n/plot nt.d1dz/d1%z $cut ! "nsta connectpoints"
67n/plot nt.-1./(1.+z)%z $cut ! "nsta connectpoints red same"
68
69# --- d(growth)/dz
70zmin = 0.
71zmax = 10.
72set npt ${dv.size}
73dd = ($zmax-$zmin)/(${npt}-1.)
74exptovec dv nt d1
75c++exec for(int i=1;i<dv.Size(); i++) dv(i-1) = dv(i)-dv(i-1);
76
77n/plot nt.-1./pow(1.+z,2.)%z $cut ! "nsta connectpoints red"
78n/plot nt.d1dz%z $cut ! "nsta connectpoints same"
79n/plot dv.val/${dd}%${zmin}+(n+1)*$dd ! ! "nsta plusmarker5 green same"
80
81*/
Note: See TracBrowser for help on using the repository browser.