Skip to content

Commit 9a72bb5

Browse files
committed
Mahesh's changes for extrema threshold
1 parent 51a5f8e commit 9a72bb5

File tree

4 files changed

+18
-8
lines changed

4 files changed

+18
-8
lines changed

Source/Driver/Nyx.H

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -996,6 +996,10 @@ protected:
996996
// Seed mass of SMBH
997997
//
998998
static amrex::Real mass_seed;
999+
1000+
static int min_halo_n_cells;
1001+
static amrex::Real halo_component_threshold;
1002+
static amrex::Real halo_extrema_threshold;
9991003
#endif
10001004

10011005
// Previous maximum number of steps for sundials

Source/Driver/Nyx.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,9 @@ Real Nyx::he_species = 0.24;
204204
#ifdef REEBER
205205
Real Nyx::mass_halo_min = 1.e10;
206206
Real Nyx::mass_seed = 1.e5;
207+
Real Nyx::halo_component_threshold = 81.66;
208+
Real Nyx::halo_extrema_threshold = 160.0;
209+
int Nyx::min_halo_n_cells = 10;
207210
#endif
208211

209212
#ifdef _OPENMP
@@ -445,6 +448,10 @@ Nyx::read_params ()
445448
#ifdef REEBER
446449
pp_nyx.query("mass_halo_min", mass_halo_min);
447450
pp_nyx.query("mass_seed", mass_seed);
451+
ParmParse pp_reeber("reeber");
452+
pp_reeber.query("min_halo_n_cells", min_halo_n_cells);
453+
pp_reeber.query("halo_component_threshold", halo_component_threshold);
454+
pp_reeber.query("halo_extrema_threshold", halo_extrema_threshold);
448455
#endif
449456
}
450457

Source/IO/Nyx_output.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ Nyx::forcing_check_point (const std::string& dir)
10701070
int
10711071
Nyx::updateInSitu ()
10721072
{
1073-
#if defined(BL_USE_SENSEI_INSITU) || defined(AMREX_USE_ASCENT)
1073+
#if defined(BL_USE_SENSEI_INSITU) || defined(AMREX_USE_ASCENT) || defined(REEBER)
10741074
BL_PROFILE("Nyx::UpdateInSitu()");
10751075

10761076
#if defined(BL_USE_SENSEI_INSITU)

Util/reeber/src/reeber.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ std::vector<Halo> compute_halos(diy::mpi::communicator& world,
395395
diy::DiscreteBounds diy_domain,
396396
Real absolute_rho,
397397
bool negate,
398-
Real min_halo_n_cells)
398+
Real min_halo_n_cells,
399+
Real halo_extrema_threshold)
399400
{
400401
bool debug = false; //world.rank() == 0;
401402
std::string prefix = "./DIY.XXXXXX";
@@ -467,9 +468,9 @@ std::vector<Halo> compute_halos(diy::mpi::communicator& world,
467468

468469
}
469470

470-
master.foreach([](Block* b, const diy::Master::ProxyWithLink& cp) {
471+
master.foreach([halo_extrema_threshold](Block* b, const diy::Master::ProxyWithLink& cp) {
471472
b->compute_final_connected_components();
472-
b->compute_local_integral();
473+
b->compute_local_integral(halo_extrema_threshold);
473474
});
474475

475476
//if (debug) fmt::print(std::cerr, "Local integrals computed");
@@ -598,9 +599,7 @@ void Nyx::runReeberAnalysis(Vector<MultiFab*>& new_state,
598599

599600
diy::DiscreteBounds diy_domain(3);
600601

601-
// TODO: take rho, min_halo_n_cells as parameters
602-
Real min_halo_n_cells = 10;
603-
Real rho = 81.66;
602+
Real rho = halo_component_threshold;
604603

605604
Real absolute_rho = (Nyx::average_dm_density + Nyx::average_gas_density) * rho;
606605
bool negate = true; // sweep superlevel sets, highest density = root
@@ -619,7 +618,7 @@ void Nyx::runReeberAnalysis(Vector<MultiFab*>& new_state,
619618

620619
BL_PROFILE_VAR("Nyx::runReeberAnalysis()::compute_halos",compute_halos_var);
621620

622-
reeber_halos = compute_halos(world, master_reader, geom_in, threads, diy_domain, absolute_rho, negate, min_halo_n_cells);
621+
reeber_halos = compute_halos(world, master_reader, geom_in, threads, diy_domain, absolute_rho, negate, min_halo_n_cells, halo_extrema_threshold);
623622
if (verbose and world.rank() == 0) fmt::print(std::cerr, "compute_halos finished, result.size = {}\n", reeber_halos.size());
624623

625624
BL_PROFILE_VAR_STOP(compute_halos_var);

0 commit comments

Comments
 (0)