McStasMcXtrace / McCode

The home of the McStas (neutrons) and McXtrace (x-rays) Monte-Carlo ray-tracing instrument simulation codes.
https://github.com/McStasMcXtrace/McCode/wiki
GNU General Public License v3.0
77 stars 54 forks source link

General Single Crystal Inelastic Material - cont'd #1251

Open willend opened 2 years ago

willend commented 2 years ago

The right place to continue McStas-oriented discussion starting from https://github.com/mctools/ncrystal/discussions/87, that started off like this post by @thallor1:

Hello - I was wondering if a feature exists within Ncrystal to simulate scattering for a general four dimensional (Qx, Qy, Qz, Energy) space, assuming that the cross section has already been calculated for some grid of points within this space. The ultimate goal is to use this in McStas, but the current implementation (See here) is non functional. However, the described functionality is exactly what I'm looking for and I was wondering if this is possible using Ncrystal.

thallor1 commented 2 years ago

Continuing discussion from the Ncrystal thread -

I have tried spot-sample but it doesn't exactly suit my use case. It does not allow for a crystal mosaicity and does not support full single crystal scattering, only a defined two-theta so it behaves more like a powder.

The current workaround that I am using is to simply lower the outgoing neutron kf length in the standard single_crystal component, which seems to work. The problem with this is that I need to account for the change in the scattering angle, which I do by adjusting the HKL indices in the .hkl file. I think that I'm essentially doing the same thing that single_crystal_inelastic is.

farhi commented 2 years ago

Hi all,

just my 2c. There exists an inelastic SX component, initially written by Duc Le, and cleaned/optimized/pushed into McStas:

It is already part of McStas (2.x), but not ported for GPU yet (mccode-3).

willend commented 2 years ago

@farhi yup, actually @thallor1 specifically mentions that comp in the original post on the mcpl list (https://github.com/mctools/ncrystal/discussions/87)

It looks like it could need some further brushing up