From f4978e1001494e2b148128380fb37f3c2450209f Mon Sep 17 00:00:00 2001 From: Andrew Myers Date: Mon, 22 Jun 2020 09:28:16 -0700 Subject: Remove persistent E+B (#1050) * add functor for doing the tmp particles copy for the back-transformed diagnosti * merge the particle push options into one kernel * EOL * fix assertion * add a FieldGatherandPushPX method to PhysicalParticleContainer * handle offset in copyAttribs * allow this functor to be constructed even it we aren't doing the back transformed diagnostics * EOL * update the overloads of PushPX for the Photon and RigidInjected ParticleContainers * function for dispatching the right field gather * init this val to 0.0 * fix some typos * handle scaling the fields for rigid injection * EOL * don't need to get pointers to E and B arrays in PushPX any more. * actually I can't remove these yet * EOL * variable order bug * move the QED stuff to the proper place * EOL * make sure we don't build these functors unless the runtime options are toggled * EOL * perform the field gather prior to the photon particle push * remove E and B components and FieldGather methods. Reimplement PushP for rigid injected and physical particles * update ionization to do field gather inline * remove E and B from the particle diagnostics * don't write E or B in these tests for particles * add missing files * remove EB from the Regtest ini file too * no need to do this twice * important typo * also do the gather inline for the QED processes that need to * move these sources inside ifdef for QED * fix bug in RZ * remove some fields from the Python tests. * remove all particle E and B comps from json benchmarks * don't assert that Ey is the langmuir output * remove uy from this output * update test * restore the mesh fields I turned off by mistake * turn off field IO for a few python tests I missed * fix typo * reset Langmuir_multi benchmark * update Langmuir_multi_nodal benchmark * update single precision langmuir bench * update psatd single precision languir one too * also do ionization_lab * finally, ionizaiton_boost * update benchmarks_json/Langmuir_multi_psatd.json * update benchmarks_json/Langmuir_multi_psatd_current_correction.json * update benchmarks_json/Langmuir_multi_psatd_momentum_conserving.json * update benchmarks_json/Langmuir_multi_psatd_nodal.json * remove the particle E and B from the choices in the docs * fix offset bug * also add the Gather subdirectory * Update Source/WarpX.H Co-authored-by: MaxThevenet * add docstring for LowerCornerWithGalilean * add new source files to CMakeLists.txt * also need to update the GPU regression tests * update the name of the output file for this python test * remove field gather call from FieldDiagnostics * fix typo in docstring * init fields to 0 * add docstring to the CopyParticleAttribs constructor * some explicit amrex::namepace Co-authored-by: MaxThevenet --- Source/Evolve/WarpXEvolve.cpp | 45 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'Source/Evolve/WarpXEvolve.cpp') diff --git a/Source/Evolve/WarpXEvolve.cpp b/Source/Evolve/WarpXEvolve.cpp index 87d39ffc5..72621e52c 100644 --- a/Source/Evolve/WarpXEvolve.cpp +++ b/Source/Evolve/WarpXEvolve.cpp @@ -267,7 +267,8 @@ WarpX::OneStep_nosub (Real cur_time) // Loop over species. For each ionizable species, create particles in // product species. - mypc->doFieldIonization(); + doFieldIonization(); + mypc->doCoulombCollisions(); #ifdef WARPX_QED mypc->doQEDSchwinger(); @@ -298,8 +299,7 @@ WarpX::OneStep_nosub (Real cur_time) #endif #ifdef WARPX_QED - //Do QED processes - mypc->doQedEvents(); + doQEDEvents(); #endif // Synchronize J and rho @@ -408,11 +408,10 @@ WarpX::OneStep_sub1 (Real curtime) // TODO: we could save some charge depositions // Loop over species. For each ionizable species, create particles in // product species. - mypc->doFieldIonization(); + doFieldIonization(); #ifdef WARPX_QED - //Do QED processes - mypc->doQedEvents(); + doQEDEvents(); #endif AMREX_ALWAYS_ASSERT_WITH_MESSAGE(finest_level == 1, "Must have exactly two levels"); @@ -549,6 +548,40 @@ WarpX::OneStep_sub1 (Real curtime) FillBoundaryB(coarse_lev, PatchType::fine, guard_cells.ng_FieldSolver); } +void +WarpX::doFieldIonization () +{ + for (int lev = 0; lev <= finest_level; ++lev) { + doFieldIonization(lev); + } +} + +void +WarpX::doFieldIonization (int lev) +{ + mypc->doFieldIonization(lev, + *Efield_aux[lev][0],*Efield_aux[lev][1],*Efield_aux[lev][2], + *Bfield_aux[lev][0],*Bfield_aux[lev][1],*Bfield_aux[lev][2]); +} + +#ifdef WARPX_QED +void +WarpX::doQEDEvents () +{ + for (int lev = 0; lev <= finest_level; ++lev) { + doQEDEvents(lev); + } +} + +void +WarpX::doQEDEvents (int lev) +{ + mypc->doQedEvents(lev, + *Efield_aux[lev][0],*Efield_aux[lev][1],*Efield_aux[lev][2], + *Bfield_aux[lev][0],*Bfield_aux[lev][1],*Bfield_aux[lev][2]); +} +#endif + void WarpX::PushParticlesandDepose (amrex::Real cur_time) { -- cgit v1.2.3