本文整理汇总了Python中pylada.vasp.Vasp.nsw方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.nsw方法的具体用法?Python Vasp.nsw怎么用?Python Vasp.nsw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pylada.vasp.Vasp
的用法示例。
在下文中一共展示了Vasp.nsw方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test
# 需要导入模块: from pylada.vasp import Vasp [as 别名]
# 或者: from pylada.vasp.Vasp import nsw [as 别名]
def test():
from pickle import loads, dumps
from pylada.vasp import Vasp
from pylada.error import ValueError
a = Vasp()
for key in a._input.keys():
if key not in ['isif', 'nsw', 'ibrion', 'relaxation']:
del a._input[key]
assert a.relaxation == 'static'
assert len(a.output_map(vasp=a)) == 1
assert a.output_map(vasp=a)['ibrion'] == str(-1)
a.relaxation = 'cellshape'
assert a.relaxation == 'cellshape'
assert a.isif == 5
assert a.nsw == 50
assert a.ibrion == 2
assert len(a.output_map(vasp=a)) == 3
assert a.output_map(vasp=a)['ibrion'] == str(2)
assert a.output_map(vasp=a)['isif'] == str(5)
assert a.output_map(vasp=a)['nsw'] == str(50)
a = loads(dumps(a))
assert len(a.output_map(vasp=a)) == 3
assert a.output_map(vasp=a)['ibrion'] == str(2)
assert a.output_map(vasp=a)['isif'] == str(5)
assert a.output_map(vasp=a)['nsw'] == str(50)
a.relaxation = 'cellshape volume'
a.nsw = 25
assert a.relaxation == 'cellshape volume'
assert a.isif == 6
assert a.nsw == 25
assert a.ibrion == 2
assert len(a.output_map(vasp=a)) == 3
assert a.output_map(vasp=a)['ibrion'] == str(2)
assert a.output_map(vasp=a)['isif'] == str(6)
assert a.output_map(vasp=a)['nsw'] == str(25)
a.relaxation = 'ions'
assert a.relaxation == 'ionic'
assert a.isif == 2
a.relaxation = 'ionic'
assert a.relaxation == 'ionic'
assert a.isif == 2
a.relaxation = 'cellshape, volume ions'
print a.relaxation
assert a.relaxation == 'cellshape ionic volume'
assert a.isif == 3
a.relaxation = 'cellshape, ionic'
assert a.relaxation == 'cellshape ionic'
assert a.isif == 4
a.relaxation = 'volume'
assert a.relaxation == 'volume'
assert a.isif == 7
a.relaxation = 'static'
assert a.ibrion == -1
assert a.nsw == 0
assert a.isif == 2
try: a.relaxation = 'ions, volume'
except ValueError: pass
else: raise Exception