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

Fix crash when dz_fields=0 #104

Open
AngelFP opened this issue Feb 9, 2023 · 0 comments
Open

Fix crash when dz_fields=0 #104

AngelFP opened this issue Feb 9, 2023 · 0 comments

Comments

@AngelFP
Copy link
Owner

AngelFP commented Feb 9, 2023

There is currently a bug where the code will crash when dz_fields = 0

Traceback (most recent call last):
  File "C:\Users\ferran\Repos\Wake-T\examples\track_plasma_qs2d.py", line 45, in <module>
    bunch_list = plasma.track(bunch, opmd_diag=opmd_diag)
  File "C:\Users\ferran\Repos\Wake-T\wake_t\beamline_elements\field_element.py", line 105, in track
    tracker = Tracker(
  File "C:\Users\ferran\Repos\Wake-T\wake_t\tracking\tracker.py", line 82, in __init__
    field.adjust_dt(self.t_final)
  File "C:\Users\ferran\Repos\Wake-T\wake_t\fields\numerical_field.py", line 74, in adjust_dt
    n_updates = np.ceil(t_final / self.dt_update)
ZeroDivisionError: float division by zero
@AngelFP AngelFP changed the title Fix crash if dz_fields=0 Fix crash when dz_fields=0 Feb 9, 2023
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

No branches or pull requests

1 participant