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

Code cleaning #21

Merged
merged 16 commits into from
Mar 5, 2021
Merged

Code cleaning #21

merged 16 commits into from
Mar 5, 2021

Conversation

AngelFP
Copy link
Owner

@AngelFP AngelFP commented Mar 5, 2021

Lots of housekeeping and changes in this PR. Some features and parts of the code have been removed. Others have been better organized, allowing also to easily add new features. See below for summary.

Removed stuff

  • The 'analytical' tracking option has been removed from the PlasmaStage. This was the oldest code of Wake-T, and ultimately, the original reason which led to its development. Although fast, it had intrinsic limitations, such as not working when particles experience defocusing fields. It was also making other parts of the code less nice (such as requiring a Kx and Ez_p components on the Wakefields). Also, it wasn't really being used anymore, as the Runge-Kutta tracking is fast enough. So, with this PR we say good bye to original building block or Wake-T 😢.
  • Removed Kx and Ez_p methods from all Wakefield models. They were only needed for 'analytical' tracking.
  • The parallel tracking option in the plasma elements has been removed. The implementation with multiprocessing is not ideal and it didn't work properly anyways with some wakefield models. Instead, a future version of the tracking algorithm using numba threads is foreseen.
  • Remove duplicated definition of PlasmaRampBlowoutField.
  • The relativistic option from ActivePlasmaLens has been removed. All wakefields should eventually be updated not to a assume relativistic particles.

New stuff

  • All plasma elements have (finally!) been unified. This means that PlasmaRamp and ActivePlasmaLens (renamed from PlasmaLens) are now subclasses of PlasmaStage. This avoids a lot of code repetition.
  • Each plasma element class is now defined in its own module.
  • The n_p argument of PlasmaStage has been renamed to a more explicit density, and it now accepts a callable as value.
  • Thanks to the above, a custom longitudinal density profile can be given to any plasma element and not only to PlasmaRamp (the user can pass a function for the plasma density ramp profile #19).
  • The wakefield_model argument of PlasmaStage now accepts a Wakefield instance as input.
  • The PlasmaRamp element now also accepts as an input a decay_length parameter. Previously, this length was determined internally from the plasma_dens_down and position_down parameters (which are still available if decay_length is not provided).

Other changes

  • Renamed driver to laser in the Wakefield models where this hadn't been done already.
  • The predefined ramp profiles are now defined outside of the PlasmaRamp class. This is is cleaner and allows for easily adding new ones.
  • The time step in the ActivePlasmaLens when wakefields=True is now determined from the plasma density. Previously it was calculated from foc_strength, but this might not be accurate if the wakefields are much stronger the the APL field.
  • Renamed PlasmaRampBlowoutField to FocusingBlowoutField
  • Cleaned a bunch of lines from the .gitignore (created by Visual Studio) which are no longer needed.
  • Updated README.md to reflect changes in the code.

@AngelFP AngelFP merged commit 69eb8a0 into dev Mar 5, 2021
@AngelFP AngelFP deleted the code_cleaning branch March 5, 2021 15:58
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