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

Add a Particles class for purely longitudinal studies (without "minitracker") #326

Merged
merged 16 commits into from
Mar 22, 2023

Conversation

szymonlopaciuk
Copy link
Collaborator

Description

Adapt xtrack to the new particles classes introduced in xsuite/xpart#73, however do not use the idea of a minitracker proposed in #312.

Replaces #312.

Checklist

Mandatory:

  • I have added tests to cover my changes
  • All the tests are passing, including my new ones
  • I described my changes in this PR description

Optional:

  • The code I wrote follows good style practices (see PEP 8 and PEP 20).
  • I have updated the docs in relation to my changes, if applicable
  • I have tested also GPU contexts

Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
Comment on lines 22 to 25
t = xt.Tracker(line=l, compile=False, _context=test_context)

t.track(p_fixed)
t.track(p)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use:

l.build_tracker(_context=test_context)
l.track(...)

Comment on lines 256 to 257
self.compile_kernels(particles_class=particles_class,
only_if_needed=True)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be needed

Comment on lines 46 to 49
temp_poly.impact_point_and_normal(particles_class=tracker.particles_class,
x_in=na([0]), y_in=na([0]),
z_in=na([0]), x_out=na([2]),
y_out=na([2]), z_out=na([0]))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

@@ -464,6 +466,7 @@ def characterize_aperture(tracker, i_aperture, n_theta, r_max, dr,
# Get a convex polygon that has vertices at all requested angles
r_out = 1. # m
res = temp_poly.impact_point_and_normal(
particles_class=tracker.particles_class,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

Signed-off-by: Szymon Łopaciuk <szymon@lopaciuk.eu>
@giadarol giadarol merged commit 8598e69 into xsuite:main Mar 22, 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

Successfully merging this pull request may close these issues.

2 participants