MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
powerspectrum.h
Go to the documentation of this file.
1 #ifndef POWERSPEC_H
2 #define POWERSPEC_H
3 
4 #include <stddef.h>
5 #include <stdint.h>
6 #include <gsl/gsl_interp.h>
7 
8 typedef struct _powerspectrum {
9  double * kk;
10  double * Power;
11  int64_t * Nmodes;
12  int size;
13  int nalloc;
14  int nonzero;
15  double Norm;
16  /* Used to set the output units of the power to Mpc*/
18  /*These are for the LRA neutrino code*/
19  /*log k bins and ratio of Pnu to Pcdm: stored so interpolation is accurate*/
20  double * logknu;
21  double * delta_nu_ratio;
22  double nu_prefac;
23  gsl_interp *nu_spline;
24  gsl_interp_accel * nu_acc;
25 
27 
28 /*Allocate memory for the power spectrum*/
29 void powerspectrum_alloc(Power * ps, const int nbins, const int nthreads, const int MassiveNuLinResp, const double BoxSize_in_cm);
30 
31 /*Zero memory for the power spectrum*/
32 void powerspectrum_zero(Power * ps);
33 
34 /*Free power spectrum memory*/
35 void powerspectrum_free(Power * ps);
36 
37 /* Sum the different modes on each thread and processor together to get a power spectrum,
38  * and fix the units.*/
39 void powerspectrum_sum(Power * ps);
40 
41 /*Save the power spectrum to a file*/
42 void powerspectrum_save(Power * ps, const char * OutputDir, const char * filename, const double Time, const double D1);
43 #endif
void powerspectrum_save(Power *ps, const char *OutputDir, const char *filename, const double Time, const double D1)
Definition: powerspectrum.c:92
void powerspectrum_free(Power *ps)
Definition: powerspectrum.c:44
struct _powerspectrum Power
void powerspectrum_sum(Power *ps)
Definition: powerspectrum.c:54
void powerspectrum_zero(Power *ps)
Definition: powerspectrum.c:35
void powerspectrum_alloc(Power *ps, const int nbins, const int nthreads, const int MassiveNuLinResp, const double BoxSize_in_cm)
Definition: powerspectrum.c:16
gsl_interp_accel * nu_acc
Definition: powerspectrum.h:24
double * logknu
Definition: powerspectrum.h:20
double * delta_nu_ratio
Definition: powerspectrum.h:21
double * Power
Definition: powerspectrum.h:10
double BoxSize_in_MPC
Definition: powerspectrum.h:17
gsl_interp * nu_spline
Definition: powerspectrum.h:23
int64_t * Nmodes
Definition: powerspectrum.h:11