From d73bfa1f13efe9efcebc97f823aca8c96ac1f723 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Fri, 2 Sep 2022 18:08:06 +0200 Subject: Remove some magic numbers (#3355) * remove some magic numbers * fixed unreachable code issue * fixed issue with unreachable code * fixed issue with unreachable code * remove type traits * revert one change in Gaussian Laser * improved ParticleExtrema * fix bug --- .../QEDInternals/BreitWheelerEngineWrapper.cpp | 23 +++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp') diff --git a/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp b/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp index 59503d2ae..f7e32dcbb 100644 --- a/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp +++ b/Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp @@ -159,10 +159,14 @@ void BreitWheelerEngine::compute_lookup_tables ( void BreitWheelerEngine::init_builtin_dndt_table() { + constexpr auto default_chi_phot_min = 0.02_prt; + constexpr auto default_chi_phot_max = 200.0_prt; + constexpr auto default_chi_phot_how_many = 64; + BW_dndt_table_params dndt_params; - dndt_params.chi_phot_min = 0.02_prt; - dndt_params.chi_phot_max = 200.0_prt; - dndt_params.chi_phot_how_many = 64; + dndt_params.chi_phot_min = default_chi_phot_min; + dndt_params.chi_phot_max = default_chi_phot_max; + dndt_params.chi_phot_how_many = default_chi_phot_how_many; const auto vals = amrex::Gpu::DeviceVector{ -1.34808e+02_prt, -1.16674e+02_prt, -1.01006e+02_prt, -8.74694e+01_prt, @@ -189,11 +193,16 @@ void BreitWheelerEngine::init_builtin_dndt_table() void BreitWheelerEngine::init_builtin_pair_prod_table() { + constexpr auto default_chi_phot_min = 0.02_prt; + constexpr auto default_chi_phot_max = 200.0_prt; + constexpr auto default_chi_phot_how_many = 64; + constexpr auto default_frac_how_many = 64; + BW_pair_prod_table_params pair_prod_params; - pair_prod_params.chi_phot_min = 0.02_prt; - pair_prod_params.chi_phot_max = 200.0_prt; - pair_prod_params.chi_phot_how_many = 64; - pair_prod_params.frac_how_many = 64; + pair_prod_params.chi_phot_min = default_chi_phot_min; + pair_prod_params.chi_phot_max = default_chi_phot_max; + pair_prod_params.chi_phot_how_many = default_chi_phot_how_many; + pair_prod_params.frac_how_many = default_frac_how_many; const auto vals = amrex::Gpu::DeviceVector{ 0.00000e+00_prt, 0.00000e+00_prt, 0.00000e+00_prt, 0.00000e+00_prt, -- cgit v1.2.3