diff --git a/multi_physics/QED/include/picsar_qed/math/quadrature.hpp b/multi_physics/QED/include/picsar_qed/math/quadrature.hpp index 0daecbc43..523cdc5b4 100644 --- a/multi_physics/QED/include/picsar_qed/math/quadrature.hpp +++ b/multi_physics/QED/include/picsar_qed/math/quadrature.hpp @@ -74,41 +74,41 @@ namespace picsar::multi_physics::math inline constexpr RealType generic_quad_a_b( const std::function& f, RealType a, RealType b) { - PXRMP_CONSTEXPR_IF ( + if constexpr ( QuadAlgo == quadrature_algorithm::trapezoidal){ return boost::math::quadrature::trapezoidal(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::tanh_sinh){ boost::math::quadrature::tanh_sinh integrator; return integrator.integrate(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::exp_sinh){ boost::math::quadrature::exp_sinh integrator; return integrator.integrate(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::gauss_kronrod15){ return boost::math::quadrature::gauss_kronrod ::integrate(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::gauss_kronrod31){ return boost::math::quadrature::gauss_kronrod ::integrate(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::gauss_kronrod41){ return boost::math::quadrature::gauss_kronrod ::integrate(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::gauss_kronrod51){ return boost::math::quadrature::gauss_kronrod ::integrate(f, a, b); } - else PXRMP_CONSTEXPR_IF ( + else if constexpr ( QuadAlgo == quadrature_algorithm::gauss_kronrod61){ return boost::math::quadrature::gauss_kronrod ::integrate(f, a, b); diff --git a/multi_physics/QED/include/picsar_qed/physics/breit_wheeler/breit_wheeler_engine_tables_generator.hpp b/multi_physics/QED/include/picsar_qed/physics/breit_wheeler/breit_wheeler_engine_tables_generator.hpp index bfb597a8f..b913c995c 100644 --- a/multi_physics/QED/include/picsar_qed/physics/breit_wheeler/breit_wheeler_engine_tables_generator.hpp +++ b/multi_physics/QED/include/picsar_qed/physics/breit_wheeler/breit_wheeler_engine_tables_generator.hpp @@ -88,7 +88,7 @@ namespace picsar::multi_physics::phys::breit_wheeler #pragma omp parallel for #endif for (int i = 0; i < static_cast(all_coords.size()); ++i){ - PXRMP_CONSTEXPR_IF (use_internal_double){ + if constexpr (use_internal_double){ all_vals[i] = aux_generate_double(all_coords[i]); } else { @@ -199,7 +199,7 @@ namespace picsar::multi_physics::phys::breit_wheeler ); std::vector vals = std::vector(frac_size); - PXRMP_CONSTEXPR_IF (use_internal_double){ + if constexpr (use_internal_double){ vals = aux_generate_double( chi_phot, chi_parts); } else { diff --git a/multi_physics/QED/include/picsar_qed/physics/quantum_sync/quantum_sync_engine_tables_generator_detail.hpp b/multi_physics/QED/include/picsar_qed/physics/quantum_sync/quantum_sync_engine_tables_generator_detail.hpp index 5fb1791b0..edc1d650c 100644 --- a/multi_physics/QED/include/picsar_qed/physics/quantum_sync/quantum_sync_engine_tables_generator_detail.hpp +++ b/multi_physics/QED/include/picsar_qed/physics/quantum_sync/quantum_sync_engine_tables_generator_detail.hpp @@ -61,7 +61,7 @@ namespace picsar::multi_physics::phys::quantum_sync::detail #pragma omp parallel for #endif for (int i = 0; i < static_cast(all_coords.size()); ++i){ - PXRMP_CONSTEXPR_IF (ForceInternalDouble && !std::is_same()){ + if constexpr (ForceInternalDouble && !std::is_same()){ all_vals[i] = static_cast( compute_G_function(all_coords[i])); } @@ -69,7 +69,7 @@ namespace picsar::multi_physics::phys::quantum_sync::detail all_vals[i] = compute_G_function(all_coords[i]); } - PXRMP_CONSTEXPR_IF (ShowProgress){ + if constexpr (ShowProgress){ #pragma omp critical { count++; @@ -136,7 +136,7 @@ namespace picsar::multi_physics::phys::quantum_sync::detail auto vals = std::vector(all_frac_size); - PXRMP_CONSTEXPR_IF (ForceInternalDouble && !std::is_same()){ + if constexpr (ForceInternalDouble && !std::is_same()){ const auto d_chi_part = static_cast(chi_part); auto d_chi_phots = std::vector(all_frac_size); std::transform( @@ -160,7 +160,7 @@ namespace picsar::multi_physics::phys::quantum_sync::detail std::copy(vals.begin(), vals.end(), all_vals.begin() + i*all_frac_size); - PXRMP_CONSTEXPR_IF (ShowProgress){ + if constexpr (ShowProgress){ #ifdef PXRMP_HAS_OPENMP #pragma omp critical #endif diff --git a/multi_physics/QED/include/picsar_qed/qed_commons.h b/multi_physics/QED/include/picsar_qed/qed_commons.h index 056427e92..9e9997869 100644 --- a/multi_physics/QED/include/picsar_qed/qed_commons.h +++ b/multi_physics/QED/include/picsar_qed/qed_commons.h @@ -108,17 +108,6 @@ #endif -/** - * If possible (i.e. if C++17 or more recent is used) - * picsar makes use of "if constexpr". Otherwise, the - * expression falls back to a regular "if". - */ - #if __cplusplus >= 201703L - #define PXRMP_CONSTEXPR_IF if constexpr - #else - #define PXRMP_CONSTEXPR_IF if - #endif - /** * Unless PXRMP_PREVENT_USE_STD_FOR_MATH is defined by the * user std::sqrt, std::cbrt... mathematical functions