本文整理汇总了Python中pyne.material.Material.mcnp方法的典型用法代码示例。如果您正苦于以下问题:Python Material.mcnp方法的具体用法?Python Material.mcnp怎么用?Python Material.mcnp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyne.material.Material
的用法示例。
在下文中一共展示了Material.mcnp方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_mcnp
# 需要导入模块: from pyne.material import Material [as 别名]
# 或者: from pyne.material.Material import mcnp [as 别名]
def test_mcnp():
leu = Material(nucvec={'U235': 0.04, 'U238': 0.96},
metadata={'mat_number': 2,
'table_ids': {'92235':'15c', '92238':'25c'},
'mat_name':'LEU',
'source':'Some URL',
'comments': ('this is a long comment that will definitly '
'go over the 80 character limit, for science'),
'name':'leu'},
density=19.1)
mass = leu.mcnp()
mass_exp = ('C name: leu\n'
'C density = 19.1\n'
'C source: Some URL\n'
'C comments: this is a long comment that will definitly go over the 80 character\n'
'C limit, for science\n'
'm2\n'
' 92235.15c -4.0000E-02\n'
' 92238.25c -9.6000E-01\n')
assert_equal(mass, mass_exp)
atom = leu.mcnp(frac_type='atom')
atom_exp = ('C name: leu\n'
'C density = 19.1\n'
'C source: Some URL\n'
'C comments: this is a long comment that will definitly go over the 80 character\n'
'C limit, for science\n'
'm2\n'
' 92235.15c 4.0491E-02\n'
' 92238.25c 9.5951E-01\n')
assert_equal(atom, atom_exp)