Skip to content

Commit

Permalink
Make quantum_xi_c2 a non-static member variable of the WarpX class (#…
Browse files Browse the repository at this point in the history
…5073)

* make quantum_xi_c2 a non-static member variable of the WarpX class

* rename member variable as m_..
  • Loading branch information
lucafedeli88 authored Aug 9, 2024
1 parent e246300 commit f044929
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Source/FieldSolver/WarpX_QED_Field_Pushers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion Source/WarpX.H
Original file line number Diff line number Diff line change
Expand Up @@ -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
*/
Expand Down
6 changes: 4 additions & 2 deletions Source/WarpX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int> WarpX::boost_direction = {0,0,0};
Expand Down Expand Up @@ -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<amrex::Real>(quantum_xi * PhysConst::c * PhysConst::c);
m_quantum_xi_c2 = static_cast<amrex::Real>(quantum_xi * PhysConst::c * PhysConst::c);
}

const auto at_least_one_boundary_is_pml =
Expand Down

0 comments on commit f044929

Please sign in to comment.