本文整理汇总了Python中pymatgen.io.vaspio.vasp_input.Kpoints.automatic_density_by_vol方法的典型用法代码示例。如果您正苦于以下问题:Python Kpoints.automatic_density_by_vol方法的具体用法?Python Kpoints.automatic_density_by_vol怎么用?Python Kpoints.automatic_density_by_vol使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.io.vaspio.vasp_input.Kpoints
的用法示例。
在下文中一共展示了Kpoints.automatic_density_by_vol方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_static_constructors
# 需要导入模块: from pymatgen.io.vaspio.vasp_input import Kpoints [as 别名]
# 或者: from pymatgen.io.vaspio.vasp_input.Kpoints import automatic_density_by_vol [as 别名]
def test_static_constructors(self):
kpoints = Kpoints.gamma_automatic([3, 3, 3], [0, 0, 0])
self.assertEqual(kpoints.style, "Gamma")
self.assertEqual(kpoints.kpts, [[3, 3, 3]])
kpoints = Kpoints.monkhorst_automatic([2, 2, 2], [0, 0, 0])
self.assertEqual(kpoints.style, "Monkhorst")
self.assertEqual(kpoints.kpts, [[2, 2, 2]])
kpoints = Kpoints.automatic(100)
self.assertEqual(kpoints.style, "Automatic")
self.assertEqual(kpoints.kpts, [[100]])
filepath = os.path.join(test_dir, 'POSCAR')
poscar = Poscar.from_file(filepath)
kpoints = Kpoints.automatic_density(poscar.structure, 500)
self.assertEqual(kpoints.kpts, [[2, 4, 4]])
self.assertEqual(kpoints.style, "Monkhorst")
kpoints = Kpoints.automatic_density(poscar.structure, 500, True)
self.assertEqual(kpoints.style, "Gamma")
kpoints = Kpoints.automatic_density_by_vol(poscar.structure, 1000)
self.assertEqual(kpoints.kpts, [[6, 11, 13]])
self.assertEqual(kpoints.style, "Gamma")
s = poscar.structure
s.make_supercell(3)
kpoints = Kpoints.automatic_density(s, 500)
self.assertEqual(kpoints.kpts, [[1, 1, 1]])
self.assertEqual(kpoints.style, "Gamma")