Closed tkittel closed 3 months ago
This seems to be a bug in the MatCfg
class, as the normalised version is clearly wrong:
$> nctool --cfg 'phases<0.25*Ge_sg227.ncmat;density=1gcm3&0.75*Al_sg225.ncmat>;vdoslux=0'
==> Debugging cfg-string: "phases<0.25*Ge_sg227.ncmat;density=1gcm3&0.75*Al_sg225.ncmat>;vdoslux=0"
==> Normalised cfg-string : "phases<0.25*Ge_sg227.ncmat;density=1gcm3&0.75*Al_sg225.ncmat>;vdoslux=0;density=1gcm3"
The bug is in MatCfg::toStrCfg
, since createInfo(..)
with the original cfg string gives the correct density. However, nctool passes the normalised (i.e. processed by MatCfg::toStrCfg
) to createInfo()
, thus triggering the bug.
Same issue for phasechoice params:
$> sb_ncperfval_normcfg 'phases<0.25*NCTestData/Al_Sapphire_mix_test.ncmat;phasechoice=0&0.75*Al_sg225.ncmat>;vdoslux=0'
cfgstring in: >>phases<0.25*NCTestData/Al_Sapphire_mix_test.ncmat;phasechoice=0&0.75*Al_sg225.ncmat>;vdoslux=0<<
cfgstring normalised: >>phases<0.25*NCTestData/Al_Sapphire_mix_test.ncmat;phasechoice=0&0.75*Al_sg225.ncmat>;vdoslux=0;phasechoice=0<<
Bug found and understood, testing a fix.
Should add unit tests for this of course.
Fixed for next release (v3.8.3 or 3.9.0).
Fixed in v3.9.0.
Somehow, the density keyword inside a phase in connection with scatter-cfg hints affect the reported material density!:
This is a clear bug!! Without the
density
keyword, this is not seen: