Skip to content

Commit

Permalink
purely runtime parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
SamG-01 committed Jan 18, 2025
1 parent dffde49 commit 31e3e2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions screening/_parameters
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

enable_chabrier1998_quantum_corr bool 0
enable_debye_huckel_skip bool 0
debye_huckel_skip_threshold real 1.01e0
14 changes: 5 additions & 9 deletions screening/screen.H
Original file line number Diff line number Diff line change
Expand Up @@ -646,19 +646,17 @@ number_t chabrier1998 (const plasma_state_t<number_t>& state,
template <typename number_t>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
number_t actual_screen(const plasma_state_t<number_t>& state,
const scrn::screen_factors_t& scn_fac,
const bool enable_skip_check = screening_rp::enable_debye_huckel_skip,
const amrex::Real skip_threshold = 1.01_rt)
const scrn::screen_factors_t& scn_fac)
{
number_t scor = 1.0_rt;
#if SCREEN_METHOD == SCREEN_METHOD_null
// null screening
amrex::ignore_unused(state, scn_fac);
return scor;
#endif
if (enable_skip_check) {
if (screening_rp::enable_debye_huckel_skip) {
scor = debye_huckel(state, scn_fac);
if (scor <= skip_threshold) {
if (scor <= screening_rp::debye_huckel_skip_threshold) {
return scor;
}
}
Expand All @@ -680,12 +678,10 @@ template <typename number_t>
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
void actual_screen(const plasma_state_t<number_t>& state,
const scrn::screen_factors_t& scn_fac,
amrex::Real& scor, amrex::Real& scordt,
const bool enable_skip_check = screening_rp::enable_debye_huckel_skip,
const amrex::Real skip_threshold = 1.01_rt)
amrex::Real& scor, amrex::Real& scordt)
{
number_t scor_dual;
scor_dual = actual_screen(state, scn_fac, enable_skip_check, skip_threshold);
scor_dual = actual_screen(state, scn_fac);
if constexpr (autodiff::detail::isDual<number_t>) {
scor = autodiff::val(scor_dual);
scordt = autodiff::derivative(scor_dual);
Expand Down

0 comments on commit 31e3e2d

Please sign in to comment.