Ejemplo n.º 1
0
def nmdGulp(latVec, latType, dim, mass, freqConv, gulpName, gulpTrans, \
			gulpExe, numModes, numAtomsUC, kpt):

	freq = np.zeros( (kpt[:,0].size, numModes), dtype=float)
	eigvec = np.zeros( (kpt[:,0].size, numModes, numModes), dtype=complex)
	vel = np.zeros( (kpt[:,0].size, numModes, 3), dtype=float)

	for ikpt in range(kpt[:,0].size):
		strchg = dict({ 'tempName' : gulpTrans,
					'MASS' : '{0:10.10f}'.format(mass),
					'KPT' : '{0:.10f} {1:.10f} {2:.10f}'.format(kpt[ikpt,0], \
							kpt[ikpt,1], kpt[ikpt,2]),
					'ALAT' : '{0:.10f} {1:.10f} {2:.10f}'.format(latVec, \
							latVec, latVec)
					})
	
		freq[ikpt,:] = gp.freq(strchg, numAtomsUC, gulpName, gulpTrans, \
								gulpExe=gulpExe) * freqConv

		vel[ikpt,:,:] = gp.vel(strchg, numAtomsUC, gulpName, gulpTrans, \
								kpt[ikpt,:], latVec, gulpExe=gulpExe)

		eigvec[ikpt,:,:] = gp.eig(strchg, numAtomsUC, gulpName, gulpTrans, \
								kpt[ikpt,:], gulpExe=gulpExe)

	return freq, vel, eigvec
Ejemplo n.º 2
0
		# 100 Direction, Create kpts
		kpt = np.zeros( (numKpts, 3), dtype=float)
		kpt[:, 0] = np.linspace(0, 0.5, num=numKpts)

		for ikpt in range(numKpts):

			strainalat = alat[itemp] * (1.0 + strains[istrain])

			strchg = dict({ 'tempName' : tempName,
							'MASS' : '{:10.10f}'.format(mass),
							'KPT' : '{:.10f} {:.10f} {:.10f}'.format(kpt[ikpt,0], kpt[ikpt,1], kpt[ikpt,2]),
							'ALAT' :'{:.10f} {:.10f} {:.10f}'.format(strainalat, strainalat, strainalat)
							})

			freq[itemp, istrain, ikpt, 0, :] = \
				gp.freq(strchg, numAtomsUC,	gulpName, tempName) * freqConv

		# 110 Direction, Create kpts
		kpt = np.zeros( (numKpts, 3), dtype=float)
		kpt[:, 0] = np.linspace(0, 0.5, num=numKpts)
		kpt[:, 1] = np.linspace(0, 0.5, num=numKpts)

		for ikpt in range(numKpts):

			strainalat = alat[itemp] * (1.0 + strains[istrain])

			strchg = dict({ 'tempName' : tempName,
							'MASS' : '{:10.10f}'.format(mass),
							'KPT' : '{:.10f} {:.10f} {:.10f}'.format(kpt[ikpt,0], kpt[ikpt,1], kpt[ikpt,2]),
							'ALAT' :'{:.10f} {:.10f} {:.10f}'.format(strainalat, strainalat, strainalat)
							})