Replies: 1 comment 1 reply
-
Hello in case anyone is reading! I have a heavily modified version of the code which now runs both on CPU and GPU with a great increase in performance! However I don't know if this should be a different repository already since some key things have been modified... @AxelHenningsson if I push a new working branch with said changes would you give it a try and we can discuss if you think its worth it? Cheers, |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi @AxelHenningsson,
I am reworking large parts of the code to compute using CUDA in NVIDIA GPUs which is the natural step after vectorization.
Thing is: I am changing so much of the code which I am unsure about making a new repository or not.
I am making several sacrifices in exchange of performance. Among them, I am removing all convex-hull computations, since the upgrade is oriented towards realistic powder scattering and that involves millions of tetrahedrons, each of them way smaller than the detector pixel size.
I can currently compute scattering from 8.000.000 tets in less than 10 seconds using cuda. The slowest part is reading the mesh file from the hard drive, actually.
There are some architecture changes I want to make.
Make polycrystal.diffract detector-independent, then move the intersection event and rendering to the detector module.
This would allow to place several detectors around the sample for instance, and compute the scattering only once.
Introduce the scherrer formula into the factors to compute the point-spread-function.
When crystallite size falls way below 100nm size, the assumption of crystal as a ideal crystal starts falling apart. This creates a spread of the diffraction signal and is typically modelled with the scherrer equation.
Modify the beam to introduce either some divergence or some energy spread
This is probably the hardest to implement since it deals with the actual formulation of the x-ray scattering. When simulating rotations around any axis perpendicular to the beam, there is barely any event taking place in the place of the axis, this is because of the idealization of the beam, I think. I wonder if there would be a way to introduce a more realistic way of simulating the interaction with the beam.
Turn the simulator into a solver.
The final idea is to make the code run fast enough to be used as a forward model to compare with real experiments which is able to modify the polycrystal to fit the diffraction pattern with the actual experimental data.
I would like to hear your thoughts about all these things and also ask if you (or your smart colleagues from Denmark) know a better suited diffraction formulation for a non-parallel non-monochromatic incident beam.
Cheers!
Beta Was this translation helpful? Give feedback.
All reactions