optimas-org / optimas

Optimization at scale, powered by libEnsemble
https://optimas.readthedocs.io
Other
22 stars 13 forks source link

Add multi-model MT example with FBPIC and Wake-T #52

Closed AngelFP closed 2 years ago

AngelFP commented 2 years ago

This PR adds the multi-task example that combines Wake-T (low fidelity) and FBPIC (high fidelity) simulations. The physical case is an LPA with external injection, where the witness beam has a trapezoidal current profile. The four parameters to tune are the current at the head, current at the tail, beam length, and longitudinal position of the head.

The example includes a file bunch_utils.py made by @delaossa to generate the trapezoidal distribution. Also, in order to have the Wake-T and FBPIC diagnostics at exactly the same locations in the plasma, custom diagnostic classes for FBPIC have been defined in custom_fld_diags.py and custom_ptcl_diags.py. These classes add the option of specifying the start time of the backtransformed diagnostics so that we can get the output at the exact time the bunch enters (and exits) the plasma.

To install Wake-T, get the latest dev version as indicated here