Пример #1
0
		grid.append((tmp[0],ref,tmp[2]))
		grid2.append([tmp[0],new_v,tmp[2]])
		grid3.append((tmp[0],v2,tmp[2]))
	if pos == 1:
		v2 = pt.cal_p.poxy(ref,tmp[1],tmp[2])
		# get exact value use dinp in teng's lib
		grid.append((ref,tmp[1],tmp[2]))
		grid2.append([new_v,tmp[1],tmp[2]])
		grid3.append((v2,tmp[1],tmp[2]))
	if pos == 3:
		v2 = pt.cal_p.poxy(tmp[0],tmp[1],ref)
		# get exact value use dinp in teng's lib
		grid.append((tmp[0],tmp[1]),ref)
		grid2.append([tmp[0],tmp[1],new_v])
		grid3.append((tmp[1],tmp[2],v2))

grid2 = np.matrix(grid2)
e = grid2[:,1]
grid2[:,1] = grid2[:,2]
grid2[:,2] = e
grid2 = grid2.tolist()
grid.sort()
grid2.sort()

cc = np.matrix(grid)
dd = np.matrix(grid2)
np.savetxt('./tmp/matrix_body.txt',cc,fmt = '%12.4f')
np.savetxt('./tmp/matrix_body_computed.txt',dd,fmt = '%12.4f')
adf.add_space('matrix_body_computed')
adf.add_space('matrix_body')
Пример #2
0
	v2 = pt.cal_p.dinp(new_x,new_y,0)[-1]
	# get exact value use dinp in teng's lib
	grid.append((new_x,new_y,new_v))
	grid2.append((new_x,new_y,v2))
	
# Sort grid to get data in correct order for gnuplot
grid.sort()
grid2.sort()

# Output data
#	1. cacluted data mesh
#	2. surface mesh
# 	3. exact data mesh
cc = np.matrix(grid)
np.savetxt('./tmp/matrix_computed.txt',cc,fmt = '%12.4f')

cc[:,2] = 0.
np.savetxt('./tmp/mesh_saved.txt',cc,fmt = '%12.4f')

dd = np.matrix(grid2)
np.savetxt('./tmp/matrix_exact.txt',dd,fmt = '%12.4f')

adf.add_space('matrix_computed')
adf.add_space('mesh_saved')
adf.add_space('matrix_exact')
print "==================Data Output Finished==========================="