本文整理汇总了Python中vasp.Vasp.run方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.run方法的具体用法?Python Vasp.run怎么用?Python Vasp.run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vasp.Vasp
的用法示例。
在下文中一共展示了Vasp.run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Vasp
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import run [as 别名]
from vasp import Vasp
wd = 'bulk/Si-bandstructure'
calc = Vasp('bulk/Si-selfconsistent')
calc.clone(wd)
kpts = [[0.5, 0.5, 0.0], # L
[0, 0, 0], # Gamma
[0, 0, 0],
[0.5, 0.5, 0.5]] # X
calc.set(kpts=kpts,
reciprocal=True,
kpts_nintersections=10,
icharg=11)
print calc.run()
示例2: enumerate
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import run [as 别名]
from vasp import Vasp
from ase import Atom, Atoms
calcs = []
for i, a in enumerate([4.7, 5.38936, 6.0]):
atoms = Atoms([Atom('Si', [0, 0, 0]),
Atom('Si', [0.25, 0.25, 0.25])])
atoms.set_cell([[a/2., a/2., 0.0],
[0.0, a/2., a/2.],
[a/2., 0.0, a/2.]], scale_atoms=True)
calc = Vasp('bulk/Si-bs-{0}'.format(i),
xc='PBE',
lcharg=True,
lwave=True,
kpts=[4, 4, 4],
atoms=atoms)
print(calc.run())
calcs += [calc]
Vasp.wait(abort=True)
for i, calc in enumerate(calcs):
n, bands, p = calc.get_bandstructure(kpts_path=[('L', [0.5,0.5,0.0]),
('$\Gamma$', [0, 0, 0]),
('$\Gamma$', [0, 0, 0]),
('X', [0.5, 0.5, 0.5])],
kpts_nintersections=10)
if p is not None:
png = 'images/Si-bs-{0}.png'.format(i)
p.savefig(png)
示例3: Atoms
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import run [as 别名]
from vasp import Vasp
from ase import Atom, Atoms
from ase.visualize import view
a = 5.38936
atoms = Atoms([Atom('Si', [0, 0, 0]),
Atom('Si', [0.25, 0.25, 0.25])])
atoms.set_cell([[a / 2., a / 2., 0.0],
[0.0, a / 2., a / 2.],
[a / 2., 0.0, a / 2.]], scale_atoms=True)
calc = Vasp('bulk/Si-selfconsistent',
xc='PBE',
prec='Medium',
lcharg=True,
lwave=True,
kpts=[4, 4, 4],
atoms=atoms)
calc.run()
示例4: FaceCenteredCubic
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import run [as 别名]
import matplotlib.pyplot as plt
DELTAS = np.linspace(-0.05, 0.05, 5)
calcs = []
volumes = []
for delta in DELTAS:
atoms = FaceCenteredCubic(symbol='Al')
cell = atoms.cell
T = np.array([[1 + delta, 0, 0],
[0,1, 0],
[0, 0, 1]])
newcell = np.dot(cell, T)
atoms.set_cell(newcell, scale_atoms=True)
volumes += [atoms.get_volume()]
calcs += [Vasp('bulk/Al-c11-{}'.format(delta),
xc='pbe',
kpts=[12, 12, 12],
encut=350,
atoms=atoms)]
Vasp.run()
energies = [calc.potential_energy for calc in calcs]
# fit a parabola
eos = np.polyfit(DELTAS, energies, 2)
# first derivative
d_eos = np.polyder(eos)
print(np.roots(d_eos))
xfit = np.linspace(min(DELTAS), max(DELTAS))
yfit = np.polyval(eos, xfit)
plt.plot(DELTAS, energies, 'bo', xfit, yfit, 'b-')
plt.xlabel('$\delta$')
plt.ylabel('Energy (eV)')
plt.savefig('images/Al-c11.png')