本文整理汇总了Python中vasp.Vasp.set_nbands方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.set_nbands方法的具体用法?Python Vasp.set_nbands怎么用?Python Vasp.set_nbands使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vasp.Vasp
的用法示例。
在下文中一共展示了Vasp.set_nbands方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: fcc111
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import set_nbands [as 别名]
from vasp import Vasp
from ase.lattice.surface import fcc111
import matplotlib.pyplot as plt
Nlayers = [3, 4, 5, 6, 7, 8, 9, 10, 11]
energies = []
sigmas = []
for n in Nlayers:
slab = fcc111('Cu', size=(1, 1, n), vacuum=10.0)
slab.center()
calc = Vasp('bulk/Cu-layers/{0}'.format(n),
xc='PBE',
encut=350,
kpts=[8, 8, 1],
atoms=slab)
calc.set_nbands(f=2) # the default nbands in VASP is too low for Cu
energies.append(slab.get_potential_energy())
calc.stop_if(None in energies)
for i in range(len(Nlayers) - 1):
N = Nlayers[i]
DeltaE_N = energies[i + 1] - energies[i]
sigma = 0.5 * (-N * energies[i + 1] + (N + 1) * energies[i])
sigmas.append(sigma)
print 'nlayers = {1:2d} sigma = {0:1.3f} eV/atom'.format(sigma, N)
plt.plot(Nlayers[0:-1], sigmas, 'bo-')
plt.xlabel('Number of layers')
plt.ylabel('Surface energy (eV/atom)')
plt.savefig('images/Cu-unrelaxed-surface-energy.png')
示例2: Atoms
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import set_nbands [as 别名]
from vasp import Vasp
from ase import Atom, Atoms
atoms = Atoms([Atom('Cu', [0.000, 0.000, 0.000])],
cell=[[1.818, 0.000, 1.818],
[1.818, 1.818, 0.000],
[0.000, 1.818, 1.818]])
calc = Vasp('bulk/alloy/cu-setnbands',
xc='PBE',
encut=350,
kpts=[13, 13, 13],
ibrion=2,
isif=4,
nsw=10,
atoms=atoms)
calc.set_nbands(f=3)
calc.write_input()
print calc
示例3: Atoms
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import set_nbands [as 别名]
from vasp import Vasp
from ase import Atom, Atoms
atoms = Atoms([Atom('Cu', [0.000, 0.000, 0.000])],
cell=[[1.818, 0.000, 1.818],
[1.818, 1.818, 0.000],
[0.000, 1.818, 1.818]])
calc = Vasp('bulk/alloy/cu',
xc='PBE',
encut=350,
kpts=[13, 13, 13],
ibrion=2,
isif=4,
nsw=10,
atoms=atoms)
calc.set_nbands(f=7)
calc.write_input() # you have to write out the input for it to take effect
print calc
示例4: Atom
# 需要导入模块: from vasp import Vasp [as 别名]
# 或者: from vasp.Vasp import set_nbands [as 别名]
Atom('Br', [ 0.0000, 0.0000, 1.1146]),
Atom('F', [ 0.0000, 1.2455, -1.2651]),
Atom('F', [ 1.0787, -0.6228, -1.2651]),
Atom('F', [-1.0787, -0.6228, -1.2651])],
cell=(10, 10, 10))
atoms.center()
calc = Vasp('molecules/CF3Br',
encut=350,
xc='PBE',
ibrion=1,
nsw=50,
lcharg=True,
lvtot=True,
lvhar=True,
atoms=atoms)
calc.set_nbands(f=2)
calc.stop_if(calc.potential_energy is None)
x, y, z, lp = calc.get_local_potential()
x, y, z, cd = calc.get_charge_density()
mlab.figure(1, bgcolor=(1, 1, 1)) # make a white figure
# plot the atoms as spheres
for atom in atoms:
mlab.points3d(atom.x,
atom.y,
atom.z,
scale_factor=vdw_radii[atom.number]/5.,
resolution=20,
# a tuple is required for the color
color=tuple(cpk_colors[atom.number]),
scale_mode='none')
# plot the bonds. We want a line from C-Br, C-F, etc...