From f044929d123e3bbe1639b28d09b31b8b8c137917 Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Sat, 10 Aug 2024 01:59:32 +0200 Subject: [PATCH] Make quantum_xi_c2 a non-static member variable of the WarpX class (#5073) * make quantum_xi_c2 a non-static member variable of the WarpX class * rename member variable as m_.. --- Source/FieldSolver/WarpX_QED_Field_Pushers.cpp | 2 +- Source/WarpX.H | 2 +- Source/WarpX.cpp | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/FieldSolver/WarpX_QED_Field_Pushers.cpp b/Source/FieldSolver/WarpX_QED_Field_Pushers.cpp index 1d3cb04a8a7..9741d9b667b 100644 --- a/Source/FieldSolver/WarpX_QED_Field_Pushers.cpp +++ b/Source/FieldSolver/WarpX_QED_Field_Pushers.cpp @@ -169,7 +169,7 @@ WarpX::Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real a_dt) ); // Make local copy of xi, to use on device. - const Real xi_c2 = WarpX::quantum_xi_c2; + const Real xi_c2 = m_quantum_xi_c2; // Apply QED correction to electric field, using temporary arrays. amrex::ParallelFor( diff --git a/Source/WarpX.H b/Source/WarpX.H index da60824945e..5fad8085673 100644 --- a/Source/WarpX.H +++ b/Source/WarpX.H @@ -667,7 +667,7 @@ public: */ void Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real dt); - static amrex::Real quantum_xi_c2; + amrex::Real m_quantum_xi_c2; /** Check and potentially compute load balancing */ diff --git a/Source/WarpX.cpp b/Source/WarpX.cpp index 4d51dd283a3..9ed59c348b3 100644 --- a/Source/WarpX.cpp +++ b/Source/WarpX.cpp @@ -100,7 +100,6 @@ bool WarpX::fft_do_time_averaging = false; amrex::IntVect WarpX::m_fill_guards_fields = amrex::IntVect(0); amrex::IntVect WarpX::m_fill_guards_current = amrex::IntVect(0); -Real WarpX::quantum_xi_c2 = PhysConst::xi_c2; Real WarpX::gamma_boost = 1._rt; Real WarpX::beta_boost = 0._rt; Vector WarpX::boost_direction = {0,0,0}; @@ -903,12 +902,15 @@ WarpX::ReadParameters () utils::parser::queryWithParser( pp_warpx, "n_current_deposition_buffer", n_current_deposition_buffer); + //Default value for the quantum parameter used in Maxwell’s QED equations + m_quantum_xi_c2 = PhysConst::xi_c2; + amrex::Real quantum_xi_tmp; const auto quantum_xi_is_specified = utils::parser::queryWithParser(pp_warpx, "quantum_xi", quantum_xi_tmp); if (quantum_xi_is_specified) { double const quantum_xi = quantum_xi_tmp; - quantum_xi_c2 = static_cast(quantum_xi * PhysConst::c * PhysConst::c); + m_quantum_xi_c2 = static_cast(quantum_xi * PhysConst::c * PhysConst::c); } const auto at_least_one_boundary_is_pml =