Skip to content

Commit 7b30d39

Browse files
Fix bug in grid ionization with multiple plasma species (#1378)
1 parent b9e8909 commit 7b30d39

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/utils/GridIonization.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@ GridIonization::IonizeGrid (Fields& fields, const MultiPlasma& multi_plasma,
152152

153153
for (auto& plasma_name : m_names) {
154154
const auto& plasma = multi_plasma.GetPlasma(plasma_name);
155+
const bool is_last_plasma = plasma_name == m_names.back();
155156

156157
const int ion_weight_comp =
157158
Comps[WhichSlice::This]["grid_ionization_w_" + plasma_name + "_0"];
@@ -296,7 +297,9 @@ GridIonization::IonizeGrid (Fields& fields, const MultiPlasma& multi_plasma,
296297
// chi
297298
// chi of new electrons does not depend on the laser field strength
298299
// or the the new random momentum
299-
chi += arr(i, j, comps[1]) * chi_factor_elec;
300+
if (is_last_plasma) {
301+
chi += arr(i, j, comps[1]) * chi_factor_elec;
302+
}
300303

301304
// last ion level
302305
chi += arr(i, j, ion_weight_comp + max_ion_lev) *

0 commit comments

Comments
 (0)