LASY-org / lasy

https://lasydoc.readthedocs.io
Other
33 stars 24 forks source link

Lasy and Fbpic #308

Closed alexanatoly closed 1 month ago

alexanatoly commented 1 month ago

Hi, I would like to make a kind request for initializing or loading the laser pulse created with Lasy in FBPIC. Currently, the laser pulse is initialized with an antenna method. It would be very helpful if direct initialization of a Lasy created laser is also possible.

Thanks, Alex

hightower8083 commented 1 month ago

Dear @alexanatoly ,

Well it's more of an FBPIC question than a LASY one. I'm not sure if in FBPIC we are hard-blocking "direct" injection from LASY -- looks like it's rather not recommended, since by default LASY implies temporal representation, E(x,y,t). Antenna is the only proper way to inject such field in the PIC simulation box that requires the spatial representation, E(x,y,z).

Currently we do not have much support for the spatial representation in LASY (it'd most likely imply doubling the code size), but I believe, you can still do that. To do this properly, before exporting to the file, you'd need to overwrite the field in the Laser object by the spatial form, that you get with the converter method. Then to read it in FBPIC, you should make a copy of FromLasyFileLaser profile and add here something like t = -z / c, since direct injection will pass z coordinates but interpolation runs over t variable. This is of course only a temporal solution, in case you need this urgently. Maybe this could be discussed further in the FBPIC issues.

alexanatoly commented 1 month ago

Dear @hightower8083,

Thank you for explaining the approach of LASY in detail. Partially, I am getting your point. I would like to look into everything you mentioned. Let me try how far I can go my self and if I will need advices in between, I will write again for the help on FBPIC forum.

Thank you so much once again. Alex