-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laser envelope solver (finally!) #743
Conversation
first attempt of laser IO
…om several time steps etc.
…so far). But amplitude evolves wrongly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great! See a couple of comments below.
Further problems discussed offline.
A few more items to be added to the to-do list:
- Initialization of a laser profile via the parser (non-Gaussian),
- the possibility to propagate the laser backwards,
- the possibility to load and restart the laser.
Alright, thanks for all the comments! I believe all are either solved or listed in the todo above. |
Could you please comment on the status of point 1 on the to do list? Was this resolved at least for serial runs now? Or is this still present? Otherwise, I think we can merge soon and move the to do list to an issue. |
Point 1 above is still relevant. This is not a surprise: the Notify/Wait code full is written for |
Option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Awesome!
Let's merge this now and move the to do list to an issue and work on it on separate PRs 🚀
This PR proposes an implementation of a laser envelope solver. The plasma response to an analytic laser pulse was already implemented. Now, the propagation of the laser pulse in a plasma is also included. The model is based on Benedetti's 2017/2018 article.
Features
Structure
The 3D array is
Laser::m_F
; 2D slices (FArrayBox
es) are stored inLaser::m_slices
, labelledn**j**
where n stands for the time step, j for the longitudinal slice. n00 is time step n, nm1 is n-1 and np1 is n+1. A similar notation is used for slice j. In general, fields are stored with 2Real
components, one for the real part, the other for the imaginary part, except inside the FFT solver (where fields are directly stored asComplex
arrays).A new Poisson solver is implemented to solve the C2C Poisson equation with periodic BC. Although this causes duplication with the existing solver, it reduces complexity (the capability to abstract the type of the source array of the forward FFT to be either
Real
, as needed everywhere, orComplex
, as needed for the laser pulse, would take significant templating and obfuscate the code). This could be reconsidered. The solver is directly implemented inLaser.cpp
inLaser::AdvanceSliceFFT
, with the required abstraction for portability inLaser.H
.Two solvers are implemented, a MG solver and a FFT solver, to advance a laser slice by 1 time step. This solver operation computes slice$s_{j}^{n+1} = f(s_{j+1,j+2}^{n+1}, s_{j,j+1,j+2}^{n}, s_{j,j+1,j+2}^{n+1})$ . This is integrated within the loop over slices. The management of these slices is largely done in
j
at stepn+1
using previous slices and previous time steps:Laser::Copy
.For parallel runs, the whole 3D array on the current box has to be communicated. This is done similar to beam communication.
A new quantity
chi
has to be deposited (inPlasmaCurrentDepositionInner.H
) for the plasma response. This is essentially the plasma density divided by the Lorentz factor. It is used in the laser solver.Performance
The CI test with resolution
1024 1024 500
for 7 time steps gives the following time (in vacuum, so the changes would not be that dramatic with a plasma):and memory usage
when changing the number of ranks and whether the laser envelope is on host or device. As expected, storing the 3D laser envelope on host makes the code slower, but uses less memory.
Remains to be done
See #804.