-
Notifications
You must be signed in to change notification settings - Fork 20
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 aperture element #398
Add aperture element #398
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the draft of the aperture element, this is great!
Why do you set the id negative and the position to zero?
If we only set the id to negative, we can keep the transversal position where the particle was lost as information.
Generally, particles with negative ids will be removed on the next communication call. I would propose we add a filter step, that moves all negative-ly id's particles to a new species, so we can keep track and add the step and s
where the particle was lost?
src/particles/elements/Aperture.H
Outdated
|
||
switch(m_shape) { | ||
|
||
// rectangular aperture (default) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not super important yet, but since only one option can be true at the same time, we potentially want to move this switch decision out of kernel code, where it increases register pressure, and into a host-side decision.
For this, we could write a general aperture base class and derive it into special rectangular and elliptical classes.
Anyway, I think the part here is too small to warrant this just yet and this will be fine.
I set the transverse position to zero in the initial draft so that the test passes (all particles in the output lie inside the aperture). This should be removed once we add the step of moving the particles with negative index. |
3c31e4e
to
d3642af
Compare
b9ee9a3
to
4f2efe5
Compare
50de186
to
2d1f96d
Compare
Correct element docs.
Place arguments with defaults last (Python docs).
Place arguments with defaults last (Python equivalent).
Co-authored-by: Axel Huebl <[email protected]>
Add missing ,
Update the C++ API to use an enum for the aperture shape and the Python API & inputs file syntax to accept a string. That makes the parameters at the call sites self-describing.
to do: - remove in beam species - output
Update changed input API
This way, we can test if "s" was set to the right value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The bookkeeping changes look good to me.
2b089c4
to
934807c
Compare
Do not generate empty files with half-ready meta data.
Outdated line from an earlier design created an empty species in output.
Added a first draft of collimator/aperture element. For now, this element simply compares each particle against an aperture boundary (rectangular or elliptical), and records whether the particle has been lost.
For this initial draft, coordinates of lost particles are updated to x = y = 0 (so that all particles lie within the aperture). This will be changed to modify the sign of the particle index.
s
of reference particle at point of particle loss to "lost" particle container/species*To be followed-up with additional bookkeeping of lost particles.
Metadata to add:
s