diff options
author | 2020-06-22 09:28:16 -0700 | |
---|---|---|
committer | 2020-06-22 09:28:16 -0700 | |
commit | f4978e1001494e2b148128380fb37f3c2450209f (patch) | |
tree | 237a671ca194338411f16f52797e70114b220384 /Source/Particles/ElementaryProcess/Ionization.cpp | |
parent | 97755d1c2e04e5b8c3295182eaff472c73cf8a53 (diff) | |
download | WarpX-f4978e1001494e2b148128380fb37f3c2450209f.tar.gz WarpX-f4978e1001494e2b148128380fb37f3c2450209f.tar.zst WarpX-f4978e1001494e2b148128380fb37f3c2450209f.zip |
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 <mthevenet@lbl.gov>
* 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 <mthevenet@lbl.gov>
Diffstat (limited to 'Source/Particles/ElementaryProcess/Ionization.cpp')
-rw-r--r-- | Source/Particles/ElementaryProcess/Ionization.cpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/Source/Particles/ElementaryProcess/Ionization.cpp b/Source/Particles/ElementaryProcess/Ionization.cpp new file mode 100644 index 000000000..4c30987f4 --- /dev/null +++ b/Source/Particles/ElementaryProcess/Ionization.cpp @@ -0,0 +1,72 @@ +/* Copyright 2019-2020 Andrew Myers, Axel Huebl, + * Maxence Thevenet + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ + +#include "WarpX.H" +#include "Particles/ElementaryProcess/Ionization.H" + +IonizationFilterFunc::IonizationFilterFunc (const WarpXParIter& a_pti, int lev, int ngE, + amrex::FArrayBox const& exfab, + amrex::FArrayBox const& eyfab, + amrex::FArrayBox const& ezfab, + amrex::FArrayBox const& bxfab, + amrex::FArrayBox const& byfab, + amrex::FArrayBox const& bzfab, + amrex::Array<amrex::Real,3> v_galilean, + const amrex::Real* const AMREX_RESTRICT a_ionization_energies, + const amrex::Real* const AMREX_RESTRICT a_adk_prefactor, + const amrex::Real* const AMREX_RESTRICT a_adk_exp_prefactor, + const amrex::Real* const AMREX_RESTRICT a_adk_power, + int a_comp, + int a_atomic_number, + int a_offset) noexcept +{ + m_ionization_energies = a_ionization_energies; + m_adk_prefactor = a_adk_prefactor; + m_adk_exp_prefactor = a_adk_exp_prefactor; + m_adk_power = a_adk_power; + comp = a_comp; + m_atomic_number = a_atomic_number; + + m_get_position = GetParticlePosition(a_pti, a_offset); + m_get_externalE = GetExternalEField (a_pti, a_offset); + m_get_externalB = GetExternalBField (a_pti, a_offset); + + m_ex_arr = exfab.array(); + m_ey_arr = eyfab.array(); + m_ez_arr = ezfab.array(); + m_bx_arr = bxfab.array(); + m_by_arr = byfab.array(); + m_bz_arr = bzfab.array(); + + m_ex_type = exfab.box().ixType(); + m_ey_type = eyfab.box().ixType(); + m_ez_type = ezfab.box().ixType(); + m_bx_type = bxfab.box().ixType(); + m_by_type = byfab.box().ixType(); + m_bz_type = bzfab.box().ixType(); + + amrex::Box box = a_pti.tilebox(); + box.grow(ngE); + + const std::array<amrex::Real,3>& dx = WarpX::CellSize(std::max(lev, 0)); + m_dx_arr = {dx[0], dx[1], dx[2]}; + + // Lower corner of tile box physical domain (take into account Galilean shift) + amrex::Real cur_time = WarpX::GetInstance().gett_new(lev); + const auto& time_of_last_gal_shift = WarpX::GetInstance().time_of_last_gal_shift; + amrex::Real time_shift = (cur_time - time_of_last_gal_shift); + amrex::Array<amrex::Real,3> galilean_shift = { v_galilean[0]*time_shift, v_galilean[1]*time_shift, v_galilean[2]*time_shift }; + const std::array<amrex::Real, 3>& xyzmin = WarpX::LowerCorner(box, galilean_shift, lev); + m_xyzmin_arr = {xyzmin[0], xyzmin[1], xyzmin[2]}; + + m_l_lower_order_in_v = WarpX::l_lower_order_in_v; + m_nox = WarpX::nox; + m_n_rz_azimuthal_modes = WarpX::n_rz_azimuthal_modes; + + m_lo = amrex::lbound(box); +} |