MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <omp.h>
#include "physconst.h"
#include "sfr_eff.h"
#include "cooling.h"
#include "slotsmanager.h"
#include "walltime.h"
#include "winds.h"
#include "hydra.h"
#include "forcetree.h"
#include "domain.h"
Go to the source code of this file.
Classes | |
struct | SFRParams |
struct | sfr_eeqos_data |
Functions | |
int | get_generations (void) |
static struct sfr_eeqos_data | get_sfr_eeqos (struct particle_data *part, struct sph_particle_data *sph, double dtime, struct UVBG *local_uvbg, const double redshift, const double a3inv) |
static void | cooling_direct (int i, const double redshift, const double a3inv, const double hubble, const struct UVBG *const GlobalUVBG) |
static void | cooling_relaxed (int i, double dtime, struct UVBG *local_uvbg, const double redshift, const double a3inv, struct sfr_eeqos_data sfr_data, const struct UVBG *const GlobalUVBG) |
static int | make_particle_star (int child, int parent, int placement, double Time) |
static int | starformation (int i, double *localsfr, MyFloat *sm_out, MyFloat *GradRho, const double redshift, const double a3inv, const double hubble, const double GravInternal, const struct UVBG *const GlobalUVBG) |
static int | quicklyastarformation (int i, const double a3inv) |
static double | get_sfr_factor_due_to_selfgravity (int i, const double atime, const double a3inv, const double hubble, const double GravInternal) |
static double | get_sfr_factor_due_to_h2 (int i, MyFloat *GradRho, const double atime) |
static double | get_starformation_rate_full (int i, MyFloat *GradRho, struct sfr_eeqos_data sfr_data, const double atime, const double a3inv, const double hubble, const double GravInternal) |
static double | get_egyeff (double redshift, double dens, struct UVBG *uvbg) |
static double | find_star_mass (int i, const double avg_baryon_mass) |
static int * | sfr_reserve_slots (ActiveParticles *act, int *NewStars, int NumNewStar, ForceTree *tt) |
void | set_sfr_params (ParameterSet *ps) |
void | cooling_and_starformation (ActiveParticles *act, double Time, double dloga, ForceTree *tree, const Cosmology *CP, MyFloat *GradRho, FILE *FdSfr) |
int | sfreff_on_eeqos (const struct sph_particle_data *sph, const double a3inv) |
double | get_neutral_fraction_sfreff (double redshift, double hubble, struct particle_data *partdata, struct sph_particle_data *sphdata) |
double | get_helium_neutral_fraction_sfreff (int ion, double redshift, double hubble, struct particle_data *partdata, struct sph_particle_data *sphdata) |
double | get_MinEgySpec (void) |
void | init_cooling_and_star_formation (int CoolingOn, int StarformationOn, Cosmology *CP, const double avg_baryon_mass, const double BoxSize, const struct UnitSystem units) |
int | sfr_need_to_compute_sph_grad_rho (void) |
static double | ev_NH_from_GradRho (MyFloat gradrho_mag, double hsml, double rho, double include_h) |
Variables | |
static struct SFRParams | sfr_params |
void cooling_and_starformation | ( | ActiveParticles * | act, |
double | Time, | ||
double | dloga, | ||
ForceTree * | tree, | ||
const Cosmology * | CP, | ||
MyFloat * | GradRho, | ||
FILE * | FdSfr | ||
) |
Definition at line 167 of file sfr_eff.c.
References ActiveParticles::ActiveParticle, cooling_direct(), CP, dloga, endrun(), gadget_compact_thread_arrays(), gadget_setup_thread_arrays(), get_global_UVBG(), Cosmology::GravInternal, hubble_function(), slots_manager_type::info, make_particle_star(), slot_info::maxsize, message(), MPIU_Barrier, myfree, mymalloc, mymalloc2, myrealloc, ActiveParticles::NumActiveParticle, P, quicklyastarformation(), SFRParams::QuickLymanAlphaProbability, report_memory_usage, sfr_params, sfr_reserve_slots(), sfreff_on_eeqos(), slot_info::size, SlotsManager, SPHP, starformation(), SFRParams::StarformationOn, sumup_large_ints(), ta_free, ta_malloc, SFRParams::UnitSfr_in_solar_per_year, walltime_measure, SFRParams::WindOn, winds_and_feedback(), winds_are_subgrid(), winds_evolve(), and winds_subgrid().
Referenced by run(), and runfof().
|
static |
Definition at line 444 of file sfr_eff.c.
References part_manager_type::CurrentParticleOffset, dloga, DoCooling(), dti_from_timebin(), GAMMA_MINUS1, get_dloga_for_bin(), get_local_UVBG(), SFRParams::HIReionTemp, HYDROGEN_MASSFRAC, loga_from_ti(), SFRParams::MinGasTemp, P, PartManager, sfr_params, SPHP, SFRParams::temp_to_u, and UVBG::zreion.
Referenced by cooling_and_starformation().
|
static |
Definition at line 606 of file sfr_eff.c.
References SFRParams::BHFeedbackUseTcool, sfr_eeqos_data::cloudfrac, sph_particle_data::Density, sfr_eeqos_data::egyhot, SFRParams::EgySpecCold, GAMMA_MINUS1, GetCoolingTime(), sph_particle_data::Metallicity, P, sfr_params, SPHP, and sfr_eeqos_data::trelax.
Referenced by get_sfr_eeqos().
|
static |
Definition at line 959 of file sfr_eff.c.
Referenced by get_sfr_factor_due_to_h2().
|
static |
Definition at line 921 of file sfr_eff.c.
References SFRParams::Generations, P, SFRParams::QuickLymanAlphaProbability, and sfr_params.
Referenced by get_sfr_eeqos().
|
static |
Definition at line 782 of file sfr_eff.c.
References sfr_eeqos_data::egyhot, SFRParams::EgySpecCold, SFRParams::EgySpecSN, SFRParams::FactorEVP, SFRParams::FactorSN, GetCoolingTime(), SFRParams::MaxSfrTimescale, sfr_eeqos_data::ne, SFRParams::PhysDensThresh, sfr_params, and sfr_eeqos_data::tsfr.
Referenced by init_cooling_and_star_formation(), and sfreff_on_eeqos().
int get_generations | ( | void | ) |
Definition at line 87 of file sfr_eff.c.
References SFRParams::Generations, and sfr_params.
Referenced by init(), and petaio_read_header_internal().
double get_helium_neutral_fraction_sfreff | ( | int | ion, |
double | redshift, | ||
double | hubble, | ||
struct particle_data * | partdata, | ||
struct sph_particle_data * | sphdata | ||
) |
Definition at line 548 of file sfr_eff.c.
References sfr_eeqos_data::cloudfrac, part_manager_type::CurrentParticleOffset, sph_particle_data::Density, dloga, sfr_eeqos_data::egyhot, SFRParams::EgySpecCold, sph_particle_data::Entropy, GAMMA_MINUS1, get_dloga_for_bin(), get_global_UVBG(), get_local_UVBG(), get_sfr_eeqos(), GetHeliumIonFraction(), sfr_eeqos_data::ne, sph_particle_data::Ne, PartManager, particle_data::Pos, SFRParams::QuickLymanAlphaProbability, sfr_params, sfreff_on_eeqos(), particle_data::Ti_drift, and particle_data::TimeBin.
Referenced by GTHeliumIFraction(), GTHeliumIIFraction(), and GTHeliumIIIFraction().
double get_MinEgySpec | ( | void | ) |
Definition at line 797 of file sfr_eff.c.
References HYDROGEN_MASSFRAC, SFRParams::MinGasTemp, sfr_params, and SFRParams::temp_to_u.
Referenced by begrun(), run(), and runfof().
double get_neutral_fraction_sfreff | ( | double | redshift, |
double | hubble, | ||
struct particle_data * | partdata, | ||
struct sph_particle_data * | sphdata | ||
) |
Definition at line 520 of file sfr_eff.c.
References sfr_eeqos_data::cloudfrac, part_manager_type::CurrentParticleOffset, sph_particle_data::Density, dloga, sfr_eeqos_data::egyhot, SFRParams::EgySpecCold, sph_particle_data::Entropy, GAMMA_MINUS1, get_dloga_for_bin(), get_global_UVBG(), get_local_UVBG(), get_sfr_eeqos(), GetNeutralFraction(), sfr_eeqos_data::ne, sph_particle_data::Ne, PartManager, particle_data::Pos, SFRParams::QuickLymanAlphaProbability, sfr_params, sfreff_on_eeqos(), particle_data::Ti_drift, and particle_data::TimeBin.
Referenced by blackhole_accretion_ngbiter(), and GTNeutralHydrogenFraction().
|
static |
Definition at line 666 of file sfr_eff.c.
References SFRParams::avg_baryon_mass, cooling_relaxed(), part_manager_type::CurrentParticleOffset, dloga, find_star_mass(), SFRParams::Generations, get_dloga_for_bin(), get_local_UVBG(), get_random_number(), get_starformation_rate_full(), METAL_YIELD, sfr_eeqos_data::ne, P, PartManager, sfr_params, slots_split_particle(), SPHP, and SFRParams::UnitSfr_in_solar_per_year.
Referenced by get_helium_neutral_fraction_sfreff(), and get_neutral_fraction_sfreff().
|
static |
Definition at line 973 of file sfr_eff.c.
References ev_NH_from_GradRho(), METAL_YIELD, P, sfr_params, SPHP, and SFRParams::tau_fmol_unit.
Referenced by get_starformation_rate_full().
|
static |
Definition at line 997 of file sfr_eff.c.
References HAS, SFRParams::PhysDensThresh, SFR_CRITERION_CONTINUOUS_CUTOFF, SFR_CRITERION_CONVERGENT_FLOW, sfr_params, SPHP, and SFRParams::StarformationCriterion.
Referenced by get_starformation_rate_full().
|
static |
Definition at line 759 of file sfr_eff.c.
References sfr_eeqos_data::cloudfrac, endrun(), SFRParams::FactorSN, get_sfr_factor_due_to_h2(), get_sfr_factor_due_to_selfgravity(), HAS, P, SFR_CRITERION_MOLECULAR_H2, SFR_CRITERION_SELFGRAVITY, sfr_params, sfreff_on_eeqos(), SPHP, SFRParams::StarformationCriterion, and sfr_eeqos_data::tsfr.
Referenced by get_sfr_eeqos().
void init_cooling_and_star_formation | ( | int | CoolingOn, |
int | StarformationOn, | ||
Cosmology * | CP, | ||
const double | avg_baryon_mass, | ||
const double | BoxSize, | ||
const struct UnitSystem | units | ||
) |
Definition at line 805 of file sfr_eff.c.
References SFRParams::avg_baryon_mass, BOLTZMANN, cooling_units::CoolingOn, coolunits, CP, SFRParams::CritOverDensity, SFRParams::CritPhysDensity, cooling_units::density_in_phys_cgs, SFRParams::EgySpecCold, SFRParams::EgySpecSN, SFRParams::FactorEVP, SFRParams::FactorSN, GAMMA_MINUS1, get_egyeff(), GetCoolingTime(), Cosmology::GravInternal, GRAVITY, Cosmology::Hubble, HUBBLE, Cosmology::HubbleParam, HYDROGEN_MASSFRAC, init_cooling(), init_uvf_table(), init_winds(), SFRParams::MaxSfrTimescale, message(), SFRParams::MetalCoolFile, Cosmology::OmegaBaryon, SFRParams::OverDensThresh, SFRParams::PhysDensThresh, PROTONMASS, SFRParams::ReionHistFile, cooling_units::rho_crit_baryon, SEC_PER_YEAR, sfr_params, sigma, SOLAR_MASS, SFRParams::StarformationOn, SFRParams::tau_fmol_unit, SFRParams::temp_to_u, SFRParams::TempClouds, SFRParams::TempSupernova, SFRParams::TreeCoolFile, cooling_units::tt_in_s, UnitSystem::UnitDensity_in_cgs, UnitSystem::UnitInternalEnergy_in_cgs, UnitSystem::UnitLength_in_cm, UnitSystem::UnitMass_in_g, SFRParams::UnitSfr_in_solar_per_year, UnitSystem::UnitTime_in_s, cooling_units::uu_in_cgs, SFRParams::UVFluctuationFile, and SFRParams::WindOn.
Referenced by begrun().
|
static |
Definition at line 578 of file sfr_eff.c.
References sph_particle_data::Density, endrun(), sph_particle_data::Metallicity, sph_particle_data::Metals, NMETALS, P, PartManager, slots_convert(), SlotsManager, SPHP, and STARP.
Referenced by cooling_and_starformation().
|
static |
Definition at line 641 of file sfr_eff.c.
References sph_particle_data::Density, GAMMA_MINUS1, get_random_number(), HYDROGEN_MASSFRAC, SFRParams::OverDensThresh, P, SFRParams::QuickLymanAlphaProbability, SFRParams::QuickLymanAlphaTempThresh, sfr_params, SPHP, and SFRParams::temp_to_u.
Referenced by cooling_and_starformation().
void set_sfr_params | ( | ParameterSet * | ps | ) |
Definition at line 129 of file sfr_eff.c.
References SFRParams::BHFeedbackUseTcool, SFRParams::CritOverDensity, SFRParams::CritPhysDensity, endrun(), SFRParams::FactorEVP, SFRParams::FactorSN, SFRParams::Generations, SFRParams::HIReionTemp, SFRParams::MaxSfrTimescale, SFRParams::MetalCoolFile, SFRParams::MinGasTemp, param_get_double(), param_get_enum(), param_get_int(), param_get_string2(), SFRParams::QuickLymanAlphaProbability, SFRParams::QuickLymanAlphaTempThresh, SFRParams::ReionHistFile, sfr_params, SFRParams::StarformationCriterion, SFRParams::TempClouds, SFRParams::TempSupernova, ThisTask, SFRParams::TreeCoolFile, SFRParams::UVFluctuationFile, and SFRParams::WindOn.
Referenced by read_parameter_file().
int sfr_need_to_compute_sph_grad_rho | ( | void | ) |
Definition at line 952 of file sfr_eff.c.
References HAS, SFR_CRITERION_MOLECULAR_H2, sfr_params, and SFRParams::StarformationCriterion.
Referenced by run(), and runfof().
|
static |
Definition at line 380 of file sfr_eff.c.
References ActiveParticles::ActiveParticle, ForceTree::Father, ForceTree::firstnode, force_tree_allocated(), slots_manager_type::info, part_manager_type::MaxPart, slot_info::maxsize, message(), myfree, mymalloc, mymalloc2, ForceTree::Nodes, ForceTree::Nodes_base, ActiveParticles::NumActiveParticle, ForceTree::numnodes, part_manager_type::NumPart, PartManager, slot_info::size, slots_reserve(), and SlotsManager.
Referenced by cooling_and_starformation().
int sfreff_on_eeqos | ( | const struct sph_particle_data * | sph, |
const double | a3inv | ||
) |
Definition at line 486 of file sfr_eff.c.
References SFRParams::BHFeedbackUseTcool, sph_particle_data::DelayTime, sph_particle_data::Density, sph_particle_data::Entropy, GAMMA_MINUS1, get_egyeff(), get_global_UVBG(), SFRParams::OverDensThresh, SFRParams::PhysDensThresh, sfr_params, and SFRParams::StarformationOn.
Referenced by blackhole_feedback_ngbiter(), cooling_and_starformation(), get_helium_neutral_fraction_sfreff(), get_neutral_fraction_sfreff(), and get_starformation_rate_full().
|
static |
Definition at line 666 of file sfr_eff.c.
Referenced by cooling_and_starformation().
|
static |
Referenced by cooling_and_starformation(), cooling_direct(), cooling_relaxed(), find_star_mass(), get_egyeff(), get_generations(), get_helium_neutral_fraction_sfreff(), get_MinEgySpec(), get_neutral_fraction_sfreff(), get_sfr_eeqos(), get_sfr_factor_due_to_h2(), get_sfr_factor_due_to_selfgravity(), get_starformation_rate_full(), init_cooling_and_star_formation(), quicklyastarformation(), set_sfr_params(), sfr_need_to_compute_sph_grad_rho(), and sfreff_on_eeqos().