From 15227a9eee0fe63980e0e13849ed6bdf8e3a33f4 Mon Sep 17 00:00:00 2001 From: Yohai Meiron Date: Mon, 30 Aug 2021 09:31:53 -0400 Subject: [PATCH] exposed grapite_set_eps_bh in conf --- config.cpp | 1 + config.h | 1 + phigrape.conf | 9 +++++++++ phigrape.cpp | 2 ++ 4 files changed, 13 insertions(+) diff --git a/config.cpp b/config.cpp index 62c2cd3..db40311 100644 --- a/config.cpp +++ b/config.cpp @@ -237,6 +237,7 @@ Config::Config(std::string file_name) grapite_mask_file_name = get_parameter(dictionary, "grapite_mask_file_name", "grapite.mask"); etics_dump_coeffs = get_parameter(dictionary, "etics_dump_coeffs", false); grapite_active_search = get_parameter(dictionary, "grapite_active_search", false); + grapite_smbh_star_eps = get_parameter(dictionary, "grapite_smbh_star_eps", -1); grapite_dev_exec_threshold = get_parameter(dictionary, "grapite_dev_exec_threshold", 32); #endif diff --git a/config.h b/config.h index b07ffdc..93c0fa6 100644 --- a/config.h +++ b/config.h @@ -61,6 +61,7 @@ public: std::string grapite_mask_file_name; bool etics_dump_coeffs; bool grapite_active_search; + double grapite_smbh_star_eps; int grapite_dev_exec_threshold; #endif diff --git a/phigrape.conf b/phigrape.conf index 9643b6f..a7f3252 100644 --- a/phigrape.conf +++ b/phigrape.conf @@ -217,6 +217,15 @@ dt_scf = 0.015625 # accelerate the calculation in some circumstances [default: false] #grapite_active_search = true +# Custom softening length for SMBH-star interactions in the hybrid scheme only. +# This value (can also be zero) is used in the direct gravity calculation +# between SMBHs (tag=3) and both core (tag=0) and halo (tag=1) stars. If +# negative, the Plummer softening parameter (`eps`) is used in these +# interactions. Do not confuse with `live_smbh_custom_eps`, which is the +# softening length for SMBH-SMBH interactions, and works both in the normal and +# hybrid schemes. [default: -1] +#grapite_smbh_star_eps = 1E-6 + # If the number of active particles in a particular bunch is bigger than this # threshold, then the execution is on the GPU, otherwise on the CPU. When the # active bunch is small, the overhead of calculating the SCF gravity on the GPU diff --git a/phigrape.cpp b/phigrape.cpp index aae2390..1d18693 100644 --- a/phigrape.cpp +++ b/phigrape.cpp @@ -400,6 +400,8 @@ int main(int argc, char *argv[]) v[grapite_cep_index] = vdc; grapite_update_cep(time_cur, xdc, vdc, zeros, zeros); } + + if (config.grapite_smbh_star_eps >= 0) grapite_set_eps_bh(config.grapite_smbh_star_eps); #endif std::vector a(N), adot(N);