diff options
author | 2020-02-18 22:25:34 -0800 | |
---|---|---|
committer | 2020-02-18 22:25:34 -0800 | |
commit | 050e12f5293d42aabd812ff314baa2199060cdc3 (patch) | |
tree | 7e23162948ed11c0d9593323f6c66e796b5b5a5c /Source/Particles/PhysicalParticleContainer.cpp | |
parent | 9d27958bc8467090e17d784999c4dd13f1eb8846 (diff) | |
download | WarpX-050e12f5293d42aabd812ff314baa2199060cdc3.tar.gz WarpX-050e12f5293d42aabd812ff314baa2199060cdc3.tar.zst WarpX-050e12f5293d42aabd812ff314baa2199060cdc3.zip |
Galilean PSATD with shift (#704)
* Read Galilean velocity
* Prepare structures for Galilean solver
* Started implementing Galilean equations
* Analytical limits for X1, X2, X3, X4 coefficients added
* Slight changes added
* Added Galilean position pusher
* Scale galilean velocity
* Remove unneeded Abort
* Fix Galilean pusher
* Allocate Theta2 array
* Fix definition of coefficients
* Increase guard cells for Galilean
* Add guard cell in particle exchange
* Type corrected
* v_gal added to warpx_current_deposition
* v_gal added to WarpXParticleContainer.H
* Bug fixed - update particle x-position over one time step
* Fix issues with merge from dev
* Preparation for merging dev into galilean.
* Adding galilean shift
* Implemented galilean shift
* Changed method's name from GalileanShift to ShiftGalileanBoundary
* Added doxygen string for ShiftGalileanBoundary
* Removed never used method LowerCornerWithCentering
* Removed temporary comments
* Removed dt as a variable from DepositCharge method and its dependencies
* Converted tab to spaces
* Removed EOL white space
* Add documentation and automated tests
* Fix compilation error
* Add automated test
* Update automated test
* Removed temporary used galilean shift
* Removed temporary used particle's push for Galilean PSATD
* Removed unused statement
* Remove EOL white space.
* Added zero shift for LowerCorner in RZ geometry
* Minor changes to Galilean implementation
* Modifications for GPU
* Fix typo
Co-authored-by: Remi Lehe <remi.lehe@normalesup.org>
Diffstat (limited to 'Source/Particles/PhysicalParticleContainer.cpp')
-rw-r--r-- | Source/Particles/PhysicalParticleContainer.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/Source/Particles/PhysicalParticleContainer.cpp b/Source/Particles/PhysicalParticleContainer.cpp index dd1407c8b..dd0693cb0 100644 --- a/Source/Particles/PhysicalParticleContainer.cpp +++ b/Source/Particles/PhysicalParticleContainer.cpp @@ -128,6 +128,12 @@ PhysicalParticleContainer::PhysicalParticleContainer (AmrCore* amr_core, int isp } } + // Parse galilean velocity + ParmParse ppsatd("psatd"); + ppsatd.query("v_galilean", v_galilean); + // Scale the velocity by the speed of light + for (int i=0; i<3; i++) v_galilean[i] *= PhysConst::c; + #ifdef WARPX_QED if(m_do_qed){ //Optical depths is always plotted if QED is on @@ -1311,11 +1317,11 @@ PhysicalParticleContainer::Evolve (int lev, } else { ion_lev = nullptr; } - // Deposit inside domains DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, &jx, &jy, &jz, 0, np_current, thread_num, lev, lev, dt); + if (has_buffer){ // Deposit in buffers DepositCurrent(pti, wp, uxp, uyp, uzp, ion_lev, cjx, cjy, cjz, @@ -1637,7 +1643,6 @@ PhysicalParticleContainer::PushPX (WarpXParIter& pti, Real dt, DtType a_dt_type) const Real m = this-> mass; #ifdef WARPX_QED - if(do_classical_radiation_reaction){ if(m_do_qed_quantum_sync){ const auto t_chi_max = m_shr_p_qs_engine->get_ref_ctrl().chi_part_min; @@ -2208,8 +2213,12 @@ PhysicalParticleContainer::FieldGather (WarpXParIter& pti, const auto GetPosition = GetParticlePosition(pti, offset); - // Lower corner of tile box physical domain - const std::array<Real, 3>& xyzmin = WarpX::LowerCorner(box, gather_lev); + // Lower corner of tile box physical domain (take into account Galilean shift) + Real cur_time = WarpX::GetInstance().gett_new(lev); + const auto& time_of_last_gal_shift = WarpX::GetInstance().time_of_last_gal_shift; + 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<Real, 3>& xyzmin = WarpX::LowerCorner(box, galilean_shift, gather_lev); const Dim3 lo = lbound(box); |