Skip to content

Commit

Permalink
Investigate multcreate test issue
Browse files Browse the repository at this point in the history
  • Loading branch information
tkittel committed Oct 27, 2024
1 parent b424e88 commit 75153ad
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 13 deletions.
4 changes: 4 additions & 0 deletions tests/scripts/multcreate.log
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Debugging "stdlib::Au_sg225.ncmat;temp=600K;dcutoff=1Aa":
sigma_coh_elas ( 2 Aa ) = 4.7361254892674 barn
sigma_incoh_elas ( 2 Aa ) = 0.31946864208618 barn
sigma_inelas ( 2 Aa ) = 1.9616867001227 barn
19.28768344355451
LoadedMaterial(Info=n/a, Scatter=n/a, Absorption=n/a)
----------------------------------------------------------------------------------------------------
Expand Down
39 changes: 26 additions & 13 deletions tests/scripts/multcreate.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,20 @@
## ##
################################################################################

import NCTestUtils.enable_fpe
import NCTestUtils.enable_fpe # noqa F401
import NCrystal as NC

data_Au_sg225_ncmat="""NCMAT v4
def test1():
cfgstr='stdlib::Au_sg225.ncmat;temp=600K;dcutoff=1Aa'
print(f'Debugging "{cfgstr}":')
from NCrystal.misc import detect_scattering_components
for comp in detect_scattering_components(cfgstr):
wl=2.0
xs=NC.load(cfgstr+f';comp={comp}').scatter.xsect(wl=wl)
print(f" sigma_{comp} ( {wl:g} Aa ) = {xs:.14g} barn")

def test2():
data_Au_sg225_ncmat="""NCMAT v4
@CELL
cubic 4.07825
@SPACEGROUP
Expand All @@ -37,7 +47,7 @@
Au 167
"""

mat = NC.directMultiCreate( """NCMAT v1
mat = NC.directMultiCreate( """NCMAT v1
@CELL
lengths 4.07825 4.07825 4.07825
angles 90. 90. 90.
Expand All @@ -51,14 +61,17 @@
@DEBYETEMPERATURE
Au 167
""" )
print(mat.info.getDensity())
print(mat.info.getDensity())

mat2=NC.directMultiCreate( data_Au_sg225_ncmat,
dtype='ncmat',
doInfo=False,
doScatter=False,
doAbsorption=False )
print(mat2)
mat2=NC.directMultiCreate(data_Au_sg225_ncmat,'temp=600K;dcutoff=1')
mat2.info.dump()
print('%.14g'%mat2.scatter.crossSectionIsotropic(NC.wl2ekin(2.0)))

mat2=NC.directMultiCreate( data_Au_sg225_ncmat,
dtype='ncmat',
doInfo=False,
doScatter=False,
doAbsorption=False )
print(mat2)
mat2=NC.directMultiCreate(data_Au_sg225_ncmat,'temp=600K;dcutoff=1')
mat2.info.dump()
print('%.14g'%mat2.scatter.crossSectionIsotropic(NC.wl2ekin(2.0)))
test1()
test2()

0 comments on commit 75153ad

Please sign in to comment.