-
Notifications
You must be signed in to change notification settings - Fork 3
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
Optimize timestep #57
Conversation
…plifies the result without extraneous Is in real numbers
…or vector length in place
…ct that the timestep is more liberal now
…agnitude and one that returns the magnitude squared. This will allow us to add the flux components without repeatedly square rooting and squaring.
…he minimum particle energy in initializing step to avoid doing a reduction over particles at every timestep under the assumption that particle energies do not change
…eeds antineutrinos to be conjugated
…ng into the maxError limit
…to limit timestep based on total lepton density
…s 0 because of equal numbers of neutrinos and antineutrinos by introducing a parameter (max_adaptive_speedup). When set to 0 it behaves exactly as before, except for the inclusion of the vacuum potential in the timestep calculation. When set towards infinity, it always allows the "optimized" timestep, which may itself become infinite if terms happen to cancel by chance, but otherwise is a much better estimate of the required timestep
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.
Awesome, looks pretty good!
There were a few things I pointed out here and there that may need some clarification :)
…ding the ParticleContainer copy operator, fix mistake in conjugation of Hermitian matrices.
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.
Awesome @srichers ! These changes resolved all the concerns from the initial review.
Not deleting this branch for now since #59 targets it. |
The timestep now properly takes into account the full potential. The vacuum term is split off from the other terms for two reasons. First, the minimum neutrino energy (and hence maximum vacuum potential) needs only be calculated at the beginning of the simulation because the particle energies don't change. Second, the vacuum and matter/self-interaction potentials combine differently for neutrinos and antineutrinos, so I figured it would be better to just take the more conservative limit and add the magnitudes of those separately rather than do a more complicated grid reduction for neutrinos and antineutrinos separately.
I left in the original way of calculating the timestep as
dt_stupid
(though it is slightly different in that it includes the vacuum contribution). Settingmax_adaptive_speedup
to 0 will force the use of the original timestep. Setting it to 1e99 (or in general towards infinity) will allow the timestep to always be the one as determined by the current potential. This can lead to problems if the potential is zero and the timestep becomes extremely large. This can be a problem in the first step of the bipolar test case, for example. I leftmax_adaptive_speedup
as 0 in all of the test parameter files.Closes #43