diff --git a/sample.cfg b/sample.cfg index 06c4d50..34d5047 100644 --- a/sample.cfg +++ b/sample.cfg @@ -50,6 +50,7 @@ power_spectrum = planck15 sim_name = mini-SURFS volume = 144703.125 lbox = 210 +particle_mass = 2.21e8 # in Msun/h tot_n_subvolumes = 64 min_snapshot = 51 max_snapshot = 199 diff --git a/sample_lagos23.cfg b/sample_lagos23.cfg index 3dfee36..03e90b2 100644 --- a/sample_lagos23.cfg +++ b/sample_lagos23.cfg @@ -65,6 +65,7 @@ spin_mass_dependence = true sim_name = mini-SURFS volume = 144703.125 lbox = 210 +particle_mass = 2.21e8 # in Msun/h tot_n_subvolumes = 64 min_snapshot = 51 max_snapshot = 199 diff --git a/src/evolve_halos.cpp b/src/evolve_halos.cpp index c09d49c..81c8474 100644 --- a/src/evolve_halos.cpp +++ b/src/evolve_halos.cpp @@ -114,12 +114,6 @@ void transfer_galaxies_to_next_snapshot(const std::vector &halos, int s for(auto &halo: halos){ for(auto &subhalo: halo->all_subhalos()) { - // Make sure all SFRs and BH accretion rates (in mass and metals) are set to 0 for the next snapshot - for (auto &galaxy: subhalo->galaxies) { - //restart descendant_id - galaxy.descendant_id = -1; - } - // Check if this is a satellite subhalo, and whether this is the last snapshot in which it is identified. // In that case, the transfer of galaxies has already been done in merging_subhalos. // In any other case, we need to do the transfer. @@ -207,6 +201,8 @@ void reset_instantaneous_galaxy_properties(const std::vector &halos, in galaxy.sfr_disk = 0; galaxy.smbh.macc_sb = 0; galaxy.smbh.macc_hh = 0; + //restart descendant_id + galaxy.descendant_id = -1; //restart counter of mergers and disk instabilities. galaxy.interaction.restore_interaction_item(); diff --git a/src/galaxy_mergers.cpp b/src/galaxy_mergers.cpp index 1414bf9..cdf7d5c 100644 --- a/src/galaxy_mergers.cpp +++ b/src/galaxy_mergers.cpp @@ -150,7 +150,7 @@ void GalaxyMergers::merging_timescale(Galaxy &galaxy, SubhaloPtr &primary, Subha // The satellites mass including its baryon mass double mgal = galaxy.baryon_mass(); - double ms = simparams.particle_mass * secondary->Npart + mgal; + double ms = secondary->Mvir + mgal; if(transfer_types2){ ms = galaxy.msubhalo_type2 + mgal; } diff --git a/src/tree_builder.cpp b/src/tree_builder.cpp index ea558f4..bf495a7 100644 --- a/src/tree_builder.cpp +++ b/src/tree_builder.cpp @@ -749,9 +749,9 @@ void HaloBasedTreeBuilder::loop_through_halos(std::vector &halos, Simul std::set halo_snapshots; for(const auto &halo: halos) { halo_snapshots.insert(halo->snapshot); - // compute the minimum particle number for structures - for(const auto &subhalo: halo->all_subhalos()) { - if (exec_params.define_transient == ExecutionParameters::ZDEP_3SIGMA || exec_params.define_transient == ExecutionParameters::CONST_10MINPART){ + // compute the minimum particle number for structures when the transient fixes are applied + if ((exec_params.apply_fix_to_massive_transient_events) && (exec_params.define_transient == ExecutionParameters::ZDEP_3SIGMA || exec_params.define_transient == ExecutionParameters::CONST_10MINPART)){ + for(const auto &subhalo: halo->all_subhalos()) { // compute the particle number for each subhalo particle_subhalo = round(subhalo->Mvir/sim_params.particle_mass); // find the minimum and save it @@ -761,8 +761,8 @@ void HaloBasedTreeBuilder::loop_through_halos(std::vector &halos, Simul } } } - // minimum particle number for structures - if (exec_params.define_transient == ExecutionParameters::ZDEP_3SIGMA || exec_params.define_transient == ExecutionParameters::CONST_10MINPART){ + // minimum particle number for structures when the transient fixes are applied + if ((exec_params.apply_fix_to_massive_transient_events) && (exec_params.define_transient == ExecutionParameters::ZDEP_3SIGMA || exec_params.define_transient == ExecutionParameters::CONST_10MINPART)){ LOG(info) << "Minimum particle subhalo: " << min_particle_subhalo; }