Fast Methods for Cosmological Simulations
FastSim serves as a tool for quick N-body simulations in modified gravity.
ccl_3dcorr_sample.c File Reference
#include "ccl.h"
#include "ccl_correlation.h"
#include "ccl_utils.h"
#include "ctest.h"
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string.h>
Include dependency graph for ccl_3dcorr_sample.c:

Go to the source code of this file.

Macros

#define OC   0.25
 
#define OB   0.05
 
#define OK   0.00
 
#define ON   0.00
 
#define HH   0.70
 
#define W0   -1.0
 
#define WA   0.00
 
#define NS   0.96
 
#define NORMPS   0.80
 
#define ZD   0.5
 
#define NZ   128
 
#define Z0_GC   0.50
 
#define SZ_GC   0.05
 
#define NL   512
 
#define PS   0.1
 
#define NEFF   3.046
 
#define K_MIN   0.001
 
#define K_MAX   100
 
#define N_MAX_PK   20000
 

Functions

int main (int argc, char **argv)
 

Macro Definition Documentation

#define HH   0.70

Definition at line 16 of file ccl_3dcorr_sample.c.

Referenced by main().

#define K_MAX   100

Definition at line 29 of file ccl_3dcorr_sample.c.

Referenced by main().

#define K_MIN   0.001

Definition at line 28 of file ccl_3dcorr_sample.c.

#define N_MAX_PK   20000

Definition at line 30 of file ccl_3dcorr_sample.c.

#define NEFF   3.046

Definition at line 27 of file ccl_3dcorr_sample.c.

Referenced by main().

#define NL   512

Definition at line 25 of file ccl_3dcorr_sample.c.

#define NORMPS   0.80

Definition at line 20 of file ccl_3dcorr_sample.c.

Referenced by main().

#define NS   0.96

Definition at line 19 of file ccl_3dcorr_sample.c.

Referenced by main().

#define NZ   128

Definition at line 22 of file ccl_3dcorr_sample.c.

#define OB   0.05

Definition at line 13 of file ccl_3dcorr_sample.c.

Referenced by main().

#define OC   0.25

Definition at line 12 of file ccl_3dcorr_sample.c.

Referenced by main().

#define OK   0.00

Definition at line 14 of file ccl_3dcorr_sample.c.

Referenced by main().

#define ON   0.00

Definition at line 15 of file ccl_3dcorr_sample.c.

#define PS   0.1

Definition at line 26 of file ccl_3dcorr_sample.c.

#define SZ_GC   0.05

Definition at line 24 of file ccl_3dcorr_sample.c.

#define W0   -1.0

Definition at line 17 of file ccl_3dcorr_sample.c.

Referenced by main().

#define WA   0.00

Definition at line 18 of file ccl_3dcorr_sample.c.

Referenced by main().

#define Z0_GC   0.50

Definition at line 23 of file ccl_3dcorr_sample.c.

#define ZD   0.5

Definition at line 21 of file ccl_3dcorr_sample.c.

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 33 of file ccl_3dcorr_sample.c.

References ccl_correlation_3d(), ccl_cosmology_create(), ccl_cosmology_free(), ccl_halofit, ccl_log_spacing(), ccl_mnu_sum, ccl_parameters_create(), cl_cmbl_bm::cosmo, default_config, HH, ccl_configuration::matter_power_spectrum_method, ccl_test_distances::mnu, NEFF, NORMPS, NS, OB, OC, OK, halomod_bm::params, W0, and WA.

34 {
35  // Use the default configuration, plus the cosmological parameters that were
36  // defined above
37  int status=0;
40 
41  double mnuval = 0.;
42  double* mnu;
43  mnu = &mnuval;
45 
47  W0, WA, HH, NORMPS, NS,
48  14.079181246047625, 0.5, 55, 0, NULL, NULL, &status);
49  ccl_cosmology *cosmo = ccl_cosmology_create(params,config);
50 
51  // Define cosine tapering, to reduce ringing. The first two numbers are
52  // [kmin, kmax] for the low-k taper, and the last two are [kmin, kmax] for
53  // the high-k taper.
54  double taper_pk_limits[4] = {0.001, 0.002, 50, 75};
55 
56  double *xi, *r;
57  int n_r = 20;
58  r = ccl_log_spacing(0.1, 50., n_r); // New array with log spacing
59  xi = malloc(n_r*sizeof(double));
60 
61  // Calculate 3dcorrelation function from power spectrum
62  ccl_correlation_3d(cosmo, 1.0,
63  n_r, r, xi,
64  0, taper_pk_limits,
65  &status);
66 
67  // Print results
68  for(int it=0; it < n_r; it++)
69  printf("%le %le\n", r[it], xi[it]);
70 
71  // Free allocated memory
72  ccl_cosmology_free(cosmo);
73  free(xi);
74 
75  return 0;
76 }
matter_power_spectrum_t matter_power_spectrum_method
Definition: ccl_config.h:112
#define NORMPS
#define OB
#define OC
double * ccl_log_spacing(double xmin, double xmax, int N)
Definition: ccl_utils.c:102
#define HH
int * status
Definition: ccl_redshifts.c:41
#define OK
ccl_cosmology * ccl_cosmology_create(ccl_parameters params, ccl_configuration config)
Definition: ccl_core.c:173
#define W0
ccl_mnu_convention
Definition: ccl_core.h:142
void ccl_cosmology_free(ccl_cosmology *cosmo)
Definition: ccl_core.c:829
dictionary params
Definition: halomod_bm.py:27
const ccl_configuration default_config
Definition: ccl_core.c:21
#define NS
void ccl_correlation_3d(ccl_cosmology *cosmo, double a, int n_r, double *r, double *xi, int do_taper_pk, double *taper_pk_limits, int *status)
#define WA
ccl_parameters ccl_parameters_create(double Omega_c, double Omega_b, double Omega_k, double Neff, double *mnu, ccl_mnu_convention mnu_type, double w0, double wa, double h, double norm_pk, double n_s, double bcm_log10Mc, double bcm_etab, double bcm_ks, int nz_mgrowth, double *zarr_mgrowth, double *dfarr_mgrowth, int *status)
Definition: ccl_core.c:294
#define NEFF