-
Notifications
You must be signed in to change notification settings - Fork 31
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
Multibunch wakefieldpass #493
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.
WakefieldPass.c
does not compile in Matlab:
WakeFieldPass.c:148:29: error: use of undeclared identifier 'PyExc_ValueError'
All files in atintegrators
are compiled, even if they are not used. So you must provide the mex entry points (mexFunction
and trackFunction
, possibly just throwing an error if it cannot be used in Matlab), and provide a compatible way to throw exceptions: for instance see AtGetLong
in the included atelem.
c file.
If you want, I can modify atelem.c
to provide a function to throw arbitrary errors.
Ok I will change this, I thought the mexfunction was optional. |
Added the
Now, we need the 2 entry points ! |
Simulation of Transverse Resistive Wall for Q'=0. The formula (eq 31 of https://journals.iucr.org/s/issues/2014/05/00/xe5009/xe5009.pdf ) expects a mode -1 with a given growth rate. Ib = 200mA Simulating a case in uniform filling with similar un-converged parameters as above gives the following: As before, the data was acquired by doing an SVD of the 992xNturn data set. As before, I will soon put an example file in the directory as this is a fundamental test. |
Thanks! Very useful, I have added the mexfunction, it just prints an error message. |
Very nice! thanks @lcarver is it just an impression or the rise time seems systematically lower than theory? |
OK, it now compiles correctly. But why not make it work ? At least the case |
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.
No compilation problem in Matlab any more, so it's ok !
Ok to print out the required fields, but the full implementation does not make much sense does it? |
You're right, it does not look realistic to run this on a single core in Matlab. But |
I have restored the mexfunction, still I think it is meaningless as the ring parameters cannot be passed...anyway it is done now, could be of some use for debugging... |
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.
Added example files for LCBI and TRW which can be found in pyat/examples/CollectiveEffects
For me, it has passed the 2 fundamental tests for longitudinal and transverse, some more detailed benchmarking will of course take place but for me this implementation is working well and is correct.
This PR implements multibunch wakefield computation making use of the fill pattern information introduced in #452
The particles are distributed into bunches using
particle_number % number of bunches
and this on each MPI process. The advantage is that the bunch structure is entirely independent of the number of CPUs which is a strong limitation in some existing codes wherenumber of bunches = number of CPUs
was required.The drawback is that each process has to fulfill
number of particle >= number of bunches
which is the case for a vast majority of potential usage.Changes associated to this branch:
WakeFieldPass.c
andatimplib.c
for multibunchwake_elements.py
to use the fillpattern information and minor tweaks to related functions inlattice_object.py
Mutlibunch wake calculation is activated by setting the fillpattern using:
Besides these the syntax is identical to single bunch calculations.