@@ -68,11 +68,11 @@ Collision::ReadParameters(
6868 // The user is asked to always input the target type as the second specie
6969 m_has_collision_product = m_collision_type == " electron_impact" || m_collision_type == " ion_impact" ;
7070
71- getWithParser (pp, " species1 " , m_inout_species1_name );
72- getWithParser (pp, " species2 " , m_inout_species2_name );
71+ getWithParser (pp, " projectile " , m_projectile_name );
72+ getWithParser (pp, " target " , m_target_name );
7373
7474 if (m_has_collision_product) {
75- getWithParser (pp, " species3 " , m_out_species3_name );
75+ getWithParser (pp, " new_electron " , m_new_electron_name );
7676 }
7777
7878 if (m_collision_type == " electron_impact" ) {
@@ -90,7 +90,7 @@ Collision::ReadParameters(
9090
9191 }
9292 // Plasma physical element name
93- amrex::ParmParse pp_s2 (m_inout_species2_name );
93+ amrex::ParmParse pp_s2 (m_target_name );
9494 getWithParser (pp_s2, " element" , m_physical_element);
9595}
9696
@@ -120,9 +120,9 @@ Collision::doCollisionA (
120120 const amrex::Real* p_binding_energies = m_binding_energies.data ();
121121 const amrex::Real* p_ionization_energies = m_ionization_energies.data ();
122122
123- auto & species1 = multi_plasma.GetPlasma (m_inout_species1_name );
124- auto & species2 = multi_plasma.GetPlasma (m_inout_species2_name );
125- auto & species3 = multi_plasma.GetPlasma (m_out_species3_name );
123+ auto & species1 = multi_plasma.GetPlasma (m_projectile_name );
124+ auto & species2 = multi_plasma.GetPlasma (m_target_name );
125+ auto & species3 = multi_plasma.GetPlasma (m_new_electron_name );
126126
127127 auto m1 = species1.GetMass ();
128128 auto m2 = species2.GetMass ();
@@ -134,7 +134,7 @@ Collision::doCollisionA (
134134 AMREX_ALWAYS_ASSERT_WITH_MESSAGE (
135135 ion_atomic_number == 1 ||
136136 ion_atomic_number == 18 ,
137- " The current implementation of electron-impact ionization only supports Hydrogen and Argon. Please check the input file and the physical element specified for species2 ."
137+ " The current implementation of electron-impact ionization only supports Hydrogen and Argon. Please check the input file and the physical element specified for target ."
138138 );
139139
140140 const amrex::Real inv_dV = geom.InvCellSize (0 )*geom.InvCellSize (1 )*geom.InvCellSize (2 );
@@ -374,8 +374,8 @@ Collision::doCollisionImp (
374374 G const & ionization_function)
375375{
376376 // assume the two species are different for now
377- auto & species1 = multi_plasma.GetPlasma (m_inout_species1_name );
378- auto & species2 = multi_plasma.GetPlasma (m_inout_species2_name );
377+ auto & species1 = multi_plasma.GetPlasma (m_projectile_name );
378+ auto & species2 = multi_plasma.GetPlasma (m_target_name );
379379
380380 for (PlasmaParticleIterator pti (species1); pti.isValid (); ++pti) {
381381 amrex::removeInvalidParticles (species1.ParticlesAt (0 , pti));
@@ -442,34 +442,6 @@ Collision::doCollisionImp (
442442 auto p_flag1 = flag1.dataPtr ();
443443 auto p_flag2 = flag2.dataPtr ();
444444
445- amrex::Gpu::DeviceVector<amrex::Real> cell_weight1 (num_cells);
446- amrex::Gpu::DeviceVector<amrex::Real> cell_weight2 (num_cells);
447- auto p_cell_weight1 = cell_weight1.dataPtr ();
448- auto p_cell_weight2 = cell_weight2.dataPtr ();
449-
450- amrex::ParallelFor (2 *num_cells,
451- [=] AMREX_GPU_DEVICE (int icell) {
452- if (icell < num_cells) {
453- auto start = offset1[icell];
454- auto stop = offset1[icell+1 ];
455- amrex::Real loc_cell_weight1 = 0 ;
456- for (int idx1 = start; idx1 < stop; ++idx1) {
457- loc_cell_weight1 += ptd1.rdata (PlasmaIdx::w)[perm1[idx1]];
458- }
459- p_cell_weight1[icell] = loc_cell_weight1;
460- } else {
461- icell -= num_cells;
462- auto start = offset2[icell];
463- auto stop = offset2[icell+1 ];
464- amrex::Real loc_cell_weight2 = 0 ;
465- for (int idx2 = start; idx2 < stop; ++idx2) {
466- loc_cell_weight2 += ptd2.rdata (PlasmaIdx::w)[perm2[idx2]];
467- }
468- p_cell_weight2[icell] = loc_cell_weight2;
469- }
470- }
471- );
472-
473445 // loop over independent pairs
474446 amrex::ParallelForRNG (total_ind_pairs,
475447 [=] AMREX_GPU_DEVICE (int ipair, amrex::RandomEngine const & engine){
@@ -485,9 +457,6 @@ Collision::doCollisionImp (
485457 const int N1 = offset1_stop - offset1_start;
486458 const int N2 = offset2_stop - offset2_start;
487459
488- // const amrex::Real loc_cell_weight1 = p_cell_weight1[icell];
489- // const amrex::Real loc_cell_weight2 = p_cell_weight2[icell];
490-
491460 int idx1 = icoll;
492461 int idx2 = icoll;
493462 while (idx1 < N1 && idx2 < N2) {
@@ -554,12 +523,12 @@ Collision::doCollisionImp (
554523 amrex::Scan::Type::exclusive, amrex::Scan::retSum
555524 );
556525
557- auto & species3 = multi_plasma.GetPlasma (m_out_species3_name );
526+ auto & species3 = multi_plasma.GetPlasma (m_new_electron_name );
558527 auto & ptile3 = species3.ParticlesAt (0 , pti);
559528 int old_size3 = ptile3.size ();
560529 ptile3.resize (old_size3 + num_new_particles);
561530
562- // get new ptd after resize in case species3 is the same as species1 or 2
531+ // get new ptd after resize in case species3 is the same as species1 or species2
563532 ptd1 = ptile1.getParticleTileData ();
564533 ptd2 = ptile2.getParticleTileData ();
565534 auto ptd3 = ptile3.getParticleTileData ();
0 commit comments