当前位置: 首页>>代码示例>>Python>>正文


Python Vasp.abort方法代码示例

本文整理汇总了Python中vasp.Vasp.abort方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.abort方法的具体用法?Python Vasp.abort怎么用?Python Vasp.abort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vasp.Vasp的用法示例。


在下文中一共展示了Vasp.abort方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: fcc111

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import abort [as 别名]
from ase.lattice.surface import fcc111
from vasp import Vasp
slab = fcc111('Al', size=(1, 1, 4), vacuum=10.0)
calc = Vasp('surfaces/Al-bandstructure',
            xc='PBE',
            encut=300,
            kpts=[6, 6, 6],
            lcharg=True,  # you need the charge density
            lwave=True,   # and wavecar for the restart
            atoms=slab)
n, bands, p = calc.get_bandstructure(kpts_path=[(r'$\Gamma$', [0, 0, 0]),
                                                ('$K1$', [0.5, 0.0, 0.0]),
                                                ('$K1$', [0.5, 0.0, 0.0]),
                                                ('$K2$', [0.5, 0.5, 0.0]),
                                                ('$K2$', [0.5, 0.5, 0.0]),
                                                (r'$\Gamma$', [0, 0, 0]),
                                                (r'$\Gamma$', [0, 0, 0]),
                                                ('$K3$', [0.0, 0.0, 1.0])],
                                     kpts_nintersections=10)
if p is None: calc.abort()
p.savefig('images/Al-slab-bandstructure.png')
开发者ID:jkitchin,项目名称:dft-book,代码行数:23,代码来源:script-166.py

示例2: BodyCenteredCubic

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import abort [as 别名]
from vasp import Vasp
from ase.lattice.cubic import BodyCenteredCubic
atoms = BodyCenteredCubic(directions=[[1, 0, 0],
                                      [0, 1, 0],
                                      [0, 0, 1]],
                                      size=(1, 1, 1),
                                      symbol='Fe')
NUPDOWNS = [0.0, 2.0, 4.0, 5.0, 6.0, 8.0]
energies = []
for B in NUPDOWNS:
    calc = Vasp('bulk/Fe-bcc-fixedmagmom-{0:1.2f}'.format(B),
                xc='PBE',
                encut=300,
                kpts=[4, 4, 4],
                ispin=2,
                nupdown=B,
                atoms=atoms)
    energies.append(atoms.get_potential_energy())
if None in energies:
    calc.abort()
import matplotlib.pyplot as plt
plt.plot(NUPDOWNS, energies)
plt.xlabel('Total Magnetic Moment')
plt.ylabel('Energy (eV)')
plt.savefig('images/Fe-fixedmagmom.png')
开发者ID:beeruyue,项目名称:dft-book,代码行数:27,代码来源:script-161.py

示例3: Vasp

# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import abort [as 别名]
                  cell=(10, 10, 10))
    calc = Vasp('molecules/O-sp-triplet-{0}'.format(encut),
                xc='PBE',
                encut=encut,
                ismear=0,
                ispin=2,
                atoms=atoms)
    E_O = atoms.get_potential_energy()
    # now relaxed O2 dimer
    atoms = Atoms([Atom('O', [5,    5, 5], magmom=1),
                   Atom('O', [6.22, 5, 5], magmom=1)],
                  cell=(10, 10, 10))
    calc = Vasp('molecules/O2-sp-triplet-{0}'.format(encut),
                xc='PBE',
                encut=encut,
                ismear=0,
                ispin=2,   # turn spin-polarization on
                ibrion=2,  # this turns relaxation on
                nsw=10,
                atoms=atoms)
    E_O2 = atoms.get_potential_energy()
    if None not in (E_O, E_O2):
        d = 2*E_O - E_O2
        D.append(d)
        print('O2 -> 2O encut = {0}  D = {1:1.3f} eV'.format(encut, d))
if not D or None in D: calc.abort()
import matplotlib.pyplot as plt
plt.plot(encuts, D)
plt.xlabel('ENCUT (eV)')
plt.ylabel('O$_2$ dissociation energy (eV)')
plt.savefig('images/O2-dissociation-convergence.png')
开发者ID:beeruyue,项目名称:dft-book,代码行数:33,代码来源:script-64.py


注:本文中的vasp.Vasp.abort方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。