Skip to content

Commit f044929

Browse files
authored
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_..
1 parent e246300 commit f044929

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

Source/FieldSolver/WarpX_QED_Field_Pushers.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ WarpX::Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real a_dt)
169169
);
170170

171171
// Make local copy of xi, to use on device.
172-
const Real xi_c2 = WarpX::quantum_xi_c2;
172+
const Real xi_c2 = m_quantum_xi_c2;
173173

174174
// Apply QED correction to electric field, using temporary arrays.
175175
amrex::ParallelFor(

Source/WarpX.H

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ public:
667667
*/
668668
void Hybrid_QED_Push (int lev, PatchType patch_type, amrex::Real dt);
669669

670-
static amrex::Real quantum_xi_c2;
670+
amrex::Real m_quantum_xi_c2;
671671

672672
/** Check and potentially compute load balancing
673673
*/

Source/WarpX.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ bool WarpX::fft_do_time_averaging = false;
100100
amrex::IntVect WarpX::m_fill_guards_fields = amrex::IntVect(0);
101101
amrex::IntVect WarpX::m_fill_guards_current = amrex::IntVect(0);
102102

103-
Real WarpX::quantum_xi_c2 = PhysConst::xi_c2;
104103
Real WarpX::gamma_boost = 1._rt;
105104
Real WarpX::beta_boost = 0._rt;
106105
Vector<int> WarpX::boost_direction = {0,0,0};
@@ -903,12 +902,15 @@ WarpX::ReadParameters ()
903902
utils::parser::queryWithParser(
904903
pp_warpx, "n_current_deposition_buffer", n_current_deposition_buffer);
905904

905+
//Default value for the quantum parameter used in Maxwell’s QED equations
906+
m_quantum_xi_c2 = PhysConst::xi_c2;
907+
906908
amrex::Real quantum_xi_tmp;
907909
const auto quantum_xi_is_specified =
908910
utils::parser::queryWithParser(pp_warpx, "quantum_xi", quantum_xi_tmp);
909911
if (quantum_xi_is_specified) {
910912
double const quantum_xi = quantum_xi_tmp;
911-
quantum_xi_c2 = static_cast<amrex::Real>(quantum_xi * PhysConst::c * PhysConst::c);
913+
m_quantum_xi_c2 = static_cast<amrex::Real>(quantum_xi * PhysConst::c * PhysConst::c);
912914
}
913915

914916
const auto at_least_one_boundary_is_pml =

0 commit comments

Comments
 (0)