Skip to content
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

Implement new tracking pipeline #69

Merged
merged 88 commits into from
Jul 8, 2022
Merged

Implement new tracking pipeline #69

merged 88 commits into from
Jul 8, 2022

Conversation

AngelFP
Copy link
Owner

@AngelFP AngelFP commented May 31, 2022

This PR brings in major changes to the way in which Wake-T works internally. In particular, it redefines the way in which the tracking of particle bunches in a field is performed. Currently, these changes apply to the PlasmaStage and its subclasses (i.e., anything which is not a TMElement). The new implementation, including all the changes listed below, results in up to a x4 speedup of the code. It does not change anything in the user API and it only adds a few new optional parameters.

The main change to the working principle of Wake-T is the addition of a new Tracker class (#76) that takes care of orchestrating the evolution of the particle bunches and fields, and generating the diagnostics. This is done in a more general and extensible way compared to the old _track_numerically method in the PlasmaStage. It also supports new features. Among others, tracking of multiple beams simultaneously and the use of adaptive time steps.

The new Tracker moves the simulation in time by determining what should be updated next (pushing a particle bunch, updating the fields, or generating diagnostics), and continues until the specified final time. As an example, a simulation with one particle bunch with adaptive time step, one NumericalField and openPMD diagnostics would look like this:

Bunch: x-x-x--x---x-----x------x--------x---------x----x|
Field: x-------x-------x-------x-------x-------x-------x|
Diags: x-----------x-----------x-----------x-----------x|
Time:  ------------------------------------------------>| End

where the x indicate the points in time where the updates should be made.

As part of this redesign, the implementation of the fields as well as of the beam particle pushing have also been updated:

  • Fields: a new base Field class has been implemented from which AnalyticalField (for simple fields based on analytical expressions) and NumericalField (for fields requiring more expensive numerical solutions to be calculated) are derived. This replaces the old Wakefield class. All wakefield models are now subclasses of AnalyticalField or NumericalField .
  • Beam particle pushing: the whole process of particle pushing has been redesigned so that the Tracker can be in charge of pushing the beams. This has also been a good chance to implement the RK4 pusher in a much more efficient way, and has allowed the implementation of the new Boris pusher (Implement Boris pusher. #66).

In addition, this PR includes the new features from #77 and #79, which implement a new plasma pusher and bring performance improvements to the Baxevanis wakefield model.

The full list of changes is the following:

@AngelFP AngelFP changed the title [WIP] Implement new pipeline Implement new pipeline Jul 8, 2022
@AngelFP AngelFP changed the title Implement new pipeline Implement new tracking pipeline Jul 8, 2022
@AngelFP AngelFP merged commit c058576 into dev Jul 8, 2022
@AngelFP AngelFP deleted the new_pipeline branch July 8, 2022 11:04
AngelFP added a commit that referenced this pull request Apr 20, 2023
Fix bug in grid global offset introduced in (#69)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants