-
Notifications
You must be signed in to change notification settings - Fork 33
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
Fill pattern #452
Fill pattern #452
Conversation
Hi @swhite2401. As you suspected, I think that duplicating the harmonic number in the
I understand that the bunch are equally spaced. And the harmonic number does not appear anywhere. So why do you need more in the The only point is to check the validity of the number of bunches. So let the To set bunches, you must call a method to which you provide the weight array, and the lattice. Then you can check that the Or, may be better, you add a method to the Well, may be I missed something, but that's an idea… |
No bunch distribution can be arbitrary, in which case a vector |
Hi @swhite2401: I was not clear enough in my description. I think that you can efficiently describe any arbitrary bunch combination with 2 variables;
So the harmonic number is only necessary in the property setter to check the length of the It struct parameters
{
...
double beam_current;
double nbunch;
double bunch_spacing;
double *bunch_currents;
}; These 2 attributes are sufficient to fill Now I think that This means a very small modification of the original
Almost nothing to modify in I have a question concerning the future tracking: do you intend to track a single macro-particle in each bunch ? Then how to ensure that |
@lfarv, ok I get the point you mean It ok for me to move everything to the |
Now concerning your question it is a bit complicated, but I have a solution to handle multiple particles per bunch. |
I think we are now down to a question of taste... I prefer it this way I think it is more readable / understandable. With what you propose I have to modify the interface of 2 functions. Anyway I will do it because I need this branch merged... I hope after that it will be ok. |
Ok I have modified the implementation as suggested |
I can't believe that… The new version is so simpler ! Anyway, with the comments above, I think it can be merged. There are a few details that can be solved later:
I'm a bit worried that "fillpattern' is not exactly the read/write property associated with So feel free to merge when you like. |
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.
After minor modifications
Ok final review I hope, I have implemated all your comments I believe. Concerning the saving and loading of .repr format, I now force everything to default, at least value are consistent even though you lose the information on the Concerning you comment on periodicity, I disagree. It is perfectly fine to simulate a non periodic fill pattern on a periodic lattice, both are independent, I did more changes that expected, to I request for a last review if you have time... |
By the way, I very often have to re-run the matlab test several times for them to complete properly, is this a known issue? |
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.
I also hope it's the final one!
For a few days, I also noticed strange cancellations of Matlab test runs. Even before the test itself starts. No idea why… |
Beam characteristics are added to the
Lattice
object:fillpattern
: contain information on the filled buckets and relative amplitudebunch_spos
: bunch spatial distributionbunch_currents
: bunch current distributionnbunch
: number of bunchesbeam_current
: total beam current (mean to replace the current properties in all collective effectspassmethods
)These attributes are then accessible to the c
passmethods
. This is a pre-requisit for the implementation of multi-bunch tracking implementation that will be introduced in a future PR.Existing pyAT functionalities are not modified by this PR.