params - special dictionary 'jmol' -{} - to save path as png
In [1]:
import sys
sys.path.extend(['/home/aksenov/Simulation_wrapper/siman'])
import header
from calc_manage import add, res
from database import write_database, read_database
from set_functions import read_vasp_sets
from calc_manage import smart_structure_read
from SSHTools import SSHTools
from project_funcs import calc_barriers
%matplotlib inline
In [5]:
header.ssh_object = SSHTools()
header.ssh_object.setup(user="aksenov",host="10.30.16.62",pkey="/home/aksenov/.ssh/id_rsa")
header.PATH2PROJECT = 'barriers' # path to project relative to your home folder on cluster
header.PATH2POTENTIALS = '/home/aksenov/scientific_projects/PAW_PBE_VASP' #path to VASP POTENTIALS
header.PATH2NEBMAKE = '~/Simulation_wrapper/vts/nebmake.pl' # add path to nebmake in your project_conf.py
read_database()
header.varset['static'].potdir = {29:'Cu_new', 3:'Li'} #subfolders with required potentials
read_vasp_sets([
('ion', 'static', {'ISIF':2, 'IBRION':1, 'NSW':20, 'EDIFFG':-0.025}, ), # relax only ions
('cell', 'static', {'ISIF':4, 'IBRION':1, 'NSW':20, 'EDIFFG':-0.025},)]) #relax everything except volume
Out[5]:
Choose starting calculation. For example 2-atom cell of fcc Cu
In [3]:
add('Cu2', 'static', 1, input_geo_file = 'Cu/Cu2fcc.geo', it_folder = 'Cu')
Out[3]:
In [3]:
pd = {
'id':('Cu2', 'static', 1), # starting calculation
'el':'Li', # Element to move
'itfolder':'Cu/', # Workding directory
'main_set':'ion', # This set is used for supercell calculation
'scaling_set':'ion', # This set is used for determining lattice parameters
'neb_set':'ion', # This set is used for calculation of migration barrier
'scale_region':(-4, 4), # range of unit cell uniform deformation in %
'ortho':[7,7,7], # Target sizes of supercell in A
'r_impurity':1.2, # radius of searchable void
'images':5, # number of images in NEB calculation
'start_pos':0, # starting position for NEB; offered by the wrapper
'end_pos':1, # final position for NEB; offered by the wrapper
'readfiles':1, # read OUTCAR files
}
First argument should be normal
Second and third arguments are moving element up - update unit cell optimization upA - update supercell calculation upC - update neb calculation
In [6]:
calc_barriers('normal', 'Li', 'Li', show_fit = 0, up = 1, upA = 0, upC = 0, param_dic = pd, add_loop_dic = {'run':1})
Out[6]:
After the optimization is finished, run the same command once again, it will show the fit and construct the supercell.
In [8]:
calc_barriers('normal', 'Li', 'Li', show_fit = 1, up = 0, upA = 0, upC = 0, param_dic = pd, add_loop_dic = {'run':1})
Out[8]:
This step uses add_neb subroutine from neb.py
To choose different paths change
pd['start_pos'] and
pd['end_pos'] values
The command suggest you possible values of initial and final positions, see below.
If you want to study migration of substitution atom, then
use additional arguments:
In [4]:
pd['el'] = 'Cu' # Cu atom is chosen for moving
pd['i_atom_to_move'] = 1 # number of atom to move
pd['rep_moving_atom'] = 'Li' # replace moving atom with Li
In [5]:
calc_barriers('normal', 'Cu', 'Cu', show_fit = 0, up = 0, upA = 0, upC = 0, param_dic = pd, add_loop_dic = {'run':0})
# after running this command, go to ./xyz/Cu2.su.s7v100.n5Cu2Cu2v1rLi_all and check the created path
Out[5]:
In [8]:
pd['i_atom_to_move'] = None
pd['rep_moving_atom'] = None
pd['el'] = 'Li'
calc_barriers('normal', 'Li', 'Li', show_fit = 0, up = 0, upA = 0, upC = 1, param_dic = pd, add_loop_dic = {'run':0})
#after the command is finished please check Cu2.su.s7v100.n5i0e1Li_all folder with POSCARs
Out[8]:
In [10]:
#Here we use additional parameter *end_pos_types_z*; it allow to use Cu as final positions for Li migration
from neb import add_neb
st = smart_structure_read('Cu/POSCAR_Cu310A2Liis2_1lo_2_end')
add_neb(st = st, it_new = 'Cu310A2_212Li', ise_new = 'ion', it_folder = 'Cu/neb',
images = 5, i_atom_to_move = 215, i_void_final = 6, end_pos_types_z = [29])
#Check created path in xyz/Cu310A2_212Li.n5Li216Li216v6_all
Out[10]:
In [14]:
write_database()