MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
Functions
cooling_qso_lightup.h File Reference
#include "forcetree.h"
#include "fof.h"
#include "utils/paramset.h"
Include dependency graph for cooling_qso_lightup.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void set_qso_lightup_params (ParameterSet *ps)
 
void init_qso_lightup (char *reion_hist_file)
 
void do_heiii_reionization (double atime, FOFGroups *fof, DomainDecomp *ddecomp, Cosmology *CP, double uu_in_cgs, FILE *FdHelium)
 
double get_long_mean_free_path_heating (double redshift)
 
int during_helium_reionization (double redshift)
 
int qso_lightup_on (void)
 
int need_change_helium_ionization_fraction (double atime)
 

Function Documentation

◆ do_heiii_reionization()

void do_heiii_reionization ( double  atime,
FOFGroups fof,
DomainDecomp ddecomp,
Cosmology CP,
double  uu_in_cgs,
FILE *  FdHelium 
)

Definition at line 640 of file cooling_qso_lightup.c.

641 {
643  return;
644  if(atime < 1/(1+QSOLightupParams.heIIIreion_start))
645  return;
646 
647  /* Do nothing if we are past the end of the table.*/
648  if(atime > He_zz[Nreionhist-1])
649  return;
650 
651  walltime_measure("/Misc");
652  //message(0, "HeII: Reionization initiated.\n");
653  turn_on_quasars(atime, fof, ddecomp, CP, uu_in_cgs, FdHelium);
654 }
static double * He_zz
static void turn_on_quasars(double atime, FOFGroups *fof, DomainDecomp *ddecomp, Cosmology *CP, double uu_in_cgs, FILE *FdHelium)
static int Nreionhist
static struct qso_lightup_params QSOLightupParams
static Cosmology * CP
Definition: power.c:27
#define walltime_measure(name)
Definition: walltime.h:8

References CP, QSOPriv::fof, He_zz, qso_lightup_params::heIIIreion_start, Nreionhist, qso_lightup_params::QSOLightupOn, QSOLightupParams, turn_on_quasars(), QSOPriv::uu_in_cgs, and walltime_measure.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ during_helium_reionization()

int during_helium_reionization ( double  redshift)

Definition at line 667 of file cooling_qso_lightup.c.

668 {
670  return 0;
671  if(redshift > QSOLightupParams.heIIIreion_start)
672  return 0;
673 
674  /* Past the end of the table, it has finished.*/
675  if(redshift < 1./He_zz[Nreionhist-1] - 1)
676  return 0;
677 
678  return 1;
679 }

References He_zz, qso_lightup_params::heIIIreion_start, Nreionhist, qso_lightup_params::QSOLightupOn, and QSOLightupParams.

Referenced by run().

Here is the caller graph for this function:

◆ get_long_mean_free_path_heating()

double get_long_mean_free_path_heating ( double  redshift)

Definition at line 249 of file cooling_qso_lightup.c.

250 {
252  return 0;
253  if(redshift > QSOLightupParams.heIIIreion_start)
254  return 0;
255  if(redshift == last_zz)
256  return last_long_mfp_heating;
257  double atime = 1/(1+redshift);
258 
259  /* Guard against the end of the table*/
260  if(atime > He_zz[Nreionhist-1])
261  return 0;
262 
263  double long_mfp_heating = gsl_interp_eval(LMFP_intp, He_zz, LMFP, atime, NULL);
264 
265  last_zz = redshift;
266  last_long_mfp_heating = long_mfp_heating;
267  return long_mfp_heating;
268 }
static double last_long_mfp_heating
static gsl_interp * LMFP_intp
static double last_zz
static double * LMFP

References He_zz, qso_lightup_params::heIIIreion_start, last_long_mfp_heating, last_zz, LMFP, LMFP_intp, Nreionhist, qso_lightup_params::QSOLightupOn, and QSOLightupParams.

Referenced by get_lambdanet().

Here is the caller graph for this function:

◆ init_qso_lightup()

void init_qso_lightup ( char *  reion_hist_file)

Definition at line 238 of file cooling_qso_lightup.c.

239 {
241  load_heii_reion_hist(reion_hist_file);
242 }
static void load_heii_reion_hist(const char *reion_hist_file)

References load_heii_reion_hist(), qso_lightup_params::QSOLightupOn, and QSOLightupParams.

Referenced by init_cooling().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ need_change_helium_ionization_fraction()

int need_change_helium_ionization_fraction ( double  atime)

Definition at line 657 of file cooling_qso_lightup.c.

658 {
659  double desired_ion_frac = gsl_interp_eval(HeIII_intp, He_zz, XHeIII, atime, NULL);
660  double curionfrac = gas_ionization_fraction();
661  if(curionfrac < desired_ion_frac)
662  return 1;
663  return 0;
664 }
static double * XHeIII
static double gas_ionization_fraction(void)
static gsl_interp * HeIII_intp

References gas_ionization_fraction(), He_zz, HeIII_intp, and XHeIII.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ qso_lightup_on()

int qso_lightup_on ( void  )

Definition at line 682 of file cooling_qso_lightup.c.

683 {
685 }

References qso_lightup_params::QSOLightupOn, and QSOLightupParams.

Referenced by open_outputfiles().

Here is the caller graph for this function:

◆ set_qso_lightup_params()

void set_qso_lightup_params ( ParameterSet ps)

Definition at line 94 of file cooling_qso_lightup.c.

95 {
96  int ThisTask;
97  MPI_Comm_rank(MPI_COMM_WORLD, &ThisTask);
98  if(ThisTask == 0) {
99  QSOLightupParams.QSOLightupOn = param_get_int(ps, "QSOLightupOn");
102  QSOLightupParams.mean_bubble = param_get_double(ps, "QSOMeanBubble");
103  QSOLightupParams.var_bubble = param_get_double(ps, "QSOVarBubble");
104  QSOLightupParams.heIIIreion_finish_frac = param_get_double(ps, "QSOHeIIIReionFinishFrac");
105  }
106  MPI_Bcast(&QSOLightupParams, sizeof(struct qso_lightup_params), MPI_BYTE, 0, MPI_COMM_WORLD);
107 }
double param_get_double(ParameterSet *ps, const char *name)
Definition: paramset.c:336
int param_get_int(ParameterSet *ps, const char *name)
Definition: paramset.c:368
int ThisTask
Definition: test_exchange.c:23

References qso_lightup_params::heIIIreion_finish_frac, qso_lightup_params::mean_bubble, param_get_double(), param_get_int(), qso_lightup_params::qso_candidate_max_mass, qso_lightup_params::qso_candidate_min_mass, qso_lightup_params::QSOLightupOn, QSOLightupParams, ThisTask, and qso_lightup_params::var_bubble.

Referenced by read_parameter_file().

Here is the call graph for this function:
Here is the caller graph for this function: