Changeset 3768 in Sophya for trunk/Cosmo/SimLSS/pkspectrum.cc


Ignore:
Timestamp:
May 3, 2010, 4:08:34 PM (15 years ago)
Author:
cmv
Message:
  • refonte du code pour creer uniquement des conditions initiales
  • introduction du tirage des vitesse LOS pour les redshift-distortion

cmv 03/05/2010

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cosmo/SimLSS/pkspectrum.cc

    r3662 r3768  
    399399}
    400400
     401double GrowthFactor::DsDz(double z,double dzinc)
     402// y-y0 = a*(x-x0)^2 + b*(x-x0)
     403// dy = a*dx^2 + b*dx   avec  dx = x-x0
     404// dy'(dx) = 2*a*dx + b -> pour x=x0 on a dy'(0) = b
     405{
     406 if(z<0. || dzinc<=0.) {
     407   cout<<"GrowthFactor::DsDz: z<0 or dzinc<=0. !"<<endl;
     408   throw ParmError("GrowthFactor::DsDz: z<0 or dzinc<=0. !");
     409 }
     410
     411 double z1, z2;
     412 if(z>dzinc/2.) {
     413   // cas ou z est suffisamment loin de zero
     414   // resolution avec 2 points encadrant x0=z
     415   z1 = z - dzinc; if(z1<0.) z1 = 0.;
     416   z2 = z + dzinc;
     417 } else {
     418   // cas ou z est proche de zero
     419   // resolution avec 2 points au dessus, x0=z1
     420   z1 = z + dzinc;
     421   z2 = z + 2.*dzinc;
     422 }
     423
     424 double gz  = (*this)(z);
     425 double dgz1 = (*this)(z1) - gz;
     426 double dgz2 = (*this)(z2) - gz;
     427
     428 z1 -= z;
     429 z2 -= z;
     430 return (dgz2*z1*z1 - dgz1*z2*z2)/(z1*z2*(z1-z2));
     431}
     432
    401433void GrowthFactor::SetParTo(double OmegaMatter0,double OmegaLambda0)
    402434{
Note: See TracChangeset for help on using the changeset viewer.