Skip to content

Commit

Permalink
forgot to include quasirandom as an arg
Browse files Browse the repository at this point in the history
  • Loading branch information
adrianbayer committed Apr 23, 2024
1 parent 9c2da13 commit 2c06681
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
5 changes: 3 additions & 2 deletions api/fastpm/thermalvelocity.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ typedef struct FastPMncdmInitData{
double m_ncdm_sum; /* total eV mass of all ncdm */
double z; /* initialization redshift of ncdm species */

int quasirandom; /* whether velocity sampling is quasirandom or pseudorandom */
int n_shells; /* number of shells for splitting velocity magnitude distribution */
FastPMncdmSphereScheme ncdm_sphere_scheme;
int n_side; /* n_side for healpix, also n_fib for fibonacci */
Expand All @@ -24,8 +25,8 @@ typedef struct FastPMncdmInitData{
} FastPMncdmInitData;

FastPMncdmInitData *
fastpm_ncdm_init_create(double BoxSize, FastPMCosmology * c, double z, int n_shells, int n_side,
int lvk, FastPMncdmSphereScheme ncdm_sphere_scheme);
fastpm_ncdm_init_create(double BoxSize, FastPMCosmology * c, double z, int quasirandom, int n_shells,
int n_side, int lvk, FastPMncdmSphereScheme ncdm_sphere_scheme);

void
fastpm_ncdm_init_free(FastPMncdmInitData* nid);
Expand Down
4 changes: 3 additions & 1 deletion libfastpm/thermalvelocity.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ fastpm_ncdm_init_create(
double BoxSize,
FastPMCosmology * c,
double z,
int quasirandom,
int n_shells,
int n_side,
int lvk,
Expand All @@ -375,7 +376,8 @@ fastpm_ncdm_init_create(
nid->Omega_ncdm = Omega_ncdmTimesHubbleEaSq(1, c);
nid->z = z;
fastpm_info("ncdm reference redshift = %g\n", z);


nid->quasirandom = quasirandom;
if (nid->quasirandom){
nid->n_shells = n_shells;
nid->n_side = n_side;
Expand Down
4 changes: 3 additions & 1 deletion src/fastpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -740,7 +740,9 @@ prepare_ncdm(FastPMSolver * fastpm, RunData * prr, double a0, MPI_Comm comm)
// init the nid
FastPMncdmInitData* nid = fastpm_ncdm_init_create(
boxsize,
fastpm->cosmology, 1 / CONF(prr->lua, time_step)[0] - 1, n_shell, n_side, lvk,
fastpm->cosmology, 1 / CONF(prr->lua, time_step)[0] - 1,
CONF(prr->lua, ncdm_quasirandom),
n_shell, n_side, lvk,
CONF(prr->lua, ncdm_sphere_scheme));

size_t total_np_ncdm_sites = nc_ncdm * nc_ncdm * nc_ncdm;
Expand Down

0 comments on commit 2c06681

Please sign in to comment.