297 constexpr int getpos_offset = 0;
298 for (
int i = 0; i < n_product_species; i++)
300 ParticleTileType& ptile_product = product_species_vector[i]->ParticlesAt(lev, mfi);
301 tile_products.push_back(&ptile_product);
304 products_np.push_back(ptile_product.numParticles());
305 products_mass.push_back(product_species_vector[i]->getMass());
307 auto *tile_products_data = tile_products.data();
315 global_debye_length_data = global_debye_length_fab.
dataPtr();
321#if defined(WARPX_DIM_RZ) || defined(WARPX_DIM_RCYLINDER) || defined(WARPX_DIM_RSPHERE)
323#if defined(WARPX_DIM_RZ)
326 int const nz = hi.y - lo.y + 1;
330 auto const dr = geom_lev.
CellSize(0);
334#if defined(WARPX_DIM_RZ)
336 int const ri = (i_cell - i_cell%nz)/nz;
340#elif defined(WARPX_DIM_RCYLINDER)
341 int const ri = i_cell;
345#elif defined(WARPX_DIM_RSPHERE)
347 int const ri = i_cell;
364 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findParticlesInEachCell", prof_findParticlesInEachCell);
371 auto const n_cells =
static_cast<int>(bins_1.
numBins());
373 auto np1 = ptile_1.numParticles();
374 const auto soa_1 = ptile_1.getParticleTileData();
385 const int n_cells_products = have_product_species ? n_cells: 0;
392 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::computeNumberOfPairs", prof_computeNumberOfPairs);
396 const auto n_part_in_cell = cell_offsets_1[i_cell+1] - cell_offsets_1[i_cell];
398 p_n_pairs_in_each_cell[i_cell] = (n_part_in_cell == 1)? 0: (n_part_in_cell+1)/2;
404 const index_type n_total_pairs = (n_cells_products == 0) ? 0:
406 p_n_pairs_in_each_cell, pair_offsets.data());
415 const auto n_part_in_cell = (i_cell < n_cells)? cell_offsets_1[i_cell+1] - cell_offsets_1[i_cell]: 0;
417 p_n_ind_pairs_in_each_cell[i_cell] = n_part_in_cell/2;
442 pair_reaction_weight.
dataPtr();
444 int const n_product_data = (binary_collision_functor.m_need_product_data ? n_total_pairs : 0);
464 if (binary_collision_functor.m_computeSpeciesDensities) {
465 n1_vec.
resize(n_cells, 0.0_prt);
467 if (binary_collision_functor.m_computeSpeciesTemperatures) {
468 T1_vec.
resize(n_cells, 0.0_prt);
469 vx1_vec.
resize(n_cells, 0.0_prt);
470 vy1_vec.
resize(n_cells, 0.0_prt);
471 vz1_vec.
resize(n_cells, 0.0_prt);
472 vs1_vec.
resize(n_cells, 0.0_prt);
490 ww_weighted_sum_vec.
resize(n_cells, 0.0_prt);
491 KE_vec.
resize(n_cells, 0.0_prt);
492 px_vec.
resize(n_cells, 0.0_prt);
493 py_vec.
resize(n_cells, 0.0_prt);
494 pz_vec.
resize(n_cells, 0.0_prt);
514 std::vector<std::string>
const & real_names1 = species_1.
GetRealSoANames();
515 auto const pos1 = std::find(real_names1.begin(), real_names1.end(),
"ux_n");
516 if (pos1 != real_names1.end()) {
518 auto const u1x_ni =
static_cast<int>(std::distance(real_names1.begin(), pos1));
519 int const u1x_runtime_ni = u1x_ni - n_builtin_real;
520 u1x_before_ptr = soa_1.m_runtime_rdata[u1x_runtime_ni];
521 u1y_before_ptr = soa_1.m_runtime_rdata[u1x_runtime_ni + 1];
522 u1z_before_ptr = soa_1.m_runtime_rdata[u1x_runtime_ni + 2];
527 u1x_before_ptr = u1x_before.
dataPtr();
528 u1y_before_ptr = u1y_before.
dataPtr();
529 u1z_before_ptr = u1z_before.
dataPtr();
536 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures", prof_findDensityTemperatures);
539 binary_collision_functor.m_computeSpeciesDensities ||
540 binary_collision_functor.m_computeSpeciesTemperatures) {
544 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures::atomics", prof_findDensityTemperatures_atomics);
549 if (correct_energy_momentum) {
550 u1x_before_ptr[ip] = u1x[ip];
551 u1y_before_ptr[ip] = u1y[ip];
552 u1z_before_ptr[ip] = u1z[ip];
554 const int i_cell = bins_1_ptr[ip];
567 if (binary_collision_functor.m_computeSpeciesDensities) {
569 w1[ip]/(dV*volume_factor(bins_1_ptr[ip])));
573 if (binary_collision_functor.m_computeSpeciesTemperatures) {
590 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures::finishTemperature", prof_findDensityTemperatures_finish);
595 index_type const cell_start_1 = cell_offsets_1[i_cell];
596 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
599 if ( cell_stop_1 - cell_start_1 <= 1 ) {
return; }
602 if (binary_collision_functor.m_computeSpeciesTemperatures) {
604 auto vx1 = vx1_in_each_cell[i_cell] * invsum;
605 auto vy1 = vy1_in_each_cell[i_cell] * invsum;
606 auto vz1 = vz1_in_each_cell[i_cell] * invsum;
607 auto vs1 = vs1_in_each_cell[i_cell] * invsum;
609 T1_in_each_cell[i_cell] = m1/(3._prt)*(vs1 -(vx1*vx1+vy1*vy1+vz1*vz1));
616 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures::shuffle", prof_findDensityTemperatures_shuffle);
622 index_type const cell_start_1 = cell_offsets_1[i_cell];
623 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
626 if ( cell_stop_1 - cell_start_1 <= 1 ) {
return; }
641 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::LoopOverCollisions", prof_loopOverCollisions);
649 const int i_cell =
amrex::bisect( p_coll_offsets, 0, n_cells, ui_coll );
653 index_type const cell_start_1 = cell_offsets_1[i_cell];
654 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
655 index_type const cell_half_1 = (cell_start_1+cell_stop_1)/2;
658 const index_type coll_idx = ui_coll - p_coll_offsets[i_cell];
661 index_type const cell_start_pair = have_product_species?
662 p_pair_offsets[i_cell] : 0;
667 if (binary_collision_functor.m_computeSpeciesDensities) {
668 n1 = n1_in_each_cell[i_cell];
670 if (binary_collision_functor.m_computeSpeciesTemperatures) {
671 T1 = T1_in_each_cell[i_cell];
676 global_lamdb = global_debye_length_data[i_cell];
682 binary_collision_functor(
683 cell_start_1, cell_half_1,
684 cell_half_1, cell_stop_1,
685 indices_1, indices_1,
686 soa_1, soa_1, get_position_1, get_position_1,
687 n1, n1, T1, T1, global_lamdb,
688 q1, q1, m1, m1, dt, dV*volume_factor(i_cell), coll_idx,
689 cell_start_pair, p_mask, p_pair_indices_1, p_pair_indices_2,
690 p_pair_reaction_weight, p_product_data, engine);
699 product_species_vector,
702 products_mass, p_mask, products_np,
703 copy_species1, copy_species2,
704 p_pair_indices_1, p_pair_indices_2,
705 p_pair_reaction_weight, p_product_data);
707 for (
int i = 0; i < n_product_species; i++)
709 setNewParticleIDs(*(tile_products_data[i]),
static_cast<int>(products_np[i]), num_added[i]);
717 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::correctEnergyMomentum", prof_correctEnergyMomentum);
722 const int i_cell = bins_1_ptr[i1];
739 const int i_cell = bins_1_ptr[i1];
743 u1x[i1] += w_factor*px_in_each_cell[i_cell]/ww_weighted_sum;
744 u1y[i1] += w_factor*py_in_each_cell[i_cell]/ww_weighted_sum;
745 u1z[i1] += w_factor*pz_in_each_cell[i_cell]/ww_weighted_sum;
754 amrex::Long* failed_corrections_ptr = failed_corrections.data();
761 index_type const cell_start_1 = cell_offsets_1[i_cell];
762 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
765 if (deltaEp1 != 0.) {
767 const bool correction_failed =
769 cell_start_1, cell_stop_1, m1,
770 energy_fraction, energy_fraction_max, deltaEp1);
771 if (correction_failed) {
774 for (
index_type i1=cell_start_1; i1<cell_stop_1; ++i1) {
775 u1x[ indices_1[i1] ] = u1x_before_ptr[ indices_1[i1] ];
776 u1y[ indices_1[i1] ] = u1y_before_ptr[ indices_1[i1] ];
777 u1z[ indices_1[i1] ] = u1z_before_ptr[ indices_1[i1] ];
787 amrex::Long const num_failed_corrections = *(failed_corrections.copyToHost());
789 if (num_failed_corrections > 0) {
791 "The energy correction failed for " + std::to_string(num_failed_corrections) +
" cells " +
793 "The remaining energy is " + std::to_string(total_remaining_energy/
PhysConst::q_e) +
" eV. " +
794 "The collisions in those cells was cancelled.");
808 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findParticlesInEachCell", prof_findParticlesInEachCell);
816 auto const n_cells =
static_cast<int>(bins_1.
numBins());
818 auto np1 = ptile_1.numParticles();
819 const auto soa_1 = ptile_1.getParticleTileData();
827 auto np2 = ptile_2.numParticles();
828 const auto soa_2 = ptile_2.getParticleTileData();
839 const int n_cells_products = have_product_species ? n_cells: 0;
846 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::computeNumberOfPairs", prof_computeNumberOfPairs);
850 const auto n_part_in_cell_1 = cell_offsets_1[i_cell+1] - cell_offsets_1[i_cell];
851 const auto n_part_in_cell_2 = cell_offsets_2[i_cell+1] - cell_offsets_2[i_cell];
853 if (n_part_in_cell_1 == 0 || n_part_in_cell_2 == 0) {
854 p_n_pairs_in_each_cell[i_cell] = 0;
856 p_n_pairs_in_each_cell[i_cell] =
857 amrex::max(n_part_in_cell_1,n_part_in_cell_2);
864 const index_type n_total_pairs = (n_cells_products == 0) ? 0:
866 p_n_pairs_in_each_cell, pair_offsets.data());
875 if (i_cell < n_cells)
877 const auto n_part_in_cell_1 = cell_offsets_1[i_cell+1] - cell_offsets_1[i_cell];
878 const auto n_part_in_cell_2 = cell_offsets_2[i_cell+1] - cell_offsets_2[i_cell];
879 p_n_ind_pairs_in_each_cell[i_cell] =
amrex::min(n_part_in_cell_1, n_part_in_cell_2);
883 p_n_ind_pairs_in_each_cell[i_cell] = 0;
909 pair_reaction_weight.
dataPtr();
911 int const n_product_data = (binary_collision_functor.m_need_product_data ? n_total_pairs : 0);
936 if (binary_collision_functor.m_computeSpeciesDensities) {
937 n1_vec.
resize(n_cells, 0.0_prt);
938 n2_vec.
resize(n_cells, 0.0_prt);
940 if (binary_collision_functor.m_computeSpeciesTemperatures) {
941 T1_vec.
resize(n_cells, 0.0_prt);
942 T2_vec.
resize(n_cells, 0.0_prt);
943 vx1_vec.
resize(n_cells, 0.0_prt);
944 vx2_vec.
resize(n_cells, 0.0_prt);
945 vy1_vec.
resize(n_cells, 0.0_prt);
946 vy2_vec.
resize(n_cells, 0.0_prt);
947 vz1_vec.
resize(n_cells, 0.0_prt);
948 vz2_vec.
resize(n_cells, 0.0_prt);
949 vs1_vec.
resize(n_cells, 0.0_prt);
950 vs2_vec.
resize(n_cells, 0.0_prt);
974 ww_weighted_sum_vec.
resize(n_cells, 0.0_prt);
975 KE_vec.
resize(n_cells, 0.0_prt);
976 px_vec.
resize(n_cells, 0.0_prt);
977 py_vec.
resize(n_cells, 0.0_prt);
978 pz_vec.
resize(n_cells, 0.0_prt);
998 std::vector<std::string>
const & real_names1 = species_1.
GetRealSoANames();
999 auto const pos1 = std::find(real_names1.begin(), real_names1.end(),
"ux_n");
1000 if (pos1 != real_names1.end()) {
1002 auto const u1x_ni =
static_cast<int>(std::distance(real_names1.begin(), pos1));
1003 int const u1x_runtime_ni = u1x_ni - n_builtin_real;
1004 u1x_before_ptr = soa_1.m_runtime_rdata[u1x_runtime_ni];
1005 u1y_before_ptr = soa_1.m_runtime_rdata[u1x_runtime_ni + 1];
1006 u1z_before_ptr = soa_1.m_runtime_rdata[u1x_runtime_ni + 2];
1011 u1x_before_ptr = u1x_before.
dataPtr();
1012 u1y_before_ptr = u1y_before.
dataPtr();
1013 u1z_before_ptr = u1z_before.
dataPtr();
1025 std::vector<std::string>
const & real_names2 = species_2.
GetRealSoANames();
1026 auto const pos2 = std::find(real_names2.begin(), real_names2.end(),
"ux_n");
1027 if (pos2 != real_names2.end()) {
1029 auto const u2x_ni =
static_cast<int>(std::distance(real_names2.begin(), pos2));
1030 int const u2x_runtime_ni = u2x_ni - n_builtin_real;
1031 u2x_before_ptr = soa_2.m_runtime_rdata[u2x_runtime_ni];
1032 u2y_before_ptr = soa_2.m_runtime_rdata[u2x_runtime_ni + 1];
1033 u2z_before_ptr = soa_2.m_runtime_rdata[u2x_runtime_ni + 2];
1038 u2x_before_ptr = u2x_before.
dataPtr();
1039 u2y_before_ptr = u2y_before.
dataPtr();
1040 u2z_before_ptr = u2z_before.
dataPtr();
1046 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures", prof_findDensityTemperatures);
1049 binary_collision_functor.m_computeSpeciesDensities ||
1050 binary_collision_functor.m_computeSpeciesTemperatures) {
1055 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures::atomics", prof_findDensityTemperatures_atomics);
1059 if (correct_energy_momentum) {
1062 const int i_cell = bins_1_ptr[i1];
1065 u1x_before_ptr[i1] = u1x[i1];
1066 u1y_before_ptr[i1] = u1y[i1];
1067 u1z_before_ptr[i1] = u1z[i1];
1081 const int i_cell = bins_2_ptr[i2];
1084 u2x_before_ptr[i2] = u2x[i2];
1085 u2y_before_ptr[i2] = u2y[i2];
1086 u2z_before_ptr[i2] = u2z[i2];
1100 if (binary_collision_functor.m_computeSpeciesDensities) {
1103 w1[ip]/(dV*volume_factor(bins_1_ptr[ip])));
1107 w2[ip]/(dV*volume_factor(bins_2_ptr[ip])));
1112 if (binary_collision_functor.m_computeSpeciesTemperatures) {
1141 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures::finishTemperature", prof_findDensityTemperatures_finish);
1144 const int i_cell = i < n_cells ? i : i - n_cells;
1148 index_type const cell_start_1 = cell_offsets_1[i_cell];
1149 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
1152 index_type const cell_start_2 = cell_offsets_2[i_cell];
1153 index_type const cell_stop_2 = cell_offsets_2[i_cell+1];
1156 if ( cell_stop_1 - cell_start_1 < 1 ||
1157 cell_stop_2 - cell_start_2 < 1 ) {
return; }
1160 if (binary_collision_functor.m_computeSpeciesTemperatures) {
1163 auto vx1 = vx1_in_each_cell[i_cell] * invsum1;
1164 auto vy1 = vy1_in_each_cell[i_cell] * invsum1;
1165 auto vz1 = vz1_in_each_cell[i_cell] * invsum1;
1166 auto vs1 = vs1_in_each_cell[i_cell] * invsum1;
1168 T1_in_each_cell[i_cell] = m1/(3._prt)*(vs1 -(vx1*vx1+vy1*vy1+vz1*vz1));
1171 auto vx2 = vx2_in_each_cell[i_cell] * invsum2;
1172 auto vy2 = vy2_in_each_cell[i_cell] * invsum2;
1173 auto vz2 = vz2_in_each_cell[i_cell] * invsum2;
1174 auto vs2 = vs2_in_each_cell[i_cell] * invsum2;
1176 T2_in_each_cell[i_cell] = m2/(3._prt)*(vs2 -(vx2*vx2+vy2*vy2+vz2*vz2));
1184 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::findDensityTemperatures::shuffle", prof_findDensityTemperatures_shuffle);
1188 const int i_cell = i < n_cells ? i : i - n_cells;
1192 index_type const cell_start_1 = cell_offsets_1[i_cell];
1193 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
1196 index_type const cell_start_2 = cell_offsets_2[i_cell];
1197 index_type const cell_stop_2 = cell_offsets_2[i_cell+1];
1200 if ( cell_stop_1 - cell_start_1 < 1 ||
1201 cell_stop_2 - cell_start_2 < 1 ) {
return; }
1220 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::LoopOverCollisions", prof_loopOverCollisions);
1228 const int i_cell =
amrex::bisect( p_coll_offsets, 0, n_cells, ui_coll );
1232 index_type const cell_start_1 = cell_offsets_1[i_cell];
1233 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
1235 index_type const cell_start_2 = cell_offsets_2[i_cell];
1236 index_type const cell_stop_2 = cell_offsets_2[i_cell+1];
1239 const index_type coll_idx = ui_coll - p_coll_offsets[i_cell];
1242 index_type const cell_start_pair = have_product_species?
1243 p_pair_offsets[i_cell]: 0;
1252 if (binary_collision_functor.m_computeSpeciesDensities) {
1253 n1 = n1_in_each_cell[i_cell];
1254 n2 = n2_in_each_cell[i_cell];
1256 if (binary_collision_functor.m_computeSpeciesTemperatures) {
1257 T1 = T1_in_each_cell[i_cell];
1258 T2 = T2_in_each_cell[i_cell];
1263 global_lamdb = global_debye_length_data[i_cell];
1269 binary_collision_functor(
1270 cell_start_1, cell_stop_1, cell_start_2, cell_stop_2,
1271 indices_1, indices_2,
1272 soa_1, soa_2, get_position_1, get_position_2,
1273 n1, n2, T1, T2, global_lamdb,
1274 q1, q2, m1, m2, dt, dV*volume_factor(i_cell), coll_idx,
1275 cell_start_pair, p_mask, p_pair_indices_1, p_pair_indices_2,
1276 p_pair_reaction_weight, p_product_data, engine);
1286 product_species_vector,
1289 products_mass, p_mask, products_np,
1290 copy_species1, copy_species2,
1291 p_pair_indices_1, p_pair_indices_2,
1292 p_pair_reaction_weight, p_product_data);
1294 for (
int i = 0; i < n_product_species; i++)
1296 setNewParticleIDs(*(tile_products_data[i]),
static_cast<int>(products_np[i]), num_added[i]);
1304 ABLASTR_PROFILE_VAR(
"BinaryCollision::doCollisionsWithinTile::correctEnergyMomentum", prof_correctEnergyMomentum);
1311 const int i_cell = bins_1_ptr[i1];
1325 const int i_cell = bins_2_ptr[i2];
1344 const int i_cell = bins_1_ptr[i1];
1348 u1x[i1] += w_factor*px_in_each_cell[i_cell]/ww_weighted_sum;
1349 u1y[i1] += w_factor*py_in_each_cell[i_cell]/ww_weighted_sum;
1350 u1z[i1] += w_factor*pz_in_each_cell[i_cell]/ww_weighted_sum;
1355 const int i_cell = bins_2_ptr[i2];
1359 u2x[i2] += w_factor*px_in_each_cell[i_cell]/ww_weighted_sum;
1360 u2y[i2] += w_factor*py_in_each_cell[i_cell]/ww_weighted_sum;
1361 u2z[i2] += w_factor*pz_in_each_cell[i_cell]/ww_weighted_sum;
1368 amrex::Long* failed_corrections_ptr = failed_corrections.data();
1376 index_type const cell_start_1 = cell_offsets_1[i_cell];
1377 index_type const cell_stop_1 = cell_offsets_1[i_cell+1];
1379 index_type const cell_start_2 = cell_offsets_2[i_cell];
1380 index_type const cell_stop_2 = cell_offsets_2[i_cell+1];
1383 if ( cell_stop_1 - cell_start_1 < 1 ||
1384 cell_stop_2 - cell_start_2 < 1 ) {
return; }
1387 py_in_each_cell[i_cell]*py_in_each_cell[i_cell] +
1388 pz_in_each_cell[i_cell]*pz_in_each_cell[i_cell];
1394 for (
index_type i1=cell_start_1; i1<cell_stop_1; ++i1) {
1395 w1_sum += w1[ indices_1[i1] ];
1397 u1y[ indices_1[i1] ],
1398 u1z[ indices_1[i1] ], m1);
1400 for (
index_type i2=cell_start_2; i2<cell_stop_2; ++i2) {
1401 w2_sum += w2[ indices_2[i2] ];
1403 u2y[ indices_2[i2] ],
1404 u2z[ indices_2[i2] ], m2);
1410 int const numCell1 = (cell_stop_1 - cell_start_1);
1411 int const numCell2 = (cell_stop_2 - cell_start_2);
1412 if (numCell1 == 1) {
1415 }
else if (numCell2 == 1) {
1419 const amrex::ParticleReal Etotdenom = w1_sum*KE1_after/numCell1 + w2_sum*KE2_after/numCell2;
1420 deltaEp1 = w1_sum*KE1_after/Etotdenom*deltaE/numCell1;
1421 deltaEp2 = w2_sum*KE2_after/Etotdenom*deltaE/numCell2;
1424 bool correction1_failed =
false;
1425 bool correction2_failed =
false;
1426 if (deltaEp1 != 0.) {
1428 correction1_failed =
1430 cell_start_1, cell_stop_1, m1,
1431 energy_fraction, energy_fraction_max, deltaEp1);
1434 if (deltaEp2 != 0.) {
1436 correction2_failed =
1438 cell_start_2, cell_stop_2, m2,
1439 energy_fraction, energy_fraction_max, deltaEp2);
1442 if (correction1_failed || correction2_failed) {
1445 for (
index_type i1=cell_start_1; i1<cell_stop_1; ++i1) {
1446 u1x[ indices_1[i1] ] = u1x_before_ptr[ indices_1[i1] ];
1447 u1y[ indices_1[i1] ] = u1y_before_ptr[ indices_1[i1] ];
1448 u1z[ indices_1[i1] ] = u1z_before_ptr[ indices_1[i1] ];
1450 for (
index_type i2=cell_start_2; i2<cell_stop_2; ++i2) {
1451 u2x[ indices_2[i2] ] = u2x_before_ptr[ indices_2[i2] ];
1452 u2y[ indices_2[i2] ] = u2y_before_ptr[ indices_2[i2] ];
1453 u2z[ indices_2[i2] ] = u2z_before_ptr[ indices_2[i2] ];
1463 amrex::Long const num_failed_corrections = *(failed_corrections.copyToHost());
1465 if (num_failed_corrections > 0) {
1467 "The energy correction failed for " + std::to_string(num_failed_corrections) +
" cells " +
1469 "The remaining energy is " + std::to_string(total_remaining_energy/
PhysConst::q_e) +
" eV. " +
1470 "The collisions in those cells was cancelled.");