Example #1
0
    if lattice_info[s]['lattice_type'] == 'fcc':
        r0[s] = fcc_NN_info['1NN']['da'] * lattice_info[s]['a0']
parameters['p_NiNi_r0']= r0['Ni']
parameters['d_Ni_r0'] = r0['Ni']

print(80*'-')
print('{:^80}'.format('RADIUS VECTOR'))
print(80*'-')
for s in symbols:
    print('r0({})={}'.format(s,r0[s]))
rmax = max([v for k,v in r_cutoffs.items()])
r = rmax * np.linspace(1,Nr,Nr)/Nr
dr = r[1]-r[0]


eam_pot.evaluate_density(r=r,parameters=parameters,rcut=r_cutoffs['Ni'])
#plt.plot(r,eam_pot.density['Ni'])
#plt.savefig('density.png')

# determine equilibrium density
print(80*'-')
print('{:^80}'.format('DETERMINE EQUILIBRIUM DENSITY'))
print(80*'-')
rho0 = OrderedDict()
for s in symbols:
    print('elements:{}'.format(s))
    rho0[s] = 0
    for iNN in ['1NN','2NN']:
        n = fcc_NN_info[iNN]['n']
        d = fcc_NN_info[iNN]['da']*lattice_info['Ni']['a0']
        d_rho0 = np.interp(x=d,xp=r,fp=eam_pot.density['Ni'])
N['O'] = 4
N['1NN'] = 12
N['2NN'] = 6
N['3NN'] = 24
da = OrderedDict()
da['T'] = 0.433
da['O'] = 0.866
da['1NN']= 0.707
da['2NN']= 1.00
da['3NN'] = 1.225

rcut = 0.5 * (da['2NN'] + da['3NN'])
rho = OrderedDict()
for s in sites:
    _pair = eam.evaluate_density(
            r=a0*da[s],
            parameters=parameters)
    for p in _pair:
        if p not in rho: rho[p] = OrderedDict()
        rho[p][s] = _pair[p]

print(rho)
_pair = [p for p in rho]
for p in _pair:
    for s in sites:
        print("{s:^10}{N_s:^10}{da:^10.4f}{rho:^15.4e}{ttl_rho:^15.4e}".format(
            s=s,
            N_s=N[s],
            da=da[s],
            rho=rho[p][s],
            ttl_rho=N[s]*rho[p][s]))