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

Fix of order system in Single_crystal #1764

Merged
merged 2 commits into from
Nov 19, 2024
Merged

Conversation

mads-bertelsen
Copy link
Contributor

It was realized that the order system in Single_crystal in general performed unnecessary calculations, mainly calculating the coherent cross section, and then not using it when the ray leaves the crystal. This was fixed, and this made recent introduction of a order=0.5 mode and double bookkeeping of the heavy Tau_list unnecessary, so these were removed.

This update retains the speedup of order=0.5 for order=1 and reduces the memory footprint significantly for large systems.
Figure 3
The above graph was done with a relatively small ncount / problem size, the ceiling for speed up is increased with these parameters, speed ups of factor 100 are still observed with sufficiently large problems.

There is a significant difference between order=0 (all multiple scattering) and order=1, there are still improvements that could be made without sacrificing performance, for example allowing incoherent scattering to higher orders even when the coherent part is disabled.
Figure 8

Some changes were made in the propagation for Powder and PG mode that can lead to the ray leaving the sample during normal propagation. This is reversed to a more secure version. To show this works as intended, there is a test instrument that compares PowderN and Single_crystal with the powder mode. This fails as they are not exactly alike, meaning there is more debugging to do.

performed unecessary calculations, mainly calculating the coherent
cross section, and then not using it when the ray leaves the crystal.
This was fixed, and this made recent introduction of a order=0.5
mode and double bookkeeping of the heavy Tau_list unecessary, so
these were removed.
@willend
Copy link
Contributor

willend commented Nov 19, 2024

@mads-bertelsen thanks all of this follow-up work. I think a comparison / port across to McXtrace Single_crystal would also be very nice.

@willend willend merged commit 68aba44 into main Nov 19, 2024
28 checks passed
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