mctools / ncrystal

NCrystal : a library for thermal neutron transport in crystals and other materials
https://mctools.github.io/ncrystal/
Other
39 stars 18 forks source link

Provide analyseVDOS() for DI_VDOSDebye objects #174

Closed marquezj closed 1 month ago

marquezj commented 5 months ago

It would be useful if the DI_VDOSDebye provides an analyseVDOS() method. That way DynamicInfo.analyseVDOS() would work whether it is a DI_VDOS or DI_VDOSDebye object.

Maybe it would also be better if DI_VDOSDebye inherits from DI_VDOS instead of DI_ScatKnl?

tkittel commented 3 months ago

Agreed to your first point, but not the second, since in the C++ layer, DI_VDOS has methods that makes no sense for DI_VDOSDebye. Of course it could perhaps be redesigned somewhat, but for now I don't really have the appetite :-)

tkittel commented 3 months ago

Ok @marquezj , I added it now locally, and there is one funny issue:

> ==> AcrylicGlass_C5O2H8.ncmat;temp=0.001;vdoslux=0//C => debye_temp=400.005233181; gamma0=1.49998037694; integral=0.0114917629601; msd=0.00757242841697; teff=150
> ==> AcrylicGlass_C5O2H8.ncmat;temp=0.001;vdoslux=0//O => debye_temp=400.005233181; gamma0=1.49998037694; integral=0.0114917629601; msd=0.00568479185812; teff=150

The funny part being that in this case the two elements in question have a VDOS defined by debye_temp=400. Thus, converting to a curve and performing a gamma0 integral, and we are back to debye_temp=400.005233181.

So the question is, should we just live with that or should we intercept and correct the analysed value (back to 400.0 in this case)?

tkittel commented 3 months ago

Or, it could actually be an argument for NOT adding the analyseVDOS method, since it might be misleading?

tkittel commented 3 months ago

Ok, I am choosing to simply add it - it is after all not without information to have the derived debye_temp=400.005 even when the input one was 400 exactly. After all, the parabolic VDOS curve is not an ideal parabola, but one put on a rather coarse grid (to not waste CPU cycles on what is anyway not very precise).

tkittel commented 1 month ago

Release 3.9.0 is out with this!