Ejemplo n.º 1
0
 
 print 'fields: ', data.GetFieldNames()
 print 'extract coords'
 coord = data.GetLocations()
 print 'extract U'
 U = data.GetVectorField('Velocity')
 print 'done.'

 del data

 id_U = np.where(coord[:,2] == 0) # values from surface
 
 coord = coord[id_U]

 c     = fio.fluidityclean_coord(coord,0)
 Us    = fio.fluidityclean_2D(coord,U[id_U,0].flatten(),0)
 Vs    = fio.fluidityclean_2D(coord,U[id_U,1].flatten(),0)

 S = np.sqrt(Us**2 + Vs**2)

 x = c[:,0]
 y = c[:,1]

 ## PRINT
 
 #triang = tri.Triangulation(x, y)
 
 plt.figure()
 plt.gca().set_aspect('equal')
 plt.autoscale(enable=True, axis='both', tight=True)
 if time == 0:
Ejemplo n.º 2
0
 print 'extract U'
 U = data.GetVectorField('Velocity')
 print 'done.'
 #T = data.GetScalarField('T')
 #Tmax = np.max(T)
 #Tmin = np.min(T)
 print 'using: ', Tmin,Tmax, ' while max is', np.max(T), ' and min is ', min(T)

 del data

 id_T = np.where(coord[:,2] == 0) # values from surface
 
 coord = coord[id_T]

 c     = fio.fluidityclean_coord(coord,0)
 T     = fio.fluidityclean_2D(coord,T[id_T],0)
 Us    = fio.fluidityclean_2D(coord,U[id_T,0].flatten(),0)
 Vs    = fio.fluidityclean_2D(coord,U[id_T,1].flatten(),0)

 x = c[:,0]
 y = c[:,1]

# T[np.asarray(np.where(T > Tmax))]  = Tmax
# T[np.asarray(np.where(T < Tmin))]  = Tmin

 ## PRINT
 
 #triang = tri.Triangulation(x, y)
 
 plt.figure()
 plt.gca().set_aspect('equal')