Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

Commit 9709373e authored by Plaszczynski Stephane's avatar Plaszczynski Stephane
Browse files

add comobile distance- fix CMTPATH

parent dc0515ad
......@@ -4,7 +4,11 @@ if [ -z "$CMTCLASS" ] ; then
echo "CMTCLASS is undefined"
exit 1
else
if [ -z "$CMTPATH" ] ; then
export CMTPATH=${CMTCLASS}
else
export CMTPATH=${CMTPATH}:${CMTCLASS}
fi
fi
if [ ! -f setup.sh ] ; then
......
......@@ -694,6 +694,26 @@ double ClassEngine::get_H(double z)
return(H_z);
}
double ClassEngine::com_distance(double z)
{
double tau;
int index;
double *pvecback;
//transform redshift in conformal time
background_tau_of_z(&ba,z,&tau);
//pvecback must be allocated
pvecback=(double *)malloc(ba.bg_size*sizeof(double));
//call to fill pvecback
background_at_tau(&ba,tau,ba.long_info,ba.inter_normal, &index, pvecback);
double r=pvecback[ba.index_bg_conf_distance];
free (pvecback);
return(r);
}
double ClassEngine::get_Da(double z)
......
......@@ -146,6 +146,8 @@ public:
double get_Pk(double k, double z);
double get_PkNL(double k, double z);
double com_distance(double z);
//expansion
inline double get_H0() const {return ba.H0*_c_/1e3;}
inline double theta() const {return th.rs_rec/th.ra_rec;}
......
......@@ -81,7 +81,7 @@ public:
double z_rec() const {return klass->z_rec();}
double rs_rec() const {return klass->rs_rec();}
double com_distance(double z) {return klass->com_distance(z);}
void writeCls(std::ostream &o) {klass->writeCls(o);}
......
......@@ -117,6 +117,7 @@ Engine::get(const std::string& key)
else if (var=="tau_reio") return get_tau_reio();
else if (var=="z_reio") return get_z_reio();
else if (var=="H") return get_H(z);
else if (var=="com_distance") return com_distance(z);
else planck_assert(false,("key="+key+" not found in Engine::get()"));
}
......
......@@ -65,6 +65,8 @@ public:
virtual double get_DMod(double z) { return undef("Dmod(z)");}
virtual double Omega_m() const { return undef("Omega_m");}
virtual double YHe() const { return undef("YHe");}
//distance (comobile Mpc)
virtual double com_distance(double z) { return undef("com_distance");}
virtual double get_Pk(double k, double z) { return undef("getpk");}
virtual double get_PkNL(double k, double z) { return undef("getpknl");}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment