Esempio n. 1
0
 def testgetIbin(self):
     fas = fixAveSpace('tmpfixAveSpace.txt')
     x = np.abs(fas.getIbin(1)[:, 1] - np.array([0, 0, 0])) < 0.01
     self.assertEqual(x.all(), True)
     x = np.abs(
         fas.getIbin(3)[:, 0] - np.array([291.11, 291.343, 304.537])) < 0.01
     self.assertEqual(x.all(), True)
Esempio n. 2
0
 def testinit(self):
     fas = fixAveSpace('tmpfixAveSpace.txt')
     self.assertEqual(
         "Spatial-averaged data for fix temp_profile and group main",
         fas.title)
     self.assertEqual(fas.quants, ["v_temp", "v_jx"])
     self.assertEqual([fas.snapStep, fas.nbin, fas.nstep], [100000, 4, 3])
Esempio n. 3
0
 def testgetIStep(self):
     fas = fixAveSpace('tmpfixAveSpace.txt')
     print fas.getIStep(1)[2][:, 1]
     x = np.abs(
         fas.getIStep(1)[2][:, 1] -
         np.array([0, 0, 0.00463008, 0.00275501])) < 0.01
     self.assertEqual(x.all(), True)
     x = np.abs(
         fas.getIStep(1)[2][:, 0] -
         np.array([0, 0, 287.894, 291.343])) < 0.01
     self.assertEqual(x.all(), True)
     x = np.abs(fas.getIStep(1)[1] - np.array([0, 0, 10, 10.9962])) < 0.01
     self.assertEqual(x.all(), True)
Esempio n. 4
0
	def getTempProfile(self,begin,upP,deta,S,tcfactor,zfactor):
		fas=fixAveSpace('tempProfile.txt')
		quants=fas.getConvergence(upP+1,begin)
		tools.to_txt(['Temperature(K)','Jx'],quants,'convergenceT.txt')
		snapStep=fas.snapStep

		dto=dict(log="step\tkappa\n",plots=[])
		coord,aveN,aveQuants=fas.iterate(begin,self.kappaConverge,snapStep,upP,deta,S,tcfactor,zfactor,dto)
		tools.write(dto['log'],'convergenceK.txt')
		series('x(Augstrom)','temperature(K)',dto['plots'],'convergenceT.png',linewidth=1,legend=False)
		filter=aveN[:]>1# at least 1 atom in the bin
		aveC=coord[filter]
		aveN=aveN[filter]
		aveTemp=aveQuants[filter,0]
		avejx=aveQuants[filter,1]
		nbin=len(avejx)
		data=np.c_[np.arange(nbin)+1,aveC,aveN,aveTemp,avejx]

		tools.to_txt(['id','Coord','Count','Temp','Jx'],data,'tempAve.txt')
		drawTempAve()
		return (aveC,aveN,aveTemp,avejx)