diff options
author | 2022-09-02 18:08:06 +0200 | |
---|---|---|
committer | 2022-09-02 09:08:06 -0700 | |
commit | d73bfa1f13efe9efcebc97f823aca8c96ac1f723 (patch) | |
tree | 9edcb2270ca6c3d12e2936d8d2341254f2744ced /Source/Particles/ElementaryProcess/QEDInternals | |
parent | 09940d721ac2cbb6173f7a3855a969f1f6e98bce (diff) | |
download | WarpX-d73bfa1f13efe9efcebc97f823aca8c96ac1f723.tar.gz WarpX-d73bfa1f13efe9efcebc97f823aca8c96ac1f723.tar.zst WarpX-d73bfa1f13efe9efcebc97f823aca8c96ac1f723.zip |
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
Diffstat (limited to 'Source/Particles/ElementaryProcess/QEDInternals')
-rw-r--r-- | Source/Particles/ElementaryProcess/QEDInternals/BreitWheelerEngineWrapper.cpp | 23 | ||||
-rw-r--r-- | Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp | 26 |
2 files changed, 34 insertions, 15 deletions
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<amrex::ParticleReal>{ -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<amrex::ParticleReal>{ 0.00000e+00_prt, 0.00000e+00_prt, 0.00000e+00_prt, 0.00000e+00_prt, diff --git a/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp b/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp index e93d757a3..c7b39a6fb 100644 --- a/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp +++ b/Source/Particles/ElementaryProcess/QEDInternals/QuantumSyncEngineWrapper.cpp @@ -158,10 +158,14 @@ void QuantumSynchrotronEngine::compute_lookup_tables ( void QuantumSynchrotronEngine::init_builtin_dndt_table() { + constexpr auto default_chi_part_min = 1.0e-3_prt; + constexpr auto default_chi_part_max = 200.0_prt; + constexpr auto default_chi_part_how_many = 64; + QS_dndt_table_params dndt_params; - dndt_params.chi_part_min = 1.0e-3_prt; - dndt_params.chi_part_max = 200.0_prt; - dndt_params.chi_part_how_many = 64; + dndt_params.chi_part_min = default_chi_part_min; + dndt_params.chi_part_max = default_chi_part_max; + dndt_params.chi_part_how_many = default_chi_part_how_many; const auto vals = amrex::Gpu::DeviceVector<amrex::ParticleReal>{ @@ -190,12 +194,18 @@ void QuantumSynchrotronEngine::init_builtin_dndt_table() void QuantumSynchrotronEngine::init_builtin_phot_em_table() { + constexpr auto default_chi_part_min = 1.0e-3_prt; + constexpr auto default_chi_part_max = 200.0_prt; + constexpr auto default_frac_min = 1.0e-12_prt; + constexpr auto default_chi_part_how_many = 64; + constexpr auto default_frac_how_many = 64; + QS_phot_em_table_params phot_em_params; - phot_em_params.chi_part_min = 1.0e-3_prt; - phot_em_params.chi_part_max = 200.0_prt; - phot_em_params.frac_min = 1.0e-12_prt; - phot_em_params.chi_part_how_many = 64; - phot_em_params.frac_how_many = 64; + phot_em_params.chi_part_min = default_chi_part_min; + phot_em_params.chi_part_max = default_chi_part_max; + phot_em_params.frac_min = default_frac_min; + phot_em_params.chi_part_how_many = default_chi_part_how_many; + phot_em_params.frac_how_many = default_frac_how_many; const auto vals = amrex::Gpu::DeviceVector<amrex::ParticleReal>{ |