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 Tracker class #76

Merged
merged 39 commits into from
Jul 2, 2022
Merged

Implement new Tracker class #76

merged 39 commits into from
Jul 2, 2022

Conversation

AngelFP
Copy link
Owner

@AngelFP AngelFP commented Jul 2, 2022

(Same as #75, but without squash and merge)

This PR focuses on implementing a new Tracker class that takes care of evolving the particle beams, the fields, and generating the output diagnostics. As a result, this does not need to be done by beamline elements themselves anymore. The new logic implemented in this class is also more general than before, and should now allow for simulations with multiple (#48) or no (#50) particle beams, adaptive time steps, and other features.

Implementing this new class has also led to refinements in the new field classes (Field, NumericalField and AnalyticalField) as well as other changes:

  • When gathering a field at the location of the beam particles, the current time is now also passed as a parameter. This allows the AnalyticalFields to use the time as variable.
  • The field gathering is now additive, meaning that the gathered field is added to the existing values stored in the field array (instead of replacing them). This allows a more efficient implementation of simulations where more than one field is applied to the particle beams.
  • In an AnalyticalField, null field components are now more efficient (previously zeros where gathered, now simply no action is performed)
  • Tracking in multiple fields is now working again.
  • The update method is now exclusive of NumericalField and no longer part of the base Field class.
  • The new Tracker also includes a more advanced progress bar. This progress bar displays the name of the element being tracked as well as the simulation time. The element name can be changed by the user and is exposed as an input parameter in any PlasmaStage subclass.
  • An adaptive time step is now enabled by default (dt_bunch='auto').
  • Calculating the optimal dt in a plasma stage is now much more efficient. It also uses the minimum gamma of the beam particles, instead of the average, making sure that the simulations are more correct.
  • All plasma wakefield models have been ported to the new implementation, which uses the AnalyticalField and NumericalField classes instead of the old Wakefield class.
  • Added tests for more wakefield models.
  • Update tests.
  • In the Baxevanis and fluid wakefield models, a small bug was fixed which caused the laser envelope solver to use the current density to evolve the laser, instead of the density from back when the plasma susceptibility was calculated.
    AnalyticField has been renamed to AnalyticalField.

@AngelFP AngelFP merged commit dda66a9 into new_pipeline Jul 2, 2022
@AngelFP AngelFP deleted the implement__tracker branch July 2, 2022 00:02
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.

1 participant