本文整理汇总了Python中ase.calculators.vasp.Vasp.write_potcar方法的典型用法代码示例。如果您正苦于以下问题:Python Vasp.write_potcar方法的具体用法?Python Vasp.write_potcar怎么用?Python Vasp.write_potcar使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ase.calculators.vasp.Vasp
的用法示例。
在下文中一共展示了Vasp.write_potcar方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: write_input_files
# 需要导入模块: from ase.calculators.vasp import Vasp [as 别名]
# 或者: from ase.calculators.vasp.Vasp import write_potcar [as 别名]
def write_input_files(self, at, label):
global _chdir_lock
# For LOTF Simulations active number of quantum
# atoms vary and must wait to this stage in order for
# magnetic moments to be set properly. If magnetic moments
# not set defaults to 0.
self.vasp_args['magmom'] = at.get_initial_magnetic_moments()
vasp = Vasp(**self.vasp_args)
vasp.initialize(at)
# chdir not thread safe, so acquire global lock before using it
orig_dir = os.getcwd()
try:
_chdir_lock.acquire()
os.chdir(self.subdir)
if os.path.exists('OUTCAR'):
n = 1
while os.path.exists('OUTCAR.%d' % n):
n += 1
shutil.copyfile('OUTCAR', 'OUTCAR.%d' % n)
shutil.copyfile('POSCAR', 'POSCAR.%d' % n)
write_vasp('POSCAR', vasp.atoms_sorted,
symbol_count=vasp.symbol_count,
vasp5='5' in self.exe)
vasp.write_incar(at)
vasp.write_potcar()
vasp.write_kpoints()
finally:
os.chdir(orig_dir)
_chdir_lock.release()
示例2: write_input_files
# 需要导入模块: from ase.calculators.vasp import Vasp [as 别名]
# 或者: from ase.calculators.vasp.Vasp import write_potcar [as 别名]
def write_input_files(self, at, label):
global _chdir_lock
vasp = Vasp(**self.vasp_args)
vasp.initialize(at)
# chdir not thread safe, so acquire global lock before using it
orig_dir = os.getcwd()
try:
_chdir_lock.acquire()
os.chdir(self.subdir)
if os.path.exists('OUTCAR'):
n = 1
while os.path.exists('OUTCAR.%d' % n):
n += 1
shutil.copyfile('OUTCAR', 'OUTCAR.%d' % n)
shutil.copyfile('POSCAR', 'POSCAR.%d' % n)
write_vasp('POSCAR', vasp.atoms_sorted,
symbol_count=vasp.symbol_count,
vasp5='5' in self.exe)
vasp.write_incar(at)
vasp.write_potcar()
vasp.write_kpoints()
finally:
os.chdir(orig_dir)
_chdir_lock.release()
示例3: Vasp
# 需要导入模块: from ase.calculators.vasp import Vasp [as 别名]
# 或者: from ase.calculators.vasp.Vasp import write_potcar [as 别名]
from ase.lattice import surface
from ase.constraints import FixAtoms
from ase.calculators.vasp import Vasp
from ase.visualize import view
from ase.io import write
from ase.io import read
#sigma=0.01 for gases and edif=13-8
calc = Vasp(xc='PBE', kpts=(3,3,1), lwave=False, lcharg=False,lvtot=False, nwrite=1
, encut=400, algo='Fast', ismear=0, sigma=0.0031, voskown=1, istart=0, nelm=400, nelmdl=-10, ediff=1e-8, ispin=2
,nsw=1, isif=2, ibrion=5, nfree=2, potim=0.015, ediffg=-0.05, isym=0
,lvdw=True, vdw_version=3
,lreal='Auto')
slab = read('../CONTCAR')
slab.center(vacuum=20.0,axis=2)
view(slab) # View the slab, frozen atoms will be marked with a "X"
#slab.set_calculator(calc)
calc.initialize(slab)
calc.write_incar(slab)
calc.write_potcar()
calc.write_kpoints()
write('POSCAR', calc.atoms_sorted) # this will write a "sorted" POSCAR