本文整理汇总了Python中pymatgen.io.vasp.Kpoints.gamma_automatic方法的典型用法代码示例。如果您正苦于以下问题:Python Kpoints.gamma_automatic方法的具体用法?Python Kpoints.gamma_automatic怎么用?Python Kpoints.gamma_automatic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.io.vasp.Kpoints
的用法示例。
在下文中一共展示了Kpoints.gamma_automatic方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_jobs
# 需要导入模块: from pymatgen.io.vasp import Kpoints [as 别名]
# 或者: from pymatgen.io.vasp.Kpoints import gamma_automatic [as 别名]
#.........这里部分代码省略.........
for k in ["NPAR", "KPOINT_BSE", "LAECHG", "LCHARG", "LVHAR",
"NSW"]:
incar.pop(k, None)
if k in vinput["INCAR"]:
unset[k] = 1
kpoints = vis.get_kpoints(vinput["POSCAR"].structure)
settings.extend([
{"dict": "INCAR",
"action": {"_set": dict(incar),
"_unset": unset}},
{'dict': 'KPOINTS',
'action': {'_set': kpoints.as_dict()}}])
auto_npar = False
elif job_type.startswith("static"):
m = [i * args.static_kpoint for i in vinput["KPOINTS"].kpts[0]]
settings.extend([
{"dict": "INCAR",
"action": {"_set": {"NSW": 0}}},
{'dict': 'KPOINTS',
'action': {'_set': {'kpoints': [m]}}}])
elif job_type.startswith("nonscf_derived"):
from pymatgen.io.vasp.sets import MPNonSCFSet
vis = MPNonSCFSet.from_prev_calc(".", copy_chgcar=False,
user_incar_settings={"LWAVE": True})
settings.extend([
{"dict": "INCAR",
"action": {"_set": dict(vis.incar)}},
{'dict': 'KPOINTS',
'action': {'_set': vis.kpoints.as_dict()}}])
elif job_type.startswith("optics_derived"):
from pymatgen.io.vasp.sets import MPNonSCFSet
vis = MPNonSCFSet.from_prev_calc(
".", optics=True, copy_chgcar=False,
nedos=2001, mode="uniform", nbands_factor=5,
user_incar_settings={"LWAVE": True, "ALGO": "Exact", "SIGMA": 0.01, "EDIFF": 1e-6},
ediff_per_atom=False)
settings.extend([
{"dict": "INCAR",
"action": {"_set": dict(vis.incar)}},
{'dict': 'KPOINTS',
'action': {'_set': vis.kpoints.as_dict()}}])
elif job_type.startswith("rampu"):
f = ramps / (n_ramp_u - 1)
settings.append(
{"dict": "INCAR",
"action": {"_set": {"LDAUJ": [j * f for j in ldauj],
"LDAUU": [u * f for u in ldauu]}}})
copy_magmom = True
ramps += 1
elif job_type.startswith("quick_relax") or job_type.startswith(\
"quickrelax"):
kpoints = vinput["KPOINTS"]
incar = vinput["INCAR"]
structure = vinput["POSCAR"].structure
if "ISMEAR" in incar:
post_settings.append(
{"dict": "INCAR",
"action": {"_set": {"ISMEAR": incar["ISMEAR"]}}})
else:
post_settings.append(
{"dict": "INCAR",
"action": {"_unset": {"ISMEAR": 1}}})
post_settings.append({"dict": "KPOINTS",
"action": {"_set": kpoints.as_dict()}})
# lattice vectors with length < 9 will get >1 KPOINT
low_kpoints = Kpoints.gamma_automatic(
[max(int(18/l), 1) for l in structure.lattice.abc])
settings.extend([
{"dict": "INCAR",
"action": {"_set": {"ISMEAR": 0}}},
{'dict': 'KPOINTS',
'action': {'_set': low_kpoints.as_dict()}}])
# let vasp determine encut (will be lower than
# needed for compatibility with other runs)
if "ENCUT" in incar:
post_settings.append(
{"dict": "INCAR",
"action": {"_set": {"ENCUT": incar["ENCUT"]}}})
settings.append(
{"dict": "INCAR",
"action": {"_unset": {"ENCUT": 1}}})
elif job_type.startswith("relax"):
pass
elif job_type.startswith("full_relax"):
for j in VaspJob.full_opt_run(
vasp_command):
yield j
else:
print("Unsupported job type: {}".format(job))
sys.exit(-1)
if not job_type.startswith("full_relax"):
yield VaspJob(vasp_command, final=final, suffix=suffix,
backup=backup, settings_override=settings,
copy_magmom=copy_magmom, auto_npar=auto_npar)