Editing
Pos2pot.py
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
go back to [[Main Page]], [[Group Pages]], [[Núria López and Group]], [[Scripts_for_VASP]] This script reads your POSCAR and generates POTCAR with pseudopotentials recommended by VASP which are on the page: [https://cms.mpi.univie.ac.at/vasp/vasp/Recommended_PAW_potentials_DFT_calculations_using_vasp_5_2.html] This version works with in conjunction with [[potgenpbe5.3]] which you can change in line 116 if you prefer some other version. '''Instructions''': Put it in your ~/bin/ folder ($ vim ~/bin/pos2pot.py) and make it executable ($ chmod +x pos2pot.py). '''pos2pot.py''' #!/usr/bin/env python # by Konstantin # adapted from shifu Qiang # 7 Avg 2019 ################################################################################# # # # Read your POSCAR and generate POTCAR with pseudopotentials redomended by VASP # # # ################################################################################# import subprocess print "***"*10 print "Removing OLD POTCAR..." print "***"*10 subprocess.call("rm POTCAR", shell = True) print "Generating NEW POTCAR..." print "***"*10 f = open ("POSCAR", mode='r') pos_elem = f.readlines()[5].split() elem = "" for i in pos_elem: if i == "Li": elem += "Li_sv " elif i == "Na": elem += "Na_pv " elif i == "K": elem += "K_sv " elif i == "Ca": elem += "Ca_sv " elif i == "Sc": elem += "Sc_sv " elif i == "Ti": elem += "Ti_sv " elif i == "V": elem += "V_sv " elif i == "Cr": elem += "Cr_pv " elif i == "Mn": elem += "Mn_pv " elif i == "Ga": elem += "Ga_d " elif i == "Ge": elem += "Ge_d " elif i == "Rb": elem += "Rb_sv " elif i == "Sr": elem += "Sr_sv " elif i == "Y": elem += "Y_sv " elif i == "Zr": elem += "Zr_sv " elif i == "Nb": elem += "Nb_sv " elif i == "Mo": elem += "Mo_sv " elif i == "Tc": elem += "Tc_pv " elif i == "Ru": elem += "Ru_pv " elif i == "Rh": elem += "Rh_pv " elif i == "In": elem += "In_d " elif i == "Sn": elem += "Sn_d " elif i == "Cs": elem += "Cs_sv " elif i == "Ba": elem += "Ba_sv " elif i == "Pr": elem += "Pr_3 " elif i == "Nd": elem += "Nd_3 " elif i == "Pm": elem += "Pm_3 " elif i == "Sm": elem += "Sm_3 " elif i == "Eu": elem += "Eu_2 " elif i == "Gd": elem += "Gd_3 " elif i == "Tb": elem += "Tb_3 " elif i == "Dy": elem += "Dy_3 " elif i == "Ho": elem += "Ho_3 " elif i == "Er": elem += "Er_3 " elif i == "Tm": elem += "Tm_3 " elif i == "Yb": elem += "Yb_2 " elif i == "Lu": elem += "Lu_3 " elif i == "Hf": elem += "Hf_pv " elif i == "Ta": elem += "Ta_pv " elif i == "W": elem += "W_pv " elif i == "Tl": elem += "Tl_d " elif i == "Pb": elem += "Pb_d " elif i == "Bi": elem += "Bi_d " elif i == "Po": elem += "Po_d " elif i == "At": elem += "At_d " elif i == "Fr": elem += "Fr_sv " elif i == "Ra": elem += "Ra_sv " else: elem = elem + i + " " subprocess.call("potgenpbe5.3 " + elem, shell = True) f.close() print "Done" print "***"*10 print 'NEW POTCAR containes .....' print "***"*10 subprocess.call("grep TIT POTCAR| awk '{print $4}' | xargs -n100", shell = True) print "***"*10 print "Elements in POSCAR" print "***"*10 subprocess.call("sed -n 6p POSCAR", shell = True) go back to [[Main Page]], [[Group Pages]], [[Núria López and Group]], [[Scripts_for_VASP]]
Summary:
Please note that all contributions to Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Wiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information