MP-Gadget
5.0.1.dev1-76bc7d4726-dirty
|
#include <math.h>
#include <string.h>
#include <omp.h>
#include "winds.h"
#include "physconst.h"
#include "treewalk.h"
#include "slotsmanager.h"
#include "timebinmgr.h"
#include "walltime.h"
#include "density.h"
#include "hydra.h"
Go to the source code of this file.
Classes | |
struct | WindParams |
struct | TreeWalkQueryWind |
struct | TreeWalkResultWind |
struct | TreeWalkNgbIterWind |
struct | winddata |
struct | StarKick |
struct | WindPriv |
Macros | |
#define | NWINDHSML 5 /* Number of densities to evaluate for wind weight ngbiter*/ |
#define | NUMDMNGB 40 /*Number of DM ngb to evaluate vel dispersion */ |
#define | MAXDMDEVIATION 2 |
#define | WIND_GET_PRIV(tw) ((struct WindPriv *) (tw->priv)) |
#define | WINDP(i, wind) wind[P[i].PI] |
Functions | |
void | set_winds_params (ParameterSet *ps) |
void | init_winds (double FactorSN, double EgySpecSN, double PhysDensThresh, double UnitTime_in_s) |
int | winds_are_subgrid (void) |
int | winds_is_particle_decoupled (int i) |
void | winds_decoupled_hydro (int i, double atime) |
static void | wind_do_kick (int other, double vel, double therm, double atime) |
static int | get_wind_dir (int i, double dir[3]) |
static void | get_wind_params (double *vel, double *windeff, double *utherm, const double vdisp, const double time) |
static void | sfr_wind_reduce_weight (int place, TreeWalkResultWind *remote, enum TreeWalkReduceMode mode, TreeWalk *tw) |
static void | sfr_wind_copy (int place, TreeWalkQueryWind *input, TreeWalk *tw) |
static void | sfr_wind_weight_postprocess (const int i, TreeWalk *tw) |
static void | sfr_wind_weight_ngbiter (TreeWalkQueryWind *I, TreeWalkResultWind *O, TreeWalkNgbIterWind *iter, LocalTreeWalk *lv) |
static void | sfr_wind_feedback_ngbiter (TreeWalkQueryWind *I, TreeWalkResultWind *O, TreeWalkNgbIterWind *iter, LocalTreeWalk *lv) |
int | winds_ever_decouple (void) |
int | cmp_by_part_id (const void *a, const void *b) |
static void | winds_find_weights (TreeWalk *tw, struct WindPriv *priv, int *NewStars, int NumNewStars, const double Time, const double hubble, ForceTree *tree) |
void | winds_subgrid (int *MaybeWind, int NumMaybeWind, const double Time, const double hubble, ForceTree *tree, MyFloat *StellarMasses) |
void | winds_and_feedback (int *NewStars, int NumNewStars, const double Time, const double hubble, ForceTree *tree) |
void | winds_evolve (int i, double a3inv, double hubble) |
static double | effdmradius (int place, int i, TreeWalk *tw) |
int | winds_make_after_sf (int i, double sm, double vdisp, double atime) |
Variables | |
static struct WindParams | wind_params |
#define NUMDMNGB 40 /*Number of DM ngb to evaluate vel dispersion */ |
#define NWINDHSML 5 /* Number of densities to evaluate for wind weight ngbiter*/ |
#define WIND_GET_PRIV | ( | tw | ) | ((struct WindPriv *) (tw->priv)) |
int cmp_by_part_id | ( | const void * | a, |
const void * | b | ||
) |
Definition at line 231 of file winds.c.
References StarKick::part_index, StarKick::StarDistance, and StarKick::StarID.
Referenced by winds_and_feedback().
|
inlinestatic |
Definition at line 422 of file winds.c.
References ForceTree::BoxSize, NWINDHSML, TreeWalk::tree, WIND_GET_PRIV, and WINDP.
Referenced by sfr_wind_copy(), and sfr_wind_weight_postprocess().
|
static |
Definition at line 614 of file winds.c.
References get_random_number(), and P.
Referenced by wind_do_kick().
|
static |
Definition at line 630 of file winds.c.
References endrun(), HAS, WindParams::MinWindVelocity, WIND_FIXED_EFFICIENCY, wind_params, WIND_USE_HALO, WindParams::WindEfficiency, WindParams::WindModel, WindParams::WindSigma0, WindParams::WindSpeed, WindParams::WindSpeedFactor, and WindParams::WindThermalFactor.
Referenced by sfr_wind_feedback_ngbiter().
void init_winds | ( | double | FactorSN, |
double | EgySpecSN, | ||
double | PhysDensThresh, | ||
double | UnitTime_in_s | ||
) |
Definition at line 97 of file winds.c.
References endrun(), HAS, WindParams::MaxWindFreeTravelTime, message(), SEC_PER_MEGAYEAR, WIND_FIXED_EFFICIENCY, wind_params, WIND_USE_HALO, WindParams::WindEfficiency, WindParams::WindEnergyFraction, WindParams::WindFreeTravelDensFac, WindParams::WindFreeTravelDensThresh, WindParams::WindModel, WindParams::WindSigma0, WindParams::WindSpeed, and WindParams::WindSpeedFactor.
Referenced by init_cooling_and_star_formation().
void set_winds_params | ( | ParameterSet * | ps | ) |
Definition at line 72 of file winds.c.
References WindParams::MaxWindFreeTravelTime, WindParams::MinWindVelocity, param_get_double(), param_get_enum(), ThisTask, wind_params, WindParams::WindEfficiency, WindParams::WindEnergyFraction, WindParams::WindFreeTravelDensFac, WindParams::WindFreeTravelLength, WindParams::WindModel, WindParams::WindSigma0, WindParams::WindSpeedFactor, and WindParams::WindThermalFactor.
Referenced by read_parameter_file().
|
static |
Definition at line 501 of file winds.c.
References TreeWalkQueryWind::DMRadius, TreeWalkQueryWind::Dt, effdmradius(), get_dloga_for_bin(), TreeWalkQueryWind::Hsml, TreeWalkQueryWind::ID, TreeWalkQueryWind::Mass, NWINDHSML, P, TreeWalkQueryWind::TotalWeight, TreeWalkQueryWind::Vdisp, TreeWalkQueryWind::Vel, WIND_GET_PRIV, and WINDP.
Referenced by winds_find_weights().
|
static |
Definition at line 650 of file winds.c.
References atomic_fetch_and_add_64(), TreeWalkNgbIterWind::base, endrun(), get_random_number(), get_wind_params(), TreeWalkNgbIterBase::Hsml, TreeWalkQueryWind::Hsml, TreeWalkQueryWind::ID, TreeWalkNgbIterBase::mask, TreeWalkQueryWind::Mass, NGB_TREEFIND_ASYMMETRIC, TreeWalkNgbIterBase::other, P, StarKick::part_index, TreeWalkNgbIterBase::r, SPHP, StarKick::StarDistance, StarKick::StarID, StarKick::StarKickVelocity, StarKick::StarTherm, TreeWalkNgbIterBase::symmetric, TreeWalkQueryWind::TotalWeight, LocalTreeWalk::tw, TreeWalkQueryWind::Vdisp, and WIND_GET_PRIV.
Referenced by winds_and_feedback().
|
static |
Definition at line 480 of file winds.c.
References TreeWalkResultWind::maxcmpte, winddata::maxcmpte, TreeWalkResultWind::Ngb, winddata::Ngb, TreeWalkResultWind::TotalWeight, winddata::TotalWeight, TREEWALK_REDUCE, TreeWalkResultWind::V1sum, winddata::V1sum, TreeWalkResultWind::V2sum, winddata::V2sum, WIND_GET_PRIV, and WINDP.
Referenced by winds_find_weights().
|
static |
Definition at line 521 of file winds.c.
References TreeWalkNgbIterWind::base, TreeWalkNgbIterBase::dist, DMAX, TreeWalkQueryWind::DMRadius, winddata::DMRadius, TreeWalkNgbIterBase::Hsml, TreeWalkQueryWind::Hsml, TreeWalkNgbIterBase::mask, TreeWalkResultWind::maxcmpte, TreeWalkResultWind::Ngb, NGB_TREEFIND_ASYMMETRIC, NUMDMNGB, NWINDHSML, TreeWalkNgbIterBase::other, P, TreeWalkNgbIterBase::r, SPHP, TreeWalkNgbIterBase::symmetric, TreeWalkResultWind::TotalWeight, LocalTreeWalk::tw, TreeWalkResultWind::V1sum, TreeWalkResultWind::V2sum, TreeWalkQueryWind::Vel, WIND_GET_PRIV, and wk.
Referenced by winds_find_weights().
|
static |
Definition at line 441 of file winds.c.
References ForceTree::BoxSize, effdmradius(), winddata::Left, MAXDMDEVIATION, TreeWalk::maxnumngb, TreeWalk::minnumngb, winddata::Ngb, ngb_narrow_down(), TreeWalk::NPLeft, TreeWalk::NPRedo, NUMDMNGB, NWINDHSML, winddata::Right, TreeWalk::tree, winddata::V1sum, WIND_GET_PRIV, and WINDP.
Referenced by winds_find_weights().
|
static |
Definition at line 590 of file winds.c.
References GAMMA_MINUS1, get_wind_dir(), WindParams::MaxWindFreeTravelTime, P, SPHP, wind_params, WindParams::WindFreeTravelLength, and winds_ever_decouple().
Referenced by winds_and_feedback().
void winds_and_feedback | ( | int * | NewStars, |
int | NumNewStars, | ||
const double | Time, | ||
const double | hubble, | ||
ForceTree * | tree | ||
) |
Definition at line 333 of file winds.c.
References cmp_by_part_id(), endrun(), TreeWalk::ev_label, HAS, TreeWalk::haswork, WindPriv::hubble, WindPriv::kicks, WindPriv::maxkicks, message(), MPI_INT64, MPIU_Any(), myfree, mymalloc, TreeWalk::ngbiter, TreeWalk::Niteration, WindPriv::nkicks, WindPriv::nvisited, StarKick::part_index, TreeWalk::postprocess, qsort_openmp, TreeWalk::reduce, sfr_wind_feedback_ngbiter(), SPHP, StarKick::StarDistance, StarKick::StarID, StarKick::StarKickVelocity, StarKick::StarTherm, sumup_large_ints(), ta_free, WindPriv::Time, treewalk_run(), walltime_measure, wind_do_kick(), wind_params, WIND_SUBGRID, WindPriv::Winddata, WindParams::WindModel, and winds_find_weights().
Referenced by cooling_and_starformation().
int winds_are_subgrid | ( | void | ) |
Definition at line 115 of file winds.c.
References HAS, wind_params, WIND_SUBGRID, and WindParams::WindModel.
Referenced by cooling_and_starformation().
void winds_decoupled_hydro | ( | int | i, |
double | atime | ||
) |
Definition at line 133 of file winds.c.
References DMAX, GAMMA, SPHP, wind_params, WindParams::WindFreeTravelDensThresh, and WindParams::WindSpeed.
Referenced by hydro_postprocess().
int winds_ever_decouple | ( | void | ) |
Definition at line 192 of file winds.c.
References WindParams::MaxWindFreeTravelTime, and wind_params.
Referenced by wind_do_kick().
void winds_evolve | ( | int | i, |
double | a3inv, | ||
double | hubble | ||
) |
Definition at line 403 of file winds.c.
References dloga, DMAX, get_dloga_for_bin(), WindPriv::hubble, WindParams::MaxWindFreeTravelTime, P, SPHP, wind_params, and WindParams::WindFreeTravelDensThresh.
Referenced by cooling_and_starformation().
|
static |
Definition at line 255 of file winds.c.
References ForceTree::BoxSize, TreeWalk::ev_label, TreeWalk::fill, HAS, TreeWalk::haswork, WindPriv::hubble, slots_manager_type::info, mymalloc, TreeWalk::ngbiter, TreeWalk::ngbiter_type_elsize, NUMDMNGB, WindPriv::nvisited, P, TreeWalk::postprocess, TreeWalk::priv, TreeWalk::query_type_elsize, TreeWalk::reduce, TreeWalk::result_type_elsize, sfr_wind_copy(), sfr_wind_reduce_weight(), sfr_wind_weight_ngbiter(), sfr_wind_weight_postprocess(), slot_info::size, SlotsManager, sumup_large_ints(), ta_malloc, WindPriv::Time, TreeWalk::tree, treewalk_do_hsml_loop(), treewalk_visit_nolist_ngbiter(), TreeWalk::visit, WIND_GET_PRIV, wind_params, WIND_SUBGRID, WindPriv::Winddata, WindParams::WindModel, and WINDP.
Referenced by winds_and_feedback(), and winds_subgrid().
int winds_is_particle_decoupled | ( | int | i | ) |
Definition at line 124 of file winds.c.
References HAS, P, SPHP, WIND_DECOUPLE_SPH, wind_params, and WindParams::WindModel.
Referenced by add_particle_to_group(), blackhole_accretion_ngbiter(), blackhole_feedback_ngbiter(), density_ngbiter(), hydro_ngbiter(), and hydro_postprocess().
int winds_make_after_sf | ( | int | i, |
double | sm, | ||
double | vdisp, | ||
double | atime | ||
) |
Definition at line 708 of file winds.c.
Referenced by winds_subgrid().
void winds_subgrid | ( | int * | MaybeWind, |
int | NumMaybeWind, | ||
const double | Time, | ||
const double | hubble, | ||
ForceTree * | tree, | ||
MyFloat * | StellarMasses | ||
) |
Definition at line 306 of file winds.c.
References HAS, WindPriv::hubble, MPIU_Any(), myfree, WindPriv::nvisited, P, WindPriv::Time, walltime_measure, wind_params, WIND_SUBGRID, WindPriv::Winddata, WindParams::WindModel, WINDP, winds_find_weights(), and winds_make_after_sf().
Referenced by cooling_and_starformation().
|
static |