本文整理汇总了Python中pymatgen.io.vaspio.vasp_input.Potcar.write_file方法的典型用法代码示例。如果您正苦于以下问题:Python Potcar.write_file方法的具体用法?Python Potcar.write_file怎么用?Python Potcar.write_file使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pymatgen.io.vaspio.vasp_input.Potcar
的用法示例。
在下文中一共展示了Potcar.write_file方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: generate_files
# 需要导入模块: from pymatgen.io.vaspio.vasp_input import Potcar [as 别名]
# 或者: from pymatgen.io.vaspio.vasp_input.Potcar import write_file [as 别名]
def generate_files(args):
from pymatgen.io.vaspio.vasp_input import Potcar
if args.symbols:
try:
p = Potcar(args.symbols, functional=args.functional)
p.write_file("POTCAR")
except Exception as ex:
print("An error has occurred: {}".format(str(ex)))
else:
print("No valid options selected.")
示例2: Poscar
# 需要导入模块: from pymatgen.io.vaspio.vasp_input import Potcar [as 别名]
# 或者: from pymatgen.io.vaspio.vasp_input.Potcar import write_file [as 别名]
sd_flag_slab= []
for i in iface.sites:
sd_flag_iface.append(false_site)
for i in iface_slab.sites:
sd_flag_slab.append(false_site)
#POSCAR and POTCAR construction, pending setting of exact flags for POSCAR
interface_poscar = Poscar(iface, selective_dynamics= sd_flag_iface)
interface_potcar= Potcar(interface_poscar.site_symbols)
slab_poscar = Poscar(iface_slab, selective_dynamics= sd_flag_slab)
slab_potcar= Potcar(slab_poscar.site_symbols)
#write the files in appropriate directories
interface_poscar.write_file("./Interface/POSCAR_PbS100DMF_interface_with_sd.vasp")
slab_poscar.write_file("./Slab/POSCAR_PbS100_slab_with_sd.vasp")
interface_potcar.write_file("./Interface_with_vdw/POTCAR")
slab_potcar.write_file("./Slab_with_vdw/POTCAR")
#set the common INCAR file and KPOINTS
incar_dict = {
'SYSTEM': 'ligand_PbS',
'ENCUT': 600,
'ISIF': 2,
'IBRION': 2,
'ALGO': 'Normal',
'ISMEAR': 1,
'ISPIN': 1,
'EDIFF': 1e-06,
'EDIFFG': -0.005,
'NPAR': 8,
'SIGMA': 0.1,
示例3: get_ModifiedMaterialsProject_VASP_inputs
# 需要导入模块: from pymatgen.io.vaspio.vasp_input import Potcar [as 别名]
# 或者: from pymatgen.io.vaspio.vasp_input.Potcar import write_file [as 别名]
def get_ModifiedMaterialsProject_VASP_inputs(structure, workdir, job_name, nproc=16,
U_strategy_instance = None, supplementary_incar_dict = None):
"""
Inputs will be inspired by MaterialsProject, but this function is appropriate
when we are seriously modifying the inputs such that they no longer conform to Materials Project.
"""
if os.path.exists(workdir):
print 'WORKDIR ALREADY EXISTS. DELETE TO LAUNCH NEW JOB'
return -1
os.mkdir(workdir)
# let's start with MP
input_set = MPVaspInputSet()
incar = input_set.get_incar(structure)
if U_strategy_instance != None:
# reading the structure here insures consistency, rather
# than having the strategy read the structure outside this driver.
U_strategy_instance.read_structure(structure)
# Generate all LDAU-related variables according to specified strategy.
LDAU_dict, poscar_need_hack, potcar_need_hack = U_strategy_instance.get_LDAU()
incar.update(LDAU_dict)
# set the number of parallel processors to sqrt(nproc),
# as recommended in manual.
incar.update({'NPAR':int(np.sqrt(nproc))})
if supplementary_incar_dict != None:
incar.update(supplementary_incar_dict)
poscar = input_set.get_poscar(structure)
kpoints = input_set.get_kpoints(structure)
potcar = input_set.get_potcar(structure)
incar.write_file(workdir+'INCAR')
poscar.write_file(workdir+'POSCAR', vasp4_compatible = True)
kpoints.write_file(workdir+'KPOINTS')
potcar.write_file(workdir+'POTCAR')
if poscar_need_hack:
# do we need specialized hacking of the poscar because of the U strategy?
new_poscar_lines = U_strategy_instance.get_new_poscar_lines()
with open(workdir+'POSCAR','w') as f:
for line in new_poscar_lines:
print >>f, line.strip()
if potcar_need_hack:
# do we need specialized hacking of the potcar because of the U strategy?
new_potcar_symbols = U_strategy_instance.get_new_potcar_symbols(potcar)
new_potcar = Potcar(new_potcar_symbols)
# overwrite the previous potcar
new_potcar.write_file(workdir+'POTCAR')
with open(workdir+'job.sh','w') as f:
f.write(submit_template.format(job_name,nproc))
with open(workdir+'clean.sh','w') as f:
f.write(clean_template)
return 0