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
@AngelFP AngelFP added this to To Do in Release 0.6.0 Mar 9, 2023
@AngelFP AngelFP moved this from To Do to In progress in Release 0.6.0 Mar 9, 2023
@AngelFP AngelFP moved this from In progress to To Do in Release 0.6.0 Mar 9, 2023
@AngelFP AngelFP added this to To do in Release 0.7.0 Mar 10, 2023
@AngelFP AngelFP removed this from To Do in Release 0.6.0 Mar 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant