-
Notifications
You must be signed in to change notification settings - Fork 14
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Implement Boris pusher
Implement new `Tracker` class
Implement 5th order Adams-Bashforth pusher
Without making a copy, the final bunch in the diagnostics shares the same arrays as the returned final bunch. Thus, if the bunch goes into a `PlasmaStage` afterwards, where the arrays are modified, the last bunch of the TMEdiagnostics will also be modified.
Improve performance of Baxevanis wakefield model
This was referenced Feb 9, 2023
AngelFP
added a commit
that referenced
this pull request
Apr 20, 2023
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 aTMElement
). 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 thePlasmaStage
. 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, oneNumericalField
and openPMD diagnostics would look like this: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:
Field
class has been implemented from whichAnalyticalField
(for simple fields based on analytical expressions) andNumericalField
(for fields requiring more expensive numerical solutions to be calculated) are derived. This replaces the oldWakefield
class. All wakefield models are now subclasses ofAnalyticalField
orNumericalField
.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:
_track_numericaly
method replaced by newTracker
class.Field
base class and the derivedAnalyticalField
andNumericalField
classes.NumericalField
s.AnalyticalField
s.E
andB
fields separately #49).bunch_pusher
attribute to all plasma elements. Possible values are'rk4'
and'boris'
.dt_bunch
in all plasma elements (solves Add option for setting tracking time step #53).Tracker
class #76