CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
CAMB.h
Go to the documentation of this file.
1 /*******************************************************************
2  * Copyright (C) 2022 by Federico Marulli and Giorgio Lesci *
3  * federico.marulli3@unibo.it *
4  * *
5  * This program is free software; you can redistribute it and/or *
6  * modify it under the terms of the GNU General Public License as *
7  * published by the Free Software Foundation; either version 2 of *
8  * the License, or (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful,*
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public *
16  * License along with this program; if not, write to the Free *
17  * Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  *******************************************************************/
20 
33 #ifndef __CAMB__
34 #define __CAMB__
35 
36 #include "Kernel.h"
37 
38 namespace cbl {
39 
40  namespace wrapper {
41 
48  namespace camb {
49 
50  extern"C"
51  {
52 
61  void* GetCAMBparams ();
62 
71  void* GetCAMBdata ();
72 
117  void SetCAMBparams (void* params, const double ombh2, const double omch2, const double omnuh2, const double massless_nu, const int massive_nu, const int neutrino_hierarchy, const double omk, const double H0, const int dark_energy_model, const double w, const double wa, const double tau, const double cs2_lam, const double T_cmb, const double helium_fraction);
118 
141  void SetCAMBPk (void* params, const double redshift, const double ns, const double As, const double pivot_scalar, const bool accurate_massive_nu, const double kmax, const bool nonlinear);
142 
153  void GetCAMBresults (void* params, void* data);
154 
173  void GetCAMBPk (void* data, double *Pk, const double mink, const double dlnkh, const int npoints);
174 
184  void* ReleaseCAMBparams (void* params);
185 
195  void* ReleaseCAMBdata (void* data);
196 
197  }
198 
261  std::vector<double> Pk_CAMB (const bool nonlinear, const double redshift, const double kmin, const double kmax, const int npoints, const double ombh2, const double omch2, const double omnuh2, const double massless_nu, const int massive_nu, const double omk, const double H0, const double ns, const double As, const double pivot_scalar=0.05, const double w=-1., const double wa=0., const double tau=2.1e-9, const bool accurate_massive_nu=false, const int neutrino_hierarchy=3, const int dark_energy_model=1, const double cs2_lam=1., const double T_cmb=2.7255, const double helium_fraction=0.24);
262 
263  }
264  }
265 }
266 
267 #endif
Useful generic functions.
std::vector< double > Pk_CAMB(const bool nonlinear, const double redshift, const double kmin, const double kmax, const int npoints, const double ombh2, const double omch2, const double omnuh2, const double massless_nu, const int massive_nu, const double omk, const double H0, const double ns, const double As, const double pivot_scalar=0.05, const double w=-1., const double wa=0., const double tau=2.1e-9, const bool accurate_massive_nu=false, const int neutrino_hierarchy=3, const int dark_energy_model=1, const double cs2_lam=1., const double T_cmb=2.7255, const double helium_fraction=0.24)
Get the matter power spectrum from CAMB.
Definition: CAMB.cpp:42
void * ReleaseCAMBdata(void *data)
wrapper of the subroutine ReleaseCAMBdata in CAMB/CAMBinterface.f90, deallocating CAMBdata instance
void * ReleaseCAMBparams(void *params)
wrapper of the subroutine ReleaseCAMBparams in CAMB/CAMBinterface.f90, deallocating CAMBparams instan...
void GetCAMBPk(void *data, double *Pk, const double mink, const double dlnkh, const int npoints)
wrapper of the subroutine GetCAMBPk in CAMB/CAMBinterface.f90, calling the subroutine Transfer_GetMat...
void SetCAMBparams(void *params, const double ombh2, const double omch2, const double omnuh2, const double massless_nu, const int massive_nu, const int neutrino_hierarchy, const double omk, const double H0, const int dark_energy_model, const double w, const double wa, const double tau, const double cs2_lam, const double T_cmb, const double helium_fraction)
wrapper of the subroutine SetCAMBparams in CAMB/CAMBinterface.f90, setting CAMBparams parameters
void GetCAMBresults(void *params, void *data)
wrapper of the subroutine GetCAMBresults in CAMB/CAMBinterface.f90, calling the subroutine CAMB_GetRe...
void * GetCAMBparams()
wrapper of the function GetCAMBparams in CAMB/CAMBinterface.f90, creating an instance of the CAMBpara...
void SetCAMBPk(void *params, const double redshift, const double ns, const double As, const double pivot_scalar, const bool accurate_massive_nu, const double kmax, const bool nonlinear)
wrapper of the subroutine SetCAMBPk in CAMB/CAMBinterface.f90, setting the power spectrum parameters
The global namespace of the CosmoBolognaLib
Definition: CAMB.h:38